Skip to content
Snippets Groups Projects
Commit 4f924301 authored by qmo-odoo's avatar qmo-odoo Committed by Thibault Delavallée
Browse files

[FIX] mass_mailing_sale: fix domain for invoiced

PURPOSE

This commit removes the mass_mailing.campaign model. Instead of having a fully
fledged model, we will simply inherit utm.campaign. We will also add relevant
statistics on utm campaign model in order to use it in various applications.

SPECIFICATIONS

This commit fixes the domain used to get the invoiced amount generated
by the mailing.mailing.

The new domain will be the same as the one used in the invoice report

Task ID: 2002029
PR: #34015
parent 682b62f8
No related branches found
No related tags found
No related merge requests found
......@@ -36,17 +36,21 @@ class MassMailing(models.Model):
def action_redirect_to_quotations(self):
action = self.env.ref('sale.action_quotations_with_onboarding').read()[0]
action['domain'] = self._get_sale_utm_domain()
action['context'] = {'default_type': 'lead', 'create': False}
action['context'] = {'create': False}
return action
def action_redirect_to_invoiced(self):
action = self.env.ref('account.view_move_form').read()[0]
action = self.env.ref('account.action_move_journal_line').read()[0]
invoices = self.env['sale.order'].search(self._get_sale_utm_domain()).mapped('invoice_ids')
action['context'] = {
'create': False,
'edit': False,
'view_no_maturity': True
}
action['domain'] = [
('id', 'in', invoices.ids),
('type', 'in', ('out_invoice', 'out_refund')),
('type', '=', 'posted'),
('partner_id', 'child_of', self.id),
('type', 'in', ('out_invoice', 'out_refund', 'in_invoice', 'in_refund', 'out_receipt', 'in_receipt')),
('state', 'not in', ['draft', 'cancel'])
]
action['context'] = {'create': False}
return action
......
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