Files
odoo_source/addons/purchase/mail_mail.py
T
Thibault Delavallée de27deba9b [MOVE] mass_mailing, portal_sale, purchase, website_mail_group: move code
related to the mail.mail model in their own mail_mail.py file. This ease
the process of working on the mail.mail model and inheritance, if the
code is not hidden between unrelated models.
2015-07-02 13:33:59 +02:00

14 lines
608 B
Python

from openerp.osv import osv
class mail_mail(osv.Model):
_name = 'mail.mail'
_inherit = 'mail.mail'
def _postprocess_sent_message(self, cr, uid, mail, context=None, mail_sent=True):
if mail_sent and mail.model == 'purchase.order':
obj = self.pool.get('purchase.order').browse(cr, uid, mail.res_id, context=context)
if obj.state == 'draft':
self.pool.get('purchase.order').signal_workflow(cr, uid, [mail.res_id], 'send_rfq')
return super(mail_mail, self)._postprocess_sent_message(cr, uid, mail=mail, context=context, mail_sent=mail_sent)