changeset def60f300e07 in modules/product_cost_warehouse:default details: https://hg.tryton.org/modules/product_cost_warehouse?cmd=changeset&node=def60f300e07 description: Save less often cost values when doing move
We can save the cost values only when a cost value was computed for a product already moved. Also FIFO requires to save extra moves which can be included in the save loop so the Move._do method returns an extra list of moves to save. issue10640 review369361002 diffstat: stock.py | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diffs (21 lines): diff -r 6dc20fbde310 -r def60f300e07 stock.py --- a/stock.py Fri Aug 06 11:02:44 2021 +0200 +++ b/stock.py Fri Aug 27 08:59:26 2021 +0200 @@ -140,7 +140,7 @@ to=move.to_location.rec_name)) def _do(self): - cost_price = super()._do() + cost_price, to_save = super()._do() if (self.company.cost_price_warehouse and self.from_location.type == 'storage' and self.to_location.type == 'storage' @@ -150,7 +150,7 @@ elif self.to_warehouse: cost_price = self._compute_product_cost_price( 'in', self.unit_price_company) - return cost_price + return cost_price, to_save @property def _cost_price_pattern(self):