From 9642f8efdd9b7a63b58788251959e5968db8d7ee Mon Sep 17 00:00:00 2001 From: AndriFP Date: Wed, 30 Apr 2025 08:18:07 +0700 Subject: (andri) delete comment code --- indoteknik_custom/models/sale_order.py | 1 - 1 file changed, 1 deletion(-) diff --git a/indoteknik_custom/models/sale_order.py b/indoteknik_custom/models/sale_order.py index ab63509b..b0643874 100755 --- a/indoteknik_custom/models/sale_order.py +++ b/indoteknik_custom/models/sale_order.py @@ -1457,7 +1457,6 @@ class SaleOrder(models.Model): def _requires_approval_margin_manager(self): return 15 < self.total_percent_margin <= 24 and not self.env.user.is_sales_manager and not self.env.user.is_leader - # return self.total_percent_margin >= 15 and not self.env.user.is_leader and not self.env.user.is_sales_manager def _create_approval_notification(self, approval_role): title = 'Warning' -- cgit v1.2.3 From a73856faaa1999b0c5ec20c41b37fda8a8eed31a Mon Sep 17 00:00:00 2001 From: "Indoteknik ." Date: Wed, 30 Apr 2025 15:13:52 +0700 Subject: (andri) add area (kecamatan kota) pada stock picking --- indoteknik_custom/models/stock_picking.py | 8 ++++++++ indoteknik_custom/views/stock_picking.xml | 1 + 2 files changed, 9 insertions(+) diff --git a/indoteknik_custom/models/stock_picking.py b/indoteknik_custom/models/stock_picking.py index 64dc1499..75803ccb 100644 --- a/indoteknik_custom/models/stock_picking.py +++ b/indoteknik_custom/models/stock_picking.py @@ -157,6 +157,14 @@ class StockPicking(models.Model): so_lama = fields.Boolean('SO LAMA', copy=False) linked_manual_bu_out = fields.Many2one('stock.picking', string='BU Out', copy=False) + area_name = fields.Char(string="Area", compute="_compute_area_name", store=True) + @api.depends('real_shipping_id.district_id_pengiriman', 'real_shipping_id.city_id_pengiriman') + def _compute_area_name(self): + for record in self: + district = record.real_shipping_id.district_id_pengiriman.name if record.real_shipping_id.district_id_pengiriman else '' + city = record.real_shipping_id.city_id_pengiriman.name if record.real_shipping_id.city_id_pengiriman else '' + record.area_name = f"{district}, {city}".strip(', ') + # def write(self, vals): # if 'linked_manual_bu_out' in vals: # for record in self: diff --git a/indoteknik_custom/views/stock_picking.xml b/indoteknik_custom/views/stock_picking.xml index c916f2ef..0a6f4752 100644 --- a/indoteknik_custom/views/stock_picking.xml +++ b/indoteknik_custom/views/stock_picking.xml @@ -26,6 +26,7 @@ --> + -- cgit v1.2.3 From ee062e41281b7a1f582ff299ba4c671a4bbbe24d Mon Sep 17 00:00:00 2001 From: "Indoteknik ." Date: Wed, 30 Apr 2025 15:28:43 +0700 Subject: (andri) undo penyesuaian margin pada branch ini (agar tidak konflik) --- 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 b0643874..ab63509b 100755 --- a/indoteknik_custom/models/sale_order.py +++ b/indoteknik_custom/models/sale_order.py @@ -1457,6 +1457,7 @@ class SaleOrder(models.Model): def _requires_approval_margin_manager(self): return 15 < self.total_percent_margin <= 24 and not self.env.user.is_sales_manager and not self.env.user.is_leader + # return self.total_percent_margin >= 15 and not self.env.user.is_leader and not self.env.user.is_sales_manager def _create_approval_notification(self, approval_role): title = 'Warning' -- cgit v1.2.3 From 6601e72946ebcbca6b73b20dd4f3f86f39f89265 Mon Sep 17 00:00:00 2001 From: "Indoteknik ." Date: Wed, 30 Apr 2025 15:29:04 +0700 Subject: (andri) undo penyesuaian margin pada branch ini (agar tidak konflik) --- indoteknik_custom/models/sale_order.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/indoteknik_custom/models/sale_order.py b/indoteknik_custom/models/sale_order.py index ab63509b..e25b9570 100755 --- a/indoteknik_custom/models/sale_order.py +++ b/indoteknik_custom/models/sale_order.py @@ -1453,11 +1453,10 @@ class SaleOrder(models.Model): # Rule: # ≤ 15% → Pimpinan, > 15% - <24% → Manager, == 24% → Langsung Confirm def _requires_approval_margin_leader(self): - return self.total_percent_margin <= 15 and not self.env.user.is_leader + return self.total_percent_margin < 15 and not self.env.user.is_leader def _requires_approval_margin_manager(self): - return 15 < self.total_percent_margin <= 24 and not self.env.user.is_sales_manager and not self.env.user.is_leader - # return self.total_percent_margin >= 15 and not self.env.user.is_leader and not self.env.user.is_sales_manager + return self.total_percent_margin >= 15 and not self.env.user.is_leader and not self.env.user.is_sales_manager def _create_approval_notification(self, approval_role): title = 'Warning' -- cgit v1.2.3