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: [object with reference: alias_name - alias.name] on create object

By
remi mores
on 7/12/13, 9:50 AM 2,537 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?

0

Grover Menacho

--Grover Menacho--
2523
| 5 7 8
La Paz, Bolivia
--Grover Menacho--

Systems Engineer + MBA

Grover Menacho
On 7/12/13, 11:05 AM

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.

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

remi mores
on 7/12/13, 12:09 PM

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/12/13, 9:50 AM
Seen: 2537 times
Last updated: 3/16/15, 8:10 AM