From da77c957170b03aaa23f88298ee6cad4b9a8f7cf Mon Sep 17 00:00:00 2001 From: Pierrick Brun Date: Fri, 14 Jan 2022 11:57:56 +0100 Subject: [PATCH] [FIX] address_default: return ids on address_get --- partner_contact_address_default/models/res_partner.py | 2 +- .../tests/test_partner_contact_address_default.py | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) 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)