This question has been flagged
5 Replies
6715 Views

Hi All,

Have started using Odoo 10. 

Seem to be having the following error in the project module when clicking on create project under Configuration -> Project also getting this error when going to settings on Project in Dashboard view 

The error is Error: Unknown field state in domain [["state","in",["cancelled","close"]]]

Have attempted to look at views but i can't seem to find an attribute in there thats causing this? Any ideas would be appreciated. 


Thanks,


Adrian

 

Avatar
Discard
Best Answer

Hi,

Just check if field state is included in the tree view of the model.This error occurs because you might have this domain defined for any field in project form and when try to load the tree view if the state field is missing this error shoots. 

Avatar
Discard
Best Answer

Hi adrian,

You just need to re define "state" field into tree/form view of the project model.

I hope this issue will resolve

Avatar
Discard
Best Answer

The project.project model has changes between Odoo v9 and Odoo v10. The field "state" doesn't exist any more.

It seems to me that you are using the OCA-module project_task_default_stage.
This module is not ported for v10 yet.

A quick fix is to modify the file: project_task_default_stage/models/project.py
In the project model-definition, under type_ids, remove the part about states:
Original:

class ProjectProject(models.Model):
_inherit = 'project.project' def _get_type_common(self):
ids = self.env['project.task.type'].search([
 ('case_default', '=', True)])
 return ids

type_ids = fields.Many2many(
comodel_name='project.task.type', relation='project_task_type_rel',
column1='project_id', column2='type_id', string='Tasks Stages',
states={
'close': [('readonly', True)],
'cancelled': [('readonly', True)]
}, default=_get_type_common)
}

"Fixed":

class ProjectProject(models.Model):
_inherit = 'project.project' def _get_type_common(self):
ids = self.env['project.task.type'].search([
('case_default', '=', True)])
return ids

type_ids = fields.Many2many( comodel_name='project.task.type', relation='project_task_type_rel',
column1='project_id', column2='type_id', string='Tasks Stages',
  default=_get_type_common)
}

(Note: You might have to fix the indentation of this example code.)

Avatar
Discard
Best Answer

same error when install Project Task Default Stage

any help plz

Avatar
Discard
Author Best Answer

Hi all have figured this out uninstalled Project Task Default Stage module then rebooted server after this i was able to get into project settings something odd may have happened here. Thanks for all help so far.

Avatar
Discard