Do not create accounting move for period without method when updating product cost price

issue11393
review411611003
This commit is contained in:
Cédric Krier
2022-09-01 21:55:48 +02:00
parent 2d463b44bf
commit c19b44fe33
+4 -2
View File
@@ -221,8 +221,10 @@ class Product(metaclass=PoolMeta):
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)