diff --git a/partner_identification/README.rst b/partner_identification/README.rst index 32ea80896..433ed4250 100644 --- a/partner_identification/README.rst +++ b/partner_identification/README.rst @@ -1,11 +1,30 @@ -.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.png - :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html - :alt: License: AGPL-3 - ============================== Partner Identification Numbers ============================== +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Production%2FStable-green.png + :target: https://odoo-community.org/page/development-status + :alt: Production/Stable +.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fpartner--contact-lightgray.png?logo=github + :target: https://github.com/OCA/partner-contact/tree/12.0/partner_identification + :alt: OCA/partner-contact +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/partner-contact-12-0/partner-contact-12-0-partner_identification + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png + :target: https://runbot.odoo-community.org/runbot/134/12.0 + :alt: Try me on Runbot + +|badge1| |badge2| |badge3| |badge4| |badge5| + This module allows to manage all sort of identification numbers and certificates which are assigned to a partner (company or individual) and vary from country to country. @@ -17,12 +36,10 @@ and vary from country to country. * Driver license * etc +**Table of contents** -Installation -============ - -No specific installation step required. - +.. contents:: + :local: Configuration ============= @@ -52,7 +69,7 @@ In partner form you will see another tab called 'ID Numbers'. You can add any IDs to this partner, defining: Category: - ID type defined in configuration. For example, Driver License + ID type defined in configuration. For example, Driver License ID Number: The ID itself. For example, Driver License number of this person Issued by: @@ -68,38 +85,37 @@ Status: Notes: Any further information related with this ID. For example, vehicle types this person can drive -.. 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/11.0 - - Known issues / Roadmap ====================== * If you want to search a partner by ID you will use advance search form. You can't search by issuer, valid dates, category or notes. - 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 smash it by providing detailed and welcomed feedback. +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 `_. +Do not contact contributors directly about support or help with technical issues. Credits ======= -Images ------- - -* Odoo Community Association: `Icon `_. +Authors +~~~~~~~ +* ChriCar Beteiligungs- und Beratungs- GmbH +* Tecnativa +* Camptocamp +* ACSONE SA/NV +* LasLabs +* Onestein Contributors ------------- +~~~~~~~~~~~~ * Antonio Espinosa * Ferdinand Gassauer @@ -108,19 +124,21 @@ Contributors * Jairo Llopis * Dave Lasley * Simone Orsi +* Dennis Sluijk +Maintainers +~~~~~~~~~~~ -Maintainer ----------- +This module is maintained by the OCA. .. image:: https://odoo-community.org/logo.png :alt: Odoo Community Association :target: https://odoo-community.org -This module is maintained by the OCA. - OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use. -To contribute to this module, please visit https://odoo-community.org. +This module is part of the `OCA/partner-contact `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/partner_identification/__manifest__.py b/partner_identification/__manifest__.py index 25cc490c0..5b6aacb6a 100644 --- a/partner_identification/__manifest__.py +++ b/partner_identification/__manifest__.py @@ -9,22 +9,24 @@ { 'name': 'Partner Identification Numbers', 'category': 'Customer Relationship Management', - 'version': '11.0.1.0.0', + 'version': '12.0.1.0.0', 'license': 'AGPL-3', 'depends': [ 'contacts', ], 'data': [ + 'security/ir.model.access.csv', 'views/res_partner_id_category_view.xml', 'views/res_partner_id_number_view.xml', 'views/res_partner_view.xml', - 'security/ir.model.access.csv', ], - 'author': 'ChriCar Beteiligungs- und Beratungs- GmbH, ' + 'author': 'ChriCar Beteiligungs- und Beratungs- GmbH,' 'Tecnativa,' 'Camptocamp,' 'ACSONE SA/NV,' 'LasLabs,' + 'Onestein,' 'Odoo Community Association (OCA)', 'website': 'https://github.com/OCA/partner-contact', + 'development_status': 'Production/Stable', } diff --git a/partner_identification/models/res_partner_id_category.py b/partner_identification/models/res_partner_id_category.py index e73815598..9ecbb3ecd 100644 --- a/partner_identification/models/res_partner_id_category.py +++ b/partner_identification/models/res_partner_id_category.py @@ -15,6 +15,7 @@ from odoo.tools.safe_eval import safe_eval class ResPartnerIdCategory(models.Model): _name = "res.partner.id_category" + _description = "Partner ID Category" _order = "name" code = fields.Char( @@ -48,7 +49,7 @@ class ResPartnerIdCategory(models.Model): @api.multi def validate_id_number(self, id_number): """Validate the given ID number - The method raises an openerp.exceptions.ValidationError if the eval of + The method raises an odoo.exceptions.ValidationError if the eval of python validation code fails """ self.ensure_one() diff --git a/partner_identification/models/res_partner_id_number.py b/partner_identification/models/res_partner_id_number.py index 2276f39ca..86466fb72 100644 --- a/partner_identification/models/res_partner_id_number.py +++ b/partner_identification/models/res_partner_id_number.py @@ -12,6 +12,7 @@ from odoo import api, models, fields class ResPartnerIdNumber(models.Model): _name = "res.partner.id_number" + _description = "Partner ID Number" _order = "name" @api.constrains('name', 'category_id') diff --git a/partner_identification/readme/CONFIGURE.rst b/partner_identification/readme/CONFIGURE.rst new file mode 100644 index 000000000..1caab2e52 --- /dev/null +++ b/partner_identification/readme/CONFIGURE.rst @@ -0,0 +1,17 @@ +Configure all ID types you need in Contacts > Configuration > Partner ID Categories. +For example, we create a category 'Driver License': + +Name: + Name of this ID type. For example, 'Driver License' +Code: + Code, abbreviation or acronym of this ID type. For example, 'driver_license' +Python validation code: + Optional python code called to validate ID numbers of this ID type. This functionality can be + overridden by setting ``id_no_validate`` to ``True`` in the context, such as: + + .. code-block:: python + + partner.with_context(id_no_validate=True).write({ + 'name': 'Bad Value', + 'category_id': self.env.ref('id_category_only_numerics').id, + }) diff --git a/partner_identification/readme/CONTRIBUTORS.rst b/partner_identification/readme/CONTRIBUTORS.rst new file mode 100644 index 000000000..8d0ad002a --- /dev/null +++ b/partner_identification/readme/CONTRIBUTORS.rst @@ -0,0 +1,8 @@ +* Antonio Espinosa +* Ferdinand Gassauer +* Gerhard Könighofer +* Laurent Mignon +* Jairo Llopis +* Dave Lasley +* Simone Orsi +* Dennis Sluijk diff --git a/partner_identification/readme/DESCRIPTION.rst b/partner_identification/readme/DESCRIPTION.rst new file mode 100644 index 000000000..8c80369e5 --- /dev/null +++ b/partner_identification/readme/DESCRIPTION.rst @@ -0,0 +1,10 @@ +This module allows to manage all sort of identification numbers +and certificates which are assigned to a partner (company or individual) +and vary from country to country. + +* Commercial register +* VAT ID +* Fiscal ID's +* Membership numbers +* Driver license +* etc diff --git a/partner_identification/readme/ROADMAP.rst b/partner_identification/readme/ROADMAP.rst new file mode 100644 index 000000000..8bcf03fcc --- /dev/null +++ b/partner_identification/readme/ROADMAP.rst @@ -0,0 +1,2 @@ +* If you want to search a partner by ID you will use advance search form. + You can't search by issuer, valid dates, category or notes. diff --git a/partner_identification/readme/USAGE.rst b/partner_identification/readme/USAGE.rst new file mode 100644 index 000000000..8388250ad --- /dev/null +++ b/partner_identification/readme/USAGE.rst @@ -0,0 +1,19 @@ +In partner form you will see another tab called 'ID Numbers'. You can add +any IDs to this partner, defining: + +Category: + ID type defined in configuration. For example, Driver License +ID Number: + The ID itself. For example, Driver License number of this person +Issued by: + Another partner, who issued this ID. For example, Traffic National Institution +Place of Issuance: + The place where the ID has been issued. For example the country for passports and visa +Valid from: + Issued date. For example, date when person approved his driving exam, 21/10/2009 +Valid until: + Expiration date. For example, date when person needs to renew his driver license, 21/10/2019 +Status: + ID status. For example new/to renew/expired +Notes: + Any further information related with this ID. For example, vehicle types this person can drive diff --git a/partner_identification/tests/test_partner_identification.py b/partner_identification/tests/test_partner_identification.py index d999de565..aedd4dd5e 100644 --- a/partner_identification/tests/test_partner_identification.py +++ b/partner_identification/tests/test_partner_identification.py @@ -57,11 +57,11 @@ if id_number.name != '1234': }) partner_1 = self.env.ref('base.res_partner_1') with self.assertRaises(ValidationError), self.cr.savepoint(): - partner_1.write({'id_numbers': [(0, 0, { + partner_1.write({'id_numbers': [(0, 0, { 'name': '01234', 'category_id': partner_id_category.id })]}) - partner_1.write({'id_numbers': [(0, 0, { + partner_1.write({'id_numbers': [(0, 0, { 'name': '1234', 'category_id': partner_id_category.id })]}) diff --git a/partner_identification/tests/test_res_partner.py b/partner_identification/tests/test_res_partner.py index 693196f8c..b215ab861 100644 --- a/partner_identification/tests/test_res_partner.py +++ b/partner_identification/tests/test_res_partner.py @@ -8,9 +8,6 @@ from .fake_models import ResPartner, setup_test_model, teardown_test_model class TestResPartner(common.SavepointCase): - at_install = False - post_install = True - @classmethod def setUpClass(cls): super().setUpClass() @@ -28,7 +25,7 @@ class TestResPartner(common.SavepointCase): 'code': 'id_code', 'name': 'id_name', }) - cls.partner = cls.env.user.partner_id + cls.partner = cls.env.ref('base.main_partner') cls.partner_id = cls.env['res.partner.id_number'].create({ 'name': 'Good ID', 'category_id': cls.partner_id_category.id,