From 1014cf54005c6fba1663c66fd3a5ff9dc74b26c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Tue, 6 Jan 2015 23:31:09 +0100 Subject: [PATCH] Use price_digits issue4438 review6791002 --- move.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/move.py b/move.py index 678b4a5e71..fa1ab6c1be 100644 --- a/move.py +++ b/move.py @@ -17,6 +17,8 @@ from trytond.tools import reduce_ids from trytond.transaction import Transaction from trytond.pool import Pool +from trytond.modules.product import price_digits + __all__ = ['StockMixin', 'Move'] STATES = { @@ -210,14 +212,15 @@ class Move(Workflow, ModelSQL, ModelView): Eval('context', {}).get('company', -1)), ], depends=['state']) - unit_price = fields.Numeric('Unit Price', digits=(16, 4), + unit_price = fields.Numeric('Unit Price', digits=price_digits, states={ 'invisible': Not(Bool(Eval('unit_price_required'))), 'required': Bool(Eval('unit_price_required')), 'readonly': Not(Equal(Eval('state'), 'draft')), }, depends=['unit_price_required', 'state']) - cost_price = fields.Numeric('Cost Price', digits=(16, 4), readonly=True) + cost_price = fields.Numeric('Cost Price', digits=price_digits, + readonly=True) currency = fields.Many2One('currency.currency', 'Currency', states={ 'invisible': Not(Bool(Eval('unit_price_required'))),