diff options
Diffstat (limited to 'indoteknik_custom/models/account_move.py')
| -rw-r--r-- | indoteknik_custom/models/account_move.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/indoteknik_custom/models/account_move.py b/indoteknik_custom/models/account_move.py index 42467b78..a317dccc 100644 --- a/indoteknik_custom/models/account_move.py +++ b/indoteknik_custom/models/account_move.py @@ -601,6 +601,7 @@ class AccountMove(models.Model): template.send_mail(record.id, email_values=email_values, force_send=True) elif record.partner_id.id in special_partner_ids: + cust_ref = record.sale_id.client_order_ref if record.sale_id and record.sale_id.client_order_ref else '' attachment = self.generate_attachment(record) email_list = [record.partner_id.email] if record.partner_id.email else [] if record.real_invoice_id and record.real_invoice_id.email: @@ -610,7 +611,7 @@ class AccountMove(models.Model): 'email_to': ",".join(set(email_list)), 'attachment_ids': [(4, attachment.id)] } - template.send_mail(record.id, email_values=email_values, force_send=True) + template.with_context(cust_ref=cust_ref).send_mail(record.id, email_values=email_values, force_send=True) # @api.model # def create(self, vals): |
