Skip to content

Commit

Permalink
[REM] base: broken method Partner._email_send
Browse files Browse the repository at this point in the history
The underlying `odoo.tools.email_send` was removed in
82de620 (merged in 14.5) but this
callsite was missed, this method has been broken ever since.

I really want to remove this method directly, but technically it's an
expensive no-op if called on a recordset of partners without emails
set (or an empty recordset), so instead make it trigger a warning &
remove in master.

closes odoo#159177

X-original-commit: 457a4be
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
  • Loading branch information
xmo-odoo committed Mar 26, 2024
1 parent d90ed9d commit 7f5f296
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions odoo/addons/base/models/res_partner.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import pytz
import threading
import re
import warnings

import requests
from collections import defaultdict
Expand Down Expand Up @@ -924,8 +925,7 @@ def _get_gravatar_image(self, email):
return base64.b64encode(res.content)

def _email_send(self, email_from, subject, body, on_error=None):
for partner in self.filtered('email'):
tools.email_send(email_from, [partner.email], subject, body, on_error)
warnings.warn("Partner._email_send has not done anything but raise errors since 15.0", stacklevel=2, category=DeprecationWarning)
return True

def address_get(self, adr_pref=None):
Expand Down

0 comments on commit 7f5f296

Please sign in to comment.