From 14f5ad2f07d65a41b5b988eda72e58f80e96f6f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Thu, 21 Jan 2010 12:09:21 +0100 Subject: [PATCH] Use get_id of ir.model.data --- work.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/work.py b/work.py index 3570101a46..d3a11dd9cc 100644 --- a/work.py +++ b/work.py @@ -169,15 +169,9 @@ class Work(ModelSQL, ModelView): if vals.get('party'): ctx2['customer'] = vals['party'] - model_data_ids = model_data_obj.search(cursor, user, [ - ('fs_id', '=', 'uom_hour'), - ('module', '=', 'product'), - ('model', '=', 'product.uom'), - ], limit=1, context=context) - model_data = model_data_obj.browse(cursor, user, model_data_ids[0], - context=context) - hour_uom = uom_obj.browse(cursor, user, model_data.db_id, + uom_id = model_data_obj.get_id(cursor, user, 'product', 'uom_hour', context=context) + hour_uom = uom_obj.browse(cursor, user, uom_id, context=context) list_price = uom_obj.compute_price(cursor, user, product.default_uom, product.list_price, hour_uom,