Browse Source

[IMP] Formatting

14.0
scampbell 5 years ago
committed by Raf Ven
parent
commit
a82ca09a53
  1. 14
      partner_multi_relation/models/res_partner.py
  2. 6
      partner_multi_relation/views/res_partner.xml

14
partner_multi_relation/models/res_partner.py

@ -175,13 +175,13 @@ class ResPartner(models.Model):
@api.multi @api.multi
def action_view_relations(self): def action_view_relations(self):
for contact in 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'] = {}
relation_model = self.env['res.partner.relation.all']
relation_ids = relation_model.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['domain'] = [('id', 'in', relation_ids.ids)] action['domain'] = [('id', 'in', relation_ids.ids)]
action['context'].\ action['context'].\
update({'search_default_this_partner_id': contact.id, update({'search_default_this_partner_id': contact.id,

6
partner_multi_relation/views/res_partner.xml

@ -25,9 +25,9 @@
type="object" type="object"
class="oe_stat_button" class="oe_stat_button"
icon="fa-users"> icon="fa-users">
<field name="relation_count"
widget="statinfo"
string="Relations"/>
<field name="relation_count"
widget="statinfo"
string="Relations"/>
</button> </button>
</xpath> </xpath>
</field> </field>

Loading…
Cancel
Save