summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorstephanchrst <stephanchrst@gmail.com>2022-09-29 09:00:56 +0700
committerstephanchrst <stephanchrst@gmail.com>2022-09-29 09:00:56 +0700
commit4eff0ccadaade5964fec515a90bb0fc4c915b917 (patch)
tree2b60b538ea7bd9af7b1babe1b11dd83eeb538250
parent43a8e9a7f2d6ba127de9bcd40925b838b1f5eaeb (diff)
Update sale_order.py
-rwxr-xr-xindoteknik_custom/models/sale_order.py12
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")