From 4c02839073b250bb46d1c3b927ad56b006636962 Mon Sep 17 00:00:00 2001 From: IT Fixcomart Date: Wed, 23 Apr 2025 08:08:37 +0000 Subject: sale_order.py edited online with Bitbucket --- indoteknik_custom/models/sale_order.py | 19 +++++++++---------- 1 file 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 -- cgit v1.2.3 From 57d299950d11976917fe516736afeb0f3e0233a3 Mon Sep 17 00:00:00 2001 From: IT Fixcomart Date: Wed, 23 Apr 2025 08:16:37 +0000 Subject: sale_order.xml edited online with Bitbucket --- indoteknik_custom/views/sale_order.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/indoteknik_custom/views/sale_order.xml b/indoteknik_custom/views/sale_order.xml index 79a095fb..2ed35381 100755 --- a/indoteknik_custom/views/sale_order.xml +++ b/indoteknik_custom/views/sale_order.xml @@ -34,6 +34,7 @@ attrs="{'required': ['|', ('create_date', '>', '2023-06-15'), ('create_date', '=', False)]}" /> + -- cgit v1.2.3 From 9e9fef462d5fb71de37bb7a4a190d316af394b10 Mon Sep 17 00:00:00 2001 From: IT Fixcomart Date: Wed, 23 Apr 2025 08:18:11 +0000 Subject: xpdc views --- indoteknik_custom/views/sale_order.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/indoteknik_custom/views/sale_order.xml b/indoteknik_custom/views/sale_order.xml index 2ed35381..79a095fb 100755 --- a/indoteknik_custom/views/sale_order.xml +++ b/indoteknik_custom/views/sale_order.xml @@ -34,7 +34,6 @@ attrs="{'required': ['|', ('create_date', '>', '2023-06-15'), ('create_date', '=', False)]}" /> - -- cgit v1.2.3