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

  1. .. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
  2. :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
  3. :alt: License: AGPL-3
  4. ================
  5. Read Only ByPass
  6. ================
  7. This module provides a solution to the problem of the interaction between
  8. 'readonly' attribute and 'on_change' attribute when used together. It allows
  9. saving onchange modifications to readonly fields.
  10. Behavior: add readonly fields changed by `on_change` methods to the values
  11. passed to write or create. If `readonly_by_pass` is in the context and
  12. True then it will by pass readonly fields and save its data provide by onchange
  13. method.
  14. Usage
  15. =====
  16. This module changes the behaviour of Odoo by propagating
  17. on_change modifications to readonly fields to the backend create and write
  18. methods.
  19. To change that behavior you have to set context on ``ir.actions.act_window``::
  20. <record id="sale.action_quotations" model="ir.actions.act_window">
  21. <field name="context">{'readonly_by_pass': True}</field>
  22. </record>
  23. or by telling fields allowed to change::
  24. <record id="sale.action_quotations" model="ir.actions.act_window">
  25. <field name="context">
  26. {'readonly_by_pass': ['readonly_field_1', 'readonly_field_2',]}
  27. </field>
  28. </record>
  29. On one2many fields, you can also pass the context in the field definition:
  30. <field name="one2many_field" context="{'readonly_by_pass': True}"/>
  31. .. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
  32. :alt: Try me on Runbot
  33. :target: https://runbot.odoo-community.org/runbot/162/10.0
  34. Bug Tracker
  35. ===========
  36. Bugs are tracked on `GitHub Issues <https://github.com/OCA/web/issues>`_.
  37. In case of trouble, please check there if your issue has already been reported.
  38. If you spotted it first, help us smashing it by providing a detailed and welcomed feedback.
  39. Credits
  40. =======
  41. Contributors
  42. ------------
  43. * Jonathan Nemry <jonathan.nemry@acsone.eu>
  44. * Laetitia Gangloff <laetitia.gangloff@acsone.eu>
  45. * Pierre Verkest <pverkest@anybox.fr>
  46. * Kalpana Hemnani <hemnani.kalpana@gmail.com>
  47. * Agathe Mollé <agathe.molle@savoirfairelinux.com>
  48. * Simone Orsi <simone.orsi@camptocamp.com>
  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.