details:   https://code.tryton.org/tryton/commit/34ffdbb7306e
branch:    default
user:      Cédric Krier <[email protected]>
date:      Tue Oct 28 17:17:31 2025 +0100
description:
        Use the view_ids attribute to open the Many2One target from tree view

        Closes #14327
diffstat:

 sao/src/view/tree.js |  6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diffs (22 lines):

diff -r 70ac0802a8b4 -r 34ffdbb7306e sao/src/view/tree.js
--- a/sao/src/view/tree.js      Thu Oct 23 19:23:09 2025 +0200
+++ b/sao/src/view/tree.js      Tue Oct 28 17:17:31 2025 +0100
@@ -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);

Reply via email to