Odoo Help


how to make one field in order.line readonly depending on change of states

on 8/26/13, 8:27 AM 938 views

Hi there, I know it's easy to set the entire order.line readonly based on the state of the order ('daft'/'sent'/'done' etc). But I am adding a new state 'update', which requires to keep some of the fields in the order.line readonly and some are editable.

I add the new state 'update' into state selection and revise the workflow and views correspondingly. It works fine before I tried to set the unediatable fields readonly.

<field name="unit_amount" attrs="{'readonly':[('state','=','update']}"/>

I'm receiving running errors. I tried to relate the states field into order.line class, but it does not work either. I still receive the warning of undefined state .....

Much appreciate that anyone could advise on the issue.

Thanks a lot !

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

0 follower(s)


Asked: 8/26/13, 8:27 AM
Seen: 938 times
Last updated: 3/16/15, 8:10 AM