From bd4aa1accc4c8dbb473e480e3ec276994c2a72b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Mon, 22 Nov 2021 10:12:35 +0100 Subject: [PATCH] Ignore landed cost price when recompute unit price issue10957 review367831002 (grafted from 9b7cb0a11dab87559d69a7d0482a0313901b4b98) --HG-- branch : 6.0 --- stock.py | 10 ++++++++++ tryton.cfg | 1 + 2 files changed, 11 insertions(+) diff --git a/stock.py b/stock.py index 3b690162ee..c9a81edc0f 100644 --- a/stock.py +++ b/stock.py @@ -11,7 +11,17 @@ class Move(metaclass=PoolMeta): digits=price_digits, readonly=True) def _compute_unit_price(self, unit_price): + if self.unit_landed_cost: + unit_price -= self.unit_landed_cost unit_price = super()._compute_unit_price(unit_price) if self.unit_landed_cost: unit_price += self.unit_landed_cost return unit_price + + def _compute_component_unit_price(self, unit_price): + if self.unit_landed_cost: + unit_price -= self.unit_landed_cost + unit_price = super()._compute_component_unit_price(unit_price) + if self.unit_landed_cost: + unit_price += self.unit_landed_cost + return unit_price diff --git a/tryton.cfg b/tryton.cfg index a3cc89db20..0d643abe0f 100644 --- a/tryton.cfg +++ b/tryton.cfg @@ -9,6 +9,7 @@ depends: stock extra_depends: account_invoice_stock + product_kit xml: account.xml product.xml