简体   繁体   English

筛选合作伙伴会计报告 [Odoo12]

[英]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我正在尝试在位于Accounting-> Reporting -> Partner Ledger的 odoo 会计报告(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.我需要将默认列表设置为仅显示客户合作伙伴(customer_rank = 1),而不是现在显示的所有联系人。

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).我也尝试过 JS,但我没有看到任何在按钮(account_reports 模块)上添加域的方法。

<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: js文件上有一个function,创建widget的时候可以传入domain字段:

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

After adding that, the partner list is filtered as expected.添加后,合作伙伴列表按预期过滤。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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