summaryrefslogtreecommitdiff
path: root/addons/mail/models/mail_template.py
diff options
context:
space:
mode:
Diffstat (limited to 'addons/mail/models/mail_template.py')
-rw-r--r--addons/mail/models/mail_template.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/addons/mail/models/mail_template.py b/addons/mail/models/mail_template.py
index 1fc922a0d55..2c989bb7e2e 100644
--- a/addons/mail/models/mail_template.py
+++ b/addons/mail/models/mail_template.py
@@ -7,6 +7,8 @@ import copy
import datetime
import dateutil.relativedelta as relativedelta
import logging
+
+import functools
import lxml
import urlparse
@@ -15,6 +17,7 @@ from urllib import urlencode, quote as quote
from odoo import _, api, fields, models, tools
from odoo import report as odoo_report
from odoo.exceptions import UserError
+from odoo.tools import pycompat
_logger = logging.getLogger(__name__)
@@ -90,10 +93,9 @@ try:
'max': max,
'sum': sum,
'filter': filter,
- 'reduce': reduce,
+ 'reduce': functools.reduce,
'map': map,
'round': round,
- 'cmp': cmp,
# dateutil.relativedelta is an old-style class and cannot be directly
# instanciated wihtin a jinja2 expression, so a lambda "proxy" is
@@ -340,7 +342,7 @@ class MailTemplate(models.Model):
:param int res_ids: list of ids of document records those mails are related to.
"""
multi_mode = True
- if isinstance(res_ids, (int, long)):
+ if isinstance(res_ids, pycompat.integer_types):
multi_mode = False
res_ids = [res_ids]
@@ -385,7 +387,7 @@ class MailTemplate(models.Model):
@api.multi
def get_email_template(self, res_ids):
multi_mode = True
- if isinstance(res_ids, (int, long)):
+ if isinstance(res_ids, pycompat.integer_types):
res_ids = [res_ids]
multi_mode = False
@@ -450,7 +452,7 @@ class MailTemplate(models.Model):
"""
self.ensure_one()
multi_mode = True
- if isinstance(res_ids, (int, long)):
+ if isinstance(res_ids, pycompat.integer_types):
res_ids = [res_ids]
multi_mode = False
if fields is None: