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.
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: 3646 times|
|Last updated: 3/16/15, 8:10 AM|