From 02ab26f946972de08fb4e70d89c4a64d6249b3f0 Mon Sep 17 00:00:00 2001 From: "olt@tinyerp.com" <> Date: Tue, 28 Sep 2010 14:28:07 +0200 Subject: [PATCH] [IMP] sale_mrp: performance improvement: '_get_sale_ref' now uses browse instead of read bzr revid: olt@tinyerp.com-20100928122807-5sy8lypoo31up2e0 --- addons/sale_mrp/sale_mrp.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/addons/sale_mrp/sale_mrp.py b/addons/sale_mrp/sale_mrp.py index e8cb0c61f91..c278ef98db1 100644 --- a/addons/sale_mrp/sale_mrp.py +++ b/addons/sale_mrp/sale_mrp.py @@ -58,17 +58,17 @@ class mrp_production(osv.osv): return move_id res = {} - productions = self.read(cr, uid, ids, ['id','move_prod_id']) + productions = self.browse(cr, uid, ids) for production in productions: - res[production['id']] = False - if production.get('move_prod_id',False): - parent_move_line = get_parent_move(production['move_prod_id'][0]) + res[production.id] = False + if production.move_prod_id: + parent_move_line = get_parent_move(production.move_prod_id) if parent_move_line: move = move_obj.browse(cr,uid,parent_move_line) if field_name == 'name': - res[production['id']] = move.sale_line_id and move.sale_line_id.order_id.name or False + res[production.id] = move.sale_line_id and move.sale_line_id.order_id.name or False if field_name == 'client_order_ref': - res[production['id']] = move.sale_line_id and move.sale_line_id.order_id.client_order_ref or False + res[production.id] = move.sale_line_id and move.sale_line_id.order_id.client_order_ref or False return res _columns = { @@ -78,4 +78,4 @@ class mrp_production(osv.osv): mrp_production() -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: