From bcb4c01ca17023694139e4effeca7f7d7c5c5d18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Wed, 29 Oct 2014 20:40:07 +0100 Subject: [PATCH] New API for on_change issue4203 review8581002 --- work.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/work.py b/work.py index 3d4664deac..fd45b71b1a 100644 --- a/work.py +++ b/work.py @@ -122,7 +122,7 @@ class Work: Currency = pool.get('currency.currency') if not self.product: - return {} + return context = {} @@ -132,14 +132,12 @@ class Work: hour_uom = Uom(ModelData.get_id('product', 'uom_hour')) with Transaction().set_context(context): - list_price = Uom.compute_price(self.product.default_uom, + self.list_price = Uom.compute_price(self.product.default_uom, self.product.list_price, hour_uom) if self.company: user = User(Transaction().user) if user.company != self.company: if user.company.currency != self.company.currency: - list_price = Currency.compute(user.company.currency, - list_price, self.company.currency) - - return {'list_price': list_price} + self.list_price = Currency.compute(user.company.currency, + self.list_price, self.company.currency)