From c19b44fe336e6fda8812c85322aee095ada35c70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Thu, 1 Sep 2022 21:55:48 +0200 Subject: [PATCH] Do not create accounting move for period without method when updating product cost price issue11393 review411611003 --- product.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/product.py b/product.py index b28cc531a4..071b4fbf43 100644 --- a/product.py +++ b/product.py @@ -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)