Allow to edit Many2One from tree view

issue6848
review43771002
This commit is contained in:
Cédric Krier
2017-11-27 22:03:16 +01:00
parent 6a472c1384
commit d5e6a6b4a4
2 changed files with 23 additions and 1 deletions
+1
View File
@@ -1,3 +1,4 @@
* Allow to edit Many2One from tree view
* Use translated values when exporting Reference and Selection fields
Version 4.6.0 - 2017-10-30
+22 -1
View File
@@ -1455,7 +1455,28 @@
});
Sao.View.Tree.Many2OneColumn = Sao.class_(Sao.View.Tree.CharColumn, {
class_: 'column-many2one'
class_: 'column-many2one',
get_cell: function() {
var cell = Sao.View.Tree.Many2OneColumn._super.get_cell.call(this);
cell.append(jQuery('<a/>', {
'href': '#',
}));
return cell;
},
update_text: function(cell, record) {
cell = cell.children('a');
cell.unbind('click');
Sao.View.Tree.Many2OneColumn._super.update_text.call(this, cell, record);
cell.click(function(event) {
event.stopPropagation();
var params = {};
params.model = this.attributes.relation;
params.res_id = this.field.get(record);
params.mode = ['form'];
params.name = this.attributes.string;
Sao.Tab.create(params);
}.bind(this));
}
});
Sao.View.Tree.One2OneColumn = Sao.class_(Sao.View.Tree.Many2OneColumn, {