summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorstephanchrst <stephanchrst@gmail.com>2023-06-05 09:43:28 +0700
committerstephanchrst <stephanchrst@gmail.com>2023-06-05 09:43:28 +0700
commit7ffcb706cfbacdc7abf11c239073acadaae469a7 (patch)
tree03e2677690da0815536befacbbfb15682adfb8ba
parented2cd466938f7aee19688b6402edbb3643ee21e1 (diff)
fix compute grand total in sales order
-rwxr-xr-xindoteknik_custom/models/sale_order.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/indoteknik_custom/models/sale_order.py b/indoteknik_custom/models/sale_order.py
index d021934f..735a467c 100755
--- a/indoteknik_custom/models/sale_order.py
+++ b/indoteknik_custom/models/sale_order.py
@@ -425,7 +425,10 @@ class SaleOrder(models.Model):
def _compute_grand_total(self):
for order in self:
- order.grand_total = order.delivery_amt + order.amount_total
+ if order.shipping_cost_covered == 'customer':
+ order.grand_total = order.delivery_amt + order.amount_total
+ else:
+ order.grand_total = order.amount_total
class SaleOrderLine(models.Model):