I'm currently building a module like a project module which shows Kanban view for model 'test.project' and when I click Kanban view, It shows tree views for model 'test.task' related to 'test.project'.
So I made a code below
class Test_project(osv.osv):
_name = "test.project"
_columns = {
'name': fields.char('Name'),
'task_ids': fields.one2many('test.task', 'project_id', string='TASK')
}
class Test_Task(osv.osv):
_name = 'test.task'
_columns = {
'project_id': fields.many2one('test.project', string='Project ID', required=1),
}
When I saved a data for 'test.project', It is saved correctly, But When I saved a data for 'test.task', It shows an error which is
IntegrityError: null value in column "project_id" violates not-null constraint
Cannot get the id.