Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

License: AGPL-3

Language path mixin

This is a technical module to restore the possibility of Odoo to print RML reports in other languages than the user’s language (for instance, the customer’s language in the case of a sale order).

Odoo 8.0 has lost that capability due to an unlucky combination of technical aspects of the deprecated RML report functionality and the new API. While the static content of the report is translated fine, any translatable fields will still be rendered in the language of the user.

See https://github.com/odoo/odoo/issues/7301 for the original bug report.

This module provides a tool for developers to work around this bug in their Python code.

Configuration

With a dependency on this module, you can have any model inherit from the mixin model in your python class definition. You can then assign your class a _language_path member to indicate where to find the language into which its reports are to be translated. See the following code example:

class SaleOrder(models.Model):
    _name = 'sale.order'
    _inherit = ['sale.order', 'language.path.mixin']
    _language_path = 'partner_id.lang'

In RML reports for such a model, you can then iterate over the records in the correct language using

[[ repeatIn(objects.with_language_path(), ‘o’) ]]

Usage

For further information, please visit:

Known issues / Roadmap

  • Kudos if you find a way to do this more elegantly, preferably with a simple bugfix in the Odoo core

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 smashing it by providing a detailed and welcomed feedback here.

Credits

Contributors

Maintainer

Odoo Community Association

This module is maintained by the OCA.

OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use.

To contribute to this module, please visit http://odoo-community.org.

Metadata

Release files for odoo8-addon-language-path-mixin 8.0.1.0.0.99.dev25

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for odoo8-addon-language-path-mixin 8.0.1.0.0.99.dev25
File Interpreter ABI Platform
odoo8_addon_language_path_mixin-8.0.1.0.0.99.dev25-py2-none-any.whl Python 2 none any Details

Release files / odoo8_addon_language_path_mixin-8.0.1.0.0.99.dev25-py2-none-any.whl

Download URL odoo8_addon_language_path_mixin-8.0.1.0.0.99.dev25-py2-none-any.whl
Size 63.2 kB
Tags Python 2
SHA-256 checksum
How to use checksums
be997795d60b936d42b2981a4be70f6d94f90239ab1777f47ca3b93186d30787
BLAKE2b-256 checksum
How to use checksums
a33ea23a73bc9f8b61944a3e85b41f32b56413a3bde7987e8e650bb69a2777a5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.8.5
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page