Change unit price 4 decimals to DIGITS from config

This commit is contained in:
resteve 2014-10-28 13:15:06 +01:00
parent b3472cd075
commit 3038842f0d
1 changed files with 3 additions and 2 deletions

View File

@ -5,6 +5,8 @@ from decimal import Decimal
from trytond.model import fields
from trytond.pyson import Eval
from trytond.pool import Pool, PoolMeta
from trytond.config import CONFIG
DIGITS = int(CONFIG.get('unit_price_digits', 4))
__all__ = ['Sale', 'SaleLine']
__metaclass__ = PoolMeta
@ -48,8 +50,7 @@ class Sale:
class SaleLine:
__name__ = 'sale.line'
cost_price = fields.Numeric('Cost Price', digits=(16, 4),
cost_price = fields.Numeric('Cost Price', digits=(16, DIGITS),
states={
'invisible': Eval('type') != 'line',
}, depends=['type'])