Odoo Help

0

Integrity Error The operation cannot be completed, probably due to the following:

By
charlesraj
on 7/24/13, 10:27 AM 3,083 views

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

"Integrity Error

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] "

0

Grover Menacho

--Grover Menacho--
2563
| 5 7 8
La Paz, Bolivia
--Grover Menacho--

Systems Engineer + MBA

Grover Menacho
On 7/24/13, 10:49 AM

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

Question tools

0 follower(s)

Stats

Asked: 7/24/13, 10:27 AM
Seen: 3083 times
Last updated: 3/16/15, 8:10 AM