Odoo Help

1

Issue in Project Module (Unknown field state in domain)

By
adrian.desanti@networkspecialists.net.au
on 11/8/16, 12:48 AM 469 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

 

1

Nilmar Shereef

--Nilmar Shereef--
1503
| 4 4 7
Calicut, India
--Nilmar Shereef--

Python Developer. Android Developer. .Net Developer

Nilmar Shereef
On 11/8/16, 2:00 AM

Hi adrian,

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

I hope this issue will resolve

0
Aleksander Nøkland
On 2/10/17, 6:34 AM

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.)

0
W360S CORP
On 2/8/17, 2:11 AM

same error when install Project Task Default Stage

any help plz

0

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.

0
Sarga
On 11/8/16, 2:16 AM

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. 

About This Community

This platform 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.

Register

Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)

Stats

Asked: 11/8/16, 12:48 AM
Seen: 469 times
Last updated: 2/10/17, 6:34 AM