diff options
| author | ced <> | 2007-08-06 08:23:58 +0000 |
|---|---|---|
| committer | ced <> | 2007-08-06 08:23:58 +0000 |
| commit | bbdf7c3cb2ed163bf1b3c2d088a19ee6c3fd7269 (patch) | |
| tree | 1617e6a8363cd51237490fe261c6617d2f3620a0 /addons/base_setup/wizard/wizard_base_setup.py | |
| parent | 20462eaa056f9350ef5c1130dde09b150b12abca (diff) | |
base_setup: improve wizard
- add comment about download chart
- use the action of the user as default action at the end of the wizard
bzr revid: ced-e36fe4f539f73d1e63f56e56faf2665f5e6e3e4d
Diffstat (limited to 'addons/base_setup/wizard/wizard_base_setup.py')
| -rw-r--r-- | addons/base_setup/wizard/wizard_base_setup.py | 35 |
1 files changed, 27 insertions, 8 deletions
diff --git a/addons/base_setup/wizard/wizard_base_setup.py b/addons/base_setup/wizard/wizard_base_setup.py index 326ba7da8f8..702ad8e6cca 100644 --- a/addons/base_setup/wizard/wizard_base_setup.py +++ b/addons/base_setup/wizard/wizard_base_setup.py @@ -54,6 +54,8 @@ view_form_charts = """<?xml version="1.0"?> <newline/> <field name="charts" align="0.0"/> <newline/> + <label string="There is many other charts on http://www.tinyerp.com/" colspan="2" align="0.0"/> + <newline/> <label string="(If you don't select a chart of accounts, you'll need to set up one manually)." colspan="2" align="0.0"/> </group> </form>""" @@ -227,21 +229,38 @@ class wizard_base_setup(wizard.interface): return {} def _menu(self, cr, uid, data, context): users_obj=pooler.get_pool(cr.dbname).get('res.users') - actions_obj=pooler.get_pool(cr.dbname).get('ir.actions.act_window') - - ids=actions_obj.search(cr, uid, [('name', '=', 'Menu')]) - menu=actions_obj.browse(cr, uid, ids)[0] + action_obj=pooler.get_pool(cr.dbname).get('ir.actions.act_window') + ids=action_obj.search(cr, uid, [('name', '=', 'Menu')]) + menu=action_obj.browse(cr, uid, ids)[0] ids=users_obj.search(cr, uid, [('action_id', '=', 'Setup')]) users_obj.write(cr, uid, ids, {'action_id': menu.id}) + + user = users_obj.browse(cr, uid, uid) + action = user.action_id + if action.type == 'ir.actions.act_window': + action = action_obj.browse(cr, uid, action.id) + return { + 'name': action.name, + 'type': action.type, + 'view_id': (action.view_id and\ + (action.view_id.id, action.view_id.name)) or False, + 'domain': action.domain, + 'res_model': action.res_model, + 'src_model': action.src_model, + 'view_type': action.view_type, + 'view_mode': action.view_mode, + 'views': action.views, + } return { 'name': 'Menu', - 'type':'ir.actions.act_window', - 'res_model':'ir.ui.menu', - 'view_type':'tree', - 'domain': "[('parent_id','=',False)]", + 'type': 'ir.actions.act_window', + 'res_model': 'ir.ui.menu', + 'view_type': 'tree', + 'domain': str([('parent_id', '=', False)]), 'view_id': (menu.view_id.id, menu.view_id.name), } + def _next(self, cr, uid, data, context): if not data['form']['profile'] or data['form']['profile'] <= 0: return 'company' |
