diff --git a/location.py b/location.py index 3ec8e1567f..6b9ab33462 100644 --- a/location.py +++ b/location.py @@ -376,15 +376,9 @@ class OpenProduct(Wizard): def _action_open_product(self, cursor, user, data, context=None): model_data_obj = self.pool.get('ir.model.data') act_window_obj = self.pool.get('ir.action.act_window') - - model_data_ids = model_data_obj.search(cursor, user, [ - ('fs_id', '=', 'act_product_by_location'), - ('module', '=', 'stock'), - ('inherit', '=', False), - ], limit=1, context=context) - model_data = model_data_obj.browse(cursor, user, model_data_ids[0], - context=context) - res = act_window_obj.read(cursor, user, model_data.db_id, context=context) + act_window_id = model_data_obj.get_id(cursor, user, 'stock', + 'act_product_by_location', context=context) + res = act_window_obj.read(cursor, user, act_window_id, context=context) ctx = {} ctx['locations'] = data['ids'] diff --git a/product.py b/product.py index 46f8b0afe8..665634747b 100644 --- a/product.py +++ b/product.py @@ -570,15 +570,9 @@ class OpenLocation(Wizard): def _action_open_location(self, cursor, user, data, context=None): model_data_obj = self.pool.get('ir.model.data') act_window_obj = self.pool.get('ir.action.act_window') - - model_data_ids = model_data_obj.search(cursor, user, [ - ('fs_id', '=', 'act_location_quantity_tree'), - ('module', '=', 'stock'), - ('inherit', '=', False), - ], limit=1, context=context) - model_data = model_data_obj.browse(cursor, user, model_data_ids[0], - context=context) - res = act_window_obj.read(cursor, user, model_data.db_id, context=context) + act_window_id = model_data_obj.get_id(cursor, user, 'stock', + 'act_location_quantity_tree', context=context) + res = act_window_obj.read(cursor, user, act_window_id, context=context) ctx = {} ctx['product'] = data['id'] diff --git a/shipment.py b/shipment.py index 91e08e4a66..a97c8c1a6c 100644 --- a/shipment.py +++ b/shipment.py @@ -1724,14 +1724,9 @@ class CreateShipmentOutReturn(Wizard): context=context) ) - model_data_ids = model_data_obj.search(cursor, user, [ - ('fs_id', '=', 'act_shipment_out_return_form'), - ('module', '=', 'stock'), - ('inherit', '=', False), - ], limit=1, context=context) - model_data = model_data_obj.browse(cursor, user, model_data_ids[0], - context=context) - res = act_window_obj.read(cursor, user, model_data.db_id, context=context) + act_window_id = model_data_obj.get_id(cursor, user, 'stock', + 'act_shipment_out_return_form', context=context) + res = act_window_obj.read(cursor, user, act_window_id, context=context) res['res_id'] = shipment_out_return_ids if len(shipment_out_return_ids) == 1: res['views'].reverse()