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

@api.depends('iwave_Experience')
def _get_category_ids_value(self):
for rec in self:
if self.iwave_Experience < 1:
rec.write({'category_ids': [6, 0, 'category_ids']})
if self.iwave_Experience >= 1:
rec.write({'category_ids': [6, 0, 'category_ids']})
if self.iwave_Experience >= 2:
rec.write({'category_ids': [6, 0, 'category_ids']})
if self.iwave_Experience >= 3:
rec.write({'category_ids': [6, 0, 'category_ids']})

else:
rec.category_ids = False


category_ids = fields.Many2many(compute="_get_category_ids_value")

how to solve this error. in odoov15

Avatar
Discard
Best Answer

Hi,

Please update your code as follows:


@api.depends('iwave_Experience')
def _get_category_ids_value(self):
for rec in self:
if rec.iwave_Experience < 1:
rec.write({'category_ids': [6, 0, 'category_ids']})
elif rec.iwave_Experience >= 1:
rec.write({'category_ids': [6, 0, 'category_ids']})
elif rec.iwave_Experience >= 2:
rec.write({'category_ids': [6, 0, 'category_ids']})
elif rec.iwave_Experience >= 3:
rec.write({'category_ids': [6, 0, 'category_ids']})


Thanks and Regards

Walnut Software Solutions

Avatar
Discard