Skip to content
Snippets Groups Projects
Commit ae71f953 authored by Shreya Modi's avatar Shreya Modi
Browse files

[IMP] mass_mailing_sale: traceback due to invoice stat button


when opening the sale promotion in mass mail, it creates a traceback
due to invoice compute method as it does not have invoice id because
of changes in account.move.

task-2036203

closes odoo/odoo#35202

Signed-off-by: default avatarThibault Delavallee (tde) <tde@openerp.com>
parent ed180951
No related branches found
No related tags found
No related merge requests found
......@@ -26,7 +26,7 @@ class MassMailing(models.Model):
if has_so_access and has_invoice_report_access:
invoices = self.env['sale.order'].search(self._get_sale_utm_domain()).mapped('invoice_ids')
res = self.env['account.invoice.report'].search_read(
[('invoice_id', 'in', invoices.ids), ('state', 'not in', ['draft', 'cancel'])],
[('move_id', 'in', invoices.ids), ('state', 'not in', ['draft', 'cancel'])],
['price_subtotal']
)
mass_mailing.sale_invoiced_amount = sum(r['price_subtotal'] for r in res)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment