How to add an attribute instead of replacing an existing field in odoo 13?
25 February, 2023 by
Umme Huzaifa
| No comments yet

For example, for an existing field "percent_commission", we will add an attribute "readonly". Here is the format:

<field name="percent_commission" position="attributes">
<attribute name="readonly">0</attribute>
</field>


If we want to add an attribute for a specific state, here is the format like this:
<field name="percent_commission" position="attributes">
<attribute name="attrs">{'readonly':[('status','=','approved')]}</attribute>
</field>


Umme Huzaifa
25 February, 2023
Share this post
Archive
Sign in to leave a comment