Closed agrings closed 5 years ago
AFAIK, it should be if 20 not in partner.category_id.ids:
@pedrobaeza is right, you can also write this:
categ = odoo.env['category.model'].browse(20)
if categ not in partner.category_id:
partner.category_id += categ
Does it solve your issue?
Perfect @sebalix and @pedrobaeza . Thank you!
Hello,
I'm trying to include a Partner in a category, but first I need to verify when it is in the category already. Something like this:
But the m2m field doesn't work as a list for the "in" operator.