summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoryhu-odoo <yhu@odoo.com>2020-09-16 11:34:04 +0000
committeryhu-odoo <yhu@odoo.com>2020-09-17 09:22:21 +0000
commit57a46dec1122ca634cccfc8e60d6146e2e400c7e (patch)
treeaf309314ce1bb9e8394048bf91dc479788260014
parente6454bd104135d4851e932e500fe3fc344ff26ea (diff)
[FIX] *: adapt access to ir.actions.* records
Missing part of commit 6156f98288b16f6c84d36bacf16d5a66a661abb3 Fix issue #57780 closes odoo/odoo#57834 Related: odoo/enterprise#13315 Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
-rw-r--r--addons/hr_recruitment/models/hr_recruitment.py3
-rw-r--r--addons/purchase_stock/models/purchase.py3
-rw-r--r--addons/stock/models/stock_scrap.py4
3 files changed, 4 insertions, 6 deletions
diff --git a/addons/hr_recruitment/models/hr_recruitment.py b/addons/hr_recruitment/models/hr_recruitment.py
index c757ce15643..716cb200b0a 100644
--- a/addons/hr_recruitment/models/hr_recruitment.py
+++ b/addons/hr_recruitment/models/hr_recruitment.py
@@ -486,8 +486,7 @@ class Applicant(models.Model):
'default_applicant_id': applicant.ids,
}
- employee_action = self.env.ref('hr.open_view_employee_list')
- dict_act_window = employee_action.read([])[0]
+ dict_act_window = self.env['ir.actions.act_window']._for_xml_id('hr.open_view_employee_list')
dict_act_window['context'] = employee_data
return dict_act_window
diff --git a/addons/purchase_stock/models/purchase.py b/addons/purchase_stock/models/purchase.py
index 1600ec640ae..ec31c59ac08 100644
--- a/addons/purchase_stock/models/purchase.py
+++ b/addons/purchase_stock/models/purchase.py
@@ -126,8 +126,7 @@ class PurchaseOrder(models.Model):
def action_view_picking(self):
""" This function returns an action that display existing picking orders of given purchase order ids. When only one found, show the picking immediately.
"""
- action = self.env.ref('stock.action_picking_tree_all')
- result = action.read()[0]
+ result = self.env["ir.actions.actions"]._for_xml_id('stock.action_picking_tree_all')
# override the context to get rid of the default filtering on operation type
result['context'] = {'default_partner_id': self.partner_id.id, 'default_origin': self.name, 'default_picking_type_id': self.picking_type_id.id}
pick_ids = self.mapped('picking_ids')
diff --git a/addons/stock/models/stock_scrap.py b/addons/stock/models/stock_scrap.py
index e2c80ac8970..38801f2aeba 100644
--- a/addons/stock/models/stock_scrap.py
+++ b/addons/stock/models/stock_scrap.py
@@ -141,12 +141,12 @@ class StockScrap(models.Model):
return True
def action_get_stock_picking(self):
- action = self.env.ref('stock.action_picking_tree_all').read([])[0]
+ action = self.env['ir.actions.act_window']._for_xml_id('stock.action_picking_tree_all')
action['domain'] = [('id', '=', self.picking_id.id)]
return action
def action_get_stock_move_lines(self):
- action = self.env.ref('stock.stock_move_line_action').read([])[0]
+ action = self.env['ir.actions.act_window']._for_xml_id('stock.stock_move_line_action')
action['domain'] = [('move_id', '=', self.move_id.id)]
return action