But i'm struggling with the call to create a new project. Each time i confirm the sales order, i get a dialog with the following 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_model_id - alias.model.id]

I know i will have to adjust the call to 'create', but my question is: how?

If you create an object from another object within Odoo, note that the mandatory fields that do not have default values on the object to be created are supplied. In the case of project, a name field is mandatory, but has no default (logically). You will need to manually supply these.

In the above case, vals is just an empty dictionary.

The alias_id in this case might be a relation to the project from an analytic account, but I'm not quite sure about that.

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