From 59152c43c7b291e7d354cd1211a369e96ec28c26 Mon Sep 17 00:00:00 2001 From: Richard deMeester Date: Mon, 23 Nov 2015 09:59:19 +1100 Subject: [PATCH 1/3] [9.0] Port partner_contact_nationality. --- partner_contact_nationality/README.rst | 46 +++++++++++-------- partner_contact_nationality/__init__.py | 16 +------ partner_contact_nationality/__openerp__.py | 32 ++++++------- partner_contact_nationality/models.py | 26 ----------- .../models/__init__.py | 5 ++ .../models/res_partner.py | 11 +++++ .../views/res_partner.xml | 17 ++++--- 7 files changed, 68 insertions(+), 85 deletions(-) delete mode 100644 partner_contact_nationality/models.py create mode 100644 partner_contact_nationality/models/__init__.py create mode 100644 partner_contact_nationality/models/res_partner.py diff --git a/partner_contact_nationality/README.rst b/partner_contact_nationality/README.rst index 41bee0784..6d28a85a7 100644 --- a/partner_contact_nationality/README.rst +++ b/partner_contact_nationality/README.rst @@ -1,18 +1,18 @@ .. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg - :alt: License: AGPL-3 + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 -Module name -=========== +=================== +Partner Nationality +=================== -This module was written to extend the functionality of Odoo to support setting -a nationality for your contacts. +This module was written to extend the contact management functionality. It +allows recording of a partner's nationality. Installation ============ -To install this module, you need to: - -* Install the OCA repository `partner-contact`_. +There are no special instructions regarding installation. Configuration ============= @@ -22,22 +22,34 @@ No configuration is needed. Usage ===== -To use this module, you need to: - -* Edit or create a partner. -* Ensure it is **not** a company. -* Go to the *Personal Information* sheet. -* Set the nationality there. +New item for 'Nationality' can be edited on the 'Personal Information' tab of +the partner contact form. For further information, please visit: * https://www.odoo.com/forum/help-1 * https://github.com/OCA/partner-contact/ +.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas + :alt: Try me on Runbot + :target: https://runbot.odoo-community.org/runbot/134/9.0 + Known issues / Roadmap ====================== -* None. +* No known issues. + +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 `here `_. + Credits ======= @@ -49,6 +61,7 @@ Contributors * Jairo Llopis * Matjaž Mozetič * Rudolf Schnapka +* Richard deMeester Maintainer ---------- @@ -64,6 +77,3 @@ mission is to support the collaborative development of Odoo features and promote its widespread use. To contribute to this module, please visit http://odoo-community.org. - - -.. _partner-contact: https://github.com/OCA/partner-contact/ diff --git a/partner_contact_nationality/__init__.py b/partner_contact_nationality/__init__.py index 3b3430c28..edd280109 100644 --- a/partner_contact_nationality/__init__.py +++ b/partner_contact_nationality/__init__.py @@ -1,19 +1,5 @@ # -*- coding: utf-8 -*- - -# Odoo, Open Source Management Solution # Copyright (C) 2014-2015 Grupo ESOC -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from . import models diff --git a/partner_contact_nationality/__openerp__.py b/partner_contact_nationality/__openerp__.py index 74d78c5da..1c62acb27 100644 --- a/partner_contact_nationality/__openerp__.py +++ b/partner_contact_nationality/__openerp__.py @@ -1,32 +1,26 @@ # -*- coding: utf-8 -*- - -# Odoo, Open Source Management Solution # Copyright (C) 2014-2015 Grupo ESOC -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). { - "name": "Contact's nationality", - "version": "8.0.1.0.0", - "author": "Odoo Community Association (OCA)", + "name": "Contact nationality", + "summary": "Add nationality field to contacts", + "version": "9.0.1.0.0", "category": "Customer Relationship Management", "website": "https://odoo-community.org/", + "author": "Grupo ESOC, Odoo Community Association (OCA)", + "contributors": [ + 'Jairo Llopis ', + 'Richard deMeester ', + ], + "license": "AGPL-3", + 'application': False, + 'installable': True, + 'auto_install': False, "depends": [ "partner_contact_personal_information_page", ], "data": [ "views/res_partner.xml", ], - 'installable': False, } diff --git a/partner_contact_nationality/models.py b/partner_contact_nationality/models.py deleted file mode 100644 index 9f1ced20b..000000000 --- a/partner_contact_nationality/models.py +++ /dev/null @@ -1,26 +0,0 @@ -# -*- coding: utf-8 -*- - -# Odoo, Open Source Management Solution -# Copyright (C) 2014-2015 Grupo ESOC -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . - -from openerp import fields, models - - -class Partner(models.Model): - """Partner with nationality.""" - _inherit = "res.partner" - - nationality_id = fields.Many2one("res.country", "Nationality") diff --git a/partner_contact_nationality/models/__init__.py b/partner_contact_nationality/models/__init__.py new file mode 100644 index 000000000..9ea5a5724 --- /dev/null +++ b/partner_contact_nationality/models/__init__.py @@ -0,0 +1,5 @@ +# -*- coding: utf-8 -*- +# Copyright (C) 2014-2015 Grupo ESOC +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from . import res_partner \ No newline at end of file diff --git a/partner_contact_nationality/models/res_partner.py b/partner_contact_nationality/models/res_partner.py new file mode 100644 index 000000000..2883e2766 --- /dev/null +++ b/partner_contact_nationality/models/res_partner.py @@ -0,0 +1,11 @@ +# -*- coding: utf-8 -*- +# Copyright (C) 2014-2015 Grupo ESOC +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from openerp import fields, models + + +class ResPartner(models.Model): + _inherit = 'res.partner' + + nationality_id = fields.Many2one("res.country", "Nationality") diff --git a/partner_contact_nationality/views/res_partner.xml b/partner_contact_nationality/views/res_partner.xml index 1d6800df7..fb965848d 100644 --- a/partner_contact_nationality/views/res_partner.xml +++ b/partner_contact_nationality/views/res_partner.xml @@ -1,19 +1,22 @@ + + + - + - - Nationality field + + Partner nationality: personal info res.partner - - + + - + - + \ No newline at end of file From 6d8d1f20d392069945007478aabf9eb5204674c6 Mon Sep 17 00:00:00 2001 From: Richard deMeester Date: Mon, 23 Nov 2015 11:41:28 +1100 Subject: [PATCH 2/3] Minor changes. --- partner_contact_nationality/README.rst | 4 ++-- partner_contact_nationality/models/__init__.py | 2 +- partner_contact_nationality/views/res_partner.xml | 3 --- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/partner_contact_nationality/README.rst b/partner_contact_nationality/README.rst index 6d28a85a7..41adf0c86 100644 --- a/partner_contact_nationality/README.rst +++ b/partner_contact_nationality/README.rst @@ -6,8 +6,8 @@ Partner Nationality =================== -This module was written to extend the contact management functionality. It -allows recording of a partner's nationality. +This module extends the contact management functionality. It allows recording +of a partner's nationality. Installation ============ diff --git a/partner_contact_nationality/models/__init__.py b/partner_contact_nationality/models/__init__.py index 9ea5a5724..85e65057d 100644 --- a/partner_contact_nationality/models/__init__.py +++ b/partner_contact_nationality/models/__init__.py @@ -2,4 +2,4 @@ # Copyright (C) 2014-2015 Grupo ESOC # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -from . import res_partner \ No newline at end of file +from . import res_partner diff --git a/partner_contact_nationality/views/res_partner.xml b/partner_contact_nationality/views/res_partner.xml index fb965848d..03d129cb6 100644 --- a/partner_contact_nationality/views/res_partner.xml +++ b/partner_contact_nationality/views/res_partner.xml @@ -1,6 +1,3 @@ - - - From 9a8eccb4c0bf58eb639dcb397224bb12c433632b Mon Sep 17 00:00:00 2001 From: Richard deMeester Date: Thu, 26 Nov 2015 09:36:07 +1100 Subject: [PATCH 3/3] Remove dependency on partner_contact_personal_information_page. --- partner_contact_nationality/__openerp__.py | 2 +- .../views/res_partner.xml | 23 +++++++++++++++++-- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/partner_contact_nationality/__openerp__.py b/partner_contact_nationality/__openerp__.py index 1c62acb27..9b119648c 100644 --- a/partner_contact_nationality/__openerp__.py +++ b/partner_contact_nationality/__openerp__.py @@ -18,7 +18,7 @@ 'installable': True, 'auto_install': False, "depends": [ - "partner_contact_personal_information_page", + "base", ], "data": [ "views/res_partner.xml", diff --git a/partner_contact_nationality/views/res_partner.xml b/partner_contact_nationality/views/res_partner.xml index 03d129cb6..b9b08460d 100644 --- a/partner_contact_nationality/views/res_partner.xml +++ b/partner_contact_nationality/views/res_partner.xml @@ -2,10 +2,29 @@ - + + + Personal information page for contacts form + res.partner + + 2 + + + + + + + + + + + + Partner nationality: personal info res.partner - +