Company Currency Mixin
Project description
Company Currency Mixin
Description
Company Currency Mixin is a lightweight mixin module in the @simetri-sinergi-id/ssi-mixin technology suite for Odoo 15. It provides a reusable abstract model – mixin.company_currency – that adds a company field and its derived currency field to any model.
Any model that inherits from mixin.company_currency automatically gains:
A mandatory company_id (res.company) field defaulting to the current user’s company.
A stored, related company_currency_id field that always reflects the selected company’s currency.
Monetary fields on inheriting models can set currency_field='company_currency_id' to format amounts in the company’s currency without any extra boilerplate.
Key Features
Abstract Mixin Design: Inherit mixin.company_currency in any model – no structural view changes required.
Auto Company Default: company_id defaults to the current user’s company automatically.
Derived Currency: company_currency_id is always in sync with the selected company’s currency via a stored related field.
Monetary Field Ready: Set currency_field='company_currency_id' on any monetary field to enable proper currency display.
Minimal Footprint: Depends only on base – no heavy extra dependencies.
Open Source: AGPL-3.0 license with community-driven improvements.
Use Cases / Context
Use this mixin for any transactional or master-data model that needs multi-company currency awareness:
Sale/Purchase Orders: Ensure monetary fields are always displayed in the owning company’s currency.
Invoices & Payments: Standardise company currency derivation across accounting documents.
Warehouse Transfers: Attach cost fields with correct currency to stock transfer lines.
Custom Transactions: Any model with monetary amounts that must respect multi-company currency settings.
Simply set _inherit = ["mixin.company_currency"] on your model and reference company_currency_id in your monetary fields.
Installation
To install this module, you need to:
Clone the branch 15.0 of the repository: https://github.com/simetri-sinergi-id/ssi-mixin
Add the path to this repository in your configuration (addons-path).
Update the module list (must be in developer mode).
Go to menu Apps -> Apps -> Main Apps.
Search for Company Currency Mixin.
Install the module.
Installation & Usage
Add ssi_company_currency_mixin to your module’s depends list in __manifest__.py.
Inherit the mixin in your model:
_inherit = ["mixin.company_currency"]
On any monetary field, add currency_field="company_currency_id":
amount = fields.Monetary( string="Amount", currency_field="company_currency_id", )
FAQ
Standalone? No – it is a mixin foundation. Install it as a dependency of your custom module.
Odoo Version? Odoo 15.0.
Is company_id required? Yes – it defaults to the current user’s company but can be changed.
Is company_currency_id stored? Yes – it is a stored related field so it can be used in domain filters and reports.
Contribute? Fork, branch, and submit a pull request on GitHub.
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 smash it by providing detailed and welcomed feedback.
Credits
Contributors
Andhitia Rama <andhitia.r@gmail.com>
Maintainer
This module is maintained by PT. Simetri Sinergi Indonesia.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file odoo_addon_ssi_company_currency_mixin-15.0.1.0.0.3-py3-none-any.whl.
File metadata
- Download URL: odoo_addon_ssi_company_currency_mixin-15.0.1.0.0.3-py3-none-any.whl
- Upload date:
- Size: 58.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
83d07ae543da6b6326fd084a5ca8d4d7e91e3819f97f8dc736a1b34cf6f5c9f6
|
|
| MD5 |
59564f0ffa47d7e06a91c3facf6cee80
|
|
| BLAKE2b-256 |
e545a7480fcd8a0859b609a5df442cf8b100e0ffaef1956164b96115ae326c9c
|