diff options
| author | Thibault Delavallée <tde@openerp.com> | 2015-07-02 10:33:47 +0200 |
|---|---|---|
| committer | Thibault Delavallée <tde@openerp.com> | 2015-07-02 13:33:59 +0200 |
| commit | de27deba9bf4d32bace206a5539881323f1d20e2 (patch) | |
| tree | ae210caa0618215f48c8fee3bfb50dcb5338617e /addons/purchase | |
| parent | ba9dc7029418c3553cb1a539a45bb780fc20fc35 (diff) | |
[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.
Diffstat (limited to 'addons/purchase')
| -rw-r--r-- | addons/purchase/__init__.py | 1 | ||||
| -rw-r--r-- | addons/purchase/mail_mail.py | 13 | ||||
| -rw-r--r-- | addons/purchase/purchase.py | 12 |
3 files changed, 14 insertions, 12 deletions
diff --git a/addons/purchase/__init__.py b/addons/purchase/__init__.py index 1c6dcaac111..e53ec6f2f7b 100644 --- a/addons/purchase/__init__.py +++ b/addons/purchase/__init__.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. +import mail_mail import purchase import partner import stock diff --git a/addons/purchase/mail_mail.py b/addons/purchase/mail_mail.py new file mode 100644 index 00000000000..1bc9ec6017e --- /dev/null +++ b/addons/purchase/mail_mail.py @@ -0,0 +1,13 @@ +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) diff --git a/addons/purchase/purchase.py b/addons/purchase/purchase.py index c0cb5ea87ab..da3aa5f4a2b 100644 --- a/addons/purchase/purchase.py +++ b/addons/purchase/purchase.py @@ -1610,18 +1610,6 @@ class procurement_order(osv.osv): return res -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) - - class product_template(osv.Model): _name = 'product.template' _inherit = 'product.template' |
