diff options
| author | FIN-IT_AndriFP <it@fixcomart.co.id> | 2025-10-17 11:10:33 +0700 |
|---|---|---|
| committer | FIN-IT_AndriFP <it@fixcomart.co.id> | 2025-10-17 11:10:33 +0700 |
| commit | 7ba88682ecb9d1445f5565723adaf93106e056e2 (patch) | |
| tree | 245c9b471e112ba2811cb4a3d9220dc41e633cb6 | |
| parent | bd0cc0fa2518e735cbe766bd0ea3726c63d3ebbd (diff) | |
(andri) on
| -rwxr-xr-x | indoteknik_custom/models/purchase_order.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/indoteknik_custom/models/purchase_order.py b/indoteknik_custom/models/purchase_order.py index a1c3c0c4..b596f365 100755 --- a/indoteknik_custom/models/purchase_order.py +++ b/indoteknik_custom/models/purchase_order.py @@ -1069,13 +1069,13 @@ class PurchaseOrder(models.Model): ) % order.name) def button_confirm(self): - # if self.env.user.id != 7 and not self.env.user.is_leader: # Pimpinan - # if '/PJ/' in self.name: - # low_margin_lines = self.order_sales_match_line.filtered( - # lambda match: match.so_header_margin <= 15.0 - # ) - # if low_margin_lines: - # raise UserError("Matches SO terdapat item dengan header margin SO <= 15%. Approval Pimpinan diperlukan.") + if self.env.user.id != 7 and not self.env.user.is_leader: # Pimpinan + if '/PJ/' in self.name: + low_margin_lines = self.order_sales_match_line.filtered( + lambda match: match.so_header_margin <= 15.0 + ) + if low_margin_lines: + raise UserError("Matches SO terdapat item dengan header margin SO <= 15%. Approval Pimpinan diperlukan.") # else: # is_po_manual = '/A/' not in self.name and '/MO/' not in self.name # if is_po_manual: |
