From 3ef3aeb640c90e2817878eaa11701aedbf6b6ecb Mon Sep 17 00:00:00 2001 From: qdp-odoo Date: Mon, 28 Jan 2019 10:26:17 +0000 Subject: [PATCH] [FIX] account: Added missing method to save template --- addons/account/wizard/account_invoice_send.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/addons/account/wizard/account_invoice_send.py b/addons/account/wizard/account_invoice_send.py index ba5da81b889..54fbd7ff4be 100644 --- a/addons/account/wizard/account_invoice_send.py +++ b/addons/account/wizard/account_invoice_send.py @@ -1,8 +1,8 @@ # -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. -from odoo import api, fields, models -from odoo.exceptions import UserError +from odoo import api, fields, models, _ +from odoo.addons.mail.wizard.mail_compose_message import _reopen class AccountInvoiceSend(models.TransientModel): @@ -67,3 +67,11 @@ class AccountInvoiceSend(models.TransientModel): if self.is_print: return self._print_document() return {'type': 'ir.actions.act_window_close'} + + @api.multi + def save_as_template(self): + self.ensure_one() + self.composer_id.save_as_template() + action = _reopen(self, self.id, self.model, context=self._context) + action.update({'name': _('Send Invoice')}) + return action