Antony Lesuisse (OpenERP) has proposed merging 
lp:~openerp-dev/openobject-server/trunk-basesetup-dynamic-stw into 
lp:openobject-server.

Requested reviews:
  OpenERP Core Team (openerp)

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-server/trunk-basesetup-dynamic-stw/+merge/78021
-- 
https://code.launchpad.net/~openerp-dev/openobject-server/trunk-basesetup-dynamic-stw/+merge/78021
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-server/trunk-basesetup-dynamic-stw.
=== modified file 'openerp/addons/base/module/module.py'
--- openerp/addons/base/module/module.py	2011-09-15 14:15:33 +0000
+++ openerp/addons/base/module/module.py	2011-10-03 23:40:34 +0000
@@ -42,13 +42,13 @@
 
 
 ACTION_DICT = {
-            'view_type': 'form',
-            'view_mode': 'form',
-            'res_model': 'base.module.upgrade',
-            'target': 'new',
-            'type': 'ir.actions.act_window',
-            'nodestroy':True,
-        }
+    'view_type': 'form',
+    'view_mode': 'form',
+    'res_model': 'base.module.upgrade',
+    'target': 'new',
+    'type': 'ir.actions.act_window',
+    'nodestroy':True,
+}
 
 class module_category(osv.osv):
     _name = "ir.module.category"
@@ -70,11 +70,26 @@
                              result.get(id, 0))
         return result
 
+    def name_get(self, cr, uid, ids, context=None):
+        result = []
+
+        reads = self.read(cr, uid, ids, ['name', 'parent_id'], context=context)
+        for record in reads:
+            name = record['name']
+            if record['parent_id']:
+                name = record['parent_id'][1] + ' / ' + name
+            result.append((record['id'], name,))
+
+        return result
+
     _columns = {
         'name': fields.char("Name", size=128, required=True, select=True),
         'parent_id': fields.many2one('ir.module.category', 'Parent Category', select=True),
         'child_ids': fields.one2many('ir.module.category', 'parent_id', 'Child Categories'),
-        'module_nr': fields.function(_module_nbr, method=True, string='Number of Modules', type='integer')
+        'module_nr': fields.function(_module_nbr, method=True, string='Number of Modules', type='integer'),
+        'module_ids' : fields.one2many('ir.module.module', 'category_id', 'Modules'),
+        'description' : fields.text("Description"),
+        'sequence' : fields.integer('Sequence'),
     }
     _order = 'name'
 module_category()
@@ -288,7 +303,7 @@
         if level<1:
             raise orm.except_orm(_('Error'), _('Recursion error in modules dependencies !'))
         demo = False
-        for module in self.browse(cr, uid, ids):
+        for module in self.browse(cr, uid, ids, context=context):
             mdemo = False
             for dep in module.dependencies_id:
                 if dep.state == 'unknown':

=== modified file 'openerp/addons/base/module/module_data.xml'
--- openerp/addons/base/module/module_data.xml	2010-06-28 05:23:41 +0000
+++ openerp/addons/base/module/module_data.xml	2011-10-03 23:40:34 +0000
@@ -1,6 +1,108 @@
 <?xml version="1.0" encoding="utf-8"?>
 <openerp>
     <data>        
+        <record model="ir.module.category" id="module_category_link">
+            <field name="name">Link</field>
+            <field name="sequence">0</field>
+        </record>
+        <record model="ir.module.category" id="module_category_customer_relationship_management">
+            <field name="name">Customer Relationship Management</field>
+            <field name="description">Helps you track and manage relations with customers such as leads, requests or issues. Can automatically send reminders, escalate requests or trigger business-specific actions based on standard events.</field>
+            <field name="sequence">1</field>
+        </record>
+
+        <record model="ir.module.category" id="module_category_sales_management">
+            <field name="name">Sales Management</field>
+            <field name="description">Helps you handle your quotations, sale orders and invoicing.</field>
+            <field name="sequence">2</field>
+        </record>
+
+        <record model="ir.module.category" id="module_category_project_management">
+            <field name="name">Project Management</field>
+            <field name="description">Helps you manage your projects and tasks by tracking them, generating plannings, etc...</field>
+            <field name="sequence">3</field>
+        </record>
+
+
+        <record model="ir.module.category" id="module_category_knowledge_management">
+            <field name="name">Knowledge Management</field>
+            <field name="description">Lets you install addons geared towards sharing knowledge with and between your employees.</field>
+            <field name="sequence">4</field>
+        </record>
+
+        <record model="ir.module.category" id="module_category_warehouse_management">
+            <field name="name">Warehouse Management</field>
+            <field name="description">Helps you manage your inventory and main stock operations: delivery orders, receptions, etc.</field>
+            <field name="sequence">5</field>
+        </record>
+
+        <record model="ir.module.category" id="module_category_manufacturing">
+            <field name="name">Manufacturing</field>
+            <field name="description">Helps you manage your manufacturing processes and generate reports on those processes.</field>
+            <field name="sequence">6</field>
+        </record>
+
+        <record model="ir.module.category" id="module_category_account_voucher">
+            <field name="name">Invoicing &amp; Payments</field>
+            <field name="description">Allows you to create your invoices and track the payments. It is an easier version of the accounting module for managers who are not accountants.</field>
+            <field name="sequence">7</field>
+        </record>
+
+        <record model="ir.module.category" id="module_category_accounting_and_finance">
+            <field name="name">Accounting &amp; Finance</field>
+            <field name="description">Helps you handle your accounting needs, if you are not an accountant, we suggest you to install only the Invoicing.</field>
+            <field name="sequence">8</field>
+        </record>
+
+        <record model="ir.module.category" id="module_category_purchase_management">
+            <field name="name">Purchase Management</field>
+            <field name="description">Helps you manage your purchase-related processes such as requests for quotations, supplier invoices, etc...</field>
+            <field name="sequence">9</field>
+        </record>
+        <record model="ir.module.category" id="module_category_human_resources">
+            <field name="name">Human Resources</field>
+            <field name="description">Helps you manage your human resources by encoding your employees structure, generating work sheets, tracking attendance and more.</field>
+            <field name="sequence">10</field>
+        </record>
+
+        <record model="ir.module.category" id="module_category_tools">
+            <field name="name">Extra Tools</field>
+            <field name="description">Lets you install various interesting but non-essential tools like Survey, Lunch and Ideas box.</field>
+            <field name="sequence">11</field>
+        </record>
+
+        <record model="ir.module.category" id="module_category_marketing">
+            <field name="name">Marketing</field>
+            <field name="description">Helps you manage your marketing campaigns step by step.</field>
+            <field name="sequence">12</field>
+        </record>
+
+        <record model="ir.module.category" id="module_category_point_of_sale">
+            <field name="name">Point of Sales</field>
+            <field name="description">Helps you get the most out of your points of sales with fast sale encoding, simplified payment mode encoding, automatic picking lists generation and more.</field>
+            <field name="sequence">13</field>
+        </record>
+
+        <record model="ir.module.category" id="module_category_report_designer">
+            <field name="name">Advanced Reporting</field>
+            <field name="description">Lets you install various tools to simplify and enhance OpenERP's report creation.</field>
+            <field name="sequence">14</field>
+        </record>
+
+        <record model="ir.module.category" id="module_category_localization">
+            <field name="name">Localization</field>
+        </record>
+
+        <record model="ir.module.category" id="module_category_localization_account_charts">
+            <field name="parent_id" ref="module_category_localization" />
+            <field name="name">Account Charts</field>
+        </record>
+
+        <record model="ir.module.category" id="module_category_associations">
+            <field name="name">Associations</field>
+            <field name="description">Installs a preselected set of OpenERP applications which will help you manage your association more efficiently.</field>
+        </record>
+
 <!--        <record id="ir_ui_view_sc_modules0" model="ir.ui.view_sc">-->
 <!--            <field name="name">Modules</field>-->
 <!--            <field name="resource">ir.ui.menu</field>-->

=== modified file 'openerp/modules/db.py'
--- openerp/modules/db.py	2011-09-30 09:58:14 +0000
+++ openerp/modules/db.py	2011-10-03 23:40:34 +0000
@@ -103,7 +103,9 @@
 
     """
     p_id = None
+    category = []
     while categories:
+        category.append(categories[0])
         if p_id is not None:
             cr.execute('SELECT id \
                        FROM ir_module_category \
@@ -118,6 +120,9 @@
                     (name, parent_id) \
                     VALUES (%s, %s) RETURNING id', (categories[0], p_id))
             c_id = cr.fetchone()[0]
+            xml_id = 'module_category_' + ('_'.join(map(lambda x: x.lower(), category))).replace('&', 'and').replace(' ', '_')
+            cr.execute('INSERT INTO ir_model_data (module, name, res_id, model) \
+                       VALUES (%s, %s, %s, %s)', ('base', xml_id, c_id, 'ir.module.category'))
         else:
             c_id = c_id[0]
         p_id = c_id

_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help   : https://help.launchpad.net/ListHelp

Reply via email to