diff options
| author | Martin Trigaux <mat@odoo.com> | 2020-05-25 07:04:52 +0000 |
|---|---|---|
| committer | Martin Trigaux <mat@odoo.com> | 2020-08-17 09:09:02 +0000 |
| commit | 6156f98288b16f6c84d36bacf16d5a66a661abb3 (patch) | |
| tree | 7a760d990d660640fed108a5d1fb5c8ce62a52e5 /addons/mass_mailing_crm | |
| parent | d5c16492397047ceb97a0879aa61f068a0eeeca8 (diff) | |
[FIX] *: adapt action content retrieval
Use _for_xml_id to replace all the self.env.ref().read()[0]
This has the advantage of having a single point of control and to add
the fields filtering and model verification.
Add sudo for other operations on ir.actions.*
Diffstat (limited to 'addons/mass_mailing_crm')
| -rw-r--r-- | addons/mass_mailing_crm/models/mailing_mailing.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/mass_mailing_crm/models/mailing_mailing.py b/addons/mass_mailing_crm/models/mailing_mailing.py index 19af7cff904..941b1b7b076 100644 --- a/addons/mass_mailing_crm/models/mailing_mailing.py +++ b/addons/mass_mailing_crm/models/mailing_mailing.py @@ -28,7 +28,7 @@ class MassMailing(models.Model): def action_redirect_to_leads_and_opportunities(self): view = 'crm.crm_lead_all_leads' if self.use_leads else 'crm.crm_lead_opportunities' - action = self.env.ref(view).read()[0] + action = self.env.ref(view).sudo().read()[0] action['view_mode'] = 'tree,kanban,graph,pivot,form,calendar' action['domain'] = [('source_id', 'in', self.source_id.ids)] action['context'] = {'active_test': False, 'create': False} |
