summaryrefslogtreecommitdiff
path: root/addons/mass_mailing_sale
diff options
context:
space:
mode:
authorMartin Trigaux <mat@odoo.com>2020-05-25 07:04:52 +0000
committerMartin Trigaux <mat@odoo.com>2020-08-17 09:09:02 +0000
commit6156f98288b16f6c84d36bacf16d5a66a661abb3 (patch)
tree7a760d990d660640fed108a5d1fb5c8ce62a52e5 /addons/mass_mailing_sale
parentd5c16492397047ceb97a0879aa61f068a0eeeca8 (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_sale')
-rw-r--r--addons/mass_mailing_sale/models/mailing_mailing.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/addons/mass_mailing_sale/models/mailing_mailing.py b/addons/mass_mailing_sale/models/mailing_mailing.py
index 290875290bf..f4a5ee71fac 100644
--- a/addons/mass_mailing_sale/models/mailing_mailing.py
+++ b/addons/mass_mailing_sale/models/mailing_mailing.py
@@ -29,13 +29,13 @@ class MassMailing(models.Model):
mass_mailing.sale_invoiced_amount = 0
def action_redirect_to_quotations(self):
- action = self.env.ref('sale.action_quotations_with_onboarding').read()[0]
+ action = self.env["ir.actions.actions"]._for_xml_id("sale.action_quotations_with_onboarding")
action['domain'] = self._get_sale_utm_domain()
action['context'] = {'create': False}
return action
def action_redirect_to_invoiced(self):
- action = self.env.ref('account.action_move_out_invoice_type').read()[0]
+ action = self.env["ir.actions.actions"]._for_xml_id("account.action_move_out_invoice_type")
moves = self.env['account.move'].search(self._get_sale_utm_domain())
action['context'] = {
'create': False,