diff options
| author | AndriFP <andrifebriyadiputra@gmail.com> | 2025-04-23 14:57:14 +0700 |
|---|---|---|
| committer | AndriFP <andrifebriyadiputra@gmail.com> | 2025-04-23 14:57:14 +0700 |
| commit | 3f0a246d364a07f8c61eafeefcee7b37232a5933 (patch) | |
| tree | 44136f361b2b45892250d00fc7fe6adee03970e7 | |
| parent | 2f16e84dcceec98e3dd49cbbbf57457d00989a04 (diff) | |
(miqdad) rev add xpdc
| -rwxr-xr-x | indoteknik_custom/models/sale_order.py | 24 |
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 |
