diff options
| author | Harshad Modi <hmo@tinyerp.com> | 2008-06-25 11:57:29 +0000 |
|---|---|---|
| committer | Harshad Modi <hmo@tinyerp.com> | 2008-06-25 11:57:29 +0000 |
| commit | a3fccdb1fe3f3cd2f539cb5f1088e5a18a0abb02 (patch) | |
| tree | 4131c1ec22a11febfd3bc1d44265f3cf1b50cc65 | |
| parent | aa7fcf5188159cd1427c9d4a0c8bd3ffca9eed65 (diff) | |
modification:
* add icon on main configiration Steps and also all configuration wizards
* add new field 'note' on configuration step object for step desection
which is display on main configuration wizard
* modify some configuration wizards :
- configure user : add new button for loop , save + new
- select simple view or extend view : modify layout
- journal of bank account : put one2many object with editable tree view to allow create more than one journal
bzr revid: hmo@tinyerp.com-6847618764e7199996115d04ccb6dac991b1438a
| -rw-r--r-- | bin/addons/base/base_update.xml | 36 | ||||
| -rw-r--r-- | bin/addons/base/module/module.py | 30 | ||||
| -rw-r--r-- | bin/addons/base/module/module_view.xml | 37 | ||||
| -rw-r--r-- | bin/addons/base/res/res_user.py | 13 |
4 files changed, 90 insertions, 26 deletions
diff --git a/bin/addons/base/base_update.xml b/bin/addons/base/base_update.xml index 6230c0c8f6c..6acecf0d07d 100644 --- a/bin/addons/base/base_update.xml +++ b/bin/addons/base/base_update.xml @@ -193,8 +193,9 @@ <field name="menu_id" domain="[('usage','=','menu')]" required="True"/> <field name="signature" colspan="4"/> <group colspan="4" col="4"> - <button special="cancel" string="Cancel" /> - <button name="action_create" type='object' string="Create" /> + <button special="cancel" string="Cancel" icon="gtk-cancel"/> + <button name="action_create" type='object' string="Save" icon="gtk-ok"/> + <button name="action_create_new" type='object' string="Save + New" icon="gtk-ok" /> </group> </page> @@ -224,14 +225,25 @@ <field name="type">form</field> <field name="arch" type="xml"> <form string="Configure simple view"> - <separator string="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." colspan="4" col="4"/> + <separator string="Select between the simplified views or the extended views."/> <newline/> - <field name="view"/> - <group colspan="4" col="4"> - <button special="cancel" string="Cancel" /> - <button name="action_set" type='object' string="Set" /> + <!--<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 name="view" colspan="2"/> + </group> + <newline/> + <separator string=""/> + <newline/> + + <group> + <button special="cancel" string="Cancel" icon="gtk-cancel" /> + <button name="action_set" type='object' string="Set" icon="gtk-ok"/> </group> </form> @@ -254,15 +266,21 @@ to understand." colspan="4" col="4"/> <record model="ir.module.module.configuration.step" id="config_wizard_step_user"> <field name="name">Create User</field> + <field name="note">Create some users</field> <field name="action_id" ref="action_config_user_form"></field> <field name="state">open</field> + <field name="sequence">10</field> </record> <record model="ir.module.module.configuration.step" id="config_wizard_simple_view"> <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.)</field> <field name="action_id" ref="action_config_simple_view_form"></field> <field name="state">open</field> + <field name="sequence">5</field> </record> </data> diff --git a/bin/addons/base/module/module.py b/bin/addons/base/module/module.py index f2f4a456243..a49b47c44ac 100644 --- a/bin/addons/base/module/module.py +++ b/bin/addons/base/module/module.py @@ -574,7 +574,8 @@ class module_config_wizard_step(osv.osv): _name = 'ir.module.module.configuration.step' _columns={ - 'name':fields.char('Name', size=64, required=True, select=True), + '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) @@ -589,7 +590,22 @@ module_config_wizard_step() class module_configuration(osv.osv_memory): _name='ir.module.module.configuration.wizard' - def _get_wizard(self, cr, uid, context={}): + + 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) + 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 False + + + + 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'), @@ -600,13 +616,15 @@ class module_configuration(osv.osv_memory): return False _columns = { - 'name': fields.char('Next Wizard', size=64,readonly=True), - 'item_id':fields.many2one('ir.module.module.configuration.step', 'Next Configuration Wizard', readonly=True), + 'name': fields.text('Next Wizard',readonly=True), + 'item_id':fields.many2one('ir.module.module.configuration.step', 'Next Configuration Wizard',invisible=True, readonly=True), + } _defaults={ - 'item_id':_get_wizard - } + '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'] diff --git a/bin/addons/base/module/module_view.xml b/bin/addons/base/module/module_view.xml index 2808a76d577..3576b48fcf3 100644 --- a/bin/addons/base/module/module_view.xml +++ b/bin/addons/base/module/module_view.xml @@ -212,6 +212,19 @@ </tree> </field> </record> + <record model="ir.ui.view" id="config_wizard_step_view_form"> + <field name="model">ir.module.module.configuration.step</field> + <field name="type">form</field> + <field name="arch" type="xml"> + <form string="Config Wizard Steps" editable="bottom"> + <field name="name" select="1"/> + <field name="action_id" select="1"/> + <field name="sequence"/> + <field name="state"/> + <field name="note" colspan="4"/> + </form> + </field> + </record> <record model="ir.actions.act_window" id="act_config_wizard_step_form"> <field name="name">Config Wizard Steps</field> <field name="res_model">ir.module.module.configuration.step</field> @@ -223,18 +236,24 @@ id="menu_config_wizard_step_form"/> <record model="ir.ui.view" id="view_config_wizard_form"> - <field name="name">Main Configuration wizard</field> + <field name="name">Main Configuration Wizard</field> <field name="model">ir.module.module.configuration.wizard</field> <field name="type">form</field> <field name="arch" type="xml"> - <form string="Main Configuration wizard"> - <separator string="Main Configuration wizard" colspan="4" col="4"/> - <newline/> - <field name="item_id" select="1"/> - <group colspan="4" col="4"> - <button special="cancel" string="Cancel" /> - <button name="button_skip" type='object' string="Skip" /> - <button name="button_continue" type='object' string="Continue"/> + <form string="Next Configuration Step"> + <group colspan="4"> + <separator string="Next Configuration Step"/> + <newline/> + <field name="name" nolabel="1"/> + </group> + <separator string="" colspan="4"/> + <newline/> + <group colspan="2"> + </group> + <group colspan="2"> + <button special="cancel" colspan="1" string="Cancel" icon="gtk-cancel" /> + <!--<button name="button_skip" type='object' string="Skip" icon="gtk-ok"/>--> + <button name="button_continue" size="1" type='object' string="Continue" icon="gtk-go-forward"/> </group> </form> </field> diff --git a/bin/addons/base/res/res_user.py b/bin/addons/base/res/res_user.py index 78cfbd76db8..33d247f12d2 100644 --- a/bin/addons/base/res/res_user.py +++ b/bin/addons/base/res/res_user.py @@ -189,6 +189,15 @@ class users(osv.osv): 'type': 'ir.actions.act_window', 'target':'new', } + def action_create_new(self,cr,uid,ids,context={}): + return { + 'view_type': 'form', + "view_mode": 'form', + 'res_model': 'res.users', + 'view_id':self.pool.get('ir.ui.view').search(cr,uid,[('name','=','res.users.confirm.form')]), + 'type': 'ir.actions.act_window', + 'target':'new', + } users() class groups2(osv.osv): @@ -203,7 +212,7 @@ class res_config_view(osv.osv_memory): _name='res.config.view' _columns = { 'name':fields.char('Name', size=64), - 'view': fields.selection([('simple','Simple'),('extended','Extended')], 'Select between the simplified views or the extended views.', required=True ), + 'view': fields.selection([('simple','Simple'),('extended','Extended')], 'View', required=True ), } _defaults={ @@ -213,7 +222,7 @@ class res_config_view(osv.osv_memory): res=self.read(cr,uid,ids)[0] users_obj = self.pool.get('res.users') group_obj=self.pool.get('res.groups') - if 'view' in res: + if 'view' in res and res['view'] and res['view']=='extended': group_ids=group_obj.search(cr,uid,[('name','=','Extended View')]) if group_ids and len(group_ids): users_obj.write(cr, uid, [3],{ |
