Skip to Content
Menu
This question has been flagged
888 Rodiniai

I did override (as an extension) default web.ListRenderer template and is working fine but only in tree views.

O2M fields defined as tree inside a form view do not reflect the changes in the ListRenderer template override.

An an example, I have created a module which allows definition of much more complex aggregates (displayed in the tree footer), with a lot of options to calculate, filter aso based on the visible / loaded records.

And of course I need this to be available globally on any tree (based on some custom configuration options) so I had to path ListRenderer component and it's template.

Everything works fine except the renderer template overrides inside form views.

Below is the list renderer template override I did to conditionally remove the .o_list_number class on the aggregate fields (as in some cases I need to be left aligned or to apply custom classes passed from the view options)

<templates xml:space="preserve">
<t t-name="tdo_base_tree_summary.ListRenderer" t-inherit="web.ListRenderer" t-inherit-mode="extension">
<xpath expr="//tfoot[hasclass('o_list_footer')]//td[@t-if='aggregate']" position="attributes">
<attribute name="class" remove="o_list_number" separator=" "/>
<attribute name="t-attf-class">#{!aggregate.isNaN ? 'o_list_number' : ''} #{aggregate.class}</attribute>
</xpath>
</t>
</templates>


Portretas
Atmesti