Files
odoo_source/addons/hr_expense
Achraf (abz) 050a17de3f [FIX] hr_expense: Allow users to use optional_column
Since https://github.com/odoo/odoo/pull/120915

Steps:
	- Install `web_studio` and `hr_expense`
	- Open Expense/list view
	- click on optional column
	- Traceback

The error occurs because the dropdown needs the id of the view list in order to "hook" onto it.
This unique id is added via a `t-att-class` here

https://github.com/odoo/odoo/blob/saas-16.3/addons/web/static/src/views/list/list_renderer.xml#L7

and is used by the dropdown here

https://github.com/odoo/odoo/blob/saas-16.3/addons/web/static/src/views/list/list_renderer.xml#L50

The problem here is that the hr_expense module inherits from `web.ListRenderer` to add some classes to `o_list_renderer` with this

``xml
<xpath expr="//div[hasclass('o_list_renderer')]" position="attributes">
            <attribute name="t-att-class">'hr_expense h-auto o_forbidden_tooltip_parent'</attribute>
        </xpath>
```

but by doing so, the t-att-class of `hr_expense.ListRenderer` overwrites that of `web.ListRenderer`.

One solution was to do as the documents application does

https://github.com/odoo/enterprise/blob/saas-16.3/documents/static/src/views/list/documents_list_renderer.xml#L5

This does not override the `t-att-class`

opw-3858726

closes odoo/odoo#161846

X-original-commit: e4f222f0f05565301515ca020de3ae19c35bef06
Signed-off-by: de Wouters de Bouchout Jean-Benoît (jbw) <jbw@odoo.com>
Signed-off-by: Achraf Ben Azzouz (abz) <abz@odoo.com>
2024-04-16 07:02:56 +00:00
..