From a3a7bb50bc595c148593d0cf7f0a050332e94201 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Wed, 16 Dec 2009 16:59:41 +0100 Subject: [PATCH] [imp] add compatibility ir.actions.configuration.wizard for plugins which have yet to migrate to res.config bzr revid: xmo@tinyerp.com-20091216155941-vfzrtkpr0yestddb --- bin/addons/base/ir/ir_actions.py | 4 ++- bin/addons/base/res/res_config.py | 31 ++++++++++++++++++++ bin/addons/base/res/res_config.xml | 23 +++++++++++++++ bin/addons/base/security/ir.model.access.csv | 1 + 4 files changed, 58 insertions(+), 1 deletion(-) diff --git a/bin/addons/base/ir/ir_actions.py b/bin/addons/base/ir/ir_actions.py index e2090d497de..c850a363217 100644 --- a/bin/addons/base/ir/ir_actions.py +++ b/bin/addons/base/ir/ir_actions.py @@ -691,7 +691,9 @@ class ir_actions_todo(osv.osv): ondelete='cascade'), 'sequence': fields.integer('Sequence'), 'active': fields.boolean('Active'), - 'state': fields.selection(TODO_STATES, string='State', required=True) + 'state': fields.selection(TODO_STATES, string='State', required=True), + 'name':fields.char('Name', size=64), + 'note':fields.text('Text', translate=True), } _defaults={ 'state': lambda *a: 'open', diff --git a/bin/addons/base/res/res_config.py b/bin/addons/base/res/res_config.py index 5bb0c555b3b..595d72732e4 100644 --- a/bin/addons/base/res/res_config.py +++ b/bin/addons/base/res/res_config.py @@ -109,4 +109,35 @@ class res_config_configurable(osv.osv_memory): return self.next(cr, uid, ids, context=context) res_config_configurable() +class ir_actions_configuration_wizard(osv.osv_memory): + ''' Compatibility configuration wizard + + The old configuration wizard has been replaced by res.config, but in order + not to break existing but not-yet-migrated addons, the old wizard was + reintegrated and gutted. + ''' + _name='ir.actions.configuration.wizard' + _inherit = 'res.config' + + def _next_action_note(self, cr, uid, ids, context=None): + next = self._next_action(cr, uid) + if next: + return next.note + return "Your database is now fully configured.\n\n"\ + "Click 'Continue' and enjoy your OpenERP experience..." + + _columns = { + 'note': fields.text('Next Wizard', readonly=True), + } + _defaults = { + 'note': _next_action_note, + } + + def execute(self, cr, uid, ids, context=None): + self.logger.notifyChannel( + 'configuration', netsvc.LOG_WARNING, + 'Addon using old-style configuration wizard, please migrate to '\ + 'res.config objects') +ir_actions_configuration_wizard() + # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/bin/addons/base/res/res_config.xml b/bin/addons/base/res/res_config.xml index acf7102b95e..2b1d3b45d42 100644 --- a/bin/addons/base/res/res_config.xml +++ b/bin/addons/base/res/res_config.xml @@ -24,5 +24,28 @@ + + + Compabitiliby configuration wizard + ir.actions.configuration.wizard + form + +
+ + + + + +