refactor: Split combined list and pivot view patches into dedicated list_view_patch.xml and pivot_view_patch.xml files.

This commit is contained in:
Suherdy Yacob 2026-01-07 15:41:54 +07:00
parent a8ce87fe25
commit 0642f7ca84
3 changed files with 18 additions and 17 deletions

View File

@ -19,15 +19,14 @@
'web_decimal_style/static/src/views/fields/monetary_field.xml',
'web_decimal_style/static/src/views/purchase_dashboard.xml',
'web_decimal_style/static/src/views/purchase_dashboard_patch.js',
'web_decimal_style/static/src/views/list_pivot_patch.xml',
'web_decimal_style/static/src/views/list_view_patch.xml',
],
'web.assets_backend_lazy': [
'web_decimal_style/static/src/views/pivot_view_patch.xml',
],
'web.assets_frontend': [
'web_decimal_style/static/src/css/decimal_style.css',
'web_decimal_style/static/src/core/utils/numbers_patch.js',
'web_decimal_style/static/src/views/fields/formatters_patch.js',
'web_decimal_style/static/src/views/fields/float_field.xml',
'web_decimal_style/static/src/views/fields/monetary_field.xml',
'web_decimal_style/static/src/views/list_pivot_patch.xml',
],
},
'installable': True,

View File

@ -13,16 +13,4 @@
<t t-if="column.type === 'field'" t-out="formatAggregateValue(group, column)"/>
</xpath>
</t>
<!-- Patch Pivot View Cells -->
<t t-inherit="web.PivotRenderer" t-inherit-mode="extension">
<xpath expr="//div[hasclass('o_variation')]" position="attributes">
<attribute name="t-esc"></attribute>
<attribute name="t-out">getFormattedVariation(cell)</attribute>
</xpath>
<xpath expr="//div[hasclass('o_value')]" position="attributes">
<attribute name="t-esc"></attribute>
<attribute name="t-out">getFormattedValue(cell)</attribute>
</xpath>
</t>
</templates>

View File

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<templates xml:space="preserve">
<!-- Patch Pivot View Cells -->
<t t-inherit="web.PivotRenderer" t-inherit-mode="extension">
<xpath expr="//div[hasclass('o_variation')]" position="attributes">
<attribute name="t-esc"></attribute>
<attribute name="t-out">getFormattedVariation(cell)</attribute>
</xpath>
<xpath expr="//div[hasclass('o_value')]" position="attributes">
<attribute name="t-esc"></attribute>
<attribute name="t-out">getFormattedValue(cell)</attribute>
</xpath>
</t>
</templates>