diff options
| -rw-r--r-- | addons/hr_recruitment/models/hr_recruitment.py | 3 | ||||
| -rw-r--r-- | addons/purchase_stock/models/purchase.py | 3 | ||||
| -rw-r--r-- | addons/stock/models/stock_scrap.py | 4 |
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 |
