summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAzka Nathan <darizkyfaz@gmail.com>2024-10-15 15:55:02 +0700
committerAzka Nathan <darizkyfaz@gmail.com>2024-10-15 15:55:02 +0700
commit29e6aa1d25a7484736399ddbf21dd180ffb2f025 (patch)
tree80901a339883ff95f2b912575bc576c32dae2713
parent24b4e09c5f77d0f6d2f179693b90d924e2107ee6 (diff)
change permission po form purchasing manager to merchandise
-rwxr-xr-xindoteknik_custom/models/purchase_order.py6
-rw-r--r--indoteknik_custom/models/report_stock_forecasted.py1
2 files changed, 3 insertions, 4 deletions
diff --git a/indoteknik_custom/models/purchase_order.py b/indoteknik_custom/models/purchase_order.py
index 340df49e..21f3265e 100755
--- a/indoteknik_custom/models/purchase_order.py
+++ b/indoteknik_custom/models/purchase_order.py
@@ -508,10 +508,10 @@ class PurchaseOrder(models.Model):
if self.amount_untaxed >= 50000000 and not self.env.user.has_group('indoteknik_custom.group_role_merchandiser'):
raise UserError("Hanya Merchandiser yang bisa approve")
- if self.total_percent_margin < self.total_so_percent_margin and not self.env.user.is_purchasing_manager and not self.env.user.is_leader:
+ if self.total_percent_margin < self.total_so_percent_margin and not self.env.user.has_group('indoteknik_custom.group_role_merchandiser') and not self.env.user.is_leader:
raise UserError("Beda Margin dengan Sales, harus approval Manager")
if not self.from_apo:
- if not self.sale_order_id and not self.env.user.is_purchasing_manager and not self.env.user.is_leader:
+ if not self.sale_order_id and self.env.user.has_group('indoteknik_custom.group_role_merchandiser') and not self.env.user.is_leader:
raise UserError("Tidak ada link dengan SO, harus approval Manager")
send_email = False
@@ -641,7 +641,7 @@ class PurchaseOrder(models.Model):
def po_approve(self):
if self.amount_untaxed >= 50000000 and not self.env.user.has_group('indoteknik_custom.group_role_merchandiser'):
raise UserError("Hanya Merchandiser yang bisa approve")
- if self.env.user.is_leader or self.env.user.is_purchasing_manager:
+ if self.env.user.is_leader or self.env.user.has_group('indoteknik_custom.group_role_merchandiser'):
raise UserError("Bisa langsung Confirm")
elif self.total_percent_margin == self.total_so_percent_margin and self.sale_order_id:
raise UserError("Bisa langsung Confirm")
diff --git a/indoteknik_custom/models/report_stock_forecasted.py b/indoteknik_custom/models/report_stock_forecasted.py
index 5f9427f8..ebdc7d4a 100644
--- a/indoteknik_custom/models/report_stock_forecasted.py
+++ b/indoteknik_custom/models/report_stock_forecasted.py
@@ -33,7 +33,6 @@ class ReplenishmentReport(models.AbstractModel):
'reserved_from': result,
'qty_fullfillment': quantity,
})
-
return lines
def _calculate_result(self, line):