Search code examples
xmlmoduleodooodoo-9

Odoo 9: How to have a field displayed in edit form but not in the standard view?


I have created a module which defines some fields and displays them via a view .xml file. How can I make it so that two of these fields (which are simply used for computing a value in another field) are only displayed when editing a record, but not when displaying it?


Solution

  • You can use css class oe_edit_only.

    <field name="editable_field_name" class="oe_edit_only"/>
    

    This class ensures that the field is displayed only when in editable form.