PURPOSE
Purpose of this task is to cleanup attachment management done in generic mail
models overrides and move it in account as model overrides.
SPECIFICATIONS
Update addons
* in purchase and sale: context key update should be done at message_post
level, especially this is not used in mass mailing mode;
* in website_sale: code to update sale order to avoid sending recovery
emails several times belongs to a "post hook" method on sale order model;
* in loyalty: remove a deprecated / unsupported 'mark_coupon_as_sent' key;
Task-2792146 (Mail: Move model-dependent code from composer / template)
Part-of: odoo/odoo#106658
14 lines
473 B
Python
14 lines
473 B
Python
# -*- coding: utf-8 -*-
|
|
# purches Part of Odoo. See LICENSE file for full copyright and licensing details.
|
|
|
|
from odoo import models
|
|
|
|
|
|
class MailComposeMessage(models.TransientModel):
|
|
_inherit = 'mail.compose.message'
|
|
|
|
def _action_send_mail(self, auto_commit=False):
|
|
if self.model == 'purchase.order':
|
|
self = self.with_context(mailing_document_based=True)
|
|
return super(MailComposeMessage, self)._action_send_mail(auto_commit=auto_commit)
|