diff options
| -rwxr-xr-x | indoteknik_custom/models/sale_order.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/indoteknik_custom/models/sale_order.py b/indoteknik_custom/models/sale_order.py index 75981275..7d7eb86c 100755 --- a/indoteknik_custom/models/sale_order.py +++ b/indoteknik_custom/models/sale_order.py @@ -382,13 +382,19 @@ class SaleOrderLine(models.Model): def compute_delivery_amt_line(self): for line in self: - contribution = round((line.price_total / line.order_id.amount_total), 2) + try: + contribution = round((line.price_total / line.order_id.amount_total), 2) + except: + contribution = 0 delivery_amt = line.order_id.delivery_amt line.delivery_amt_line = delivery_amt * contribution def compute_fee_third_party_line(self): for line in self: - contribution = round((line.price_total / line.order_id.amount_total), 2) + try: + contribution = round((line.price_total / line.order_id.amount_total), 2) + except: + contribution = 0 fee = line.order_id.fee_third_party line.fee_third_party_line = fee * contribution |
