Skip to Content
Menu
This question has been flagged
1 Reply
2972 Views

Hi There,

I want to change the label "As of" by inheriting this.

How can I do this?

Here's the full code:

























class="{ 'filter_date_single_today_hook': true, 'selected': (controller.options.date.filter == 'today') }"
onSelected="() => this.updateFilter('date.filter', 'today')"
>
Today


class="{ 'filter_date_single_last_month_hook': true, 'selected': (controller.options.date.filter == 'last_month') }"
onSelected="() => this.updateFilter('date.filter', 'last_month')"
>
End of Last Month


class="{ 'filter_date_single_last_quarter_hook': true, 'selected': (controller.options.date.filter == 'last_quarter') }"
onSelected="() => this.updateFilter('date.filter', 'last_quarter')"
>
End of Last Quarter


class="{ 'filter_date_single_last_year_hook': true, 'selected': (controller.options.date.filter == 'last_year') }"
onSelected="() => this.updateFilter('date.filter', 'last_year')"
>
End of Last Financial Year




class="{ 'filter_date_this_month_hook': true, 'selected': (controller.options.date.filter == 'this_month') }"
onSelected="() => this.updateFilter('date.filter', 'this_month')"
>
This Month


class="{ 'filter_date_this_quarter_hook': true, 'selected': (controller.options.date.filter == 'this_quarter') }"
onSelected="() => this.updateFilter('date.filter', 'this_quarter')"
>
This Quarter


class="{ 'filter_date_this_year_hook': true, 'selected': (controller.options.date.filter == 'this_year') }"
onSelected="() => this.updateFilter('date.filter', 'this_year')"
>
This Financial Year




class="{ 'filter_date_range_last_month_hook': true, 'selected': (controller.options.date.filter == 'last_month') }"
onSelected="() => this.updateFilter('date.filter', 'last_month')"
>
Last Month


class="{ 'filter_date_range_last_quarter_hook': true, 'selected': (controller.options.date.filter == 'last_quarter') }"
onSelected="() => this.updateFilter('date.filter', 'last_quarter')"
>
Last Quarter


class="{ 'filter_date_range_last_year_hook': true, 'selected': (controller.options.date.filter == 'last_year') }"
onSelected="() => this.updateFilter('date.filter', 'last_year')"
>
Last Financial Year






class="dropdown-item date"
t-att-class="(controller.options.date.filter == 'custom') ? 'selected' : ''"
>

type="'date'"
value="dateFrom('date')"
onChange="(dateFrom) => this.setDateFrom('date', dateFrom)"
/>


type="'date'"
value="dateTo('date')"
onChange="(dateTo) => this.setDateTo('date', dateTo)"
/>






class="dropdown-item date"
t-att-class="(controller.options.date.filter == 'custom') ? 'selected' : ''"
>



type="'date'"
value="dateTo('date')"
onChange="(dateTo) => this.setDateTo('date', dateTo)"
/>











Avatar
Discard
Best Answer

Hi,

To inherit the template, try using the below code,

If you want to change 'As of' label inside the dropdown use this code,

<templates>
    <t
 t-inherit="account_reports.AccountReportFilterDate" t-inherit-mode="extension">
<xpath expr="//Dropdown/t[@t-if=&quot;controller.options.date.mode === 'single'&quot;]/div[hasclass('dropdown-item')]/label" position="replace">
            <label class="d-flex align-items-center">

</label>
        </xpath>
    </t>
</templates>


If you want to change the label in the Dropdown use this,


<t t-inherit="account_reports.AccountReportFilterDate" t-inherit-mode="extension">
<xpath expr="//Dropdown/t[@t-set-slot='toggler']" position="replace">
        <t t-set-slot="toggler">
            <i class="fa fa-calendar me-1"/>

<t t-if="controller.options.date.filter === 'custom'">
<t t-if="controller.options.date.mode === 'single'">
                    <t t-esc="`Date: ${ localeDateTo('date') }`"/>
                </t>

<t t-if="controller.options.date.mode === 'range'">
                    <t t-esc="`From: ${ localeDateFrom('date') } to: ${ localeDateTo('date') }`"/>
                </t>
            </t>
            <t t-else="">
<t t-if="controller.options.date.string">
                    <t t-esc="'custom'"/>
                </t>
            </t>
        </t>
    </xpath>
</t>


Hope it helps

Avatar
Discard
Author

Thanks it works

Related Posts Replies Views Activity
1
Mar 25
7010
1
Jul 24
1229
3
Jan 24
2303
1
Mar 24
1041
0
Mar 24
1304