From 48069ed88f64ecbd72ff10ac7629748d44bcc517 Mon Sep 17 00:00:00 2001 From: mle Date: Wed, 9 Nov 2022 15:34:33 +0100 Subject: [PATCH] [MIG] partner_identification: Migration to 16.0 --- partner_identification/README.rst | 11 ++++++----- partner_identification/__manifest__.py | 2 +- partner_identification/models/res_partner.py | 12 ++++++++---- .../models/res_partner_id_category.py | 17 ++++++++--------- .../models/res_partner_id_number.py | 2 +- partner_identification/readme/CONTRIBUTORS.rst | 1 + .../static/description/index.html | 9 +++++---- .../tests/test_res_partner.py | 2 +- .../views/res_partner_id_category_view.xml | 2 +- .../views/res_partner_id_number_view.xml | 2 +- 10 files changed, 33 insertions(+), 27 deletions(-) diff --git a/partner_identification/README.rst b/partner_identification/README.rst index d075407f038..1f2961adf36 100644 --- a/partner_identification/README.rst +++ b/partner_identification/README.rst @@ -14,13 +14,13 @@ Partner Identification Numbers :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/14.0/partner_identification + :target: https://github.com/OCA/partner-contact/tree/16.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-14-0/partner-contact-14-0-partner_identification + :target: https://translation.odoo-community.org/projects/partner-contact-16-0/partner-contact-16-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/14.0 + :target: https://runbot.odoo-community.org/runbot/134/16.0 :alt: Try me on Runbot |badge1| |badge2| |badge3| |badge4| |badge5| @@ -97,7 +97,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 `_. +`feedback `_. Do not contact contributors directly about support or help with technical issues. @@ -126,6 +126,7 @@ Contributors * Simone Orsi * Dennis Sluijk * Phuc Tran Thanh +* Marie Lejeune Other credits ~~~~~~~~~~~~~ @@ -147,6 +148,6 @@ 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. -This module is part of the `OCA/partner-contact `_ project on GitHub. +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 2f41f2a04ba..0c1fa2e09f4 100644 --- a/partner_identification/__manifest__.py +++ b/partner_identification/__manifest__.py @@ -9,7 +9,7 @@ { "name": "Partner Identification Numbers", "category": "Customer Relationship Management", - "version": "14.0.1.3.0", + "version": "16.0.1.0.0", "license": "AGPL-3", "depends": ["contacts"], "data": [ diff --git a/partner_identification/models/res_partner.py b/partner_identification/models/res_partner.py index 497e428bb0b..83951a33634 100644 --- a/partner_identification/models/res_partner.py +++ b/partner_identification/models/res_partner.py @@ -125,11 +125,15 @@ def _inverse_identification(self, field_name, category_code): else: raise ValidationError( _( - "This %s has multiple IDs of this type (%s), so a write " - "via the %s field is not possible. In order to fix this, " - "please use the IDs tab." + "This {record_name} has multiple IDs of this " + "type ({category_code}), so a write via the " + "{field_name} field is not possible. " + "In order to fix this, please use the IDs tab." + ).format( + record_name=record._name, + category_code=category_code, + field_name=field_name, ) - % (record._name, category_code, field_name) ) @api.model diff --git a/partner_identification/models/res_partner_id_category.py b/partner_identification/models/res_partner_id_category.py index 999cc606399..555f4425618 100644 --- a/partner_identification/models/res_partner_id_category.py +++ b/partner_identification/models/res_partner_id_category.py @@ -25,8 +25,6 @@ def _get_default_color(self): color = fields.Integer(string="Color Index", default=_get_default_color) code = fields.Char( - string="Code", - size=16, required=True, help="Abbreviation or acronym of this ID type. For example, " "'driver_license'", @@ -37,7 +35,7 @@ def _get_default_color(self): translate=True, help="Name of this ID type. For example, 'Driver License'", ) - active = fields.Boolean(string="Active", default=True) + active = fields.Boolean(default=True) validation_code = fields.Text( "Python validation code", help="Python code called to validate an id number." ) @@ -60,12 +58,13 @@ def validate_id_number(self, id_number): except Exception as e: raise UserError( _( - "Error when evaluating the id_category validation code:" - ":\n %s \n(%s)" - ) - % (self.name, e) - ) + "Error when evaluating the id_category " + "validation code: \n {name} \n({error})" + ).format(name=self.name, error=e) + ) from e if eval_context.get("failed", False): raise ValidationError( - _("%s is not a valid %s identifier") % (id_number.name, self.name) + _("{id_name} is not a valid {cat_name} identifier").format( + id_name=id_number.name, cat_name=self.name + ) ) diff --git a/partner_identification/models/res_partner_id_number.py b/partner_identification/models/res_partner_id_number.py index 22323e9aa24..34c80b28c12 100644 --- a/partner_identification/models/res_partner_id_number.py +++ b/partner_identification/models/res_partner_id_number.py @@ -67,7 +67,7 @@ def validate_id_number(self): ("close", "Expired"), ] ) - active = fields.Boolean(string="Active", default=True) + active = fields.Boolean(default=True) @api.model def default_get(self, fields): diff --git a/partner_identification/readme/CONTRIBUTORS.rst b/partner_identification/readme/CONTRIBUTORS.rst index 9cd3a91ec64..54746e292f4 100644 --- a/partner_identification/readme/CONTRIBUTORS.rst +++ b/partner_identification/readme/CONTRIBUTORS.rst @@ -7,3 +7,4 @@ * Simone Orsi * Dennis Sluijk * Phuc Tran Thanh +* Marie Lejeune diff --git a/partner_identification/static/description/index.html b/partner_identification/static/description/index.html index 05b14662e7b..0fcb2b91084 100644 --- a/partner_identification/static/description/index.html +++ b/partner_identification/static/description/index.html @@ -3,7 +3,7 @@ - + Partner Identification Numbers