summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIT Fixcomart <it@fixcomart.co.id>2025-04-23 08:08:37 +0000
committerIT Fixcomart <it@fixcomart.co.id>2025-04-23 08:08:37 +0000
commit4c02839073b250bb46d1c3b927ad56b006636962 (patch)
tree3dd381c465c33780954c4689cc1b1a65b3e3c730
parent3f0a246d364a07f8c61eafeefcee7b37232a5933 (diff)
sale_order.py edited online with Bitbucket
-rwxr-xr-xindoteknik_custom/models/sale_order.py19
1 files changed, 9 insertions, 10 deletions
diff --git a/indoteknik_custom/models/sale_order.py b/indoteknik_custom/models/sale_order.py
index bdb79fdf..b4651f3c 100755
--- a/indoteknik_custom/models/sale_order.py
+++ b/indoteknik_custom/models/sale_order.py
@@ -1437,7 +1437,15 @@ class SaleOrder(models.Model):
# partner.npwp = self.npwp
# partner.sppkp = self.sppkp
# partner.email = self.email
+
+ def _compute_total_margin(self):
+ for order in self:
+ total_margin = sum(line.item_margin for line in order.order_line if line.product_id)
+ #hitung nek onk
+ if order.ongkir_ke_xpdc:
+ total_margin -= order.ongkir_ke_xpdc
+ order.total_margin = total_margin
def _compute_total_percent_margin(self):
for order in self:
@@ -1755,13 +1763,4 @@ class SaleOrder(models.Model):
self._validate_delivery_amt()
if any(field in vals for field in ["order_line", "client_order_ref"]):
self._calculate_etrts_date()
- return res
-
- def _compute_total_margin(self):
- for order in self:
- total_margin = sum(line.item_margin for line in order.order_line if line.product_id)
- #hitung nek onk
- if order.ongkir_ke_xpdc:
- total_margin -= order.ongkir_ke_xpdc
-
- order.total_margin = total_margin \ No newline at end of file
+ return res \ No newline at end of file