[imp] add compatibility ir.actions.configuration.wizard for plugins which have yet to migrate to res.config
bzr revid: xmo@tinyerp.com-20091216155941-vfzrtkpr0yestddb
This commit is contained in:
parent
d93aa372fd
commit
a3a7bb50bc
|
@ -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',
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -24,5 +24,28 @@
|
|||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_config_wizard_form" model="ir.ui.view">
|
||||
<field name="name">Compabitiliby configuration wizard</field>
|
||||
<field name="model">ir.actions.configuration.wizard</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Next Configuration Step">
|
||||
<image name="gtk-dialog-info"/>
|
||||
<group>
|
||||
<field name="note" nolabel="1" colspan="4" width="500"/>
|
||||
<group colspan="4" col="8">
|
||||
<field name="progress" widget="progressbar"/>
|
||||
<label string="" colspan="4"/>
|
||||
<group colspan="1" col="2">
|
||||
<button name="action_next" icon="gtk-go-forward"
|
||||
type="object" string="Continue"/>
|
||||
</group>
|
||||
</group>
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
|
@ -99,6 +99,7 @@
|
|||
"access_ir_actions_wizard_all","ir_actions_wizard","model_ir_actions_wizard",,1,0,0,0
|
||||
"access_ir_actions_wizard_group_system","ir_actions_wizard_group_system","model_ir_actions_wizard","group_system",1,1,1,1
|
||||
"access_ir_actions_todo_group_system","ir_actions_todo group system","model_ir_actions_todo","group_system",1,1,1,1
|
||||
"access_ir_actions_config_wiz_group_system","ir_actions_configuration_wizard group system","model_ir_actions_configuration_wizard","group_system",1,1,1,1
|
||||
"access_workflow_all","workflow_all","model_workflow",,1,0,0,0
|
||||
"access_workflow_group_system","workflow_group_system","model_workflow","group_system",1,1,1,1
|
||||
"access_workflow_activity_all","workflow_activity_all","model_workflow_activity",,1,0,0,0
|
||||
|
|
|
Loading…
Reference in New Issue