From 3bf4d5294d9ceaba1307518e5852ce245f94bf45 Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Mon, 30 Jun 2008 14:17:11 +0000 Subject: [PATCH] bugfix: properties uses the company of the user (usefull in multi-company) bzr revid: chs@tinyerp.com-366270ace15e512a77e222847a9c911cb7650772 --- bin/addons/base/res/ir_property.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bin/addons/base/res/ir_property.py b/bin/addons/base/res/ir_property.py index 6e0637a9877..6ab36df6cf1 100644 --- a/bin/addons/base/res/ir_property.py +++ b/bin/addons/base/res/ir_property.py @@ -74,7 +74,8 @@ class ir_property(osv.osv): cr.execute('select id from ir_model_fields where name=%s and model=%s', (name, model)) res = cr.fetchone() if res: - nid = self.search(cr, uid, [('fields_id','=',res[0]),('res_id','=',res_id)]) + ucid = self.pool.get('res.users').browse(cr, uid, uid).company_id.id + nid = self.search(cr, uid, [('fields_id','=',res[0]),('res_id','=',res_id),('company_id','=',ucid)]) if nid: d = self.browse(cr, uid, nid[0], context).value return (d and int(d.split(',')[1])) or False