简体   繁体   中英

Filter Partners Accounting Report [Odoo12]

I am trying to filter the partner list on an odoo accounting report (Partner Ledger) located on Accounting-> Reporting -> Partner Ledger

在此处输入图像描述

I need to set default list to display only customer partner (customer_rank = 1),not all contacts as it is displaying right now.

Is there a way to filter that list?

I was trying to find the view displayed below, but I couldn't find any view to change the context or domain.

在此处输入图像描述

Also I tried through JS but I do not see any way to add domain on button (account_reports module).

<div class="col-12">
  <t t-if="options.get('partner_ids') != None">
    Partners:
    <t t-set="res_partner_value">All</t>
    <t t-foreach="options['selected_partner_ids']" t-as="partner_name">
      <t t-set="res_partner_value" t-value="''"/>
      <t t-esc="partner_name"/>
    </t>
    <t t-esc="res_partner_value"/>
  </t>
</div>

I was able to find the solution:

There is a function on the js file, where you can pass a domain field when creating a widget:

name: fieldName,
relation: fieldInfo.modelName,
type: 'many2many',
domain: "[('customer_rank','=',1)]",
value: fieldInfo.value

After adding that, the partner list is filtered as expected.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM