Skip to main content

Allow to save onchange modifications to readonly fields

Project description

License: AGPL-3

Read Only ByPass

This module provides a solution to the problem of the interaction between ‘readonly’ attribute and ‘on_change’ attribute when used together. It allows saving onchange modifications to readonly fields.

Behavior: add readonly fields changed by on_change methods to the values passed to write or create. If readonly_by_pass is in the context and True then it will by pass readonly fields and save its data provide by onchange method.

Usage

This module changes the behaviour of Odoo by propagating on_change modifications to readonly fields to the backend create and write methods.

To change that behavior you have to set context on ur.actions.act_window:

<record id="sale.action_quotations" model="ir.actions.act_window">
    <field name="context">{'readonly_by_pass': True}</field>
</record>

or by telling fields allowed to change:

<record id="sale.action_quotations" model="ir.actions.act_window">
    <field name="context">
        {'readonly_by_pass': ['readonly_field_1', 'readonly_field_2',]}
    </field>
</record>

On one2many fields, you can also pass the context in the field definition:

<field name=”one2many_field” context=”{‘readonly_by_pass’: True}”/>

Try me on Runbot

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

File details

Details for the file odoo8_addon_web_readonly_bypass-8.0.1.0.1.99.dev4-py2-none-any.whl.

File metadata

File hashes

Hashes for odoo8_addon_web_readonly_bypass-8.0.1.0.1.99.dev4-py2-none-any.whl
Algorithm Hash digest
SHA256 91817ecb8a486c38789f0b483703c8f76d08e477c29c72adb7c77a7f3deebdff
MD5 52577f91700ce67f367ffc56791bfe4f
BLAKE2b-256 95fb2c0e93c91577f22d6c85ff30391ca7c093b4e8a07fe57488d0db6ad61c72

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page