diff options
| -rwxr-xr-x | indoteknik_custom/models/purchase_order.py | 7 | ||||
| -rwxr-xr-x | indoteknik_custom/views/purchase_order.xml | 1 |
2 files changed, 7 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 diff --git a/indoteknik_custom/views/purchase_order.xml b/indoteknik_custom/views/purchase_order.xml index a1e6f08c..ccedd857 100755 --- a/indoteknik_custom/views/purchase_order.xml +++ b/indoteknik_custom/views/purchase_order.xml @@ -22,6 +22,7 @@ </button> <field name="date_order" position="before"> <field name="sale_order_id" attrs="{'readonly': [('state', 'not in', ['draft'])]}"/> + <field name="approval_status"/> </field> <xpath expr="//form/sheet/notebook/page/field[@name='order_line']/tree/field[@name='price_subtotal']" position="after"> <field name="item_margin"/> |
