From 0e5d2fc39196af003f8a1da246edfb23220a6851 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Tue, 28 Oct 2025 17:17:31 +0100 Subject: [PATCH] Use the view_ids attribute to open the Many2One target from tree view Closes #14327 --- sao/src/view/tree.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sao/src/view/tree.js b/sao/src/view/tree.js index 30acf206ff..b4f3a78806 100644 --- a/sao/src/view/tree.js +++ b/sao/src/view/tree.js @@ -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);