Merge pull request #1695 from expsa/pla-5644-fix-issue-purchase-confirm
fix issue purchase confirm
This commit is contained in:
commit
d4f0a724b6
|
|
@ -31,7 +31,7 @@ class PurchaseOrderCustom(models.Model):
|
|||
order.recommendation_order = True
|
||||
|
||||
def button_confirm(self):
|
||||
super(PurchaseOrderCustom, self).button_confirm()
|
||||
res = super(PurchaseOrderCustom, self).button_confirm()
|
||||
for order in self:
|
||||
if order.state not in ['draft', 'sent', 'sign']:
|
||||
continue
|
||||
|
|
@ -43,4 +43,4 @@ class PurchaseOrderCustom(models.Model):
|
|||
order.write({'state': 'to approve'})
|
||||
if order.partner_id not in order.message_partner_ids:
|
||||
order.message_subscribe([order.partner_id.id])
|
||||
return True
|
||||
return res
|
||||
|
|
|
|||
|
|
@ -76,9 +76,8 @@ class POCustom(models.Model):
|
|||
|
||||
|
||||
def button_confirm(self):
|
||||
res = None
|
||||
res = super(POCustom, self).button_confirm()
|
||||
for rec in self:
|
||||
res = super(POCustom,self).button_confirm()
|
||||
if rec.application_id:
|
||||
rec.application_id.state = 'contract'
|
||||
return res
|
||||
|
|
|
|||
|
|
@ -535,10 +535,9 @@ class PurchaseOrderCustom(models.Model):
|
|||
self.requisition_id.state = 'purchase_manager'
|
||||
|
||||
def button_confirm(self):
|
||||
# res = super(PurchaseOrderCustom, self).button_confirm()
|
||||
for order in self:
|
||||
if order.state not in ['draft']:
|
||||
continue
|
||||
return super(PurchaseOrderCustom, self).button_confirm()
|
||||
order._add_supplier_to_product()
|
||||
# Deal with double validation process
|
||||
if order._approval_allowed():
|
||||
|
|
@ -563,7 +562,7 @@ class PurchaseOrderCustom(models.Model):
|
|||
order.requisition_id.state = 'done'
|
||||
if order.request_id:
|
||||
order.request_id.write({'state': 'done'})
|
||||
return True
|
||||
return res
|
||||
|
||||
def action_unsign(self):
|
||||
"""
|
||||
|
|
|
|||
Loading…
Reference in New Issue