Skip to content

Commit

Permalink
[MIG] partner_email_check: Migration to 18.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Kimkhoi3010 committed Oct 22, 2024
1 parent fa11c33 commit 008cf41
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 7 deletions.
9 changes: 9 additions & 0 deletions partner_email_check/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,15 @@ Contributors
- Vo Hoang Dat <[email protected]>
- Jean-Charles Drubay <[email protected]>
- Diogo Cordeiro <[email protected]>
- Khoi (Kien Kim) <[email protected]>

Other credits
-------------

The migration of this module from 17.0 to 18.0 was financially supported
by:

- Camptocamp.

Maintainers
-----------
Expand Down
2 changes: 1 addition & 1 deletion partner_email_check/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

{
"name": "Email Format Checker",
"version": "17.0.1.0.0",
"version": "18.0.1.0.0",
"summary": "Validate email address field",
"author": "Komit, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/partner-contact",
Expand Down
8 changes: 4 additions & 4 deletions partner_email_check/models/res_partner.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,15 @@ def _check_email_unique(self):
for rec in self.filtered("email"):
if "," in rec.email:
raise UserError(
_(
self.env._(
"Field contains multiple email addresses. This is "
"not supported when duplicate email addresses are "
"not allowed."
)
)
if self.search_count([("email", "=", rec.email), ("id", "!=", rec.id)]):
raise UserError(
_("Email '%s' is already in use.") % rec.email.strip()
self.env._("Email '%s' is already in use.", rec.email.strip())
)

def _normalize_email(self, email):
Expand All @@ -72,11 +72,11 @@ def _normalize_email(self, email):
)
except EmailSyntaxError:
raise ValidationError(
_("%s is an invalid email") % email.strip()
self.env._("%s is an invalid email", email.strip())
) from EmailSyntaxError
except EmailUndeliverableError:
raise ValidationError(
_("Cannot deliver to email address %s") % email.strip()
self.env._("Cannot deliver to email address %s", email.strip())
) from EmailUndeliverableError
return result.normalized.lower()

Expand Down
1 change: 1 addition & 0 deletions partner_email_check/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
- Vo Hoang Dat \<<[email protected]>\>
- Jean-Charles Drubay \<<[email protected]>\>
- Diogo Cordeiro \<<[email protected]>\>
- Khoi (Kien Kim) \<<[email protected]>\>
3 changes: 3 additions & 0 deletions partner_email_check/readme/CREDITS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
The migration of this module from 17.0 to 18.0 was financially supported by:

- Camptocamp.
14 changes: 12 additions & 2 deletions partner_email_check/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,8 @@ <h1 class="title">Email Format Checker</h1>
<li><a class="reference internal" href="#credits" id="toc-entry-4">Credits</a><ul>
<li><a class="reference internal" href="#authors" id="toc-entry-5">Authors</a></li>
<li><a class="reference internal" href="#contributors" id="toc-entry-6">Contributors</a></li>
<li><a class="reference internal" href="#maintainers" id="toc-entry-7">Maintainers</a></li>
<li><a class="reference internal" href="#other-credits" id="toc-entry-7">Other credits</a></li>
<li><a class="reference internal" href="#maintainers" id="toc-entry-8">Maintainers</a></li>
</ul>
</li>
</ul>
Expand Down Expand Up @@ -429,10 +430,19 @@ <h2><a class="toc-backref" href="#toc-entry-6">Contributors</a></h2>
<li>Vo Hoang Dat &lt;<a class="reference external" href="mailto:dat.vh&#64;komit-consulting.com">dat.vh&#64;komit-consulting.com</a>&gt;</li>
<li>Jean-Charles Drubay &lt;<a class="reference external" href="mailto:jc&#64;komit-consulting.com">jc&#64;komit-consulting.com</a>&gt;</li>
<li>Diogo Cordeiro &lt;<a class="reference external" href="mailto:dcordeiro&#64;opensourceintegrators.com">dcordeiro&#64;opensourceintegrators.com</a>&gt;</li>
<li>Khoi (Kien Kim) &lt;<a class="reference external" href="mailto:khoikk&#64;trobz.com">khoikk&#64;trobz.com</a>&gt;</li>
</ul>
</div>
<div class="section" id="other-credits">
<h2><a class="toc-backref" href="#toc-entry-7">Other credits</a></h2>
<p>The migration of this module from 17.0 to 18.0 was financially supported
by:</p>
<ul class="simple">
<li>Camptocamp.</li>
</ul>
</div>
<div class="section" id="maintainers">
<h2><a class="toc-backref" href="#toc-entry-7">Maintainers</a></h2>
<h2><a class="toc-backref" href="#toc-entry-8">Maintainers</a></h2>
<p>This module is maintained by the OCA.</p>
<a class="reference external image-reference" href="https://odoo-community.org">
<img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" />
Expand Down
2 changes: 2 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# generated from manifests external_dependencies
email-validator

0 comments on commit 008cf41

Please sign in to comment.