diff options
| author | IT Fixcomart <it@fixcomart.co.id> | 2025-04-23 08:27:39 +0000 |
|---|---|---|
| committer | IT Fixcomart <it@fixcomart.co.id> | 2025-04-23 08:27:39 +0000 |
| commit | caf7253ba217063c31350b12f08a27193c25c394 (patch) | |
| tree | 2561a3a34b8166f5ea12ede4448e84d04c8f50ee | |
| parent | 57d299950d11976917fe516736afeb0f3e0233a3 (diff) | |
| parent | 4c02839073b250bb46d1c3b927ad56b006636962 (diff) | |
Merged in IT-Fixcomart/sale_orderpy-edited-online-with-bitbucke-1745395709012 (pull request #280)
sale_order.py edited online with Bitbucket
| -rwxr-xr-x | indoteknik_custom/models/sale_order.py | 19 |
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 |
