Odoo Help

Welcome!

This community 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.

0

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

By
charlesraj
on 7/24/13, 10:27 AM 2,618 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--
2523
| 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.

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

Question tools

0 follower(s)

Stats

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