From 82a31630fb217f1128e314d88c8333b96fd14fc5 Mon Sep 17 00:00:00 2001 From: cubells Date: Thu, 15 Dec 2016 14:13:36 +0100 Subject: [PATCH] base_import_match module --- base_import_match/README.rst | 9 ++-- base_import_match/__init__.py | 3 +- base_import_match/__openerp__.py | 14 +++--- base_import_match/data/base_import_match.xml | 33 ++++++++++++++ base_import_match/data/base_import_match.yml | 29 ------------ base_import_match/demo/base_import_match.xml | 45 +++++++++++++++++++ base_import_match/demo/base_import_match.yml | 40 ----------------- base_import_match/models/__init__.py | 3 +- base_import_match/models/base_import.py | 5 ++- base_import_match/tests/__init__.py | 3 +- base_import_match/tests/test_import.py | 3 +- .../views/base_import_match_view.xml | 9 ++-- 12 files changed, 104 insertions(+), 92 deletions(-) create mode 100644 base_import_match/data/base_import_match.xml delete mode 100644 base_import_match/data/base_import_match.yml create mode 100644 base_import_match/demo/base_import_match.xml delete mode 100644 base_import_match/demo/base_import_match.yml diff --git a/base_import_match/README.rst b/base_import_match/README.rst index 6dc1a429b..5b9716907 100644 --- a/base_import_match/README.rst +++ b/base_import_match/README.rst @@ -84,7 +84,7 @@ To use this module, you need to: .. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas :alt: Try me on Runbot - :target: https://runbot.odoo-community.org/runbot/149/8.0 + :target: https://runbot.odoo-community.org/runbot/149/9.0 Known Issues / Roadmap ====================== @@ -98,11 +98,7 @@ Bug Tracker Bugs are tracked on `GitHub Issues `_. In case of trouble, please check there if your issue has already been reported. If you spotted it first, -help us smashing it by providing a detailed and welcomed `feedback -`_. +help us smashing it by providing a detailed and welcomed feedback. Credits ======= @@ -111,6 +107,7 @@ Contributors ------------ * Jairo Llopis +* Vicent Cubells Maintainer ---------- diff --git a/base_import_match/__init__.py b/base_import_match/__init__.py index 09356048f..197214cdd 100644 --- a/base_import_match/__init__.py +++ b/base_import_match/__init__.py @@ -1,5 +1,6 @@ # -*- coding: utf-8 -*- -# © 2016 Grupo ESOC Ingeniería de Servicios, S.L.U. - Jairo Llopis +# Copyright 2016 Grupo ESOC Ingeniería de Servicios, S.L.U. - Jairo Llopis +# Copyright 2016 Tecnativa - Vicent Cubells # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from . import models diff --git a/base_import_match/__openerp__.py b/base_import_match/__openerp__.py index d8eb62daf..a3564a891 100644 --- a/base_import_match/__openerp__.py +++ b/base_import_match/__openerp__.py @@ -1,13 +1,15 @@ # -*- coding: utf-8 -*- -# © 2016 Grupo ESOC Ingeniería de Servicios, S.L.U. - Jairo Llopis +# Copyright 2016 Grupo ESOC Ingeniería de Servicios, S.L.U. - Jairo Llopis +# Copyright 2016 Tecnativa - Vicent Cubells # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). { "name": "Base Import Match", "summary": "Try to avoid duplicates before importing", - "version": "8.0.1.0.1", + "version": "9.0.1.0.0", "category": "Tools", - "website": "https://grupoesoc.es", - "author": "Grupo ESOC Ingeniería de Servicios, " + "website": "https://tecnativa.com", + "author": "Grupo ESOC Ingeniería de Servicios," + "Tecnativa, " "Odoo Community Association (OCA)", "license": "AGPL-3", "application": False, @@ -17,10 +19,10 @@ ], "data": [ "security/ir.model.access.csv", - "data/base_import_match.yml", + "data/base_import_match.xml", "views/base_import_match_view.xml", ], "demo": [ - "demo/base_import_match.yml", + "demo/base_import_match.xml", ], } diff --git a/base_import_match/data/base_import_match.xml b/base_import_match/data/base_import_match.xml new file mode 100644 index 000000000..b2995871b --- /dev/null +++ b/base_import_match/data/base_import_match.xml @@ -0,0 +1,33 @@ + + + + + + + + 10 + + + + + + + + + True + True + + + + + + 50 + + + + + + + diff --git a/base_import_match/data/base_import_match.yml b/base_import_match/data/base_import_match.yml deleted file mode 100644 index 5f49c911c..000000000 --- a/base_import_match/data/base_import_match.yml +++ /dev/null @@ -1,29 +0,0 @@ -# -*- coding: utf-8 -*- -# © 2016 Grupo ESOC Ingeniería de Servicios, S.L.U. - Jairo Llopis -# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). - -- !context {noupdate: True} - -# Match partners by VAT when is_company is True -- !record {id: res_partner_vat, model: base_import.match}: - model_id: base.model_res_partner - sequence: 10 - -- !record {id: res_partner_vat_vat, model: base_import.match.field}: - match_id: res_partner_vat - field_id: base.field_res_partner_vat - -- !record {id: res_partner_vat_is_company, model: base_import.match.field}: - match_id: res_partner_vat - field_id: base.field_res_partner_is_company - conditional: True - imported_value: "True" - -# Match users by login -- !record {id: res_users_login, model: base_import.match}: - model_id: base.model_res_users - sequence: 50 - -- !record {id: res_users_login_login, model: base_import.match.field}: - match_id: res_users_login - field_id: base.field_res_users_login diff --git a/base_import_match/demo/base_import_match.xml b/base_import_match/demo/base_import_match.xml new file mode 100644 index 000000000..4e9af7f42 --- /dev/null +++ b/base_import_match/demo/base_import_match.xml @@ -0,0 +1,45 @@ + + + + + + + + 20 + + + + + + + + + + + + + + + + + + 30 + + + + + + + + + + 40 + + + + + + + diff --git a/base_import_match/demo/base_import_match.yml b/base_import_match/demo/base_import_match.yml deleted file mode 100644 index 110e993ee..000000000 --- a/base_import_match/demo/base_import_match.yml +++ /dev/null @@ -1,40 +0,0 @@ -# -*- coding: utf-8 -*- -# © 2016 Grupo ESOC Ingeniería de Servicios, S.L.U. - Jairo Llopis -# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). - -- !context {noupdate: True} - -# Match partners by name, parent_id and is_company -- !record {id: res_partner_parent_name_is_company, model: base_import.match}: - model_id: base.model_res_partner - sequence: 20 - -- !record {id: res_partner_parent_name_is_company_name, model: base_import.match.field}: - match_id: res_partner_parent_name_is_company - field_id: base.field_res_partner_name - -- !record {id: res_partner_parent_name_is_company_parent, model: base_import.match.field}: - match_id: res_partner_parent_name_is_company - field_id: base.field_res_partner_parent_id - -- !record {id: res_partner_parent_name_is_company_is_company, model: base_import.match.field}: - match_id: res_partner_parent_name_is_company - field_id: base.field_res_partner_is_company - -# Match partner by email -- !record {id: res_partner_email, model: base_import.match}: - model_id: base.model_res_partner - sequence: 30 - -- !record {id: res_partner_email_email, model: base_import.match.field}: - match_id: res_partner_email - field_id: base.field_res_partner_email - -# Match partner by name -- !record {id: res_partner_name, model: base_import.match}: - model_id: base.model_res_partner - sequence: 40 - -- !record {id: res_partner_name_name, model: base_import.match.field}: - match_id: res_partner_name - field_id: base.field_res_partner_name diff --git a/base_import_match/models/__init__.py b/base_import_match/models/__init__.py index ec83d2a4b..2e3b69da7 100644 --- a/base_import_match/models/__init__.py +++ b/base_import_match/models/__init__.py @@ -1,5 +1,6 @@ # -*- coding: utf-8 -*- -# © 2016 Grupo ESOC Ingeniería de Servicios, S.L.U. - Jairo Llopis +# Copyright 2016 Grupo ESOC Ingeniería de Servicios, S.L.U. - Jairo Llopis +# Copyright 2016 Tecnativa - Vicent Cubells # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from . import base_import diff --git a/base_import_match/models/base_import.py b/base_import_match/models/base_import.py index 6251dd901..5c7d57384 100644 --- a/base_import_match/models/base_import.py +++ b/base_import_match/models/base_import.py @@ -1,5 +1,6 @@ # -*- coding: utf-8 -*- -# © 2016 Grupo ESOC Ingeniería de Servicios, S.L.U. - Jairo Llopis +# Copyright 2016 Grupo ESOC Ingeniería de Servicios, S.L.U. - Jairo Llopis +# Copyright 2016 Tecnativa - Vicent Cubells # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from openerp import api, fields, models from openerp import SUPERUSER_ID # TODO remove in v10 @@ -20,7 +21,7 @@ class BaseImportMatch(models.Model): "Model", required=True, ondelete="cascade", - domain=[("osv_memory", "=", False)], + domain=[("transient ", "=", False)], help="In this model you will apply the match.") model_name = fields.Char( related="model_id.model", diff --git a/base_import_match/tests/__init__.py b/base_import_match/tests/__init__.py index ce1b8ba33..1d8b5f1b2 100644 --- a/base_import_match/tests/__init__.py +++ b/base_import_match/tests/__init__.py @@ -1,5 +1,6 @@ # -*- coding: utf-8 -*- -# © 2016 Grupo ESOC Ingeniería de Servicios, S.L.U. - Jairo Llopis +# Copyright 2016 Grupo ESOC Ingeniería de Servicios, S.L.U. - Jairo Llopis +# Copyright 2016 Tecnativa - Vicent Cubells # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from . import test_import diff --git a/base_import_match/tests/test_import.py b/base_import_match/tests/test_import.py index 5c47663d7..0eb432b6f 100644 --- a/base_import_match/tests/test_import.py +++ b/base_import_match/tests/test_import.py @@ -1,5 +1,6 @@ # -*- coding: utf-8 -*- -# © 2016 Grupo ESOC Ingeniería de Servicios, S.L.U. - Jairo Llopis +# Copyright 2016 Grupo ESOC Ingeniería de Servicios, S.L.U. - Jairo Llopis +# Copyright 2016 Tecnativa - Vicent Cubells # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from os import path diff --git a/base_import_match/views/base_import_match_view.xml b/base_import_match/views/base_import_match_view.xml index a6490a912..11c9e8245 100644 --- a/base_import_match/views/base_import_match_view.xml +++ b/base_import_match/views/base_import_match_view.xml @@ -1,9 +1,9 @@ - - - + Import match form view @@ -78,5 +78,4 @@ action="match_action" parent="base.next_id_9"/> - - +