Trợ giúp

0

How to add filter in odoo11 E dynamic account report

Avatar
Renuka Sawai

Hi all,
I want to add Partner filter type with values customer and vendor in partner ledger dynamic report, after account .


For that I am inheriting account_report.search_template, but it is not reflecting custom changes after inheritance.
Please check code and let me know what modification required.
Thanks in advance

<template id="search_template_partner_type">
<a type="button" class="dropdown-toggle" data-toggle="dropdown">
<span class="fa fa-user"/>
Partner type:
<t t-set="partner_value" t-value="'All'"/>
<t
t-foreach="options['partner_type']" t-as="p">
<t
t-if="p.get('selected') == True">
<t
t-set="partner_value" t-value="''"/>
<t
t-esc="p.get('name')"/>
</t>
</t>
<t
t-esc="partner_value"/>
<span
class="caret"/>
</a>
<ul
class="dropdown-menu o_filters_menu" role="menu">
<t
t-foreach="options['partner_type']" t-as="p">
<li
t-att-title="p.get('name')" t-att-data-id="p.get('id')" data-filter="partner_type" class="js_account_report_choice_filter"><a><t t-esc="p.get('name')"/>
</a>
</li>
</t>
</ul>

</template>
<--Inheriting base template-->
<template
id="template_search_partner_type_report" inherit_id="account_reports.search_template">
<xpath
expr="//div[@class='account_reports.search_template_account_type']" position="after">
<div class="btn-group o_dropdown o_account_reports_filter_partner_type">
<t t-call="tax_report.search_template_partner_type" />
</div> </xpath>

</template>

Ảnh đại diện
Huỷ bỏ
1 Trả lời
0
Avatar
Renuka Sawai
Best Answer

This worked by changing xpath:
Thank you.

<template id="template_search_partner_type_report" inherit_id="account_reports.search_template" >
<xpath expr="//div[@class='btn-group o_dropdown o_account_reports_filter_analytic']" position="after">
<div class="btn-group o_dropdown o_account_reports_filter_partner_type" t-if="options.get('partner_type') != None">
<t t-call="tax_report.search_template_partner_type" />
</div>
</xpath>
</template>
Ảnh đại diện
Huỷ bỏ