Browse Source

[FIX] Contact ID Error

12.0
Patrick Wilson 5 years ago
parent
commit
971b84cf8b
  1. 10
      partner_multi_relation/models/res_partner.py

10
partner_multi_relation/models/res_partner.py

@ -186,12 +186,12 @@ class ResPartner(models.Model):
action['domain'] = [('id', 'in', relation_ids.ids)] action['domain'] = [('id', 'in', relation_ids.ids)]
context = action.get('context', '{}').strip()[1:-1] context = action.get('context', '{}').strip()[1:-1]
elements = context.split(',') if context else [] elements = context.split(',') if context else []
to_add = ["""'search_default_this_partner_id': contact.id,
'default_this_partner_id': contact.id,
to_add = ["""'search_default_this_partner_id': {0},
'default_this_partner_id': {0},
'active_model': 'res.partner', 'active_model': 'res.partner',
'active_id': contact.id,
'active_ids': [contact.id],
'active_test': False"""]
'active_id': {0},
'active_ids': [{0}],
'active_test': False""".format(contact.id)]
context = '{' + ', '.join(elements + to_add) + '}' context = '{' + ', '.join(elements + to_add) + '}'
action['context'] = context action['context'] = context
return action return action
Loading…
Cancel
Save