diff options
| -rwxr-xr-x | indoteknik_custom/models/purchase_order.py | 11 | ||||
| -rwxr-xr-x | indoteknik_custom/models/sale_order.py | 9 |
2 files changed, 19 insertions, 1 deletions
diff --git a/indoteknik_custom/models/purchase_order.py b/indoteknik_custom/models/purchase_order.py index c2b15078..8772dea9 100755 --- a/indoteknik_custom/models/purchase_order.py +++ b/indoteknik_custom/models/purchase_order.py @@ -118,9 +118,18 @@ class PurchaseOrder(models.Model): show_description = fields.Boolean( string='Show Description', + compute='_compute_show_description', default=True ) - + + @api.depends('partner_id') + def _compute_show_description(self): + for order in self: + if order.partner_id.id == 5571: + order.show_description = False + else: + order.show_description = order.show_description + @api.onchange('show_description') def onchange_show_description(self): if self.show_description == True: diff --git a/indoteknik_custom/models/sale_order.py b/indoteknik_custom/models/sale_order.py index d7b0ccee..ff79761c 100755 --- a/indoteknik_custom/models/sale_order.py +++ b/indoteknik_custom/models/sale_order.py @@ -2363,6 +2363,15 @@ class SaleOrder(models.Model): 'Peringatan', 'Hanya bisa konfirmasi SO tim Anda.' ) + if self.env.user.id in (3401, 20, 3988, 17340): + if self.total_percent_margin <= 15: + self._requires_approval_margin_leader() + self.approval_status = 'pengajuan2' + elif self.total_percent_margin < 18: + self._requires_approval_margin_manager() + self.approval_status = 'pengajuan1' + elif 18 <= self.total_percent_margin <= 24: + self._requires_approval_team_sales() raise UserError("Bisa langsung Confirm") |
