changeset c7da1bc65008 in modules/account_stock_continental:default
details: 
https://hg.tryton.org/modules/account_stock_continental?cmd=changeset&node=c7da1bc65008
description:
        Use unit_price_company

        issue10586
        review369311002
diffstat:

 stock.py |  7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)

diffs (24 lines):

diff -r 8e852bf6c86b -r c7da1bc65008 stock.py
--- a/stock.py  Mon Jul 12 22:56:26 2021 +0200
+++ b/stock.py  Wed Jul 28 00:32:29 2021 +0200
@@ -17,18 +17,15 @@
         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'
 
         move_line = AccountMoveLine()
         if ((
                     type_.endswith('supplier')
-                    or type_ == 'in_production')
+                    or type_ in {'in_production', 'in_warehouse'})
                 and self.product.cost_price_method != 'fixed'):
-            with Transaction().set_context(date=self.effective_date):
-                unit_price = Currency.compute(self.currency, self.unit_price,
-                    self.company.currency, round=False)
+            unit_price = self.unit_price_company
         else:
             unit_price = Uom.compute_price(self.product.default_uom,
                 self.cost_price, self.uom)

Reply via email to