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

How to fix intergrity error ?

v7
By
Nanda Kanoko
on 7/12/13, 12:14 AM 829 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,),
        }


notebook_project()

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

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

1 follower(s)

Stats

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