changeset bd9a8656834d in modules/account_stock_shipment_cost:6.2
details: 
https://hg.tryton.org/modules/account_stock_shipment_cost?cmd=changeset&node=bd9a8656834d
description:
        Test shipment cost is not None before adding a new cost

        issue11288
        review380441002
        (grafted from ba1cad56f12037ae4473e7cb6a114eaa05815693)
diffstat:

 account.py |  3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diffs (13 lines):

diff -r abfe146d02fd -r bd9a8656834d account.py
--- a/account.py        Mon Nov 01 17:18:34 2021 +0100
+++ b/account.py        Sat Mar 19 15:01:00 2022 +0100
@@ -213,7 +213,8 @@
                 (list(self.shipment_returns), ShipmentReturn),
                 ]:
             for shipment in shipments:
-                if any(c.state == 'posted' for c in shipment.shipment_costs):
+                if (any(c.state == 'posted' for c in shipment.shipment_costs)
+                        and shipment.cost):
                     shipment.cost += round_price(cost * factors[shipment])
                 else:
                     shipment.cost = round_price(cost * factors[shipment])

Reply via email to