Skip to Content
Menu
This question has been flagged
2220 Views

While open an existing record , How I fill or update the default value for One2many field?

I tried ,Ex:

    def _get_task_stages(self):
        task_ids = self.env["project.task.stages"].search([('case_default','=',1)])
        res = []
        for j in task_ids:
            values ={'name':j.name}
            res.append((0,0,values))
        return res

type_line = fields.One2many('project.new.task.type','project_id','Project Stages',default = _get_task_stages)

but the above code call only when create a new record.How I update the default value on all existing records.



Avatar
Discard
Related Posts Replies Views Activity
2
Nov 24
264
1
Oct 24
332
4
Oct 24
324
2
Oct 24
361
2
Dec 24
667