Odoo Help

Welcome!

This community 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.

0

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

By
Yao
on 8/26/13, 8:27 AM 602 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 !

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

0 follower(s)

Stats

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