changes
This commit is contained in:
@@ -9,6 +9,24 @@ from odoo import models
|
||||
class AccountMove(models.Model):
|
||||
_inherit = 'account.move'
|
||||
|
||||
def _get_mail_template(self):
|
||||
"""Prefer the Fusion Plating-branded invoice template over Odoo default.
|
||||
|
||||
Called by the account.move.send wizard when the user clicks
|
||||
"Send" on an invoice. Override returns our
|
||||
fp_mail_template_invoice_posted (which attaches the branded
|
||||
Invoice PDF) for out_invoice moves. Credit notes / self-billing
|
||||
fall back to Odoo's built-in templates.
|
||||
"""
|
||||
if all(m.move_type == 'out_invoice' for m in self):
|
||||
tpl = self.env.ref(
|
||||
'fusion_plating_notifications.fp_mail_template_invoice_posted',
|
||||
raise_if_not_found=False,
|
||||
)
|
||||
if tpl:
|
||||
return tpl
|
||||
return super()._get_mail_template()
|
||||
|
||||
def action_post(self):
|
||||
res = super().action_post()
|
||||
Dispatch = self.env['fp.notification.template']
|
||||
|
||||
Reference in New Issue
Block a user