[FIX] reverting bad implementation
bzr revid: fp@openerp.com-20120916172612-emr6s1t623cb6vml
This commit is contained in:
parent
3acf87fbce
commit
b09970fa0c
|
@ -141,7 +141,6 @@
|
||||||
margin-left: 4px;
|
margin-left: 4px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
position: relative;
|
position: relative;
|
||||||
display: inline-block;
|
|
||||||
top: -8px;
|
top: -8px;
|
||||||
}
|
}
|
||||||
.openerp .oe_kanban_view .oe_kanban_add {
|
.openerp .oe_kanban_view .oe_kanban_add {
|
||||||
|
|
|
@ -153,7 +153,6 @@
|
||||||
margin-left: 4px
|
margin-left: 4px
|
||||||
cursor: pointer
|
cursor: pointer
|
||||||
position: relative
|
position: relative
|
||||||
display: inline-block
|
|
||||||
top: -8px
|
top: -8px
|
||||||
.oe_kanban_add
|
.oe_kanban_add
|
||||||
float: right
|
float: right
|
||||||
|
|
|
@ -163,41 +163,6 @@ instance.web_kanban.KanbanView = instance.web.View.extend({
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
/* widget for list of tags/categories...
|
|
||||||
* make : <div widget="many2many_tags" t-att-data="record.your_field_ids.raw_value" model="note.tag"/>
|
|
||||||
*/
|
|
||||||
transform_widget_many2many: function(){
|
|
||||||
var self=this,
|
|
||||||
arg={};
|
|
||||||
// select all widget
|
|
||||||
self.$el.find("[widget='many2many_tags']").each(function(){
|
|
||||||
var model = $(this).attr("model"),
|
|
||||||
data = $(this).attr("data"),
|
|
||||||
list = data.split(",");
|
|
||||||
//select all id (per model)
|
|
||||||
if(!arg[model]) arg[model]=[];
|
|
||||||
for(var t=0;t<list.length;t++) if(list[t]!="") arg[model].push( list[t] );
|
|
||||||
});
|
|
||||||
|
|
||||||
// only one request by model
|
|
||||||
for(var model in arg){
|
|
||||||
if(arg[model].length>0){
|
|
||||||
var dataset = new instance.web.DataSetSearch(self, model, self.session.context);
|
|
||||||
dataset.name_get(_.uniq( arg[model] )).then(
|
|
||||||
function(result) {
|
|
||||||
for(var t=0;t<result.length;t++){
|
|
||||||
self.$el.find("[widget='many2many_tags'][model='" + model + "']")
|
|
||||||
.filter(function(){ return this.getAttribute("data").match(new RegExp('(^|,)'+result[t][0]+'(,|$)')); })
|
|
||||||
.append('<span class="oe_tag" data-list_id="' + result[t][0] +'"">'+result[t][1]+'</span>');
|
|
||||||
}
|
|
||||||
},
|
|
||||||
function(r){
|
|
||||||
console.log('Error',r);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
do_add_record: function() {
|
do_add_record: function() {
|
||||||
this.dataset.index = null;
|
this.dataset.index = null;
|
||||||
this.do_switch_view('form');
|
this.do_switch_view('form');
|
||||||
|
@ -385,8 +350,6 @@ instance.web_kanban.KanbanView = instance.web.View.extend({
|
||||||
} else {
|
} else {
|
||||||
this.$el.find('.oe_kanban_draghandle').removeClass('oe_kanban_draghandle');
|
this.$el.find('.oe_kanban_draghandle').removeClass('oe_kanban_draghandle');
|
||||||
}
|
}
|
||||||
|
|
||||||
this.transform_widget_many2many();
|
|
||||||
},
|
},
|
||||||
on_record_moved : function(record, old_group, old_index, new_group, new_index) {
|
on_record_moved : function(record, old_group, old_index, new_group, new_index) {
|
||||||
var self = this;
|
var self = this;
|
||||||
|
@ -403,7 +366,7 @@ instance.web_kanban.KanbanView = instance.web.View.extend({
|
||||||
var data = {};
|
var data = {};
|
||||||
data[this.group_by] = new_group.value;
|
data[this.group_by] = new_group.value;
|
||||||
this.dataset.write(record.id, data, {}, function() {
|
this.dataset.write(record.id, data, {}, function() {
|
||||||
//self.do_reload();
|
record.do_reload();
|
||||||
new_group.do_save_sequences();
|
new_group.do_save_sequences();
|
||||||
}).fail(function(error, evt) {
|
}).fail(function(error, evt) {
|
||||||
evt.preventDefault();
|
evt.preventDefault();
|
||||||
|
@ -795,7 +758,7 @@ instance.web_kanban.KanbanRecord = instance.web.Widget.extend({
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
if (this.$el.find('.oe_kanban_global_click,.oe_kanban_global_click_edit').length) {
|
if (this.$el.find('.oe_kanban_global_click').length) {
|
||||||
this.$el.on('click', function(ev) {
|
this.$el.on('click', function(ev) {
|
||||||
if (!ev.isTrigger && !$(ev.target).data('events')) {
|
if (!ev.isTrigger && !$(ev.target).data('events')) {
|
||||||
var trigger = true;
|
var trigger = true;
|
||||||
|
@ -836,15 +799,8 @@ instance.web_kanban.KanbanRecord = instance.web.Widget.extend({
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
/* actions when user click on the block with a specific class
|
|
||||||
* open on normal view : oe_kanban_global_click
|
|
||||||
* open on form/edit view : oe_kanban_global_click_edit
|
|
||||||
*/
|
|
||||||
on_card_clicked: function(ev) {
|
on_card_clicked: function(ev) {
|
||||||
if(this.$el.find('.oe_kanban_global_click_edit').size()>0)
|
this.view.open_record(this.id);
|
||||||
this.do_action_edit();
|
|
||||||
else
|
|
||||||
this.do_action_open();
|
|
||||||
},
|
},
|
||||||
setup_color_picker: function() {
|
setup_color_picker: function() {
|
||||||
var self = this;
|
var self = this;
|
||||||
|
|
Loading…
Reference in New Issue