[IMP]: base: Improvement in configuration wizard action, added view
bzr revid: rpa@tinyerp.com-20100916122927-7yzlr8l8tftiw67d
This commit is contained in:
parent
f7d18164af
commit
05b270a9cf
|
@ -27,6 +27,7 @@ import base_module_update
|
|||
import base_language_install
|
||||
import base_import_language
|
||||
import base_module_upgrade
|
||||
import base_module_configuration
|
||||
import base_export_language
|
||||
import base_update_translations
|
||||
|
||||
|
|
|
@ -19,5 +19,33 @@
|
|||
#
|
||||
##############################################################################
|
||||
|
||||
from osv import osv
|
||||
from tools.translate import _
|
||||
|
||||
class base_module_configuration(osv.osv_memory):
|
||||
|
||||
_name = "base.module.configuration"
|
||||
|
||||
def start(self, cr, uid, ids, context=None):
|
||||
todo_ids = self.pool.get('ir.actions.todo').search(cr, uid, ['|', ('state', '=', 'open'), ('restart', '=', 'always')])
|
||||
if not todo_ids:
|
||||
# When there is no wizard todo it will display message
|
||||
data_obj = self.pool.get('ir.model.data')
|
||||
result = data_obj._get_id(cr, uid, 'base', 'view_base_module_configuration_form')
|
||||
view_id = data_obj.browse(cr, uid, result).res_id
|
||||
value = {
|
||||
'name': _('System Configuration done'),
|
||||
'view_type': 'form',
|
||||
'view_mode': 'form',
|
||||
'res_model': 'base.module.configuration',
|
||||
'view_id': view_id,
|
||||
'type': 'ir.actions.act_window',
|
||||
}
|
||||
return value
|
||||
# Run the config wizards
|
||||
config_pool = self.pool.get('res.config')
|
||||
return config_pool.start(cr, uid, ids, context=context)
|
||||
|
||||
base_module_configuration()
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
|
@ -2,10 +2,24 @@
|
|||
<openerp>
|
||||
<data>
|
||||
|
||||
<record id="view_base_module_configuration_form" model="ir.ui.view">
|
||||
<field name="name">Module Configuration</field>
|
||||
<field name="model">base.module.configuration</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="System Configuration done">
|
||||
<label align="0.0" string="All pending configuration wizards have been executed. You may restart individual wizards via the list of configuration wizards" colspan="4"/>
|
||||
<separator string="" colspan="4"/>
|
||||
<newline/>
|
||||
<button special="cancel" string="_Ok" icon="gtk-ok"/>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record id="action_start_configurator" model="ir.actions.server">
|
||||
<field name="name">Start Configuration</field>
|
||||
<field name="model_id" ref="model_res_config"/>
|
||||
<field name="model_id" ref="model_base_module_configuration"/>
|
||||
<field name="state">code</field>
|
||||
<field name="code">action = obj.start([])</field>
|
||||
</record>
|
||||
|
|
Loading…
Reference in New Issue