Do not fail to compute price when carrier has no price list per weight

Closes #14111
This commit is contained in:
Cédric Krier
2025-07-11 09:41:35 +02:00
parent 490fb564ea
commit cc67a9b121
+2 -1
View File
@@ -46,11 +46,12 @@ class Carrier(metaclass=PoolMeta):
def compute_weight_price(self, weight):
"Compute price based on weight"
line = None
for line in reversed(self.weight_price_list):
if line.weight < weight:
return line.price
else:
if not line.weight and not weight:
if line and not line.weight and not weight:
return line.price
return Decimal(0)