diff options
| author | stephanchrst <stephanchrst@gmail.com> | 2024-11-12 10:53:04 +0700 |
|---|---|---|
| committer | stephanchrst <stephanchrst@gmail.com> | 2024-11-12 10:53:04 +0700 |
| commit | 45811de91c682cea9ade1e975f241a651c68b1df (patch) | |
| tree | 00ca1e54229399278091c03ef53f6351e7efc947 /indoteknik_custom/models/purchase_order.py | |
| parent | 8d087106a29341d7ffe8725fff92c43dd3a2dbf2 (diff) | |
after UAT plafon
Diffstat (limited to 'indoteknik_custom/models/purchase_order.py')
| -rwxr-xr-x | indoteknik_custom/models/purchase_order.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/indoteknik_custom/models/purchase_order.py b/indoteknik_custom/models/purchase_order.py index a8fd68e9..9faa6464 100755 --- a/indoteknik_custom/models/purchase_order.py +++ b/indoteknik_custom/models/purchase_order.py @@ -589,7 +589,7 @@ class PurchaseOrder(models.Model): for line in self.order_line: if not line.product_id: continue - if line.product_uom_qty > line.product_id.plafon_qty: + if line.product_uom_qty > line.product_id.plafon_qty and not self.env.user.has_group('indoteknik_custom.group_role_merchandiser'): raise UserError('Product '+line.product_id.name+' melebihi plafon, harus Approval MD') def button_confirm(self): @@ -733,8 +733,8 @@ class PurchaseOrder(models.Model): template.send_mail(self.id, force_send=True) 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.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.has_group('indoteknik_custom.group_role_merchandiser'): raise UserError("Bisa langsung Confirm") elif self.total_percent_margin == self.total_so_percent_margin and self.matches_so: @@ -768,8 +768,8 @@ class PurchaseOrder(models.Model): if not line.product_id: continue if line.product_uom_qty > line.product_id.plafon_qty: - message = (message + line.product_id.default_code + 'melebihi plafon ' - + str(line.product_uom_qty) + ' vs ' + str(line.product_id.plafon_qty) + message = (message + '\n'+line.product_id.default_code + ' melebihi plafon (' + + str(line.product_id.plafon_qty) + ') vs Qty PO ('+str(line.product_uom_qty)+')' + ', ') greater_than_plafon = True print(1) |
