Skip to Content
Odoo เมนู
  • ลงชื่อเข้าใช้
  • ทดลองใช้ฟรี
  • แอป
    การเงิน
    • ระบบบัญชี
    • ระบบการออกใบแจ้งหนี้
    • ระบบบัญชีรายจ่าย
    • ระบบการจัดการข้อมูลผ่านสเปรดชีต (BI)
    • เอกสาร
    • ระบบลงลายเซ็น
    การขาย
    • ลูกค้าสัมพันธ์
    • การขาย
    • POS ร้านค้า
    • POS ร้านอาหาร
    • ระบบสมัครสมาชิก
    • การเช่า
    การจัดการเว็บไซต์
    • เครื่องมือสร้างเว็บไซต์
    • ระบบการขายออนไลน์
    • บล็อก
    • ฟอรั่ม
    • ไลฟ์แชท
    • ระบบการอบรมออนไลน์
    ซัพพลายเชน
    • คลังสินค้า
    • ระบบการผลิต
    • PLM
    • ระบบการจัดซื้อ
    • การซ่อมบำรุง
    • ระบบจัดการคุณภาพ
    ทรัพยากรบุคคล
    • ข้อมูลพนักงาน
    • ระบบสรรหาบุคลากร
    • ระบบการลา
    • การประเมิน
    • ระบบการแนะนำพนักงาน
    • ระบบจัดการยานพาหนะ
    การตลาด
    • โซเชียลมาร์เก็ตติ้ง
    • การตลาดผ่านอีเมล
    • ระบบการตลาดผ่าน SMS
    • ระบบการจัดงานอีเวนต์
    • การตลาดแบบอัตโนมัติ
    • ระบบแบบสำรวจ
    การบริการ
    • โปรเจกต์
    • ระบบบันทึกเวลา
    • ระบบการจัดการบริการภาคสนาม
    • ระบบดูแลช่วยเหลือ
    • การวางแผน
    • การนัดหมาย
    ประสิทธิผล
    • ระบบแสดงความคิดเห็น
    • ระบบการอนุมัติ
    • ไอโอที
    • VoIP
    • คลังข้อมูล
    • WhatsApp
    แอปพลิเคชันของบุคคลที่สาม Odoo สตูดิโอ แพลตฟอร์มคลาวด์ของ Odoo
  • อุตสาหกรรม
    การค้าปลีก
    • ร้านขายหนังสือ
    • ร้านขายเสื้อผ้า
    • ร้านขายเฟอร์นิเจอร์
    • ร้านขายของชำ
    • ร้านขายฮาร์ดแวร์
    • ร้านขายของเล่น
    Food & Hospitality
    • บาร์และผับ
    • ร้านอาหาร
    • อาหารฟาสต์ฟู้ด
    • Guest House
    • ตัวแทนจำหน่ายเครื่องดื่ม
    • Hotel
    อสังหาริมทรัพย์
    • Real Estate Agency
    • บริษัทสถาปัตยกรรม
    • บริษัทรับเหมา
    • การจัดการอสังหาริมทรัพย์
    • การจัดสวน
    • สมาคมเจ้าของอสังหาริมทรัพย์
    ปรึกษา
    • สำนักงานบัญชี
    • Odoo พาร์ทเนอร์
    • เอเจนซี่การตลาด
    • สำนักงานกฎหมาย
    • บริการสรรหาบุคลากร
    • การตรวจสอบและการรับรอง
    ระบบการผลิต
    • Textile
    • เหล็ก
    • เฟอร์นิเจอร์
    • อาหาร
    • Brewery
    • ของขวัญขององค์กร
    สุขภาพ & ฟิตเนส
    • ชมรมกีฬา
    • ร้านขายแว่นตา
    • ฟิตเนส
    • ผู้ประกอบวิชาชีพด้านสุขภาพ
    • ร้านขายยา
    • ร้านทำผม
    Trades
    • ช่างซ่อม
    • ฮาร์ดแวร์และการสนับสนุนด้านไอที
    • ระบบพลังงานแสงอาทิตย์
    • ช่างทำรองเท้า
    • บริการทำความสะอาด
    • HVAC Services
    อื่น ๆ
    • Nonprofit Organization
    • สำนักงานสิ่งแวดล้อม
    • ร้านเช่าป้ายโฆษณา
    • การถ่ายภาพ
    • ร้านเช่าจักรยาน
    • ตัวแทนจำหน่ายซอฟต์แวร์
    Browse all Industries
  • คอมมูนิตี้
    ศึกษา
    • บทเรียน
    • เอกสารกำกับโปรแกรม
    • การรับรอง
    • การฝึกอบรม
    • บล็อก
    • พอดแคสต์
    เพิ่มศักยภาพให้กับการศึกษา
    • โปรแกรมการศึกษา
    • Scale Up! Business Game
    • เยี่ยมชม Odoo
    รับซอฟต์แวร์
    • ดาวน์โหลด
    • เปรียบเทียบรุ่น
    • เผยแพร่
    ทำงานร่วมกัน
    • Github
    • ฟอรั่ม
    • ระบบการจัดงานอีเวนต์
    • การแปล
    • ร่วมเป็นพาร์ทเนอร์
    • Services for Partners
    • ลงทะเบียนเพื่อสร้างบัญชีบริษัทของคุณ
    รับบริการ
    • ค้นหาพาร์ทเนอร์
    • ค้นหานักบัญชี
    • พบกับที่ปรึกษา
    • บริการติดตั้งระบบเพื่อใช้งาน
    • ข้อมูลอ้างอิงลูกค้า
    • การสนับสนุน
    • อัปเกรด
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    รับการสาธิต
  • ราคา
  • ช่วยเหลือ

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • ลูกค้าสัมพันธ์
  • e-Commerce
  • ระบบบัญชี
  • สินค้าคงคลัง
  • PoS
  • โปรเจกต์
  • MRP
All apps
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
All Posts คน เหรียญรางวัล
แท็ก (View all)
odoo accounting v14 pos v15
เกี่ยวกับฟอรั่มนี้
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
All Posts คน เหรียญรางวัล
แท็ก (View all)
odoo accounting v14 pos v15
เกี่ยวกับฟอรั่มนี้
ช่วยเหลือ

Add custom filter in financial reports odoo17

ติดตาม

รับการแจ้งเตือนเมื่อมีกิจกรรมในโพสต์นี้

คำถามนี้ถูกตั้งค่าสถานะ
accountingodoo
3 ตอบกลับ
7577 มุมมอง
อวตาร
Asmaa

I 'm trying to add custom filter to balance sheet report and profit and loss report in odoo 17
I added the following code :



i added this code in filter.xml in this path:
hat_account_report_multi_currency\static\src\components\hat_account_report_multi_currency\filters.xml
and i added te following code in manifest file:
'assets': {
'web.assets_backend': [
'hat_account_report_multi_currency/static/src/components/**/*',
],
},
but there is nothing appears in the report

0
อวตาร
ละทิ้ง
Mahmoud Magdy

Did you find any solution for it ?

Waqas Zia

Has anyone got guide to add in additional data column to the Aged Receivable reports. How does that work out? and how do we add similar dropdown in Aged Receivable reports.

อวตาร
Abdel-Fatah
คำตอบที่ดีที่สุด

Not like this you need to do 3 things in js and xml and py 
i think that you want currency filter will be like 
lets start with js we need extend AccountReportFilters to use our new template which we inherit it to add our new filter
xml like you did 
<?xml version="1.0" encoding="UTF-8" ?>
<templates> 
​<t t-name="your_module_name.ExtendedAccountReportFilters" t- ​ ​inherit="account_reports.AccountReportFiltersCustomizable"> 

​ ​<xpath expr="//div[@id='filter_extra_options']" position="before"> <t t-if="'currency' in controller.options"> 

​ ​ ​<Dropdown togglerClass="'btn btn-secondary'"> <t t-set-slot="toggler"> <i class="fa fa-folder-open me-1"/>Currencies </t> <MultiRecordSelector t-props="getMultiRecordSelectorProps('res.currency', 'currency_ids')"/> 

​ ​</Dropdown> 

​</t> 
 </xpath> 
 </t>
</templates>

and in js 

/** @odoo-module **/
import { AccountReport } from "@account_reports/components/account_report/account_report";
import { AccountReportFilters } from "@account_reports/components/account_report/filters/filters";
export class ExtendedAccountReportFilters extends AccountReportFilters { 
  ​static template = 'your_module_name.ExtendedAccountReportFilters';

  ​setup() { 
  ​ ​super.setup();
  ​}
}
AccountReport.registerCustomComponent(ExtendedAccountReportFilters);

	​	​	​this new component to make odoo use our new template 
lets go to python side 
first inherit account.report 

class AccountReport(models.Model): 
​ _inherit = 'account.report'
​ filter_currency = fields.Boolean(string="Currencies",compute=lambda x: x._compute_report_option_filter('filter_currency'), readonly=False, store=True, depends=['root_report_id', 'section_main_report_ids'],)
##################################################### 
OPTIONS: currencys 
####################################################
​​def _init_options_currency(self, options, previous_options=None): 
​ ​if not self.filter_currency: 
​ ​ ​return 
​ ​options['currency'] = True 
​ ​previous_currency_ids = previous_options and previous_options.get('currency_ids') or []
​ ​​selected_currency_ids = [int(currency) for currency in previous_currency_ids]  
​ ​selected_currencys = selected_currency_ids and self.env['res.currency'].with_context(active_test=False).search([('id', 'in', selected_currency_ids)]) or self.env['res.currency'] ​ ​ ​
​ ​options['selected_currency_ids'] = selected_currencys.mapped('name')  ​
​@api.model 
​def _get_options_currency_domain(self, options): 
​ ​​domain = [] 
​ ​if options.get('currency_ids'): 
​ ​ ​ currency_ids = [int(currency) for currency in options['currency_ids']] ​ ​ ​ ​               
​ ​ ​domain.append(('currency_id', 'in', currency_ids)) ​ ​ 
​ ​return domain
​​def _get_options_domain(self, options, date_scope): 
​ ​domain = super()._get_options_domain(options, date_scope) 
​ ​domain += self._get_options_city_domainoptions)  
​ ​domain += self._get_options_currency_domain(options) 
​ ​return domain

and in report you want we will inherit it's handler and override _get_custom_display_config func like to make odoo you our component


from odoo import models, fields, api 
class AccountPartnerLedgerReportHandler(models.AbstractModel): 
​_inherit = 'account.partner.ledger.report.handler' ​
​def _get_custom_display_config(self): 
​ ​return { 'css_custom_class': 'partner_ledger',
​ ​ ​ ​'templates': ​{'AccountReportLineName':'account_reports.PartnerLedgerLineName',}, 
​ ​ ​ ​ 'components': {'AccountReportFilters': 'your_module_name.ExtendedAccountReportFilters',}}
 
last thing in in account.report form we need add currency_filter field to check it to show filter

<?xml version="1.0" encoding="utf-8"?>
<odoo> 
 <!-- View account.report form --> 
​<record id="view_account_report_form" model="ir.ui.view"> 
​<field name="name">view.account.report.form</field> 
​<field name="model">account.report</field> 
​<field name="inherit_id" ref="account_reports.account_report_form"/> 
​<field name="arch" type="xml"> 
​ ​<xpath expr="//field[@name='filter_partner']" position="after"> 
​ ​​<field name="filter_currency" /> 
​ ​</xpath> 
​</field> 
​ </record>
</odoo>
0
อวตาร
ละทิ้ง
อวตาร
Gracious Joseph
คำตอบที่ดีที่สุด

From your screenshot and description, you are trying to add a custom dropdown filter in financial reports like the Balance Sheet and Profit and Loss reports in Odoo 17. However, it seems the filter is not appearing as expected. Here’s how you can troubleshoot and implement it correctly:

1. Verify the Inherited Template

You are inheriting the account_reports.AccountReportFiltersCustomizable template, which is correct. Ensure that:

  • The template ID is correct.
  • The XPath expression accurately targets the desired location in the template.

Your XPath:

<xpath expr="//div[@id='filter_date']" position="before">

Checklist:

  • Open the Odoo developer tools in your browser.
  • Inspect the DOM structure of the filters section in the financial report to confirm the filter_date ID exists.
  • Ensure there are no typos or missing elements.

If the ID filter_date is dynamic or not found, try targeting a broader or adjacent parent element.

Example:

<xpath expr="//div[contains(@class, 'o_account_reports_filter')]//div[1]" position="before">

2. Ensure the Dropdown Component is Correct

You are using a Dropdown component, which appears to be a custom or Odoo-provided widget. Verify that:

  • The Dropdown component is correctly defined in your codebase.
  • Any dependencies required by the component are loaded properly.

For debugging, replace the dropdown with static HTML to check if it appears:

<div id="curr" class="curr">
    <button class="btn btn-secondary">Test Dropdown</button>
</div>

If this appears, the issue is likely with the Dropdown component configuration.

3. Validate Asset Loading

Ensure the assets are correctly declared and loaded:

  • Manifest File Configuration:
    'assets': {
        'web.assets_backend': [
            'hat_account_report_multi_currency/static/src/components/**/*',
        ],
    },
    
    Confirm the path matches your file structure. The wildcard **/* includes all files under components.
  • Rebuild Odoo Assets: After making changes to the manifest, rebuild assets to ensure they are properly loaded:
    ./odoo-bin -c odoo.conf --dev=assets
    
  • Check Browser Console: Open the browser developer tools and check for errors or missing assets.

4. Confirm Template Usage

The financial reports might use specific rendering logic for filters. Confirm that:

  • The account_reports.AccountReportFiltersCustomizable template is used for Balance Sheet and Profit and Loss reports.
  • The inheritance chain is correctly applied.

5. Test Component Integration

Add debugging logs or a simple placeholder message to verify the component is rendered:

<div id="curr" class="curr">
    <p>Custom filter test message</p>
</div>

If this doesn’t appear, your XPath or asset declaration might be incorrect.

6. Add the Custom Filter Logic

If the dropdown is successfully displayed but doesn’t affect the report, implement the filter logic in the corresponding account.report model.

For example:

  1. Add a Field for the Filter: Add a field to handle the filter's value in the backend:
    class AccountReport(models.AbstractModel):
        _inherit = 'account.report'
    
        filter_currency = fields.Many2one('res.currency', string="Currency Filter")
    
  2. Update the Report Values: Override the _get_report_values method to include the custom filter's logic:
    def _get_report_values(self, docids, data):
        report_values = super()._get_report_values(docids, data)
        if data.get('filter_currency'):
            # Add custom filtering logic here
            report_values['currency_filter'] = data['filter_currency']
        return report_values
    
  3. Pass Filter Value from Frontend to Backend: Use JavaScript to handle the dropdown selection and pass the selected value to the report.

7. Testing

  1. Reload the Odoo server and activate developer mode.
  2. Check if the filter appears in the financial reports.
  3. Test the functionality by applying different filter values.

Common Debugging Tips:

  • Check Logs: Look for any server-side or frontend errors in the browser console or Odoo logs.
  • Inspect DOM: Ensure your XML changes are reflected in the DOM.
  • Minimal Testing: Use a simple <div> to verify if the XPath and template inheritance work.

Let me know if you need further assistance!

-1
อวตาร
ละทิ้ง
สนุกกับการพูดคุยนี้ใช่ไหม? เข้าร่วมเลย!

สร้างบัญชีวันนี้เพื่อเพลิดเพลินไปกับฟีเจอร์พิเศษและมีส่วนร่วมกับคอมมูนิตี้ที่ยอดเยี่ยมของเรา!

ลงชื่อ
Related Posts ตอบกลับ มุมมอง กิจกรรม
concatenate another field with label in account.move.line แก้ไขแล้ว
accounting odoo
อวตาร
อวตาร
1
ส.ค. 24
5022
Aged Receivable report total amount is different in general ledger account odoo14
accounting odoo
อวตาร
0
ก.ย. 21
4323
Problems installing chart of accounts
accounting odoo
อวตาร
0
มี.ค. 15
6160
Accounting app on localhost แก้ไขแล้ว
accounting installation odoo
อวตาร
อวตาร
อวตาร
อวตาร
3
พ.ค. 25
7890
Odoo 9 - Back up entire accounting / sales / etc
accounting backup odoo
อวตาร
อวตาร
2
พ.ค. 24
1946
คอมมูนิตี้
  • บทเรียน
  • เอกสารกำกับโปรแกรม
  • ฟอรั่ม
โอเพนซอร์ส
  • ดาวน์โหลด
  • Github
  • Runbot
  • การแปล
บริการ
  • โฮสติ้ง odoo.sh เซิร์ฟเวอร์
  • การสนับสนุน
  • อัปเกรด
  • การพัฒนาที่กำหนดเอง
  • การศึกษา
  • ค้นหานักบัญชี
  • ค้นหาพาร์ทเนอร์
  • ร่วมเป็นพาร์ทเนอร์
เกี่ยวกับเรา
  • บริษัทของเรา
  • ทรัพย์สินในรูปของเครื่องหมายการค้า
  • ติดต่อเรา
  • งาน
  • ระบบการจัดงานอีเวนต์
  • พอดแคสต์
  • บล็อก
  • ลูกค้า
  • กฎหมาย • ความเป็นส่วนตัว
  • ความปลอดภัย
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo เป็นชุดแอปธุรกิจแบบเปิดที่ครอบคลุมทุกความต้องการของบริษัทของคุณ อาธิ CRM eCommerce ระบบบัญชี ระบบสินค้าคงคลัง ระบบการขายหน้าร้าน โปรเจกต์ และ อีกมากมาย

ความเหนือกว่าอันเป็นเอกลักษณ์ของ Odoo คือการใช้งานที่ง่ายดายและผสานการทำงานอย่างสมบูรณ์แบบในเวลาเดียวกัน

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now