How can I hide the fields in Odoo 11 only when creating and editing a form?

0

I have created the Tree and Form type views for a small Odoo 11 module that I am creating. But there is a field, let's call it campoX that interests me only if it is not visible when I access the details of the subject: person, boat, plant, or whatever. Being that only such a field appears when you edit or create a new subject.

I have seen the invisible attribute for the view and for the model, but it is not exactly what I need, since it always obscures the X field.

Could someone put a generic example? It must be something simple, but after searching I do not find something that works for me.

    
asked by Daniel Ruiz 05.05.2018 в 19:41
source

1 answer

0

You must add the class 'oe_edit_only' in the field when displaying it in the view:

<field name="campoX" class="oe_edit_only"/>
    
answered by 16.05.2018 в 14:31