Skip to Content
Odoo Menu
  • Sign in
  • Try it free
  • Apps
    Finance
    • Accounting
    • Invoicing
    • Expenses
    • Spreadsheet (BI)
    • Documents
    • Sign
    Sales
    • CRM
    • Sales
    • POS Shop
    • POS Restaurant
    • Subscriptions
    • Rental
    Websites
    • Website Builder
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Supply Chain
    • Inventory
    • Manufacturing
    • PLM
    • Purchase
    • Maintenance
    • Quality
    Human Resources
    • Employees
    • Recruitment
    • Time Off
    • Appraisals
    • Referrals
    • Fleet
    Marketing
    • Social Marketing
    • Email Marketing
    • SMS Marketing
    • Events
    • Marketing Automation
    • Surveys
    Services
    • Project
    • Timesheets
    • Field Service
    • Helpdesk
    • Planning
    • Appointments
    Productivity
    • Discuss
    • Approvals
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Industries
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Beverage Distributor
    • Hotel
    Real Estate
    • Real Estate Agency
    • Architecture Firm
    • Construction
    • Property Management
    • Gardening
    • Property Owner Association
    Consulting
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Manufacturing
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware & Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Others
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Community
    Learn
    • Tutorials
    • Documentation
    • Certifications
    • Training
    • Blog
    • Podcast
    Empower Education
    • Education Program
    • Scale Up! Business Game
    • Visit Odoo
    Get the Software
    • Download
    • Compare Editions
    • Releases
    Collaborate
    • Github
    • Forum
    • Events
    • Translations
    • Become a Partner
    • Services for Partners
    • Register your Accounting Firm
    Get Services
    • Find a Partner
    • Find an Accountant
      • Get a Tailored Demo
    • Implementation Services
    • Customer References
    • Support
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +32 2 290 34 90
    • Get a Tailored Demo
  • Pricing
  • Help
  1. APPS
  2. Extra Tools
  3. Monetary Index Update v 16.0
  4. Sales Conditions FAQ

Monetary Index Update

by KMEE https://github.com/KMEE/kmee-odoo-addons
Odoo
v 16.0 Third Party
Download for v 16.0 Deploy on Odoo.sh
Apps purchases are linked to your Odoo account, please sign in or sign up first.
Availability
Odoo Online
Odoo.sh
On Premise
Lines of code 599
Technical Name monetary_index_update
LicenseLGPL-3
Websitehttps://github.com/KMEE/kmee-odoo-addons
You bought this module and need support? Click here!

Monetary Index Update

Beta License: LGPL-3 KMEE/kmee-odoo-addons

Este é um módulo base que fornece a infraestrutura para atualizar valores monetários utilizando índices econômicos, como SELIC, IPCA, INPC, entre outros. Ele deve ser estendido por outros módulos que implementarão a funcionalidade específica para diferentes partes do sistema (vendas, contratos, faturas, etc.).

O módulo permite cadastrar e gerenciar índices monetários com suas respectivas taxas históricas, associadas a autoridades emissoras (como BACEN, IBGE) e países específicos. Também fornece um serviço de cálculo de correção monetária que pode ser utilizado por módulos dependentes.

Módulos que estendem este módulo base podem aplicar correções monetárias em campos específicos de seus modelos, selecionando o índice desejado e o período de atualização (data inicial e final), com prévia visualização dos valores atualizados antes da confirmação.

Table of contents

  • Usage
    • For End Users
      • Using Monetary Update on Records
    • Viewing Monetary Indexes
    • For Monetary Update Managers
      • Managing Monetary Indexes
      • Managing Historical Rates
    • For Developers
      • 1. Add Dependency
      • 2. Extend Your Model
      • 3. Add UI Access
      • 4. Using the Service Programmatically (Optional)
      • Key Points
  • Bug Tracker
  • Credits
    • Authors
    • Maintainers

Usage

This is a base/technical module that provides the infrastructure for monetary updates. It should be used together with other modules that implement the specific functionality for different system models.

For End Users

The monetary update functionality will be made available through specific modules that extend this base module. Each implementing module may provide different ways to access the monetary correction feature (e.g., buttons, menu items, actions).

Using Monetary Update on Records

When the functionality is implemented in a model, you will typically use a wizard to apply monetary corrections. The wizard allows you to:

  1. Select a Monetary Index: Choose the economic index to use for correction (e.g., SELIC, IPCA, INPC)
  2. Set the Start Date: Define the original date of the monetary value
  3. Set the End Date: Define the date to which you want to correct the value
  4. Preview Changes: Review the updated values and percentage changes before applying
  5. Apply Correction: Confirm to update the monetary values
Note: The exact workflow and access method depends on how each specific module implements the monetary update functionality. Refer to the documentation of the module you are using for detailed instructions.

Viewing Monetary Indexes

To view the monetary indexes available in the system:

  1. Go to Settings > Monetary Indexes
  2. View the list of registered indexes (SELIC, IPCA, INPC, etc.)
  3. Click on an index to see its historical rates and detailed information
Note: Standard users can only view indexes. Only users with “Monetary Update Manager” permission can create, edit, or delete indexes.

For Monetary Update Managers

Managing Monetary Indexes

  1. Go to Settings > Monetary Indexes
  2. Click Create to add a new index
  3. Fill in the fields:
    • Name: Index name (e.g., “SELIC”)
    • Code: Unique code (e.g., “selic”)
    • Authority: Issuing authority (e.g., “BACEN”, “IBGE”)
    • Country: Country associated with the index
    • Description: Detailed information about the index

Managing Historical Rates

  1. Open a monetary index form
  2. Go to the Rates tab
  3. Add historical rates:
    • Date: Effective date of the rate
    • Value: Percentage value of the rate
    • Source: Data source (optional)
    • Note: Additional notes (optional)

For Developers

To implement monetary correction in your custom modules, follow these steps:

1. Add Dependency

In your module’s __manifest__.py:

{
    "name": "Your Module",
    "depends": [
        "base_module",  # your existing dependencies
        "monetary_index_update",
    ],
    # ...
}

2. Extend Your Model

Inherit from monetary.update.service and specify which fields should be tracked:

from odoo import models, fields

class YourModel(models.Model):
    _name = "your.model"
    _inherit = ["your.model", "monetary.update.service"]

    # Define which monetary fields should be updatable
    _fields_to_track = ["unit_price", "total_amount"]

    # Your model fields and methods...

3. Add UI Access

Provide a way for users to trigger the monetary update wizard. This can be done through:

Option A - Button in tree/form view:

<record id="view_your_model_tree_monetary" model="ir.ui.view">
    <field name="name">your.model.tree.monetary</field>
    <field name="model">your.parent.model</field>
    <field name="inherit_id" ref="your_module.view_your_model_tree"/>
    <field name="arch" type="xml">
        <xpath expr="//field[@name='line_ids']/tree" position="inside">
            <button name="monetary_update_fields_by_index_wizard"
                    type="object"
                    icon="fa-calculator"
                    title="Update by Monetary Index"/>
        </xpath>
    </field>
</record>

Option B - Action in context menu, or any other UI pattern that fits your use case.

4. Using the Service Programmatically (Optional)

You can also use the monetary update service directly in your code:

# Calculate updated amount
updated_amount = self.env["monetary.update.service"].compute_updated_amount(
    index_code="selic",
    amount=1000.00,
    start_date="2023-01-01",
    end_date="2024-01-01",
)

Key Points

  • The _fields_to_track attribute defines which monetary fields can be updated
  • The wizard (monetary_update_fields_by_index_wizard) is automatically available once you inherit from monetary.update.service
  • Users need appropriate permissions to see and use the monetary update functionality
  • The wizard provides a preview before applying changes, allowing users to review the updated values

Refer to the source code and tests for complete implementation examples.

Bug Tracker

Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us to smash it by providing a detailed and welcomed feedback.

Do not contact contributors directly about support or help with technical issues.

Credits

Authors

  • KMEE

Maintainers

This module is part of the KMEE/kmee-odoo-addons project on GitHub.

You are welcome to contribute.

Please log in to comment on this module

  • The author can leave a single reply to each comment.
  • This section is meant to ask simple questions or leave a rating. Every report of a problem experienced while using the module should be addressed to the author directly (refer to the following point).
  • If you want to start a discussion with the author, please use the developer contact information. They can usually be found in the description.
Please choose a rating from 1 to 5 for this module.
Community
  • Tutorials
  • Documentation
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Translations
Services
  • Odoo.sh Hosting
  • Support
  • Upgrade
  • Custom Developments
  • Education
  • Find an Accountant
  • Find a Partner
  • Become a Partner
About us
  • Our company
  • Brand Assets
  • Contact us
  • Jobs
  • Events
  • Podcast
  • Blog
  • Customers
  • Legal • Privacy
  • Security

Odoo is a suite of open source business apps that cover all your company needs: CRM, eCommerce, accounting, inventory, point of sale, project management, etc.

Odoo's unique value proposition is to be at the same time very easy to use and fully integrated.

Website made with