Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
1 Răspunde
3377 Vizualizări

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)"
/>











Imagine profil
Abandonează
Cel mai bun răspuns

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

Imagine profil
Abandonează
Autor

Thanks it works

Related Posts Răspunsuri Vizualizări Activitate
1
mar. 25
7239
1
iul. 24
1479
3
ian. 24
2672
1
mar. 24
1317
0
mar. 24
1608