Hi, i'm trying to extend the workflow of sale.order.basic to create a project when a sales order was confirmed.
class sale_order(osv.osv):
_name = 'sale.order'
_inherit = 'sale.order'
_columns = {
'customfield': fields.boolean('my custom field'),
}
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!')
else:
raise Exception('Create project failed!')
sale_order()
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?
did you ever figure this out. I'm looking for the exact same solution! thanks!