changeset 9b7cb0a11dab in modules/account_stock_landed_cost:default
details: 
https://hg.tryton.org/modules/account_stock_landed_cost?cmd=changeset&node=9b7cb0a11dab
description:
        Ignore landed cost price when recompute unit price

        issue10957
        review367831002
diffstat:

 stock.py   |  10 ++++++++++
 tryton.cfg |   1 +
 2 files changed, 11 insertions(+), 0 deletions(-)

diffs (32 lines):

diff -r 779b01bb3cf9 -r 9b7cb0a11dab stock.py
--- a/stock.py  Mon Nov 01 17:18:23 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 779b01bb3cf9 -r 9b7cb0a11dab tryton.cfg
--- a/tryton.cfg        Mon Nov 01 17:18:23 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

Reply via email to