From 716e56a6d24fa08c96c037eec9a5eaff3729ee30 Mon Sep 17 00:00:00 2001 From: Antonio Espinosa Date: Wed, 17 Jun 2015 18:18:58 +0200 Subject: [PATCH] [FIX] Type Exception when writing res.partner.relation.all model --- partner_relations/model/res_partner_relation_all.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/partner_relations/model/res_partner_relation_all.py b/partner_relations/model/res_partner_relation_all.py index f6f61b369..004a03718 100644 --- a/partner_relations/model/res_partner_relation_all.py +++ b/partner_relations/model/res_partner_relation_all.py @@ -177,6 +177,7 @@ class ResPartnerRelationAll(models.AbstractModel): def write(self, vals): """divert non-problematic writes to underlying table""" underlying_objs = self.get_underlying_object() + underlying_objs = underlying_objs and underlying_objs[0] vals = { key: val for key, val in vals.iteritems() @@ -209,4 +210,6 @@ class ResPartnerRelationAll(models.AbstractModel): @api.one def unlink(self): """divert non-problematic creates to underlying table""" - return self.get_underlying_object().unlink() + underlying_objs = self.get_underlying_object() + underlying_objs = underlying_objs and underlying_objs[0] + return underlying_objs.unlink()