This question has been flagged
3226 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 !

Avatar
Discard