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
Ali Khan
on 5/13/14, 10:49 AM 865 views

I created three classes like , ali_khan with an id ( 'ali_ids':fields.one2many('ali.khan', 'chbc_id', 'Ali khan'),, test_chbc and test_destitute. i referred that id in the rest two classes . i can add and delete records to tes_chbc but each time i try to add a record to test_destitute i get an integrity error.. my code:

class ali_khan(osv.osv): _name="ali.khan" _description="Does any member of the household have regular paid employment" _columns={ 'destitute_ids':fields.many2one('test.destitute',reuired=True), 'chbc_id':fields.many2one('test.chbc', required=True),
'person_name':fields.char('Name of Person'), 'work_type':fields.char('Type of work'), 'income_monthly':fields.char('Monthly Income'), 'com_confirm':fields.char('Communal Confirmation'), } ali_khan()

class test_chbc(osv.osv): _name="test.chbc" _columns={ 'ali_ids':fields.one2many('ali.khan', 'chbc_id', 'Ali khan'), 'first_name':fields.char('First Name',size=64), 'family_name':fields.char('Family Name',size=64), 'no_id':fields.boolean('No ID'), 'id_num':fields.char('ID Number',size=64), #with a lable of ID Number yes/no 'sex':fields.selection(gender_lov,'Sex',size=64), 'date_o_birth':fields.date('Date of birth',size=64), }
test_chbc()

class test_destitute(osv.osv): _name="test.destitute" _columns={ 'ali_ids':fields.one2many('ali.khan', 'destitute_ids', 'Khan'), 'first_name':fields.char('First Name',size=64), 'family_name':fields.char('Family Name',size=64), 'id_num':fields.char('ID Number',size=64), #with a lable of ID Number yes/no 'sex':fields.selection(gender_lov,'Sex',size=64), 'date_o_birth':fields.date('Date of birth',size=64), 'formal_edu':fields.char('Formul Education',size=64), 'qualification':fields.char('Qualification',size=64), 'place_o_birth':fields.char('Place of Birth',size=64), 'tel_home':fields.char('Home Telephone',size=64), 'cell_numb':fields.char('Cell Number',size=64),

}

test_destitute()

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: chbc_id-chbc.id]

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: 5/13/14, 10:49 AM
Seen: 865 times
Last updated: 3/16/15, 8:10 AM