From b10f3756b55240d38057b94562380bcd7aa93145 Mon Sep 17 00:00:00 2001 From: Holger Brunn Date: Mon, 26 Jan 2015 14:10:46 +0100 Subject: [PATCH] [FIX] allow to change partner_id_display --- partner_relations/model/res_partner.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/partner_relations/model/res_partner.py b/partner_relations/model/res_partner.py index 68b744442..1dddfd913 100644 --- a/partner_relations/model/res_partner.py +++ b/partner_relations/model/res_partner.py @@ -69,6 +69,16 @@ class ResPartner(orm.Model): if value[0] == 0: relation_obj.create(cr, uid, value[2], context=context2) if value[0] == 1: + # if we write partner_id_display, we also need to pass + # type_selection_id in order to have this write end up on + # the correct field + if 'partner_id_display' in value[2] and 'type_selection_id'\ + not in value[2]: + relation_data = relation_obj.read( + cr, uid, [value[1]], ['type_selection_id'], + context=context)[0] + value[2]['type_selection_id'] =\ + relation_data['type_selection_id'] relation_obj.write( cr, uid, value[1], value[2], context=context2) if value[0] == 2: