This question has been flagged
1 Reply
7197 Views

hi, i try to create a project object in my custom action handler:

def action_project_create(self,cr,uid,ids,context=None):
    project_project = self.pool.get('project.project')
    vals = {}
    project = project_project.create(cr,uid,vals,context=context)
    if(project == None):
        raise Exception('Create project failed!!!')

but I get the error:

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: alias_name - alias.name]

Could someone explain to me what to do?

Avatar
Discard
Best Answer

If you see on the project.project object there are required fields. You can't create a new record without these fields so check alias_id and add an alias_id on your function.

Avatar
Discard
Author

THANX!!!! :) My mistake was i did not set the required fields as specified in project.py