İçereği Atla
Odoo Menü
  • Portal
  • Ücretsiz deneyin
  • Uygulamalar
    Finans
    • Muhasebe
    • Faturalama
    • Masraf Yönetimi
    • Elektronik Çizelge (BI)
    • Belgeler
    • İmza
    Satış
    • Müşteri İlişkileri Yönetimi (CRM)
    • Satış
    • Satış Noktası Mağaza
    • Satış Noktası Restoran
    • Abonelikler
    • Kiralama
    Web Sitesi
    • Web Sitesi Oluşturucu
    • eTicaret
    • Blog
    • Forum
    • Canlı Sohbet
    • eÖğrenme
    Tedarik Zinciri
    • Envanter
    • Üretim
    • Ürün Yaşam Döngüsü Yönetimi
    • Satın Alma
    • Bakım
    • Kalite
    İnsan Kaynakları
    • Çalışanlar
    • İşe Alım
    • İzin
    • Değerlendirme
    • Referans
    • Filo Yönetimi
    Pazarlama
    • Sosyal Medyada Pazarlama
    • E-posta ile Pazarlama
    • SMS ile Pazarlama
    • Etkinlikler
    • Pazarlama Otomasyonu
    • Anket
    Hizmetler
    • Proje Yönetimi
    • Çalışma Çizelgeleri
    • Saha Hizmeti
    • Yardım Masası
    • Planlama
    • Randevular
    Verimlilik
    • Sohbet
    • Onay
    • Nesnelerin İnterneti
    • VoIP
    • Bilgi Bankası
    • WhatsApp
    Üçüncü taraf uygulamalar Odoo Stüdyo Odoo Bulut Platformu
  • Sektörler
    Perakende satış
    • Kitapçı
    • Giyim Mağazası
    • Mobilya Mağazası
    • Gıda Marketi
    • Hırdavat Dükkanı
    • Oyuncak Dükkanı
    Gıda ve Konaklama
    • Bar ve Pub
    • Restoran
    • Fast Food Restoranı
    • Konuk Evi
    • İçecek Distribütörü
    • Otel
    Gayrimenkul
    • Emlak Acentesi
    • Mimarlık Firması
    • İnşaat
    • Emlak Yönetimi
    • Bahçe Tasarımı
    • Mülk Sahipleri Derneği
    Uzmanlık
    • Muhasebe Firması
    • Odoo Partner
    • Pazarlama Ajansı
    • Hukuk Firması
    • Yetenek Kazanımı
    • Denetim ve Belgelendirme
    Üretim
    • Tekstil
    • Metal
    • Mobilyalar
    • Gıda
    • Bira fabrikası
    • Kurumsal Hediye
    Sağlık ve Spor
    • Spor Kulübü
    • Optik Mağazası
    • Fitness Merkezi
    • Sağlıklı Yaşam Merkezi
    • Eczane
    • Kuaför Salonu
    Ticaret
    • Tamirci
    • BT Donanım & Destek
    • Güneş Enerjisi Sistemleri
    • Ayakkabı İmalatçısı
    • Temizlik Hizmetleri
    • HVAC Hizmetleri
    Diğerleri
    • Kar Amacı Gütmeyen Kuruluş
    • Çevre Ajansı
    • Reklam Panosu Kiralama
    • Fotoğrafçılık
    • Bisiklet Kiralama
    • Yazılım Bayisi
    Tüm Sektörlere Göz Atın
  • Topluluk
    Öğrenim
    • Eğitim Araçları
    • Dokümantasyon
    • Sertifikasyonlar
    • Eğitim Etkinlikleri
    • Blog
    • Podcast
    Eğitim ve Gelişim
    • Eğitim Programı
    • Scale Up! İşletme Oyunu
    • Odoo'yu Ziyaret Edin
    Yazılım
    • İndirin
    • Sürümleri Kıyaslayın
    • Sürümler
    İş Birliği
    • Github
    • Forum
    • Etkinlikler
    • Çeviriler
    • Partner Olun
    • Partnerler için Hizmetler
    • Muhasebe Firmanızı Kaydettirin
    Hizmetler
    • Partner Bulun
    • Muhasebeci Bulun
    • Bir danışmanla görüşün
    • Kurulum Hizmetleri
    • Müşteri Referansları
    • Destek
    • Sürüm Yükseltme
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Demo randevusu alın
  • Fiyatlandırma
  • Yardım

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

  • Müşteri İlişkileri Yönetimi
  • e-Commerce
  • Muhasebe
  • Envanter
  • PoS
  • Proje Yönetimi
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Etiketler (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Etiketler (View all)
odoo accounting v14 pos v15
About this forum
Yardım

Add custom filter in financial reports odoo17

Abone Ol

Get notified when there's activity on this post

Bu soru işaretlendi
accountingodoo
3 Cevaplar
7431 Görünümler
Avatar
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
Avatar
Vazgeç
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.

Avatar
Abdel-Fatah
En İyi Yanıt

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
Avatar
Vazgeç
Avatar
Gracious Joseph
En İyi Yanıt

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
Avatar
Vazgeç
Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Üye Ol
İlgili Gönderiler Cevaplar Görünümler Aktivite
concatenate another field with label in account.move.line Çözüldü
accounting odoo
Avatar
Avatar
1
Ağu 24
4957
Aged Receivable report total amount is different in general ledger account odoo14
accounting odoo
Avatar
0
Eyl 21
4278
Problems installing chart of accounts
accounting odoo
Avatar
0
Mar 15
6096
Accounting app on localhost Çözüldü
accounting installation odoo
Avatar
Avatar
Avatar
Avatar
3
May 25
7827
Odoo 9 - Back up entire accounting / sales / etc
accounting backup odoo
Avatar
Avatar
2
May 24
1917
Topluluk
  • Eğitim Araçları
  • Dokümantasyon
  • Forum
Açık Kaynak
  • İndirin
  • Github
  • Runbot
  • Çeviriler
Hizmetler
  • Odoo.sh Hosting
  • Destek
  • Sürüm Yükseltme
  • Özel Geliştirmeler
  • Eğitim
  • Muhasebeci Bulun
  • Partner Bulun
  • Partner Olun
Hakkında
  • Şirketimiz
  • Pazarlama Gereçleri
  • İletişim
  • Kariyer
  • Etkinlikler
  • Podcast
  • Blog
  • Müşteriler
  • Hukuki • Gizlilik
  • Güvenlik
الْعَرَبيّة 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, müşteri ilişkileri yönetimi, eTicaret, muhasebe, envanter, satış noktası, proje yönetimi gibi şirketinizin tüm ihtiyaçlarını karşılayan bir açık kaynak işletme uygulamaları paketidir.

Odoo’nun eşsiz değer önermesi, aynı anda hem kullanımının çok kolay olup hem de tamamen entegre olmasıdır.

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