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.

88 lines
2.7 KiB

  1. .. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
  2. :alt: License: AGPL-3
  3. Read Only ByPass
  4. ================
  5. This module provides a solution to the problem of the interaction between
  6. 'readonly' attribute and 'on_change' attribute when used together. It allows
  7. saving onchange modifications to readonly fields.
  8. Behavior: add readonly fields changed by `on_change` methods to the values
  9. passed to write or create. If `readonly_by_pass` is in the context and
  10. True then by pass readonly fields and save its change.
  11. Installation
  12. ============
  13. There are no specific installation instructions for this module.
  14. Configuration
  15. =============
  16. There is nothing to configure.
  17. Usage
  18. =====
  19. This module changes the behaviour of Odoo by propagating
  20. on_change modifications to readonly fields to the backend create and write
  21. methods.
  22. To change that behavior you have to set context on ``ur.actions.act_window``::
  23. <record id="sale.action_quotations" model="ir.actions.act_window">
  24. <field name="context">{'readonly_by_pass': True}</field>
  25. </record>
  26. or by telling fields allow to change::
  27. <record id="sale.action_quotations" model="ir.actions.act_window">
  28. <field name="context">
  29. {'readonly_by_pass': ['readonly_field_1', 'readonly_field_2',]}
  30. </field>
  31. </record>
  32. For further information, please visit:
  33. * https://www.odoo.com/forum/help-1
  34. Known issues / Roadmap
  35. ======================
  36. * At this point, bypass on a field on o2m field (like field on sale order line)
  37. are not working, because context from action is not take on consideration
  38. when loosing focus on the line in the ``BufferedDataSet`` js Class.
  39. Bug Tracker
  40. ===========
  41. Bugs are tracked on `GitHub Issues <https://github.com/OCA/web/issues>`_.
  42. In case of trouble, please check there if your issue has already been reported.
  43. If you spotted it first, help us smashing it by providing a detailed and welcomed feedback
  44. `here <https://github.com/OCA/web/issues/new?body=module:%20web_readonly_bypass%0Aversion:%208.0.1.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
  45. Credits
  46. =======
  47. Contributors
  48. ------------
  49. * Jonathan Nemry <jonathan.nemry@acsone.eu>
  50. * Laetitia Gangloff <laetitia.gangloff@acsone.eu>
  51. * Pierre Verkest <pverkest@anybox.fr>
  52. Maintainer
  53. ----------
  54. .. image:: https://odoo-community.org/logo.png
  55. :alt: Odoo Community Association
  56. :target: https://odoo-community.org
  57. This module is maintained by the OCA.
  58. OCA, or the Odoo Community Association, is a nonprofit organization whose
  59. mission is to support the collaborative development of Odoo features and
  60. promote its widespread use.
  61. To contribute to this module, please visit http://odoo-community.org.