I am stuck in a situation and unable to resolve. Here is the scenario.
I have one `many2one` field named `Parent`, it has `title' that is `many2one` from other module. `Parent` also has another `one2many` field named `subproject`
`Subproject` has title `Question`, which should be filtered from `Parent`'s `title`. Question is also `many2one` field. I have defined it in another module.
I am unable to load subprojects(Question) filtered according to select from Parent(title)
My Parent python loos like:
class parent_page(osv.osv):
_name = 'parent.page'
_description = 'Parent Pages'
_rec_name = 'title'
_order = 'sequence'
_columns = {
'title': fields.many2one('Project.form', 'Project'),
'parent_id': fields.many2one('parent', 'Parent', ondelete='cascade'),
'question_ids': fields.one2many('parent.question', 'page_id', 'Question'),
'sequence': fields.integer('Page Nr'),
'note': fields.text('Description'),
}
parent_page()
My subProject python file looks like this:
class parent_question(osv.osv):
_name = 'parent.question'
_description = 'Parent Question'
_rec_name = 'question'
_order = 'sequence'
_columns = {
'page_id': fields.many2one('parent.page', 'Parent Page', ondelete='cascade', required=1),
'question': fields.many2one('subproject.form', 'Question'), ######## I want it to be filtered from parent title i.e project
}
My project and subproject python is as follows:
class project_form(osv.osv):
_name="project.form"
_columns={
'name':fields.char("Projects",size=128),
'emp_id': fields.many2one('hr.employee','Employee Name')
}
project_form()
class subproject_form(osv.osv):
_name="subproject.form"
_columns={
'name':fields.char("Form",size=128),
'project_id':fields.many2one('project.form','Project')
}
subproject_form()
I tried to use domain in xml but got nothing. same with value.
Please point me to right direction.
Note: Sorry for naming of modules as someone else was working on this and i had to continue it.