summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authorqmo-odoo <qmo@odoo.com>2019-08-02 07:54:57 +0000
committerThibault Delavallée <tde@odoo.com>2019-08-02 12:34:17 +0000
commit4f92430139bc5386979a7d592d18df784eec37bf (patch)
treef9757e3f91668a542a0207957cd199a5407ebfb5 /addons
parent682b62f82528b8b5e7608c68492a0ec4a829f2de (diff)
[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
Diffstat (limited to 'addons')
-rw-r--r--addons/mass_mailing_sale/models/mailing_mailing.py14
1 files changed, 9 insertions, 5 deletions
diff --git a/addons/mass_mailing_sale/models/mailing_mailing.py b/addons/mass_mailing_sale/models/mailing_mailing.py
index 2a347a3694a..08716037a55 100644
--- a/addons/mass_mailing_sale/models/mailing_mailing.py
+++ b/addons/mass_mailing_sale/models/mailing_mailing.py
@@ -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