Skip to Content
Menu
This question has been flagged
1 Reply
1788 Views

In this code ,when I select project ,all related employees are listed to one2many field.The project_id  also many2one so I can select one project at a time.I try to many2many on project_id and many2many tags in xml also for selecting multiple project.When I try that the values are printed in the treeview but the moment of saving it shows noimplement error.How can I solve that?pls help

project_id = fields.Many2one('account.analytic.account', string="Project")


demos_id = fields.One2many("billing.tree", "line_id")

@api.onchange('project_id')
def _check_emp_id(self):
for rec in self:
lines= [(5, 0, 0)]
for line in self.project_id.line_ids:
vals = {
'employee_id': line.employee_id,

}
lines.append((0, 0, vals))
rec.demos_id = lines
print(lines, "val")
Avatar
Discard

Please do not use person names as tags for your questions. This is not a personal messenger, but a public forum.