[REM] Removed manual many2many tags from kanban views

bzr revid: fme@openerp.com-20121128115417-sgpf3hr4rgwglrbm
This commit is contained in:
Fabien Meghazi 2012-11-28 12:54:17 +01:00
parent cb32b7e76f
commit 9784c7dfa5
10 changed files with 5 additions and 102 deletions

View File

@ -318,12 +318,7 @@
</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>

View 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,

View File

@ -314,9 +314,7 @@
</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>

View File

@ -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();
}
}
});
};

View File

@ -24,12 +24,7 @@
<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">

View File

@ -546,11 +546,7 @@
</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>

View 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();
},
});
};

View 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:

View File

@ -264,9 +264,7 @@
<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"/>

View File

@ -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();
}
}
});
};