diff --git a/addons/account/account.py b/addons/account/account.py index 7cce45ad006..6d074beb646 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -25,6 +25,7 @@ from dateutil.relativedelta import relativedelta from operator import itemgetter import netsvc +import pooler from osv import fields, osv import decimal_precision as dp from tools.translate import _ @@ -1641,12 +1642,19 @@ class account_tax(osv.osv): return result in the context Ex: result=round(price_unit*0.21,4) """ + + def get_precision_tax(): + def change_digit_tax(cr): + res = pooler.get_pool(cr.dbname).get('decimal.precision').precision_get(cr, 1, 'Account') + return (16, res+2) + return change_digit_tax + _name = 'account.tax' _description = 'Tax' _columns = { 'name': fields.char('Tax Name', size=64, required=True, translate=True, help="This name will be displayed on reports"), 'sequence': fields.integer('Sequence', required=True, help="The sequence field is used to order the tax lines from the lowest sequences to the higher ones. The order is important if you have a tax with several tax children. In this case, the evaluation order is important."), - 'amount': fields.float('Amount', required=True, digits_compute=dp.get_precision('Account'), help="For taxes of type percentage, enter % ratio between 0-1."), + 'amount': fields.float('Amount', required=True, digits_compute=get_precision_tax(), help="For taxes of type percentage, enter % ratio between 0-1."), 'active': fields.boolean('Active', help="If the active field is set to true, it will allow you to hide the tax without removing it."), 'type': fields.selection( [('percent','Percentage'), ('fixed','Fixed Amount'), ('none','None'), ('code','Python Code'), ('balance','Balance')], 'Tax Type', required=True, help="The computation method for the tax amount."), diff --git a/addons/account/account_invoice_view.xml b/addons/account/account_invoice_view.xml index 4d4b0a3022f..e5427a93361 100644 --- a/addons/account/account_invoice_view.xml +++ b/addons/account/account_invoice_view.xml @@ -354,7 +354,7 @@ - + diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml index 35a3b63edda..ce6e3c40f86 100644 --- a/addons/account/account_view.xml +++ b/addons/account/account_view.xml @@ -33,8 +33,8 @@ -