[FIX] res: Creating a partner with an invoice contact

When creating a partner with company_type='person' and with an invoice
adress, the created partner must stay a person.
Now a partner which is not a comany can have an invoice address.
Fixes #11730

opw:675322
This commit is contained in:
Goffin Simon
2016-04-26 14:06:51 +02:00
parent 3108a49ab2
commit 571d97e62e
2 changed files with 0 additions and 3 deletions
-2
View File
@@ -471,8 +471,6 @@ class res_partner(osv.Model, format_address):
any(partner[f] for f in address_fields) and not any(parent[f] for f in address_fields):
addr_vals = self._update_fields_values(cr, uid, partner, address_fields, context=context)
parent.update_address(addr_vals)
if not parent.is_company:
parent.write({'is_company': True})
def _clean_website(self, website):
(scheme, netloc, path, params, query, fragment) = urlparse.urlparse(website)
-1
View File
@@ -124,7 +124,6 @@ class test_base(common.TransactionCase):
self.assertEquals(p1.type, 'contact', 'Default type must be "contact", not the copied parent type')
ironshield.refresh()
self.assertEqual(ironshield.street, p1.street, 'Address fields should be copied to company')
self.assertTrue(ironshield.is_company, 'Company flag should be turned on after first contact creation')
def test_40_res_partner_address_getc(self):
""" Test address_get address resolution mechanism: it should first go down through descendants,