summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRafi Zadanly <zadanlyr@gmail.com>2023-02-01 15:08:20 +0700
committerRafi Zadanly <zadanlyr@gmail.com>2023-02-01 15:08:20 +0700
commit23b787dbb798a8b34963c9e5379538d49431e2bf (patch)
tree86e8150fac096c048b97b912032f0b5b7e2f0a73
parent211abaad9849cefbf93326742a4b295a94d3b4a2 (diff)
fix compute contribution delivery and fee third party
-rwxr-xr-xindoteknik_custom/models/sale_order.py10
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