[FIX] base_setup: 'uid' is not a company id

bzr revid: rco@openerp.com-20120622095657-cq3u3l3xgdwm1zo3
This commit is contained in:
Raphael Collet 2012-06-22 11:56:57 +02:00
parent ea65a49a94
commit f5f50124be
1 changed files with 3 additions and 9 deletions

View File

@ -35,20 +35,14 @@ class base_config_settings(osv.osv_memory):
}
def open_company(self, cr, uid, ids, context=None):
if context is None:
context = {}
company_obj = self.pool.get('res.company')
company_id = company_obj.browse(cr, uid, uid, context=context).id
user = self.pool.get('res.users').browse(cr, uid, uid, context)
return {
'type': 'ir.actions.act_window',
'name': 'Your Company',
'view_type': 'form',
'view_mode': 'form,tree',
'res_model': 'res.company',
'res_id': company_id,
'view_id': False,
'type': 'ir.actions.act_window',
'res_id': user.company_id.id,
}
# Preferences wizard for Sales & CRM.