From 135f393f9c88b51bff6e671bb6a4f9ab5b203785 Mon Sep 17 00:00:00 2001 From: Ioan Galan Date: Wed, 4 Nov 2020 17:05:01 +0100 Subject: [PATCH] [FIX] partner_contact_address_default: can't adapt type 'res.partner' --- partner_contact_address_default/__manifest__.py | 2 +- partner_contact_address_default/models/res_partner.py | 2 +- .../tests/test_partner_contact_address_default.py | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/partner_contact_address_default/__manifest__.py b/partner_contact_address_default/__manifest__.py index 75c49de70..ef30fa165 100644 --- a/partner_contact_address_default/__manifest__.py +++ b/partner_contact_address_default/__manifest__.py @@ -4,7 +4,7 @@ { "name": "Partner Contact address default", "summary": "Set a default delivery and invoice address for contacts", - "version": "14.0.1.0.0", + "version": "14.0.1.0.1", "development_status": "Beta", "category": "Generic Modules/Base", "website": "https://github.com/OCA/partner-contact", diff --git a/partner_contact_address_default/models/res_partner.py b/partner_contact_address_default/models/res_partner.py index 8da4e0423..a37f74bfe 100644 --- a/partner_contact_address_default/models/res_partner.py +++ b/partner_contact_address_default/models/res_partner.py @@ -26,5 +26,5 @@ class ResPartner(models.Model): for addr_type in default_address_type_list: default_address_id = partner["partner_{}_id".format(addr_type)] if default_address_id: - res[addr_type] = default_address_id + res[addr_type] = default_address_id.id return res diff --git a/partner_contact_address_default/tests/test_partner_contact_address_default.py b/partner_contact_address_default/tests/test_partner_contact_address_default.py index 6d8d52286..1e99df16a 100644 --- a/partner_contact_address_default/tests/test_partner_contact_address_default.py +++ b/partner_contact_address_default/tests/test_partner_contact_address_default.py @@ -31,11 +31,11 @@ class TestPartnerContactAddressDefault(common.TransactionCase): self.partner.partner_delivery_id = self.partner self.partner.partner_invoice_id = self.partner res = self.partner.address_get() - self.assertEqual(res["delivery"], self.partner) - self.assertEqual(res["invoice"], self.partner) + self.assertEqual(res["delivery"], self.partner.id) + self.assertEqual(res["invoice"], self.partner.id) self.partner_child_delivery2.partner_delivery_id = self.partner_child_delivery2 self.partner_child_delivery2.partner_invoice_id = self.partner_child_delivery2 res = self.partner_child_delivery2.address_get() - self.assertEqual(res["delivery"], self.partner_child_delivery2) - self.assertEqual(res["invoice"], self.partner_child_delivery2) + self.assertEqual(res["delivery"], self.partner_child_delivery2.id) + self.assertEqual(res["invoice"], self.partner_child_delivery2.id)