İç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 dropdown in all Odoo 17.0 financial reports.

Abone Ol

Get notified when there's activity on this post

Bu soru işaretlendi
developmentaccountingfinancialodoo17.0
3 Cevaplar
3169 Görünümler
Avatar
Mauricio Alejandro Gonzalez

Hi, I want to add or create a new filter/search option in the Odoo financial reports.


For example, in the Odoo financial report Balance Sheet, i tried to inherit the existing template and add a new filterlike this example:


	​	​
<?xml version="1.0" encoding="UTF-8" ?>
<templates>
<t t-name="l10n_ve_reports.AccountReportCurrencySelect" t-inherit="account_reports.AccountReportFiltersCustomizable">
<xpath expr="//div[@id='filter_extra_options']" position="after">
​ ​ ​<div id="multi_currency_selection">
​ ​ ​<p>My EXAMPLE</p>​
​ ​ ​</div>
</xpath>
</t>
</templates>

I added my example as above, and put it on __manifest__ . py, but nothing changed in all my templates.

I want to add a new dropdown to select a currency, but for now, I just want to be able to display a dropdown.

Can someone help me with this? Thanks before hand.

0
Avatar
Vazgeç
Mahmoud Magdy

Did you add it successfully ?  

Avatar
Pedro Dom
En İyi Yanıt

https://apps.odoo.com/apps/modules/18.0/odoo_accounting_filters

0
Avatar
Vazgeç
Avatar
Gracious Joseph
En İyi Yanıt

To add a custom dropdown filter (e.g., for currency selection) in Odoo 17.0 financial reports, you need to properly inherit the relevant XML templates and integrate the dropdown into the report filter system. Here's how you can achieve this:

Step-by-Step Solution

1. Identify the Correct Template to Inherit

Odoo financial reports use the account_reports.AccountReportFiltersCustomizable template for filters. Ensure you are targeting the correct template and its structure.

2. Create a Custom Module

If you haven't already, create a custom module to house your changes.

Directory structure:

custom_financial_report_filter/
├── __init__.py
├── __manifest__.py
├── views/
│   └── financial_report_filter.xml

3. Update the __manifest__.py File

Define your module and include the dependency on account_reports.

{
    'name': 'Custom Financial Report Filters',
    'version': '1.0',
    'depends': ['account_reports'],
    'author': 'Your Name',
    'data': [
        'views/financial_report_filter.xml',
    ],
    'installable': True,
    'application': False,
}

4. Inherit the Template and Add Your Dropdown

Create the financial_report_filter.xml file to extend the financial report filters.

<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
    <template id="add_custom_currency_filter" inherit_id="account_reports.AccountReportFiltersCustomizable">
        <xpath expr="//div[@id='filter_extra_options']" position="inside">
            <div class="form-group" id="multi_currency_selection">
                <label for="currency_dropdown">Select Currency:</label>
                <select id="currency_dropdown" class="form-control">
                    <option value="USD">USD</option>
                    <option value="EUR">EUR</option>
                    <option value="GBP">GBP</option>
                </select>
            </div>
        </xpath>
    </template>
</odoo>

5. Add Backend Logic to Handle the Dropdown

To make the dropdown functional, you need to pass the selected value to the report:

  1. Override Report Action: Modify the action context to include the selected currency value.
  2. Extend account.report Model: Add custom logic to handle the selected currency in the report.
    Example Python code:
    from odoo import models, fields
    
    class AccountReport(models.AbstractModel):
        _inherit = 'account.report'
    
        filter_currency = fields.Selection([
            ('USD', 'USD'),
            ('EUR', 'EUR'),
            ('GBP', 'GBP'),
        ], string="Currency", default='USD')
    
        def _get_report_values(self, docids, data):
            # Add custom logic to filter based on currency
            if self.filter_currency:
                data['currency'] = self.filter_currency
            return super(AccountReport, self)._get_report_values(docids, data)
    

6. Update the JavaScript (Optional)

If you want the dropdown to dynamically update the report without reloading, you can use JavaScript to handle the interaction.

  1. Add a JS File: Create a JS file to add dynamic behavior.
    Example:
    odoo.define('custom_financial_report_filter.CurrencyDropdown', function (require) {
        "use strict";
    
        const publicWidget = require('web.public.widget');
    
        publicWidget.registry.CurrencyDropdown = publicWidget.Widget.extend({
            selector: '#multi_currency_selection',
            events: {
                'change #currency_dropdown': '_onCurrencyChange',
            },
            _onCurrencyChange: function (ev) {
                const selectedCurrency = $(ev.target).val();
                // Send an AJAX request to reload the report
                console.log('Selected currency:', selectedCurrency);
            },
        });
    });
    
  2. Include the JS File in Your Module: Update the __manifest__.py to include the JS file.

7. Test Your Changes

  1. Restart your Odoo server and upgrade the module:
    ./odoo-bin -u custom_financial_report_filter
    
  2. Open the financial reports (e.g., Balance Sheet) and verify that the dropdown is displayed and functional.

Key Notes

  • Ensure Proper Dependencies: Your custom module must depend on account_reports for proper inheritance.
  • Test in Developer Mode: Use Odoo's developer mode to debug template inheritance and confirm the dropdown is rendered correctly.
  • Dynamic Behavior: If you need the dropdown to update results dynamically, you'll need to implement AJAX handling in your JavaScript.

By following these steps, you can add a custom dropdown to Odoo 17.0 financial reports. Let me know if you need further clarification or assistance!

0
Avatar
Vazgeç
Avatar
Nikhil Dhiman
En İyi Yanıt

We’ve already developed this for one of our customers. Connect with us to learn more. 

0
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
Restrict QWeb Report in Print Menu to Vendor Payments Only in Odoo 17
development accounting
Avatar
Avatar
1
Eki 25
763
Blank Page After Logged in. Çözüldü
development odoo
Avatar
Avatar
Avatar
2
Eyl 25
4507
Error in followup report
development accounting
Avatar
Avatar
1
Ağu 25
1846
How can I set it up so that the purchase_price (‘Cost’) field can also be changed in the ‘posted’ status in Model:'account.move'?
development accounting
Avatar
Avatar
1
Tem 25
2725
Dashboard Journal Balances Incorrect After Restoring Odoo 17 CE to docker
accounting 17.0
Avatar
0
Haz 25
1692
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