[FIX] portal: show only real partner on access portal wizard
Before this commit, when granting portal access to a res.partner through the wizard, it would show all the partner + its child_ids, including shipping addresses partner, billing addresses, private (hr) addresses etc, which makes no sense. This commit hide contact-address from the list. Fixes #32848 closes odoo/odoo#34522 Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com> Co-authored-by: Romain Derie <rde@odoo.com> Co-authored-by: Xavier Brochard <xavier@alternatif.org>
This commit is contained in:
co-authored by
Xavier Brochard
parent
ebb755a95d
commit
41334ca2a5
@@ -35,7 +35,7 @@ class PortalWizard(models.TransientModel):
|
||||
contact_ids = set()
|
||||
user_changes = []
|
||||
for partner in self.env['res.partner'].sudo().browse(partner_ids):
|
||||
contact_partners = partner.child_ids | partner
|
||||
contact_partners = partner.child_ids.filtered(lambda p: p.type in ('contact', 'other')) | partner
|
||||
for contact in contact_partners:
|
||||
# make sure that each contact appears at most once in the list
|
||||
if contact.id not in contact_ids:
|
||||
|
||||
Reference in New Issue
Block a user