Imrpovement in wizards
bzr revid: fp@tinyerp.com-59f5cbd2e685f0e18ca2b2883350c96f3872c5ca
This commit is contained in:
@@ -183,31 +183,20 @@
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Configure User">
|
||||
<separator col="4" colspan="4" string="Configure User"/>
|
||||
<newline/>
|
||||
<notebook>
|
||||
<page string="User">
|
||||
<field name="name" select="1"/>
|
||||
<field name="active" select="1"/>
|
||||
<field name="login" select="1"/>
|
||||
<field name="password"/>
|
||||
<field name="address_id"/>
|
||||
<field name="company_id" required="1"/>
|
||||
<field name="action_id" required="True"/>
|
||||
<field domain="[('usage','=','menu')]" name="menu_id" required="True"/>
|
||||
<field colspan="4" name="signature"/>
|
||||
<group col="4" colspan="4">
|
||||
<button icon='gtk-cancel' special="cancel" name="action_next" type='object' string='Skip & Continue'/>
|
||||
<button name='action_new' icon='gtk-ok' type='object' string='Add Other User'/>
|
||||
<button name='action_continue' icon='gtk-ok' type='object' string='Continue'/>
|
||||
</group>
|
||||
|
||||
</page>
|
||||
<page string="Security">
|
||||
<field colspan="4" name="groups_id"/>
|
||||
<field colspan="4" name="roles_id"/>
|
||||
</page>
|
||||
</notebook>
|
||||
<separator col="4" colspan="4" string="Define a New User"/>
|
||||
<field name="name" select="1"/>
|
||||
<newline/>
|
||||
<field name="login" select="1"/>
|
||||
<field name="password"/>
|
||||
<field colspan="4" name="signature"/>
|
||||
<field colspan="4" name="groups_id"/>
|
||||
<separator string="" colspan="4"/>
|
||||
<label string="" colspan="2"/>
|
||||
<group col="3" colspan="3">
|
||||
<button icon='gtk-cancel' special="cancel" name="action_next" type='object' string='Skip & Continue'/>
|
||||
<button name='action_new' icon='gtk-ok' type='object' string='Add Another User'/>
|
||||
<button name='action_continue' icon='gtk-ok' type='object' string='Continue'/>
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
@@ -229,27 +218,14 @@
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Configure simple view">
|
||||
<separator string="Select between the simplified views or the extended views."/>
|
||||
<separator string="Choose the simple or extended views" colspan="4"/>
|
||||
<field colspan="2" name="view"/>
|
||||
<newline/>
|
||||
<!--<label string="If you are testing or using OpenERP for the first time," colspan="2"/>
|
||||
|
||||
<newline/>
|
||||
<label string="We suggest you to use the simplified view, which has less features but is easier
|
||||
to understand." colspan="2"/>
|
||||
|
||||
<newline/>-->
|
||||
<group colspan="4">
|
||||
<field colspan="2" name="view"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<separator string=""/>
|
||||
<newline/>
|
||||
|
||||
<group>
|
||||
<button icon="gtk-cancel" special="cancel" name="action_cancel" type="object" string="Cancel"/>
|
||||
<separator string="" colspan="4"/>
|
||||
<label string="" colspan="2"/>
|
||||
<group colspan="2" col="1">
|
||||
<button icon="gtk-ok" name="action_set" string="Set" type="object"/>
|
||||
</group>
|
||||
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
@@ -269,7 +245,9 @@ to understand." colspan="2"/>
|
||||
|
||||
<record id="config_wizard_step_user" model="ir.module.module.configuration.step">
|
||||
<field name="name">Create User</field>
|
||||
<field name="note">Create some users</field>
|
||||
<field name="note">Create your different users.
|
||||
You will be able to assign groups to users. Groups define the access rights of each users on the different objects of the system.
|
||||
</field>
|
||||
<field name="action_id" ref="action_config_user_form"/>
|
||||
<field name="state">open</field>
|
||||
<field name="sequence">10</field>
|
||||
@@ -278,8 +256,7 @@ to understand." colspan="2"/>
|
||||
<record id="config_wizard_simple_view" model="ir.module.module.configuration.step">
|
||||
<field name="name">Select between the simplified views or the extended views.</field>
|
||||
<field name="note">Select between the simplified views or the extended views.
|
||||
(If you are testing or using OpenERP for the first time,
|
||||
we suggest you to use the simplified view, which has less features but is easier to understand.)
|
||||
If you are testing or using OpenERP for the first time, we suggest you to use the simplified view, which has less features but is easier to understand. You will be able to switch to the extended view later.
|
||||
</field>
|
||||
<field name="action_id" ref="action_config_simple_view_form"/>
|
||||
<field name="state">open</field>
|
||||
@@ -287,4 +264,4 @@ to understand." colspan="2"/>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</terp>
|
||||
</terp>
|
||||
|
||||
@@ -569,92 +569,89 @@ module_dependency()
|
||||
|
||||
|
||||
class module_config_wizard_step(osv.osv):
|
||||
_name = 'ir.module.module.configuration.step'
|
||||
_columns={
|
||||
_name = 'ir.module.module.configuration.step'
|
||||
_columns={
|
||||
'name':fields.char('Name',size=64,required=True, select=True),
|
||||
'note':fields.text('Text'),
|
||||
'action_id':fields.many2one('ir.actions.act_window', 'Action', select=True,required=True, ondelete='cascade'),
|
||||
'sequence':fields.integer('Sequence'),
|
||||
'state':fields.selection([('open', 'Open'),('done', 'Done'),('skip','Skip')], string='State', required=True)
|
||||
}
|
||||
_defaults={
|
||||
_defaults={
|
||||
'state': lambda *a: 'open',
|
||||
'sequence': lambda *a: 10,
|
||||
}
|
||||
_order="sequence"
|
||||
_order="sequence"
|
||||
module_config_wizard_step()
|
||||
|
||||
|
||||
class module_configuration(osv.osv_memory):
|
||||
_name='ir.module.module.configuration.wizard'
|
||||
|
||||
def _get_action_name(self, cr, uid, context={}):
|
||||
_name='ir.module.module.configuration.wizard'
|
||||
def _get_action_name(self, cr, uid, context={}):
|
||||
item_obj = self.pool.get('ir.module.module.configuration.step')
|
||||
item_ids = item_obj.search(cr, uid, [
|
||||
('state', '=', 'open'),
|
||||
], limit=1, context=context)
|
||||
('state', '=', 'open'),
|
||||
], limit=1, context=context)
|
||||
if item_ids and len(item_ids):
|
||||
item = item_obj.browse(cr, uid, item_ids[0], context=context)
|
||||
return item.note
|
||||
else:
|
||||
return 'Thank You! All Configuration steps are installed'
|
||||
return "Your database is now fully configured.\n\nClick 'Continue' and enyoy your OpenERP experience..."
|
||||
return False
|
||||
|
||||
|
||||
|
||||
def _get_action(self, cr, uid, context={}):
|
||||
def _get_action(self, cr, uid, context={}):
|
||||
item_obj = self.pool.get('ir.module.module.configuration.step')
|
||||
item_ids = item_obj.search(cr, uid, [
|
||||
('state', '=', 'open'),
|
||||
], limit=1, context=context)
|
||||
('state', '=', 'open'),
|
||||
], limit=1, context=context)
|
||||
if item_ids:
|
||||
item = item_obj.browse(cr, uid, item_ids[0], context=context)
|
||||
return item.id
|
||||
return False
|
||||
|
||||
_columns = {
|
||||
_columns = {
|
||||
'name': fields.text('Next Wizard',readonly=True),
|
||||
'item_id':fields.many2one('ir.module.module.configuration.step', 'Next Configuration Wizard',invisible=True, readonly=True),
|
||||
|
||||
}
|
||||
_defaults={
|
||||
_defaults={
|
||||
'item_id':_get_action,
|
||||
'name':_get_action_name,
|
||||
|
||||
}
|
||||
def button_skip(self,cr,uid,ids,context=None):
|
||||
item_obj = self.pool.get('ir.module.module.configuration.step')
|
||||
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{
|
||||
def button_skip(self,cr,uid,ids,context=None):
|
||||
item_obj = self.pool.get('ir.module.module.configuration.step')
|
||||
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.module.module.configuration.wizard',
|
||||
'type': 'ir.actions.act_window',
|
||||
'target':'new',
|
||||
}
|
||||
return {'type':'ir.actions.act_window_close'}
|
||||
return {'type':'ir.actions.act_window_close'}
|
||||
|
||||
def button_continue(self, cr, uid, ids, context=None):
|
||||
item_obj = self.pool.get('ir.module.module.configuration.step')
|
||||
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{
|
||||
def button_continue(self, cr, uid, ids, context=None):
|
||||
item_obj = self.pool.get('ir.module.module.configuration.step')
|
||||
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_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 {'type':'ir.actions.act_window_close' }
|
||||
return {'type':'ir.actions.act_window_close' }
|
||||
module_configuration()
|
||||
|
||||
|
||||
|
||||
@@ -227,14 +227,17 @@
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Next Configuration Step">
|
||||
<separator string="Next Configuration Step" colspan="4"/>
|
||||
<field name="name" nolabel="1" colspan="4" width="500"/>
|
||||
<separator colspan="4" string=""/>
|
||||
<label string="" colspan="2"/>
|
||||
<group colspan="2" col="2">
|
||||
<button icon="gtk-cancel" special="cancel" string="Cancel"/>
|
||||
<button icon="gtk-go-forward" name="button_continue" string="Continue" type="object"/>
|
||||
</group>
|
||||
<image name="gtk-dialog-info"/>
|
||||
<group>
|
||||
<separator string="Next Configuration Step" colspan="4"/>
|
||||
<field name="name" nolabel="1" colspan="4" width="500"/>
|
||||
<separator colspan="4" string=""/>
|
||||
<label string="" colspan="2"/>
|
||||
<group colspan="2" col="2">
|
||||
<button icon="gtk-cancel" special="cancel" string="Skip Step"/>
|
||||
<button icon="gtk-go-forward" name="button_continue" string="Continue" type="object"/>
|
||||
</group>
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
Reference in New Issue
Block a user