From 2def8d2ea794839a05c2c411d9d7aa856782082f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Thu, 21 Jan 2010 12:09:49 +0100 Subject: [PATCH] Use get_id of ir.model.data --- sale.py | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/sale.py b/sale.py index de7fd3e879..2d254975aa 100644 --- a/sale.py +++ b/sale.py @@ -1801,16 +1801,9 @@ class OpenCustomer(Wizard): model_data_obj = self.pool.get('ir.model.data') act_window_obj = self.pool.get('ir.action.act_window') wizard_obj = self.pool.get('ir.action.wizard') - - model_data_ids = model_data_obj.search(cursor, user, [ - ('fs_id', '=', 'act_party_form'), - ('module', '=', 'party'), - ('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, 'party', + 'act_party_form', context=context) + res = act_window_obj.read(cursor, user, act_window_id, context=context) cursor.execute("SELECT DISTINCT(party) FROM sale_sale") customer_ids = [line[0] for line in cursor.fetchall()] res['pyson_domain'] = PYSONEncoder().encode(