From 6b8991149fa945243f1f15e9c0bcf94d2808e80e Mon Sep 17 00:00:00 2001 From: Holger Brunn Date: Wed, 13 Aug 2014 12:50:47 +0200 Subject: [PATCH] [IMP] context check, make type_id browsable --- partner_relations/model/res_partner.py | 3 +++ partner_relations/model/res_partner_relation_type_selection.py | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/partner_relations/model/res_partner.py b/partner_relations/model/res_partner.py index 1f6b8f2f4..cae4f0427 100644 --- a/partner_relations/model/res_partner.py +++ b/partner_relations/model/res_partner.py @@ -30,6 +30,9 @@ class ResPartner(orm.Model): def _get_relation_ids( self, cr, uid, ids, dummy_name, dummy_arg, context=None): + if context is None: + context = {} + # TODO: do a permission test on returned ids cr.execute( '''select id, left_partner_id, right_partner_id diff --git a/partner_relations/model/res_partner_relation_type_selection.py b/partner_relations/model/res_partner_relation_type_selection.py index ee9b969d1..e691936cf 100644 --- a/partner_relations/model/res_partner_relation_type_selection.py +++ b/partner_relations/model/res_partner_relation_type_selection.py @@ -110,7 +110,8 @@ class ResPartnerRelationTypeSelection(orm.Model): _foreign_keys = [] _columns = { 'record_type': fields.selection(_RECORD_TYPES, 'Record type', size=16), - 'type_id': fields.integer('Type'), + 'type_id': fields.many2one( + 'res.partner.relation.type', 'Type'), 'name': fields.char('Name', size=64), 'contact_type_this': fields.selection( ResPartnerRelationType._get_partner_types.im_func,