[rem] remove ir_actions_configuration_wizard
bzr revid: xmo@tinyerp.com-20091210134736-ackpf4bj6nu5eruf
This commit is contained in:
parent
a0a6b7df53
commit
f32bc4e6cf
|
@ -1384,38 +1384,6 @@
|
|||
<menuitem id="next_id_11" name="Configuration Wizards" parent="base.menu_config" sequence="1"/>
|
||||
<menuitem action="act_ir_actions_todo_form" id="menu_ir_actions_todo_form" parent="next_id_11"/>
|
||||
|
||||
<record id="view_config_wizard_form" model="ir.ui.view">
|
||||
<field name="name">Main 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>
|
||||
<separator string="Next Configuration Step" colspan="4"/>
|
||||
<field name="name" nolabel="1" colspan="4" width="500"/>
|
||||
<field name="progress" widget="progressbar"/>
|
||||
<separator colspan="4" string=""/>
|
||||
<label string="" colspan="2"/>
|
||||
<group colspan="2" col="2">
|
||||
<button icon="gtk-cancel" name="button_skip" string="Skip Step" type="object"/>
|
||||
<button icon="gtk-go-forward" name="button_continue" string="Continue" type="object"/>
|
||||
</group>
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_config_wizard_form" model="ir.actions.act_window">
|
||||
<field name="name">Configuration Wizard</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">ir.actions.configuration.wizard</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="target">new</field>
|
||||
</record>
|
||||
<menuitem action="action_config_wizard_form" id="menu_config_module" parent="base.next_id_11"/>
|
||||
|
||||
<record id="action_start_configurator" model="ir.actions.server">
|
||||
<field name="name">Start Configuration</field>
|
||||
<field name="model_id" ref="model_res_config"/>
|
||||
|
|
|
@ -701,105 +701,5 @@ class ir_actions_todo(osv.osv):
|
|||
_order="sequence"
|
||||
ir_actions_todo()
|
||||
|
||||
# This model to use run all configuration actions
|
||||
class ir_actions_configuration_wizard(osv.osv_memory):
|
||||
_name='ir.actions.configuration.wizard'
|
||||
def next_configuration_action(self,cr,uid,context={}):
|
||||
item_obj = self.pool.get('ir.actions.todo')
|
||||
item_ids = item_obj.search(cr, uid, [('state','=','open'),
|
||||
('active','=',True)],
|
||||
limit=1, context=context)
|
||||
if item_ids:
|
||||
return item_obj.browse(cr, uid, item_ids[0], context=context)
|
||||
return False
|
||||
def _get_action_name(self, cr, uid, context={}):
|
||||
next_action = self.next_configuration_action(cr,uid,context=context)
|
||||
if next_action:
|
||||
return next_action.note
|
||||
else:
|
||||
return "Your database is now fully configured.\n\nClick 'Continue' and enjoy your OpenERP experience..."
|
||||
|
||||
def _get_action(self, cr, uid, context={}):
|
||||
next_action = self.next_configuration_action(cr, uid, context=context)
|
||||
if next_action:
|
||||
return next_action.id
|
||||
return
|
||||
|
||||
def _progress_get(self, cr, uid, context=None):
|
||||
total = self.pool.get('ir.actions.todo')\
|
||||
.search_count(cr, uid, [], context)
|
||||
todo = self.pool.get('ir.actions.todo')\
|
||||
.search_count(cr, uid,[('active','=',True),
|
||||
('state','<>','open')],
|
||||
context)
|
||||
if total > 0.0:
|
||||
return max(5.0, round(todo*100/total))
|
||||
else:
|
||||
return 100.0
|
||||
|
||||
_columns = {
|
||||
'name': fields.text('Next Wizard', readonly=True),
|
||||
'progress': fields.float('Configuration Progress', readonly=True),
|
||||
'item_id': fields.many2one('ir.actions.todo',
|
||||
'Next Configuration Wizard',
|
||||
invisible=True, readonly=True),
|
||||
}
|
||||
_defaults={
|
||||
'progress': _progress_get,
|
||||
'item_id': _get_action,
|
||||
'name': _get_action_name,
|
||||
}
|
||||
def button_next(self,cr,uid,ids,context=None):
|
||||
user_action = self.pool.get('res.users').browse(cr,uid,uid)
|
||||
act_obj = self.pool.get(user_action.menu_id.type)
|
||||
action_ids = act_obj.search(cr,uid,[
|
||||
('name', '=', user_action.menu_id.name)])
|
||||
action_open = act_obj.browse(cr, uid, action_ids)[0]
|
||||
if context and 'menu' in context:
|
||||
return {
|
||||
'view_type': action_open.view_type,
|
||||
'view_id': action_open.view_id and [action_open.view_id.id] or False,
|
||||
'res_model': action_open.res_model,
|
||||
'type': action_open.type,
|
||||
'domain': action_open.domain
|
||||
}
|
||||
return {'type': 'ir.actions.act_window_close'}
|
||||
|
||||
def button_skip(self,cr,uid,ids,context=None):
|
||||
item_obj = self.pool.get('ir.actions.todo')
|
||||
item_id = self.read(cr,uid,ids)[0]['item_id']
|
||||
if item_id:
|
||||
item = item_obj.browse(cr, uid, item_id, context=context)
|
||||
item_obj.write(cr, uid, item.id, {
|
||||
'state': 'skip',
|
||||
}, context=context)
|
||||
return {
|
||||
'view_type': 'form',
|
||||
"view_mode": 'form',
|
||||
'res_model': 'ir.actions.configuration.wizard',
|
||||
'type': 'ir.actions.act_window',
|
||||
'target':'new',
|
||||
}
|
||||
return self.button_next(cr, uid, ids, context)
|
||||
|
||||
def button_continue(self, cr, uid, ids, context=None):
|
||||
item_obj = self.pool.get('ir.actions.todo')
|
||||
item_id = self.read(cr,uid,ids)[0]['item_id']
|
||||
if item_id:
|
||||
item = item_obj.browse(cr, uid, item_id, context=context)
|
||||
item_obj.write(cr, uid, item.id, {
|
||||
'state': 'done',
|
||||
}, context=context)
|
||||
return {
|
||||
'view_mode': item.action_id.view_mode,
|
||||
'view_type': item.action_id.view_type,
|
||||
'view_id':item.action_id.view_id and [item.action_id.view_id.id] or False,
|
||||
'res_model': item.action_id.res_model,
|
||||
'type': item.action_id.type,
|
||||
'target':item.action_id.target,
|
||||
}
|
||||
return self.button_next(cr, uid, ids, context)
|
||||
ir_actions_configuration_wizard()
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
|
|
|
@ -92,13 +92,8 @@ class wizard_info_get(wizard.interface):
|
|||
return {}
|
||||
|
||||
def _config(self, cr, uid, data, context=None):
|
||||
return {
|
||||
'view_type': 'form',
|
||||
"view_mode": 'form',
|
||||
'res_model': 'ir.actions.configuration.wizard',
|
||||
'type': 'ir.actions.act_window',
|
||||
'target':'new',
|
||||
}
|
||||
return pooler.get_pool(cr.dbname).get('res.config')\
|
||||
.next(cr, uid, [], context=context)
|
||||
|
||||
states = {
|
||||
'init': {
|
||||
|
@ -183,13 +178,8 @@ class wizard_info_get_simple(wizard.interface):
|
|||
return {}
|
||||
|
||||
def _config(self, cr, uid, data, context=None):
|
||||
return {
|
||||
'view_type': 'form',
|
||||
"view_mode": 'form',
|
||||
'res_model': 'ir.actions.configuration.wizard',
|
||||
'type': 'ir.actions.act_window',
|
||||
'target':'new',
|
||||
}
|
||||
return pooler.get_pool(cr.dbname).get('res.config')\
|
||||
.next(cr, uid, [], context=context)
|
||||
|
||||
states = {
|
||||
'init': {
|
||||
|
|
|
@ -97,7 +97,6 @@
|
|||
"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