summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorstephanchrst <stephanchrst@gmail.com>2024-11-12 13:35:24 +0700
committerstephanchrst <stephanchrst@gmail.com>2024-11-12 13:35:24 +0700
commit9f293c1270e29db78ac8542221a4bbe6d208ea8f (patch)
tree2358cda8c91dc1c1e906566c2960f6610cd816a3
parent16cb40e0a943af1679fca60ff8cc4e6a683bd883 (diff)
bf plafon
-rwxr-xr-xindoteknik_custom/models/purchase_order.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/indoteknik_custom/models/purchase_order.py b/indoteknik_custom/models/purchase_order.py
index 9faa6464..d65e1d66 100755
--- a/indoteknik_custom/models/purchase_order.py
+++ b/indoteknik_custom/models/purchase_order.py
@@ -589,7 +589,10 @@ 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 and not self.env.user.has_group('indoteknik_custom.group_role_merchandiser'):
+ # test = line.product_uom_qty
+ # test2 = line.product_id.plafon_qty
+ # test3 = test2 + line.product_uom_qty
+ if line.product_uom_qty > line.product_id.plafon_qty + line.product_uom_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):
@@ -772,7 +775,6 @@ class PurchaseOrder(models.Model):
+ str(line.product_id.plafon_qty) + ') vs Qty PO ('+str(line.product_uom_qty)+')'
+ ', ')
greater_than_plafon = True
- print(1)
return greater_than_plafon, message
def re_calculate(self):