|
|
@ -171,3 +171,23 @@ class ResPartner(models.Model): |
|
|
|
""" |
|
|
|
self.ensure_one() |
|
|
|
return 'c' if self.is_company else 'p' |
|
|
|
|
|
|
|
@api.multi |
|
|
|
def action_view_relations(self): |
|
|
|
for contact in self: |
|
|
|
relation_ids = self.env['res.partner.relation.all'].\ |
|
|
|
search(['|', ('this_partner_id', '=', contact.id), |
|
|
|
('other_partner_id', '=', contact.id)]) |
|
|
|
action = self.env.\ |
|
|
|
ref('partner_multi_relation.action_res_partner_relation_all').\ |
|
|
|
read()[0] |
|
|
|
action['context'] = {} |
|
|
|
action['domain'] = [('id', 'in', relation_ids.ids)] |
|
|
|
action['context'].\ |
|
|
|
update({'search_default_this_partner_id': contact.id, |
|
|
|
'default_this_partner_id': contact.id, |
|
|
|
'active_model': 'res.partner', |
|
|
|
'active_id': contact.id, |
|
|
|
'active_ids': [contact.id], |
|
|
|
'active_test': False}) |
|
|
|
return action |