Skip to content Skip to sidebar Skip to footer

How To Modify The One2many Or Many2one Field In Other Model Odoo10

Can any one tell with example how to modify the field in another model if changed in type-one2many field. For example, I have two models a) hr_shifts b)hr_contract in hr_shifts the

Solution 1:

One2many and Many2many use a special "commands" format to manipulate the set of records stored in/associated with the field.

You should try:

current.write({'emp_name_ids': [(6, 0, [ids])]})

For more info regarding the special commands see docs: https://www.odoo.com/documentation/10.0/reference/orm.html#model-reference.

Scroll a bit down to the CRUD section there you will find all possible commands ((6, _, ids) is only one of a few more).


Post a Comment for "How To Modify The One2many Or Many2one Field In Other Model Odoo10"