From 4631c68f3a23e4d5c15de7f373b74816747f4409 Mon Sep 17 00:00:00 2001 From: Richard deMeester Date: Fri, 20 Nov 2015 10:57:25 +1100 Subject: [PATCH 1/9] [9.0] Upgrade Partner Gender module --- partner_contact_gender/README.rst | 48 +++++++++++++------ partner_contact_gender/__init__.py | 2 +- partner_contact_gender/__openerp__.py | 19 ++++---- partner_contact_gender/models.py | 26 ---------- partner_contact_gender/models/__init__.py | 3 ++ .../models/partner_gender.py | 32 +++++++++++++ partner_contact_gender/views/res_partner.xml | 31 +++--------- 7 files changed, 86 insertions(+), 75 deletions(-) delete mode 100644 partner_contact_gender/models.py create mode 100644 partner_contact_gender/models/__init__.py create mode 100644 partner_contact_gender/models/partner_gender.py diff --git a/partner_contact_gender/README.rst b/partner_contact_gender/README.rst index 9ec0f96f0..bb74d3304 100644 --- a/partner_contact_gender/README.rst +++ b/partner_contact_gender/README.rst @@ -1,46 +1,64 @@ .. 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 +============== Partner Gender ============== -This module was written to extend the functionality of Odoo contacts manager to -support setting the gender of a partner. +This module was written to extend the contact management functionality. It +allows recording of a partner's gender. Installation ============ -To install this module, you need to: - -* Install the `partner-contact`_ repository. +There are no special instructions regarding installation. +Configuration +============= -.. _partner-contact: https://github.com/OCA/partner-contact/ +No configuration is needed. Usage ===== -To use this module, you need to: - -* Edit a partner or create a new one. -* Ensure the partner is **not** a company. -* Go to the *Personal information* sheet. -* Set the gender there. +New item for 'Gender' 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 +====================== + +* 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 ======= -* Icon from `Font Awesome `_. - Contributors ------------ * Jairo Llopis +* Richard deMeester Maintainer ---------- diff --git a/partner_contact_gender/__init__.py b/partner_contact_gender/__init__.py index 685080d25..3b3430c28 100644 --- a/partner_contact_gender/__init__.py +++ b/partner_contact_gender/__init__.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- # Odoo, Open Source Management Solution # Copyright (C) 2014-2015 Grupo ESOC diff --git a/partner_contact_gender/__openerp__.py b/partner_contact_gender/__openerp__.py index c4f39881b..badca1e73 100644 --- a/partner_contact_gender/__openerp__.py +++ b/partner_contact_gender/__openerp__.py @@ -1,7 +1,6 @@ -# -*- encoding: utf-8 -*- +# -*- 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 @@ -18,18 +17,22 @@ { "name": "Contact gender", - "version": "8.0.1.0.0", - "category": "Customer Relationship Management", - "author": "Odoo Community Association (OCA), Grupo ESOC", + "summary": "Add gender field to contacts", + "version": "9.0.1.0.0", + "author": "Odoo Community Association (OCA)", "license": "AGPL-3", + "contributors": [ + 'Jairo Llopis ', + 'Richard deMeester ', + ], + "category": "Customer Relationship Management", "website": "https://odoo-community.org/", - 'installable': False, - "application": False, - "summary": "Add gender field to contacts", "depends": [ "partner_contact_personal_information_page", ], "data": [ "views/res_partner.xml", ], + 'installable': True, + 'auto_install': False, } diff --git a/partner_contact_gender/models.py b/partner_contact_gender/models.py deleted file mode 100644 index 88f632381..000000000 --- a/partner_contact_gender/models.py +++ /dev/null @@ -1,26 +0,0 @@ -# -*- encoding: 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): - """Partners with gender.""" - _inherit = "res.partner" - - gender = fields.Selection([('male', 'Male'), ('female', 'Female')]) diff --git a/partner_contact_gender/models/__init__.py b/partner_contact_gender/models/__init__.py new file mode 100644 index 000000000..220cfa73e --- /dev/null +++ b/partner_contact_gender/models/__init__.py @@ -0,0 +1,3 @@ +# -*- coding: utf-8 -*- + +from . import partner_gender diff --git a/partner_contact_gender/models/partner_gender.py b/partner_contact_gender/models/partner_gender.py new file mode 100644 index 000000000..af3d6cf8a --- /dev/null +++ b/partner_contact_gender/models/partner_gender.py @@ -0,0 +1,32 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2013-TODAY OpenERP SA (). +# +# 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, _, api +from openerp.osv import expression + + +class ResPartner(models.Model): + _inherit = 'res.partner' + + gender = fields.Selection([('male', 'Male'), + ('female', 'Female'), + ('other', 'Other') + ]) diff --git a/partner_contact_gender/views/res_partner.xml b/partner_contact_gender/views/res_partner.xml index fdaa83893..fe8de33a8 100644 --- a/partner_contact_gender/views/res_partner.xml +++ b/partner_contact_gender/views/res_partner.xml @@ -1,38 +1,19 @@ - - - - + - - Partner gender + + Partner gender: personal info res.partner - - + + - + From b9e84b0032ac96769dd94a89d8720bae9898ffe6 Mon Sep 17 00:00:00 2001 From: Richard deMeester Date: Fri, 20 Nov 2015 12:22:36 +1100 Subject: [PATCH 2/9] Changes to __openerp__.py as requested --- partner_contact_gender/__openerp__.py | 29 ++++++++------------------- 1 file changed, 8 insertions(+), 21 deletions(-) diff --git a/partner_contact_gender/__openerp__.py b/partner_contact_gender/__openerp__.py index badca1e73..903430f83 100644 --- a/partner_contact_gender/__openerp__.py +++ b/partner_contact_gender/__openerp__.py @@ -1,38 +1,25 @@ # -*- coding: utf-8 -*- - -# Odoo, Open Source Management Solution -# -# 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 gender", "summary": "Add gender field to contacts", "version": "9.0.1.0.0", - "author": "Odoo Community Association (OCA)", - "license": "AGPL-3", + "category": "Customer Relationship Management", + "website": "https://odoo-community.org/", + "author": "Grupo ESOC, Odoo Community Association (OCA)", "contributors": [ 'Jairo Llopis ', 'Richard deMeester ', ], - "category": "Customer Relationship Management", - "website": "https://odoo-community.org/", + "license": "AGPL-3", + 'application': False, + 'installable': True, + 'auto_install': False, "depends": [ "partner_contact_personal_information_page", ], "data": [ "views/res_partner.xml", ], - 'installable': True, - 'auto_install': False, } From c83aa71513906ab3ddc860780d196569d2e404b8 Mon Sep 17 00:00:00 2001 From: Richard deMeester Date: Fri, 20 Nov 2015 12:34:19 +1100 Subject: [PATCH 3/9] Change headers to simple. --- partner_contact_gender/models/__init__.py | 1 + .../models/partner_gender.py | 20 +------------------ 2 files changed, 2 insertions(+), 19 deletions(-) diff --git a/partner_contact_gender/models/__init__.py b/partner_contact_gender/models/__init__.py index 220cfa73e..c211abb4e 100644 --- a/partner_contact_gender/models/__init__.py +++ b/partner_contact_gender/models/__init__.py @@ -1,3 +1,4 @@ # -*- coding: utf-8 -*- +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from . import partner_gender diff --git a/partner_contact_gender/models/partner_gender.py b/partner_contact_gender/models/partner_gender.py index af3d6cf8a..0db45d49d 100644 --- a/partner_contact_gender/models/partner_gender.py +++ b/partner_contact_gender/models/partner_gender.py @@ -1,23 +1,5 @@ # -*- coding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2013-TODAY OpenERP SA (). -# -# 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 openerp import fields, models, _, api from openerp.osv import expression From 51e6c0b011045d8a29fc50e74ac9b747a8c70076 Mon Sep 17 00:00:00 2001 From: Richard deMeester Date: Fri, 20 Nov 2015 12:38:53 +1100 Subject: [PATCH 4/9] Changes as requested --- partner_contact_gender/README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/partner_contact_gender/README.rst b/partner_contact_gender/README.rst index bb74d3304..52f27abc2 100644 --- a/partner_contact_gender/README.rst +++ b/partner_contact_gender/README.rst @@ -48,7 +48,7 @@ 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 `_. +9.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_. Credits From cff28cd94e5f94894b88b705c92a285d41ca3d71 Mon Sep 17 00:00:00 2001 From: Richard deMeester Date: Fri, 20 Nov 2015 17:57:00 +1100 Subject: [PATCH 5/9] Remove unused openerp reference. --- partner_contact_gender/models/partner_gender.py | 1 - 1 file changed, 1 deletion(-) diff --git a/partner_contact_gender/models/partner_gender.py b/partner_contact_gender/models/partner_gender.py index 0db45d49d..0cddc0b73 100644 --- a/partner_contact_gender/models/partner_gender.py +++ b/partner_contact_gender/models/partner_gender.py @@ -2,7 +2,6 @@ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from openerp import fields, models, _, api -from openerp.osv import expression class ResPartner(models.Model): From 03eddbdd6a0ee7debc2745f69c8e387b7413614c Mon Sep 17 00:00:00 2001 From: Richard deMeester Date: Mon, 23 Nov 2015 09:41:18 +1100 Subject: [PATCH 6/9] Changes as requested. --- partner_contact_gender/__init__.py | 16 +--------------- partner_contact_gender/__openerp__.py | 1 + partner_contact_gender/models/__init__.py | 3 ++- .../models/{partner_gender.py => res_partner.py} | 3 ++- 4 files changed, 6 insertions(+), 17 deletions(-) rename partner_contact_gender/models/{partner_gender.py => res_partner.py} (78%) diff --git a/partner_contact_gender/__init__.py b/partner_contact_gender/__init__.py index 3b3430c28..edd280109 100644 --- a/partner_contact_gender/__init__.py +++ b/partner_contact_gender/__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_gender/__openerp__.py b/partner_contact_gender/__openerp__.py index 903430f83..a4b9d4a4a 100644 --- a/partner_contact_gender/__openerp__.py +++ b/partner_contact_gender/__openerp__.py @@ -1,4 +1,5 @@ # -*- coding: utf-8 -*- +# Copyright (C) 2014-2015 Grupo ESOC # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). { diff --git a/partner_contact_gender/models/__init__.py b/partner_contact_gender/models/__init__.py index c211abb4e..85e65057d 100644 --- a/partner_contact_gender/models/__init__.py +++ b/partner_contact_gender/models/__init__.py @@ -1,4 +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 partner_gender +from . import res_partner diff --git a/partner_contact_gender/models/partner_gender.py b/partner_contact_gender/models/res_partner.py similarity index 78% rename from partner_contact_gender/models/partner_gender.py rename to partner_contact_gender/models/res_partner.py index 0cddc0b73..ce142e659 100644 --- a/partner_contact_gender/models/partner_gender.py +++ b/partner_contact_gender/models/res_partner.py @@ -1,7 +1,8 @@ # -*- 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, _, api +from openerp import fields, models class ResPartner(models.Model): From dff15dd7c528c03aa5e88a0b8b65acf87395dce2 Mon Sep 17 00:00:00 2001 From: Richard deMeester Date: Mon, 23 Nov 2015 10:01:28 +1100 Subject: [PATCH 7/9] Fix to README link. --- partner_contact_gender/README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/partner_contact_gender/README.rst b/partner_contact_gender/README.rst index 52f27abc2..5ad532c62 100644 --- a/partner_contact_gender/README.rst +++ b/partner_contact_gender/README.rst @@ -47,7 +47,7 @@ partner-contact/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 `_. From 843e6aa672767f72cd0f341ba7e1c16609f85133 Mon Sep 17 00:00:00 2001 From: Richard deMeester Date: Mon, 23 Nov 2015 11:43:11 +1100 Subject: [PATCH 8/9] Change to readme --- partner_contact_gender/README.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/partner_contact_gender/README.rst b/partner_contact_gender/README.rst index 5ad532c62..49ab626d4 100644 --- a/partner_contact_gender/README.rst +++ b/partner_contact_gender/README.rst @@ -6,8 +6,8 @@ Partner Gender ============== -This module was written to extend the contact management functionality. It -allows recording of a partner's gender. +This module extends the contact management functionality. It allows recording +of a partner's gender. Installation ============ From 95ad6f6891e7457eb87545287befe0db3fc88396 Mon Sep 17 00:00:00 2001 From: Richard deMeester Date: Thu, 26 Nov 2015 09:33:04 +1100 Subject: [PATCH 9/9] Remove dependency on partner_contact_personal_information_page. --- partner_contact_gender/__openerp__.py | 2 +- partner_contact_gender/views/res_partner.xml | 23 ++++++++++++++++++-- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/partner_contact_gender/__openerp__.py b/partner_contact_gender/__openerp__.py index a4b9d4a4a..b7b5465ec 100644 --- a/partner_contact_gender/__openerp__.py +++ b/partner_contact_gender/__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_gender/views/res_partner.xml b/partner_contact_gender/views/res_partner.xml index fe8de33a8..01b71a253 100644 --- a/partner_contact_gender/views/res_partner.xml +++ b/partner_contact_gender/views/res_partner.xml @@ -2,10 +2,29 @@ - + + + Personal information page for contacts form + res.partner + + 2 + + + + + + + + + + + + Partner gender: personal info res.partner - +