changeset f7950a075568 in modules/account_stock_continental:default
details: 
https://hg.tryton.org/modules/account_stock_continental?cmd=changeset&node=f7950a075568
description:
        Do not create accounting move for period without method when updating 
product cost price

        issue11393
        review411611003
diffstat:

 product.py |  6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diffs (16 lines):

diff -r e07b5fb755d0 -r f7950a075568 product.py
--- a/product.py        Mon May 02 17:06:41 2022 +0200
+++ b/product.py        Thu Sep 01 21:55:48 2022 +0200
@@ -221,8 +221,10 @@
                     amount = company.currency.round(
                         Decimal(str(quantity)) * difference)
                     if amount:
-                        moves.append(product._update_cost_price_move(
-                                amount, company))
+                        move = product._update_cost_price_move(
+                                amount, company)
+                        if move.period.fiscalyear.account_stock_method:
+                            moves.append(move)
         Move.save(moves)
         Move.post(moves)
         super().update_cost_price(costs)

Reply via email to