Fix missing unit_price currency convertion
issue3036 review697002 (transplanted from 1d1da0ad31d92ddc55db2710ef7ee850caee60b5)
This commit is contained in:
1 parent
271aaf7a85
commit
ce002df9ba
1 file changed
+4
-1
@@ -22,6 +22,7 @@ class Move:
|
||||
pool = Pool()
|
||||
Uom = pool.get('product.uom')
|
||||
AccountMoveLine = pool.get('account.move.line')
|
||||
Currency = pool.get('currency.currency')
|
||||
assert type_.startswith('in_') or type_.startswith('out_'), \
|
||||
'wrong type'
|
||||
|
||||
@@ -30,7 +31,9 @@ class Move:
|
||||
if ((type_.endswith('supplier')
|
||||
or type_ == 'in_production')
|
||||
and self.product.cost_price_method != 'fixed'):
|
||||
unit_price = self.unit_price
|
||||
with Transaction().set_context(date=self.effective_date):
|
||||
unit_price = Currency.compute(self.currency, self.unit_price,
|
||||
self.company.currency, round=False)
|
||||
else:
|
||||
unit_price = Uom.compute_price(self.product.default_uom,
|
||||
self.cost_price, self.uom)
|
||||
|
||||
Reference in new issue
Block a user