[REM] Removed manual many2many tags from kanban views
authorFabien Meghazi <fme@openerp.com>
Wed, 28 Nov 2012 11:54:17 +0000 (12:54 +0100)
committerFabien Meghazi <fme@openerp.com>
Wed, 28 Nov 2012 11:54:17 +0000 (12:54 +0100)
bzr revid: fme@openerp.com-20121128115417-sgpf3hr4rgwglrbm

addons/fleet/fleet_view.xml
addons/hr_recruitment/__openerp__.py
addons/hr_recruitment/hr_recruitment_view.xml
addons/hr_recruitment/static/src/js/hr_recruitment.js [deleted file]
addons/portal_project_issue/portal_project_issue_view.xml
addons/project/project_view.xml
addons/project/static/src/js/project.js
addons/project_issue/__openerp__.py
addons/project_issue/project_issue_view.xml
addons/project_issue/static/src/js/project_issue.js [deleted file]

index 8c7ceaf..416ca19 100644 (file)
                                         
                                     </ul>
 
-                                    <div class="oe_kanban_partner_categories">
-                                        <span class="oe_kanban_list_many2many">
-                                            <div modifiers="{}" name="tag_ids" class="oe_form_field oe_tags" model="fleet.vehicle.tag" t-att-data="record.tag_ids.raw_value" />
-                                        </span>
-                                    </div>
-
+                                    <field name="tag_ids"/>
                                 </div>
                             </div>
                         </t>
index 63c1cf4..f2ba3d5 100644 (file)
@@ -60,7 +60,6 @@ You can define the different phases of interviews and easily rate the applicant
         'hr_recruitment_data.xml'
     ],
     'demo': ['hr_recruitment_demo.yml'],
-    'js': ['static/src/js/hr_recruitment.js'],
     'test': ['test/recruitment_process.yml'],
     'installable': True,
     'auto_install': False,
index c3281b4..5622e4b 100644 (file)
 
                                 </div>
                                 <div class="oe_kanban_footer_left" style="margin-top:5px;">
-                                    <div class="oe_left oe_tags">
-                                        <field name="categ_ids"/>
-                                    </div>
+                                    <field name="categ_ids"/>
                                 </div>
                             </div>
                             <div class="oe_clear"></div>
diff --git a/addons/hr_recruitment/static/src/js/hr_recruitment.js b/addons/hr_recruitment/static/src/js/hr_recruitment.js
deleted file mode 100644 (file)
index d11326a..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-openerp.hr_recruitment = function(openerp) {
-    openerp.web_kanban.KanbanView.include({
-        applicant_display_categ_names: function() {
-            /*
-             * Set proper names to applicant categories.
-             * In kanban views, many2many fields only return a list of ids.
-             * Therefore, we have to fetch the matching data by ourselves.
-             */
-            var self = this;
-            var categ_ids = [];
-
-            // Collect categories ids
-            self.$el.find('span[data-categ_id]').each(function() {
-                categ_ids.push($(this).data('categ_id'));
-            });
-
-            // Find their matching names
-            var dataset = new openerp.web.DataSetSearch(self, 'hr.applicant_category', self.session.context, [['id', 'in', _.uniq(categ_ids)]]);
-            dataset.read_slice(['id', 'name']).done(function(result) {
-                _.each(result, function(v, k) {
-                    // Set the proper value in the DOM and display the element
-                    self.$el.find('span[data-categ_id=' + v.id + ']').text(v.name);
-                });
-            });
-        },
-        on_groups_started: function() {
-            var self = this;
-            self._super.apply(self, arguments);
-
-            if (self.dataset.model === 'hr.applicant') {
-                self.applicant_display_categ_names();
-            }
-        }
-    });
-};
index 6502d92..c943bb3 100644 (file)
                                         <field name="version_id"/>
                                     </div>
                                     <div class="oe_kanban_footer_left">
-                                        <div class="oe_left oe_tags">
-                                            <t t-foreach="record.categ_ids.raw_value" t-as="categ_id">
-                                                <span class="oe_tag" t-att-data-categ_id="categ_id"></span>
-                                            </t>
-                                            <field name="categ_ids"/>
-                                        </div>
+                                        <field name="categ_ids"/>
                                         <div class="oe_right">
                                             Creation: <field name="create_date"/>
                                             <span class="oe_kanban_highlight">
index 8bb45ca..d18f054 100644 (file)
                                     </span>
                                 </div>
                                 <div class="oe_kanban_footer_left" style="margin-top:5px;">
-                                    <div class="oe_left oe_tags">
-                                        <t t-foreach="record.categ_ids.raw_value" t-as="categ_id">
-                                            <span class="oe_tag" t-att-data-categ_id="categ_id"></span>
-                                        </t>
-                                    </div>
+                                    <field name="categ_ids"/>
                                 </div>
                             </div>
                             <div class="oe_clear"></div>
index 38578a6..ce8be14 100644 (file)
@@ -25,37 +25,12 @@ openerp.project = function(openerp) {
                 });
             });
         },
-        project_display_categ_names: function() {
-            /*
-             * Set proper names to project categories.
-             * In kanban views, many2many fields only return a list of ids.
-             * Therefore, we have to fetch the matching data by ourselves.
-             */
-            var self = this;
-            var categ_ids = [];
-
-            // Collect categories ids
-            self.$el.find('span[data-categ_id]').each(function() {
-                categ_ids.push($(this).data('categ_id'));
-            });
-
-            // Find their matching names
-            var dataset = new openerp.web.DataSetSearch(self, 'project.category', self.session.context, [['id', 'in', _.uniq(categ_ids)]]);
-            dataset.read_slice(['id', 'name']).done(function(result) {
-                _.each(result, function(v, k) {
-                    // Set the proper value in the DOM and display the element
-                    self.$el.find('span[data-categ_id=' + v.id + ']').text(v.name);
-                });
-            });
-        },
         on_groups_started: function() {
             var self = this;
             self._super.apply(self, arguments);
 
             if (self.dataset.model === 'project.project') {
                 self.project_display_members_names();
-            } else if (self.dataset.model === 'project.task') {
-                self.project_display_categ_names();
             }
         },
         on_record_moved: function(record, old_group, old_index, new_group, new_index){
@@ -74,9 +49,5 @@ openerp.project = function(openerp) {
                 this._super.apply(this, arguments);
             }
         },
-        bind_events: function() {
-            this._super();
-            this.view.project_display_categ_names();
-        },
     });
 };
index b2e9197..2c5f311 100644 (file)
@@ -61,7 +61,6 @@ It allows the manager to quickly check the issues, assign them and decide on the
     'installable': True,
     'auto_install': False,
     'application': True,
-    'js': ['static/src/js/project_issue.js'],
 }
 
 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
index e310512..f98fadb 100644 (file)
                                         <field name="version_id"/>
                                     </div>
                                     <div class="oe_kanban_footer_left">
-                                        <div class="oe_left oe_tags">
-                                            <field name="categ_ids"/>
-                                        </div>
+                                        <field name="categ_ids"/>
                                         <div class="oe_right">
                                             <span class="oe_kanban_highlight">
                                                 <t t-set="priority" t-value="record.priority.raw_value || 5"/>
diff --git a/addons/project_issue/static/src/js/project_issue.js b/addons/project_issue/static/src/js/project_issue.js
deleted file mode 100644 (file)
index 24e5ff7..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-openerp.portal_project_issue = function(openerp) {
-    openerp.web_kanban.KanbanView.include({
-        on_groups_started: function() {
-            var self = this;
-            self._super.apply(this, arguments);
-
-            if (self.dataset.model === 'project.issue') {
-                // Load project's categories names from m2m field
-                self.project_display_categ_names();
-            }
-        }
-    });
-};