[FIX] base: res.company _company_default_get

Fix rule processing the criteria user.company_id was not honored.

Closes: #4614, #7504
This commit is contained in:
Antony Lesuisse 2015-07-16 14:33:44 +02:00
parent e61970241f
commit 8f07f01783
1 changed files with 2 additions and 1 deletions

View File

@ -232,9 +232,10 @@ class res_company(osv.osv):
args = [
('object_id.model', '=', object),
('field_id', '=', field),
('company_id', '=', self.pool['res.users']._get_company(cr, uid, context=context)),
]
ids = proxy.search(cr, uid, args, context=context)
ids = proxy.search(cr, uid, args, context=context, order='sequence')
user = self.pool.get('res.users').browse(cr, SUPERUSER_ID, uid, context=context)
for rule in proxy.browse(cr, uid, ids, context):
if eval(rule.expression, {'context': context, 'user': user}):