Many2One widget look in editable tree (Tryton 5 Desktop Client)

Editable tree has a lot of fields, each field is a Many2One widget (not widget=“selection”).
Each of these widgets can contain a two-character code so the columns are narrow. When editing the widgets, codes are not visible - only “Open the record” and “Clear the field” small buttons can be seen:
many2one_tree
“Open the record” and “Clear the field” buttons were not visible in editable tree in Tryton 4.
How can we hide these buttons in Tryton 5?

P.S. Manually changing view tree width is not an option for us. :slightly_smiling_face:

You can not.
But you can set a width for each field in the tree view.

It’s a pity. We were happy with Many2One widget functionality in editable tree in Tryton 4.

There are too many fields in each row.
If we increase the width of the fields, many of them will not be visible on the screen.

But if we set widget="selection" during editing Many2One widget it is expanding (even if the column is narrow) :
many2one_selection

Why the window for editing Many2One widget does not expand (as on the first screenshot) if we do not set widget="selection"?

Because PopdownMixin set a width chars on the widget when the Selection is started to edit while GenericText does not. We may implement a default width char on GenericText like we have for form widgets.

It would be much better to use not the default width, but the width specified by the developer in the xml.
That was exactly how it was implemented in Tryton 4 form widgets, right?

Yes by default width, I mean the one that the view defines as default.

No, nothing changed there.

So the developer will be able to set the default width or not?

In Tryton 4 we could set any width of a widget in a form view using width attribute.
In Tryton 5 we cannot set the width of the widget less than a certain minimum value.

Yes in the XML and if there are no value in the XML, the client will take the default for the type of field.

First, there is no such thing as Tryton 4 and Tryton 5. A series is always two numbers.
Now, I do not know what you are referring to because the all discussion was about editable tree, never form.

Yes, we are talking about editable tree.
But you was the first to mention the form: :slightly_smiling_face:

“Patch” for removing “Open the record” and “Clear the field” buttons from Many2One widget in editable tree:

Index: tryton/gui/window/view_form/view/list_gtk/widget.py
===================================================================
--- a/tryton/gui/window/view_form/view/list_gtk/widget.py
+++ b/tryton/gui/window/view_form/view/list_gtk/widget.py
@@ -697,8 +697,8 @@
                     record, self.value_from_id(model, None, ''))
 
             if self.has_target(field.get(record)):
-                icon1, tooltip1 = 'tryton-open', _("Open the record <F2>")
-                icon2, tooltip2 = 'tryton-clear', _("Clear the field <Del>")
+                icon1, tooltip1 = None, ''
+                icon2, tooltip2 = None, ''
             else:
                 icon1, tooltip1 = None, ''
                 icon2, tooltip2 = 'tryton-search', _("Search a record <F2>")

After the patching you need to build Tryton client.