[FIX] #494620 missing company_id in domain that return the bad company when there is

a multiple rules for teh same object

lp bug: https://launchpad.net/bugs/494620 fixed

bzr revid: christophe.chauvet@syleam.fr-20091209174254-pu5oxg8e4saqd48p
This commit is contained in:
Christophe Chauvet 2009-12-09 18:42:54 +01:00
parent 665bc1f513
commit 8041b935d8
1 changed files with 3 additions and 2 deletions

View File

@ -94,13 +94,14 @@ class res_company(osv.osv):
"""
if not context:
context = {}
user_company_id = self.pool.get('res.users').browse(cr, uid, uid).company_id.id
proxy = self.pool.get('multi_company.default')
ids = proxy.search(cr, uid, [('object_id.model', '=', object)])
ids = proxy.search(cr, uid, [('object_id.model', '=', object), ('company_id','=',user_company_id)])
for rule in proxy.browse(cr, uid, ids, context):
user = self.pool.get('res.users').browse(cr, uid, uid)
if eval(rule.expression, {'context': context, 'user': user}):
return rule.company_dest_id.id
return self.pool.get('res.users').browse(cr, uid, uid).company_id.id
return user_company_id
def _get_child_ids(self, cr, uid, uid2, context={}):
company = self.pool.get('res.users').company_get(cr, uid, uid2)