imrovement on configuration wizard :

* change name of all configuration wizard
* imroovemnt on view
* put view_id on user configuration wizard's action
* put action on base setup and module upgrade wizard to call configuration wizard
* make new configuration wizard for install extra module on service profile
* make new configuration wizard for set extend group on admin user to set extendend view

bzr revid: hmo@tinyerp.com-f68aa6f5d8985f63e4d63213179c9198c3f94168
This commit is contained in:
Harshad Modi
2008-06-21 09:54:30 +00:00
parent a00dea7af6
commit 6d956b2f1c
10 changed files with 216 additions and 24 deletions
+2
View File
@@ -1570,6 +1570,7 @@ class account_config_fiscalyear(osv.osv_memory):
new_id=res_obj.create(cr, uid, vals, context=context)
return {
'view_type': 'form',
"view_mode": 'form',
'res_model': 'ir.module.module.configuration.wizard',
'type': 'ir.actions.act_window',
'target':'new',
@@ -1602,6 +1603,7 @@ class account_config_journal_bank_accounts(osv.osv_memory):
res_obj.create(cr, uid, vals, context=context)
return {
'view_type': 'form',
"view_mode": 'form',
'res_model': 'ir.module.module.configuration.wizard',
'type': 'ir.actions.act_window',
'target':'new',
+6 -4
View File
@@ -1492,7 +1492,7 @@
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Configure Fiscal Year">
<separator string="Configure Fiscal Year"/>
<separator string="Configure Fiscal Year" colspan="4" col="4"/>
<newline/>
<field name="name"/>
<field name="code"/>
@@ -1511,6 +1511,7 @@
<field name="type">ir.actions.act_window</field>
<field name="res_model">account.config.fiscalyear</field>
<field name="view_type">form</field>
<field name="view_mode">form</field>
<field name="target">new</field>
</record>
@@ -1522,7 +1523,7 @@
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Configure Journal of Bank account">
<separator string="Configure Journal of Bank account"/>
<separator string="Configure Journal of Bank account" colspan="4" col="4"/>
<newline/>
<field name="name"/>
<field name="bank_account_id"/>
@@ -1541,6 +1542,7 @@
<field name="type">ir.actions.act_window</field>
<field name="res_model">account.config.journal.bank.account</field>
<field name="view_type">form</field>
<field name="view_mode">form</field>
<field name="target">new</field>
</record>
@@ -1548,14 +1550,14 @@
<record model="ir.module.module.configuration.step"
id="config_fiscalyear">
<field name="name">account.config.fiscalyear</field>
<field name="name">Define fiscal years</field>
<field name="action_id" ref="action_config_fiscalyear_form"/>
<field name="state">open</field>
</record>
<record model="ir.module.module.configuration.step"
id="config_journal_bank_account">
<field name="name">account.config.journal.bank.account</field>
<field name="name">Define journal for bank accounts</field>
<field name="action_id" ref="action_config_journal_bank_account"/>
<field name="state">open</field>
</record>
+1 -7
View File
@@ -14,12 +14,6 @@
</record>
<!--<record model="ir.module.module.configuration.step"
id="config_base_setup_menu">
<field name="name">base_setup.base_setup.menu</field>
<field name="action_id" ref=""/>
<field name="sequence" eval="99999"/>
<field name="state">open</field>
</record>-->
</data>
</terp>
+29 -2
View File
@@ -272,6 +272,25 @@ class wizard_base_setup(wizard.interface):
return 'init'
return 'charts'
def _config(self, cr, uid, data, context=None):
users_obj=pooler.get_pool(cr.dbname).get('res.users')
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})
ids=users_obj.search(cr, uid, [('menu_id', '=', 'Setup')])
users_obj.write(cr, uid, ids, {'menu_id': menu.id})
return {
'view_type': 'form',
"view_mode": 'form',
'res_model': 'ir.module.module.configuration.wizard',
'type': 'ir.actions.act_window',
'target':'new',
}
fields={
'profile':{
'string':'Profile',
@@ -412,14 +431,22 @@ IBAN: BE74 1262 0121 6907 - SWIFT: CPDF BE71 - VAT: BE0477.472.701""",
'actions': [_update],
'result': {'type': 'form', 'arch': view_form_finish, 'fields': {},
'state': [
('menu', 'Ok', 'gtk-ok', True)
('menu', 'Ok', 'gtk-ok', True),
('config', 'Start configuration', 'gtk-ok', True)
]
}
},
'config': {
'result': {
'type': 'action',
'action': _config,
'state': 'end',
},
},
'menu': {
'actions': [],
'result': {'type': 'action', 'action': _menu, 'state': 'end'}
},
}
wizard_base_setup('base_setup.base_setup')
wizard_base_setup('base_setup.base_setup')
+1 -1
View File
@@ -26,4 +26,4 @@
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
##############################################################################
import profile_service
+8 -8
View File
@@ -31,19 +31,19 @@
"author":"Tiny",
"category":"Profile",
"depends":[
"hr",
"hr_timesheet",
"hr_timesheet_invoice",
"hr_timesheet_project",
"crm",
"hr",
"hr_timesheet",
"hr_timesheet_invoice",
"hr_timesheet_project",
"crm",
"project",
"board_project",
"account_analytic_analysis"
],
#"board_project",
],
#"board_project",
#"board_account"],
"demo_xml":[],
"update_xml":[],
"update_xml":["profile_service.xml"],
"active":False,
"installable":True,
}
+115
View File
@@ -0,0 +1,115 @@
##############################################################################
#
# Copyright (c) 2004-2008 Tiny SPRL (http://tiny.be) All Rights Reserved.
#
# $Id: __terp__.py 8595 2008-06-16 13:00:21Z stw $
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# garantees and support are strongly adviced to contract a Free Software
# Service Company
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
###############################################################################
from osv import fields, osv
import pooler
##class config_install_extra_modules(osv.osv_memory):
## _name='config.install_extra_modules'
## def _get_uninstall_modules(self,cr,uid,context=None):
## module_obj=self.pool.get('ir.module.module')
## line_obj=self.pool.get('config.install_extra_modules.line')
## uninstall_module_ids=module_obj.search(cr,uid,[('state', 'in', ['uninstalled', 'uninstallable'])])
## res=[]
## for id in uninstall_module_ids:
## res.append(line_obj.create(cr,uid,{'module_id':id},context=None))
## print res
## return res
## _columns = {
## 'name':fields.char('Name', size=64),
## 'module_ids':fields.one2many('config.install_extra_modules.line', 'config_id', 'Modules'),
##
## }
## _defaults={
## 'module_ids':_get_uninstall_modules
## }
## def action_install(self, cr, uid, ids, context=None):
## res=self.read(cr,uid,ids)[0]
## mod_obj = self.pool.get('ir.module.module')
## line_obj=self.pool.get('config.install_extra_modules.line')
## if 'module_ids' in res:
## module_ids=res['module_ids']
## lines=line_obj.read(cr,uid,module_ids)
## for line in lines:
## if 'install' in line and 'module_id' and line and line['install']:
## mod_obj.download(cr, uid, [line['module_id']], context=context)
## cr.commit()
## db, pool = pooler.restart_pool(cr.dbname, update_module=True)
## return {
## 'view_type': 'form',
## "view_mode": 'form',
## 'res_model': 'ir.module.module.configuration.wizard',
## 'type': 'ir.actions.act_window',
## 'target':'new',
## }
##
##config_install_extra_modules()
#
#class config_install_extra_modules_line(osv.osv_memory):
# _name='config.install_extra_modules.line'
# _columns = {
# 'name':fields.char('Name', size=64),
# 'install':fields.boolean('Install'),
# 'config_id': fields.many2one('config.install_extra_modules', 'Configuration Module Wizard'),
# 'module_id':fields.many2one('ir.module.module', 'Module',readonly=True,required=True),
#
# }
#
#
#config_install_extra_modules_line()
class config_install_extra_modules(osv.osv_memory):
_name='config.install_extra_modules'
_columns = {
'name':fields.char('Name', size=64),
'timesheets_module':fields.boolean('Timesheets module'),
'holidays_module':fields.boolean('Holidays module'),
}
def action_install(self, cr, uid, ids, context=None):
res=self.read(cr,uid,ids)[0]
mod_obj = self.pool.get('ir.module.module')
if 'timesheets_module' in res and res['timesheets_module']:
ids = mod_obj.search(cr, uid, [('name', '=', 'hr_timesheet')])
mod_obj.download(cr, uid, ids, context=context)
cr.commit()
db, pool = pooler.restart_pool(cr.dbname, update_module=True)
if 'hr_holidays_module' in res and res['hr_holidays_module']:
ids = mod_obj.search(cr, uid, [('name', '=', 'hr_holidays')])
mod_obj.download(cr, uid, ids, context=context)
cr.commit()
db, pool = pooler.restart_pool(cr.dbname, update_module=True)
return {
'view_type': 'form',
"view_mode": 'form',
'res_model': 'ir.module.module.configuration.wizard',
'type': 'ir.actions.act_window',
'target':'new',
}
config_install_extra_modules()
@@ -0,0 +1,50 @@
<?xml version="1.0"?>
<terp>
<data>
<record model="ir.ui.view" id="view_confirm_install_module_form">
<field name="name">Install extra modules</field>
<field name="model">config.install_extra_modules</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Install Extra Module">
<separator string="Install Extra Module" colspan="4" col="4"/>
<newline/>
<field name="timesheets_module"/>
<field name="holidays_module"/>
<!--<field name="module_ids" widget="one2many_list" colspan="4" nolabel="1" mode="tree,graph">
<form string="Module Lines">
<field name="install"/>
<field name="module_id"/>
</form>
<tree string="Module Lines">
<field name="install"/>
<field name="module_id"/>
</tree>
</field>-->
<group colspan="4" col="4">
<button special="cancel" string="Cancel" />
<button name="action_install" type='object' string="Install" />
</group>
</form>
</field>
</record>
<record model="ir.actions.act_window" id="action_config_install_module">
<field name="name">Install extra modules</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">config.install_extra_modules</field>
<field name="view_type">form</field>
<field name="view_mode">form</field>
<field name="target">new</field>
</record>
<!--<record model="ir.module.module.configuration.step"
id="config_install_module">
<field name="name">Install Extra modules</field>
<field name="action_id" ref="action_config_install_module"/>
<field name="state">open</field>
</record>-->
</data>
</terp>
+1
View File
@@ -859,6 +859,7 @@ class sale_config_picking_policy(osv.osv_memory):
ir_values_obj.set(cr,uid,'default',False,'picking_policy',['sale.order'],context['picking_policy'])
return {
'view_type': 'form',
"view_mode": 'form',
'res_model': 'ir.module.module.configuration.wizard',
'type': 'ir.actions.act_window',
'target':'new',
+3 -2
View File
@@ -457,7 +457,7 @@
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Configure Picking Policy for Sale Order">
<separator string="Configure Picking Policy for Sale Order"/>
<separator string="Configure Picking Policy for Sale Order" colspan="4" col="4"/>
<newline/>
<field name="picking_policy"/>
<group colspan="4" col="4">
@@ -473,13 +473,14 @@
<field name="type">ir.actions.act_window</field>
<field name="res_model">sale.config.picking_policy</field>
<field name="view_type">form</field>
<field name="view_mode">form</field>
<field name="target">new</field>
</record>
<!-- register configuration wizard -->
<record model="ir.module.module.configuration.step"
id="config_wizard_step_sale_picking_policy">
<field name="name">sale.config.picking_policy</field>
<field name="name">Select the default picking policy for Sale Order</field>
<field name="action_id" ref="action_config_picking_policy"/>
<field name="state">open</field>
</record>