summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndriFP <andrifebriyadiputra@gmail.com>2025-04-23 14:57:14 +0700
committerAndriFP <andrifebriyadiputra@gmail.com>2025-04-23 14:57:14 +0700
commit3f0a246d364a07f8c61eafeefcee7b37232a5933 (patch)
tree44136f361b2b45892250d00fc7fe6adee03970e7
parent2f16e84dcceec98e3dd49cbbbf57457d00989a04 (diff)
(miqdad) rev add xpdc
-rwxr-xr-xindoteknik_custom/models/sale_order.py24
1 files changed, 10 insertions, 14 deletions
diff --git a/indoteknik_custom/models/sale_order.py b/indoteknik_custom/models/sale_order.py
index 2061c686..bdb79fdf 100755
--- a/indoteknik_custom/models/sale_order.py
+++ b/indoteknik_custom/models/sale_order.py
@@ -1438,19 +1438,6 @@ class SaleOrder(models.Model):
# 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_margin(self):
- # for order in self:
- # total_margin = sum(line.item_margin for line in order.order_line if line.product_id)
- # order.total_margin = total_margin
def _compute_total_percent_margin(self):
for order in self:
@@ -1768,4 +1755,13 @@ 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 \ No newline at end of file
+ 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