You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

83 lines
2.6 KiB

10 years ago
  1. .. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
  2. :alt: License: AGPL-3
  3. Language path mixin
  4. ===================
  5. This is a technical module to restore the possibility of Odoo to print RML
  6. reports in other languages than the user's language (for instance, the
  7. customer's language in the case of a sale order).
  8. Odoo 8.0 has lost that capability due to an unlucky combination of technical
  9. aspects of the deprecated RML report functionality and the new API. While the
  10. static content of the report is translated fine, any translatable fields will
  11. still be rendered in the language of the user.
  12. See https://github.com/odoo/odoo/issues/7301 for the original bug report.
  13. This module provides a tool for developers to work around this bug in their
  14. Python code.
  15. Configuration
  16. =============
  17. With a dependency on this module, you can have any model inherit from the mixin
  18. model in your python class definition. You can then assign your class a
  19. *_language_path* member to indicate where to find the language into which its
  20. reports are to be translated. See the following code example:
  21. .. code::
  22. class SaleOrder(models.Model):
  23. _name = 'sale.order'
  24. _inherit = ['sale.order', 'language.path.mixin']
  25. _language_path = 'partner_id.lang'
  26. In RML reports for such a model, you can then iterate over the records in the
  27. correct language using
  28. [[ repeatIn(objects.with_language_path(), 'o') ]]
  29. Usage
  30. =====
  31. For further information, please visit:
  32. * https://www.odoo.com/forum/help-1
  33. Known issues / Roadmap
  34. ======================
  35. * Kudos if you find a way to do this more elegantly, preferably with a simple
  36. bugfix in the Odoo core
  37. Bug Tracker
  38. ===========
  39. Bugs are tracked on `GitHub Issues <https://github.com/OCA/server-tools/issues>`_.
  40. In case of trouble, please check there if your issue has already been reported.
  41. If you spotted it first, help us smashing it by providing a detailed and welcomed feedback
  42. `here <https://github.com/OCA/server-tools/issues/new?body=module:%20language_path_mixin%0Aversion:%201.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
  43. Credits
  44. =======
  45. Contributors
  46. ------------
  47. * Stefan Rijnhart <stefan@therp.nl>
  48. * Holger Brunn <hbrunn@therp.nl>
  49. Maintainer
  50. ----------
  51. .. image:: https://odoo-community.org/logo.png
  52. :alt: Odoo Community Association
  53. :target: https://odoo-community.org
  54. This module is maintained by the OCA.
  55. OCA, or the Odoo Community Association, is a nonprofit organization whose
  56. mission is to support the collaborative development of Odoo features and
  57. promote its widespread use.
  58. To contribute to this module, please visit http://odoo-community.org.