Перейти к содержимому
Odoo Меню
  • Войти
  • Попробовать бесплатно
  • Модули
    Финансы
    • Бухгалтерия
    • Выставление счетов
    • Расходы
    • Таблицы
    • Документооборот
    • Подпись
    Продажи
    • CRM
    • Продажи
    • POS Магазин
    • POS Ресторан
    • Подписки
    • Аренда
    Вебсайты
    • Конструктор вебсайтов
    • eCommerce
    • Блог
    • Форум
    • Онлайн-чат
    • Электронное обучение
    Логистика
    • Склад
    • Производство
    • PLM
    • Закупки
    • Обслуживание
    • Качество
    Отдел кадров
    • Сотрудники
    • Подбор персонала
    • Отпуска
    • Оценка персонала
    • Реферальная программа
    • Автопарк
    Маркетинг
    • SMM
    • E-mail рассылки
    • СМС рассылки
    • Мероприятия
    • Автоматизация маркетинга
    • Опросы
    Услуги
    • Проекты
    • Табели
    • Выездной сервис
    • Поддержка
    • Планирование
    • Встречи
    Продуктивность
    • Обсуждения
    • Согласование
    • IoT
    • VoIP-телефония
    • Knowledge
    • WhatsApp
    Сторонние приложения Модуль Студия Odoo Платформа Odoo Cloud
  • Индустрии
    Розничная торговля
    • Книжный магазин
    • Магазин одежды
    • Мебельный магазин
    • Продуктовый магазин
    • Строительный магазин
    • Магазин игрушек
    Гостинично-ресторанный бизнес
    • Бар и паб
    • Ресторан
    • Фастфуд
    • Гостевой дом
    • Дистрибьютор напитков
    • Отель
    Недвижимость
    • Агентство недвижимости
    • Архитектурное бюро
    • Строительство
    • Управление недвижимостью
    • Ландшафтный дизайн
    • Товарищество собственников жилья
    Консалтинг
    • Бухгалтерская фирма
    • Партнер Odoo
    • Маркетинговое агентство
    • Юридическая фирма
    • Подбор персонала
    • Аудиторское бюро
    Производство
    • Текстиль
    • Металл
    • Мебель
    • Продукты питания
    • Пивоварня
    • Корпоративные сувениры
    Здоровье и фитнес
    • Спортивный комплекс
    • Магазин оптики
    • Фитнес-клуб
    • Велнес-центр
    • Аптека
    • Салон красоты
    Услуги
    • Специалист по бытовым услугам
    • Продажа и обслуживание IT-оборудования
    • Солнечные энергосистемы
    • Производство обуви
    • Клининг
    • Системы ОВКВ
    Прочее
    • Некоммерческая организация
    • Консалтинг в сфере устойчивого развития
    • Аренда рекламных щитов
    • Бизнес по фотосъемке
    • Прокат велосипедов
    • Реселлер программного обеспечения
    Все индустрии
  • Community
    Обучение
    • Видео уроки
    • Документация
    • Сертификация
    • Тренинг
    • Блог
    • Подкаст
    Образование и развитие
    • Образовательная программа
    • Деловая игра Scale Up!
    • Экскурсия в офис Odoo
    ПО
    • Скачать
    • Сравнить версии
    • Релизы
    Сотрудничество
    • Github
    • Форум
    • Мероприятия
    • Перевод
    • Стать партнером
    • Услуги для партнеров
    • Зарегистрировать бухгалтерскую фирму
    Услуги
    • Найти партнера
    • Найти бухгалтера
    • Встреча с экспертом
    • Услуги по внедрению
    • Отзывы клиентов
    • Поддержка
    • Обновления
    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:

  • CRM
  • e-Commerce
  • Бухгалтерия
  • Склад
  • PoS
  • Проекты
  • MRP
All apps
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Все посты Люди Значки
Теги (Смотреть все)
odoo accounting v14 pos v15
Об этом форуме
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Все посты Люди Значки
Теги (Смотреть все)
odoo accounting v14 pos v15
Об этом форуме
Помощь

Add custom dropdown in all Odoo 17.0 financial reports.

Подписаться

Получайте уведомления о появлении активности в этом посте

Этот вопрос был отмечен
developmentaccountingfinancialodoo17.0
3 Ответы
3177 Представления
Аватар
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
Аватар
Отменить
Mahmoud Magdy

Did you add it successfully ?  

Аватар
Pedro Dom
Лучший ответ

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

0
Аватар
Отменить
Аватар
Gracious Joseph
Лучший ответ

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
Аватар
Отменить
Аватар
Nikhil Dhiman
Лучший ответ

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

0
Аватар
Отменить
Не оставайтесь в стороне – присоединяйтесь к обсуждению!

Создайте аккаунт сегодня, чтобы получить доступ к эксклюзивным функциям и стать частью нашего замечательного сообщества!

Регистрация
Похожие посты Ответы Просмотры Активность
Restrict QWeb Report in Print Menu to Vendor Payments Only in Odoo 17
development accounting
Аватар
Аватар
1
окт. 25
764
Blank Page After Logged in. Решено
development odoo
Аватар
Аватар
Аватар
2
сент. 25
4507
Error in followup report
development accounting
Аватар
Аватар
1
авг. 25
1849
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
Аватар
Аватар
1
июл. 25
2735
Dashboard Journal Balances Incorrect After Restoring Odoo 17 CE to docker
accounting 17.0
Аватар
0
июн. 25
1692
Сообщество
  • Видео уроки
  • Документация
  • Форум
Открытый исходный код
  • Скачать
  • Github
  • Runbot
  • Перевод
Услуги
  • Хостинг Odoo.sh
  • Поддержка
  • Обновление
  • Индивидуальные решения по доработке
  • Образование
  • Найти бухгалтера
  • Найти партнера
  • Стать партнером
О нас
  • Наша компания
  • Активы бренда
  • Cвяжитесь с нами
  • Вакансии
  • Мероприятия
  • Подкаст
  • Блог
  • Клиенты
  • Правовые документы • Конфиденциальность
  • Безопасность
الْعَرَبيّة 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, E-commerce, Бухгалтерия, Склад, POS, управление проектами и др.

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