From 36b5d15188381eee9da90f9380e79bffdee415f4 Mon Sep 17 00:00:00 2001 From: Charbel Jacquin Date: Tue, 13 Oct 2015 17:36:29 +0200 Subject: [PATCH 1/4] [FIX][base_partner_merge] correctly handle new style reference fields --- base_partner_merge/base_partner_merge.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/base_partner_merge/base_partner_merge.py b/base_partner_merge/base_partner_merge.py index 4331c50fc..7b55f1093 100644 --- a/base_partner_merge/base_partner_merge.py +++ b/base_partner_merge/base_partner_merge.py @@ -274,9 +274,9 @@ class MergePartnerAutomatic(orm.TransientModel): if record.model == 'ir.property': continue - field_type = proxy_model._columns.get(record.name).__class__._type + field_spec = proxy_model._fields.get(record.name) - if field_type == 'function': + if field_spec.compute: continue for partner in src_partners: From 521c5cefdccaad5cab2da1c620f9b98336b993f5 Mon Sep 17 00:00:00 2001 From: Charbel Jacquin Date: Wed, 14 Oct 2015 12:10:58 +0200 Subject: [PATCH 2/4] make it green --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index b9b9313d7..60c541964 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,7 +20,7 @@ env: - secure: "R3Tr39zWkjHWyKxBuOoxtvkIZNipt+HbPccuh9+fLi5irikIN3y1+YofBbK/H/wqzg6Vv6mnmwlHfXixiDmZRzQ1GidZ3nFqZYhGREp4vuEjBEf+rUb5/Ijrn6Zspgl+CCDR7ET9E3wOLMRV4A39poPgIll0vALzrAdIbdRbDqc=" matrix: - - LINT_CHECK="1" + - LINT_CHECK="1" PYLINT_EXPECTED_ERRORS="2" # base_partner_merge uses openerp.osv - TRANSIFEX="1" - TESTS="1" ODOO_REPO="odoo/odoo" EXCLUDE="portal_partner_merge" - TESTS="1" ODOO_REPO="OCA/OCB" EXCLUDE="portal_partner_merge" From a6a27d0e20b226420113347577b218c7e98e4513 Mon Sep 17 00:00:00 2001 From: Charbel Jacquin Date: Thu, 15 Oct 2015 11:57:02 +0200 Subject: [PATCH 3/4] refine test following discussion on #180 --- base_partner_merge/base_partner_merge.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/base_partner_merge/base_partner_merge.py b/base_partner_merge/base_partner_merge.py index 7b55f1093..d9def5d34 100644 --- a/base_partner_merge/base_partner_merge.py +++ b/base_partner_merge/base_partner_merge.py @@ -274,9 +274,10 @@ class MergePartnerAutomatic(orm.TransientModel): if record.model == 'ir.property': continue + legacy = proxy_model._columns.get(record.name) field_spec = proxy_model._fields.get(record.name) - if field_spec.compute: + if isinstance(legacy, fields.function) or field_spec.compute: continue for partner in src_partners: From 8981c760b3e45816e37b858702de0519a0cd523a Mon Sep 17 00:00:00 2001 From: Charbel Jacquin Date: Mon, 2 Nov 2015 10:51:41 +0100 Subject: [PATCH 4/4] remove PYLINT_EXCEPTED_ERRORS --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 60c541964..b9b9313d7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,7 +20,7 @@ env: - secure: "R3Tr39zWkjHWyKxBuOoxtvkIZNipt+HbPccuh9+fLi5irikIN3y1+YofBbK/H/wqzg6Vv6mnmwlHfXixiDmZRzQ1GidZ3nFqZYhGREp4vuEjBEf+rUb5/Ijrn6Zspgl+CCDR7ET9E3wOLMRV4A39poPgIll0vALzrAdIbdRbDqc=" matrix: - - LINT_CHECK="1" PYLINT_EXPECTED_ERRORS="2" # base_partner_merge uses openerp.osv + - LINT_CHECK="1" - TRANSIFEX="1" - TESTS="1" ODOO_REPO="odoo/odoo" EXCLUDE="portal_partner_merge" - TESTS="1" ODOO_REPO="OCA/OCB" EXCLUDE="portal_partner_merge"