Odoo Help


How to fix intergrity error ?

Nanda Kanoko
on 7/12/13, 12:14 AM 1,309 views

I'm trying to make a custom module that inherit hr.employee and project.project

Py :

class notebook_project(osv.osv):
    _name = "notebook.project"
    _description = "Notebook Project ID"
    _columns = {
        'project_id' : fields.many2one('project.project', 'Project', required=True, store=True,),
        'notebook_project_lines' : fields.one2many('notebook.project', 'notebook_project_id', 'Members Lines'),
        'notebook_project_id': fields.many2one('notebook.project', 'Project ID', ondelete='cascade', select=True),
        'project_member' : fields.many2one('hr.employee', 'Members', required=True, store=True,),


class project_project(osv.osv):
    _inherit = "project.project"    
    _columns = {
        "project_ids": fields.one2many('notebook.project', 'project_id','Project', domain=[('project_id','=',False)]),

class hr_employee(osv.osv):
    _inherit = "hr.employee"    
    _columns = {
        "project_members": fields.one2many('notebook.project', 'project_member','Member', domain=[('project_member','=',False)]),

When i'm entering the value of fields , i get an intergrity 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 reference is project_id and project_member . Please help :(

Can you also post your view xml? It may explain what you mean to do with those fields

Alessandro Pillan
on 7/12/13, 6:13 AM

Thanks for response . well , i'm changing the whole.py , and i'm facing another problem , hope you can help :) . I'll post it later , since i'm still working on it

Nanda Kanoko
on 7/12/13, 7:57 AM

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.


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

1 follower(s)


Asked: 7/12/13, 12:14 AM
Seen: 1309 times
Last updated: 3/16/15, 8:10 AM