Odoo is the world's easiest all-in-one management software. It includes hundreds of business apps:
CRM | e-Commerce | Accounting | Inventory | PoS | Project management | MRP | etc.
in order to make the unit price coloum in the sale order line uneditable .I edited the sale.py and edited like this.
'price_unit': fields.float('Unit Price', required=True, digits_compute= dp.get_precision('Product Price'), readonly=True),
by make readonly =true
and changes made in XML file like this <field name="price_unit" readonly="1"/>
. Now the field is only readable but cannot able to save. the sale order that i create.
an error message displayed like this
The operation cannot be completed, probably due to the following: - deletion: you may be trying to delete a record while other records still reference it - creation/update: a mandatory field is not correctly set
[object with reference: price_unit - price.unit] "
You can't do that because if you are making a required field readonly it's not going to work.
A readonly field is just that a readonly field, even if you change it's content with the onchange product it's not going to work because that value is not going to be saved. That's why you can't make this readonly unless you are going to add the value again on the create or write function.
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 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.Register
Odoo Training Center
Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.Test it now
|Asked: 7/24/13, 10:27 AM|
|Seen: 2784 times|
|Last updated: 3/16/15, 8:10 AM|