Use the view_ids attribute to open the Many2One target from tree view

Closes #14327
(grafted from 34ffdbb7306e9d8158a91e056b0e06fe17b63091)

--HG--
branch : 7.0
This commit is contained in:
Cédric Krier committed 2025-10-28 17:17:31 +01:00
1 parent 14b26b3cf9
commit 53b16904d4
1 file changed
+6
+6
View File
@@ -2605,12 +2605,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);