[IMP]module: improve tree and form view and remove complexity field from ir.module...
authorMayur Maheshwari (OpenERP) <mma@tinyerp.com>
Fri, 18 May 2012 05:29:39 +0000 (10:59 +0530)
committerMayur Maheshwari (OpenERP) <mma@tinyerp.com>
Fri, 18 May 2012 05:29:39 +0000 (10:59 +0530)
bzr revid: mma@tinyerp.com-20120518052939-51ps201qaq51g2bp

openerp/addons/base/module/module.py
openerp/addons/base/module/module_view.xml
openerp/modules/db.py
openerp/modules/module.py

index 575a965..e04e4e4 100644 (file)
@@ -161,9 +161,9 @@ class module(osv.osv):
         return res
 
     _columns = {
-        'name': fields.char("Name", size=128, readonly=True, required=True, select=True),
+        'name': fields.char("Technical Name", size=128, readonly=True, required=True, select=True),
         'category_id': fields.many2one('ir.module.category', 'Category', readonly=True, select=True),
-        'shortdesc': fields.char('Short Description', size=256, readonly=True, translate=True),
+        'shortdesc': fields.char('Name', size=256, readonly=True, translate=True),
         'description': fields.text("Description", readonly=True, translate=True),
         'author': fields.char("Author", size=128, readonly=True),
         'maintainer': fields.char('Maintainer', size=128, readonly=True),
@@ -211,9 +211,6 @@ class module(osv.osv):
         'certificate' : fields.char('Quality Certificate', size=64, readonly=True),
         'application': fields.boolean('Application', readonly=True),
         'icon': fields.char('Icon URL', size=128),
-        'complexity': fields.selection([('easy','Easy'), ('normal','Normal'), ('expert','Expert')],
-            string='Complexity', readonly=True,
-            help='Level of difficulty of module. Easy: intuitive and easy to use for everyone. Normal: easy to use for business experts. Expert: requires technical skills.'),
     }
 
     _defaults = {
@@ -221,7 +218,6 @@ class module(osv.osv):
         'sequence': 100,
         'demo': False,
         'license': 'AGPL-3',
-        'complexity': 'normal',
     }
     _order = 'sequence,name'
 
@@ -464,7 +460,6 @@ class module(osv.osv):
             'website': terp.get('website', ''),
             'license': terp.get('license', 'AGPL-3'),
             'certificate': terp.get('certificate') or False,
-            'complexity': terp.get('complexity', ''),
             'sequence': terp.get('sequence', 100),
             'application': terp.get('application', False),
             'auto_install': terp.get('auto_install', False),
index 13f3307..e22f6ce 100644 (file)
@@ -77,7 +77,6 @@
                   <field name="icon"/>
                   <field name="name"/>
                   <field name="state"/>
-                  <field name="complexity"/>
                   <templates>
                     <t t-name="kanban-box">
                       <div class="oe_module_vignette">
@@ -90,7 +89,6 @@
                           <p>
                              <field name="category_id"/><br/>
                              <field name="name"/><br/>
-                             <span t-if="record.complexity.raw_value == 'Expert'" class="oe_label oe_warning">Complex</span>
                            </p>
                           <button type="object" name="button_immediate_install" states="uninstalled" class="oe_button">Install</button>
                           <button t-if="installed" class="oe_button" disabled="disabled">Installed</button>
             <field name="model">ir.module.module</field>
             <field name="type">form</field>
             <field name="arch" type="xml">
-                <form string="Module">
-                    <group colspan="4" col="6">
-                        <field name="name"/>
+                <form layout="manual">
+                <div class="oe_form_topbar">
+                    <button name="button_install" states="uninstalled" string="Install" icon="terp-gtk-jump-to-ltr" type="object" class="oe_form_button_hi"/>
+                    <button name="button_upgrade" states="installed" string="Upgrade" icon="terp-gtk-go-back-rtl" type="object" class="oe_form_button_hi"/>
+                    <button name="button_uninstall" states="installed" string="Uninstall (beta)"
+                                        icon="terp-dialog-close" type="object"
+                                        confirm="Do you confirm the uninstallation of this module? This will permanently erase all data currently stored by the module!"/>
+                    <button name="button_uninstall_cancel" states="to remove" string="Cancel Uninstall" icon="gtk-cancel" type="object"/>
+                    <button name="button_upgrade_cancel" states="to upgrade" string="Cancel Upgrade" icon="gtk-cancel" type="object"/>
+                    <button name="button_install_cancel" states="to install" string="Cancel Install" icon="gtk-cancel" type="object"/>
+                <div class="oe_right">
+                    <field name="state" widget="statusbar" nolabel="1" statusbar_visible="uninstalled,installed"/>
+                </div>
+                </div>
+                <sheet string="Module" layout="auto">
+                    <group colspan="4" col="6" class="oe_form_header">
                         <field name="shortdesc"/>
                         <field name="certificate" />
                         <field name="category_id"/>
-                        <field name="complexity"/>
-                        <field name="demo"/>
-                        <field name="application"/>
                     </group>
                     <notebook colspan="4">
                         <page string="Module">
                                 <group colspan="2" col="2">
                                     <separator string="Version" colspan="2"/>
                                     <field name="installed_version"/>
-                                    <field name="latest_version"/>
-                                    <field name="published_version"/>
                                 </group>
                             </group>
                             <separator string="Description" colspan="4"/>
                             <field colspan="4" name="description" select="2" nolabel="1"/>
-                            <newline/>
-                            <field name="state"/>
-                            <group col="6" colspan="2">
-                                <button name="button_install" states="uninstalled" string="Install" icon="terp-gtk-jump-to-ltr" type="object"/>
-                                <button name="button_install_cancel" states="to install" string="Cancel Install" icon="gtk-cancel" type="object"/>
-                                <button name="button_uninstall" states="installed" string="Uninstall (beta)"
-                                        icon="terp-dialog-close" type="object"
-                                        confirm="Do you confirm the uninstallation of this module? This will permanently erase all data currently stored by the module!"/>
-                                <button name="button_uninstall_cancel" states="to remove" string="Cancel Uninstall" icon="gtk-cancel" type="object"/>
-                                <button name="button_upgrade" states="installed" string="Upgrade" icon="terp-gtk-go-back-rtl" type="object"/>
-                                <button name="button_upgrade_cancel" states="to upgrade" string="Cancel Upgrade" icon="gtk-cancel" type="object"/>
-                            </group>
                         </page>
-                        <page string="Dependencies">
+                        <page string="Technical Data">
+                            <field name="name"/>
+                            <field name="demo"/>
+                            <field name="application"/>
                             <field colspan="4" name="dependencies_id" nolabel="1">
                                 <tree string="Dependencies">
                                     <field name="name"/>
                             <field colspan="2" name="reports_by_module" nolabel="1"/>
                         </page>
                     </notebook>
+                    </sheet>
                 </form>
             </field>
         </record>
             <field name="type">tree</field>
             <field name="arch" type="xml">
                 <tree colors="blue:state=='to upgrade' or state=='to install';red:state=='uninstalled';grey:state=='uninstallable';black:state=='installed'" string="Modules">
-                    <field name="name"/>
-                    <field name="category_id"/>
+                    <field name="name" groups="base.group_no_one"/>
                     <field name="shortdesc"/>
-                    <field name="complexity"/>
                     <field name="author"/>
                     <field name="installed_version"/>
-                    <field name="latest_version"/>
                     <field name="state"/>
-                    <button name="button_install" states="uninstalled" string="Install" icon="terp-gtk-jump-to-ltr" type="object"/>
                 </tree>
             </field>
         </record>
index 1fb2697..2449efc 100644 (file)
@@ -77,15 +77,15 @@ def initialize(cr):
 
         cr.execute('INSERT INTO ir_module_module \
                 (author, website, name, shortdesc, description, \
-                    category_id, auto_install, state, certificate, web, license, complexity, application, icon, sequence) \
-                VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s) RETURNING id', (
+                    category_id, auto_install, state, certificate, web, license, application, icon, sequence) \
+                VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s) RETURNING id', (
             info['author'],
             info['website'], i, info['name'],
             info['description'], category_id,
             info['auto_install'], state, info['certificate'],
             info['web'],
             info['license'],
-            info['complexity'], info['application'], info['icon'],
+            info['application'], info['icon'],
             info['sequence']))
         id = cr.fetchone()[0]
         cr.execute('INSERT INTO ir_model_data \
index bc8e21b..e226b69 100644 (file)
@@ -329,7 +329,6 @@ def load_information_from_description_file(module):
                 'auto_install': False,
                 'category': 'Uncategorized',
                 'certificate': None,
-                'complexity': 'normal',
                 'depends': [],
                 'description': '',
                 'icon': get_module_icon(module),