Use the view_ids attribute to open the Many2One target from tree view
Closes #14327
This commit is contained in:
1 parent
1f6403ba78
commit
0e5d2fc391
1 file changed
+6
@@ -2768,12 +2768,18 @@
|
||||
cell = cell.children('a');
|
||||
cell.unbind('click');
|
||||
Sao.View.Tree.Many2OneColumn._super.update_text.call(this, cell, record);
|
||||
let view_ids = (this.attributes.view_ids || '').split(',');
|
||||
if (!jQuery.isEmptyObject(view_ids)) {
|
||||
// Remove the first tree view as mode is form only
|
||||
view_ids.shift();
|
||||
}
|
||||
cell.click(event => {
|
||||
event.stopPropagation();
|
||||
var params = {};
|
||||
params.model = this.attributes.relation;
|
||||
params.res_id = this.field.get(record);
|
||||
params.mode = ['form'];
|
||||
params.view_ids = view_ids;
|
||||
params.name = this.attributes.string;
|
||||
params.context = this.field.get_context(record);
|
||||
Sao.Tab.create(params);
|
||||
|
||||
Reference in new issue
Block a user