diff --git a/partner_identification/README.rst b/partner_identification/README.rst index d075407f038..b2fd15ed379 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/15.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-15-0/partner-contact-15-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/15.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 +* Freni Patel 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..1b952b22109 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": "15.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..d3359900f9b 100644 --- a/partner_identification/models/res_partner.py +++ b/partner_identification/models/res_partner.py @@ -123,14 +123,11 @@ def _inverse_identification(self, field_name, category_code): id_number.active = False # Guard against writing wrong records. 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." - ) - % (record._name, category_code, field_name) + msg = "This {} has multiple IDs of this type {}, so a write via the {} field is\ +not possible. In order to fix this, please use the IDs tab.".format( + record._name, category_code, field_name ) + raise ValidationError(_(msg)) @api.model def _search_identification(self, category_code, operator, value): diff --git a/partner_identification/models/res_partner_id_category.py b/partner_identification/models/res_partner_id_category.py index 999cc606399..381a6cc6d32 100644 --- a/partner_identification/models/res_partner_id_category.py +++ b/partner_identification/models/res_partner_id_category.py @@ -25,7 +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, " @@ -37,7 +36,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." ) @@ -58,14 +57,11 @@ def validate_id_number(self, id_number): try: safe_eval(self.validation_code, eval_context, mode="exec", nocopy=True) except Exception as e: - raise UserError( - _( - "Error when evaluating the id_category validation code:" - ":\n %s \n(%s)" - ) - % (self.name, e) - ) + msg = ( + "Error when evaluating the id_category validation code:" ":\n {} \n {})" + ).format(self.name, e) + raise UserError(_(msg)) from e + if eval_context.get("failed", False): - raise ValidationError( - _("%s is not a valid %s identifier") % (id_number.name, self.name) - ) + msg = "{} is not a valid {} identifier".format(id_number.name, self.name) + raise ValidationError(_(msg)) diff --git a/partner_identification/models/res_partner_id_number.py b/partner_identification/models/res_partner_id_number.py index 22323e9aa24..54fa71e385b 100644 --- a/partner_identification/models/res_partner_id_number.py +++ b/partner_identification/models/res_partner_id_number.py @@ -50,11 +50,8 @@ def validate_id_number(self): help="Issued date. For example, date when person approved his driving " "exam, 21/10/2009", ) - valid_from = fields.Date( - string="Valid from", help="Validation period stating date." - ) + valid_from = fields.Date(help="Validation period stating date.") valid_until = fields.Date( - string="Valid until", help="Expiration date. For example, date when person needs to renew " "his driver license, 21/10/2019", ) @@ -67,7 +64,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..a8b8b599b6c 100644 --- a/partner_identification/readme/CONTRIBUTORS.rst +++ b/partner_identification/readme/CONTRIBUTORS.rst @@ -7,3 +7,4 @@ * Simone Orsi * Dennis Sluijk * Phuc Tran Thanh +* Freni Patel diff --git a/partner_identification/static/description/index.html b/partner_identification/static/description/index.html index 05b14662e7b..c658cd6c9e7 100644 --- a/partner_identification/static/description/index.html +++ b/partner_identification/static/description/index.html @@ -3,7 +3,7 @@ - + Partner Identification Numbers