summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models
diff options
context:
space:
mode:
authorstephanchrst <stephanchrst@gmail.com>2022-09-23 09:31:52 +0700
committerstephanchrst <stephanchrst@gmail.com>2022-09-23 09:31:52 +0700
commit62dfd611cac52a2099deabf26149b1779926ee7a (patch)
treeba589baeea79ac56e3a47b33cd47962e50f78f67 /indoteknik_custom/models
parentf9d6b340a6e75799edc3a6a2a9e5bd6086fc8a3f (diff)
override method cancel purchase order and add field approval status in form purchase order
Diffstat (limited to 'indoteknik_custom/models')
-rwxr-xr-xindoteknik_custom/models/purchase_order.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/indoteknik_custom/models/purchase_order.py b/indoteknik_custom/models/purchase_order.py
index b53f973f..2c9b72b1 100755
--- a/indoteknik_custom/models/purchase_order.py
+++ b/indoteknik_custom/models/purchase_order.py
@@ -108,7 +108,7 @@ class PurchaseOrder(models.Model):
(self.env.user.id != 6 and self.env.user.id != 7): # tyas or akbar
approval2 += 1
elif (line.item_percent_margin >= 15 and line.item_percent_margin < 25) and \
- (self.env.user.id != 6 and self.env.user.id != 7 and self.env.user.id != 11):
+ (self.env.user.id != 6 and self.env.user.id != 7 and self.env.user.id != 11): # tyas or akbar or darren
approval1 += 1
if approval2 > 0:
raise UserError("Need Tyas / Akbar Approval")
@@ -137,3 +137,8 @@ class PurchaseOrder(models.Model):
order.approval_status = 'pengajuan1'
else:
raise UserError("Bisa langsung Confirm")
+
+ def button_cancel(self):
+ res = super(PurchaseOrder, self).button_cancel()
+ self.approval_status = False
+ return res