This commit is contained in:
eslamabady 2024-08-07 22:16:54 +03:00
parent 0ed137f53b
commit 259bd3958f
1 changed files with 6 additions and 0 deletions

View File

@ -306,6 +306,12 @@ class PurchaseOrderCustom(models.Model):
self.state = 'sent'
return res
@api.returns('mail.message', lambda value: value.id)
def message_post(self, **kwargs):
if self.env.context.get('mark_rfq_as_sent'):
self.filtered(lambda o: o.state == 'wait').write({'state': 'sent'})
return super(PurchaseOrderCustom, self.with_context(mail_post_autofollow=True)).message_post(**kwargs)
def action_approve_po(self):
for rec in self:
if rec.requisition_id and rec.requisition_id.state != 'approve':