Skip to content
Snippets Groups Projects
Commit 1ffc0471 authored by niyasraphy's avatar niyasraphy
Browse files

[FIX] base: prevent copying of contact tag partners


before this commit, on duplicating a contact tag
will duplicate the assigned partners also.

suppose if we have a partner A with tag B assigned,
and then we duplicate tag B and create new tag C,
the newly created tag is automatically getting
assigned to partner A.

after this commit, the copy is set to False for
partner_ids field in tag and then the partners
wont be copied on duplicating a tag

closes odoo/odoo#116632

Signed-off-by: default avatarJulien Castiaux (juc) <juc@odoo.com>
parent b8b75d5b
No related branches found
No related tags found
No related merge requests found
......@@ -83,7 +83,7 @@ class PartnerCategory(models.Model):
child_ids = fields.One2many('res.partner.category', 'parent_id', string='Child Tags')
active = fields.Boolean(default=True, help="The active field allows you to hide the category without removing it.")
parent_path = fields.Char(index=True)
partner_ids = fields.Many2many('res.partner', column1='category_id', column2='partner_id', string='Partners')
partner_ids = fields.Many2many('res.partner', column1='category_id', column2='partner_id', string='Partners', copy=False)
@api.constrains('parent_id')
def _check_parent_id(self):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment