Browse Source

[FIX] partner_contact_address_default: can't adapt type 'res.partner'

14.0
Ioan Galan 4 years ago
committed by Pedro M. Baeza
parent
commit
135f393f9c
  1. 2
      partner_contact_address_default/__manifest__.py
  2. 2
      partner_contact_address_default/models/res_partner.py
  3. 8
      partner_contact_address_default/tests/test_partner_contact_address_default.py

2
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",

2
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

8
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)
Loading…
Cancel
Save