Skip to content

Commit

Permalink
[MIG] partner_identification: Migration to 12.0
Browse files Browse the repository at this point in the history
[FIX] Tests

[FIX] data sequence

Fix openerp to odoo in comment

[REM] at_install, post_install

[ADD] Model descriptions

[REM] Extra spaces
  • Loading branch information
tarteo authored and marielejeune committed Nov 9, 2022
1 parent f6ce3e0 commit f10d3a1
Show file tree
Hide file tree
Showing 11 changed files with 115 additions and 40 deletions.
78 changes: 48 additions & 30 deletions partner_identification/README.rst
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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
=============
Expand Down Expand Up @@ -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:
Expand All @@ -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
<https://github.com/OCA/partner_contact/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 <https://github.com/OCA/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 <https://github.com/OCA/partner-contact/issues/new?body=module:%20partner_identification%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Credits
=======

Images
------

* Odoo Community Association: `Icon <https://odoo-community.org/logo.png>`_.
Authors
~~~~~~~

* ChriCar Beteiligungs- und Beratungs- GmbH
* Tecnativa
* Camptocamp
* ACSONE SA/NV
* LasLabs
* Onestein

Contributors
------------
~~~~~~~~~~~~

* Antonio Espinosa <[email protected]>
* Ferdinand Gassauer <[email protected]>
Expand All @@ -108,19 +124,21 @@ Contributors
* Jairo Llopis <[email protected]>
* Dave Lasley <[email protected]>
* Simone Orsi <[email protected]>
* Dennis Sluijk <[email protected]>

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 <https://github.com/OCA/partner-contact/tree/12.0/partner_identification>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
8 changes: 5 additions & 3 deletions partner_identification/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
}
3 changes: 2 additions & 1 deletion partner_identification/models/res_partner_id_category.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

class ResPartnerIdCategory(models.Model):
_name = "res.partner.id_category"
_description = "Partner ID Category"
_order = "name"

code = fields.Char(
Expand Down Expand Up @@ -48,7 +49,7 @@ def _validation_eval_context(self, id_number):
@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()
Expand Down
1 change: 1 addition & 0 deletions partner_identification/models/res_partner_id_number.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

class ResPartnerIdNumber(models.Model):
_name = "res.partner.id_number"
_description = "Partner ID Number"
_order = "name"

@api.constrains('name', 'category_id')
Expand Down
17 changes: 17 additions & 0 deletions partner_identification/readme/CONFIGURE.rst
Original file line number Diff line number Diff line change
@@ -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,
})
8 changes: 8 additions & 0 deletions partner_identification/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
* Antonio Espinosa <[email protected]>
* Ferdinand Gassauer <[email protected]>
* Gerhard Könighofer <[email protected]>
* Laurent Mignon <[email protected]>
* Jairo Llopis <[email protected]>
* Dave Lasley <[email protected]>
* Simone Orsi <[email protected]>
* Dennis Sluijk <[email protected]>
10 changes: 10 additions & 0 deletions partner_identification/readme/DESCRIPTION.rst
Original file line number Diff line number Diff line change
@@ -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
2 changes: 2 additions & 0 deletions partner_identification/readme/ROADMAP.rst
Original file line number Diff line number Diff line change
@@ -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.
19 changes: 19 additions & 0 deletions partner_identification/readme/USAGE.rst
Original file line number Diff line number Diff line change
@@ -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
4 changes: 2 additions & 2 deletions partner_identification/tests/test_partner_identification.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,11 @@ def test_partner_id_number_validation(self):
})
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
})]})
Expand Down
5 changes: 1 addition & 4 deletions partner_identification/tests/test_res_partner.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@

class TestResPartner(common.SavepointCase):

at_install = False
post_install = True

@classmethod
def setUpClass(cls):
super().setUpClass()
Expand All @@ -28,7 +25,7 @@ def setUpClass(cls):
'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,
Expand Down

0 comments on commit f10d3a1

Please sign in to comment.