active_route_ids = self.env['route.data'].browse(active_ids)
customer_contacts_group = {}
for record in active_route_ids:
for control in record.cust_control_pts:
key_id = str(control.res_partner.id)
if key_id not in customer_contacts_group:
customer_contacts_group[key_id] = record
else:
customer_contacts_group[key_id].add(record)
Let's say we have dictionary like this:
customer_contacts_group = {'1': (20,)}
I want to make it like this:
customer_contacts_group = {'1': (20,30,40,)}
by appending values to customer_contacts_group['1'] one by one.