Search code examples
pythoncssxmlodoo-8odoo-14

How to hide a field in editable mode in odoo (version 8 to 15)


In odoo v8, I want some fields to be shown only in view mode but when the user clicks on edit or create, then those fields should be invisible (Only visible in view mode).


Solution

  • There is an openerp class called oe_read_only.

    This will allow you to view the field only when reading the form not in edit mode of the form.

    Sample Code:

    <field name="name" class="oe_read_only"/>