Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
3454 Lượt xem

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











Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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

Ảnh đại diện
Huỷ bỏ
Tác giả

Thanks it works

Bài viết liên quan Trả lời Lượt xem Hoạt động
Div t-name Inherit Đã xử lý
1
thg 3 25
7302
1
thg 7 24
1565
3
thg 1 24
2739
1
thg 3 24
1361
0
thg 3 24
1658