I want to add a function in sale.py so that if a user edits the unit price,, it will still return the initial pricelist when he tries to save the form, in sale.order.line. The values passed to the form should be the one from the database.

I did that..but its not making the field readonly..
<field name= 'price_unit' readonly="1"/>
It does not make the field readonly..what makes it readonly is in python code.
'price_unit' =fields.float("Unit Price"......,states=('draft:[reaonly, True])
but it will not save the price in the server.so u will return 0..
post your xml code here that functions..

That seems much better,,coz i was worried how comes i make fields readonly in the xml and yet they dont show any difference,, I will definately try it and if it works i will let u both know.. Thanks Pals for your continous assistance.

After many days investigating and googleling, I solved using this function, very usefull, is not read only , is a : don't allow users to quote below the sales price of products, and you can make your particular changes.

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