[FIX] account: precision_get returns a number of digits
authorDenis Ledoux <dle@odoo.com>
Tue, 7 Oct 2014 15:25:56 +0000 (17:25 +0200)
committerDenis Ledoux <dle@odoo.com>
Tue, 7 Oct 2014 15:26:49 +0000 (17:26 +0200)
In other words, it returnes a precision digits, not a precision rounding

addons/account/account_invoice.py

index 9baa3f7..25e6cba 100644 (file)
@@ -828,7 +828,7 @@ class account_invoice(osv.osv):
                     raise osv.except_osv(_('Warning!'), _('Global taxes defined, but they are not in invoice lines !'))
                 base = compute_taxes[key]['base']
                 precision = self.pool.get('decimal.precision').precision_get(cr, uid, 'Account')
-                if float_compare(abs(base - tax.base), company_currency.rounding, precision_rounding=precision) == 1:
+                if float_compare(abs(base - tax.base), company_currency.rounding, precision_digits=precision) == 1:
                     raise osv.except_osv(_('Warning!'), _('Tax base different!\nClick on compute to update the tax base.'))
             for key in compute_taxes:
                 if not key in tax_key: