diff options
| -rwxr-xr-x | indoteknik_custom/models/sale_order.py | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/indoteknik_custom/models/sale_order.py b/indoteknik_custom/models/sale_order.py index 1442b432..9f70f05b 100755 --- a/indoteknik_custom/models/sale_order.py +++ b/indoteknik_custom/models/sale_order.py @@ -54,11 +54,9 @@ class SaleOrder(models.Model): raise UserError(_('Tidak bisa Confirm menggunakan Produk Sementara')) if not line.vendor_id or not line.purchase_price or not line.purchase_tax_id: raise UserError(_('Isi Vendor, Harga Beli, dan Tax sebelum Request Approval')) - if (line.item_percent_margin <= 15) and ( - self.env.user.id != 6 and self.env.user.id != 7): # akbar or tyas + if line.item_percent_margin <= 15 and not self.env.user.is_leader: # akbar or tyas approval2 += 1 - elif line.item_percent_margin <= 25 and ( - self.env.user.id != 19 and self.env.user.id != 6 and self.env.user.id != 7): + elif line.item_percent_margin <= 25 and not self.env.user.is_leader and not self.env.user.is_sales_manager: approval1 += 1 if approval2 > 0: order.approval_status = 'pengajuan2' @@ -84,11 +82,9 @@ class SaleOrder(models.Model): raise UserError(_('Isi Vendor, Harga Beli, dan Tax sebelum Request Approval')) if not line.product_id or line.product_id.type == 'service': continue - if (line.item_percent_margin <= 15) and ( - self.env.user.id != 6 and self.env.user.id != 7): # akbar or tyas will approve + if line.item_percent_margin <= 15 and not self.env.user.is_pimpinan: approval2 += 1 - elif line.item_percent_margin <= 25 and ( - self.env.user.id != 6 and self.env.user.id != 7 and self.env.user.id != 377): # vita + elif line.item_percent_margin <= 25 and not self.env.user.is_pimpinan and not self.env.user.is_sales_manager: approval1 += 1 if approval2 > 0: raise UserError("Harus diapprove oleh Pimpinan") |
