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

        issue11288
        review380441002
diffstat:

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

diffs (13 lines):

diff -r 1fbf7b9931c0 -r ba1cad56f120 account.py
--- a/account.py        Tue Feb 15 00:08:47 2022 +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