changeset 87c2f5a28302 in modules/account_stock_landed_cost:6.2
details:
https://hg.tryton.org/modules/account_stock_landed_cost?cmd=changeset&node=87c2f5a28302
description:
Ignore landed cost price when recompute unit price
issue10957
review367831002
(grafted from 9b7cb0a11dab87559d69a7d0482a0313901b4b98)
diffstat:
stock.py | 10 ++++++++++
tryton.cfg | 1 +
2 files changed, 11 insertions(+), 0 deletions(-)
diffs (32 lines):
diff -r 7e0add276e39 -r 87c2f5a28302 stock.py
--- a/stock.py Mon Nov 01 17:18:22 2021 +0100
+++ b/stock.py Mon Nov 22 10:12:35 2021 +0100
@@ -11,7 +11,17 @@
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 -r 7e0add276e39 -r 87c2f5a28302 tryton.cfg
--- a/tryton.cfg Mon Nov 01 17:18:22 2021 +0100
+++ b/tryton.cfg Mon Nov 22 10:12:35 2021 +0100
@@ -9,6 +9,7 @@
stock
extra_depends:
account_invoice_stock
+ product_kit
xml:
account.xml
product.xml