From bf59882cd2554229cc20dc75d790686f641522c4 Mon Sep 17 00:00:00 2001 From: trisusilo48 Date: Thu, 27 Mar 2025 09:05:51 +0700 Subject: bug fixing percent margin --- indoteknik_custom/models/sale_order.py | 1 + 1 file changed, 1 insertion(+) diff --git a/indoteknik_custom/models/sale_order.py b/indoteknik_custom/models/sale_order.py index bee7d6a7..3bf6ba14 100755 --- a/indoteknik_custom/models/sale_order.py +++ b/indoteknik_custom/models/sale_order.py @@ -662,6 +662,7 @@ class SaleOrder(models.Model): if self.email and not re.match(pattern, self.email): raise UserError('Email yang anda input kurang valid') + @api.constrains('delivery_amt', 'carrier_id', 'shipping_cost_covered') def _validate_delivery_amt(self): if self.delivery_amt < 1: if(self.carrier_id.id == 1 or self.shipping_cost_covered == 'indoteknik') and not self.env.context.get('active_id', []): -- cgit v1.2.3 From a83022f278c3fbe6a8ed6ae92a2ffee2e4a7c992 Mon Sep 17 00:00:00 2001 From: trisusilo48 Date: Thu, 27 Mar 2025 09:12:49 +0700 Subject: comment total margin excl third party --- indoteknik_custom/models/sale_order.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/indoteknik_custom/models/sale_order.py b/indoteknik_custom/models/sale_order.py index 3bf6ba14..4ebc5d34 100755 --- a/indoteknik_custom/models/sale_order.py +++ b/indoteknik_custom/models/sale_order.py @@ -1693,7 +1693,7 @@ class SaleOrder(models.Model): order._compute_etrts_date() order._validate_expected_ready_ship_date() order._validate_delivery_amt() - order._check_total_margin_excl_third_party() + # order._check_total_margin_excl_third_party() # order._update_partner_details() return order @@ -1737,7 +1737,7 @@ class SaleOrder(models.Model): res = super(SaleOrder, self).write(vals) self._validate_delivery_amt() - self._check_total_margin_excl_third_party() + # self._check_total_margin_excl_third_party() if any(field in vals for field in ["order_line", "client_order_ref"]): self._calculate_etrts_date() if 'order_line' in vals: -- cgit v1.2.3