From e38974c5b62988c2887c0de0d2dbcb3526e6a214 Mon Sep 17 00:00:00 2001 From: Christophe Combelles Date: Sat, 13 Dec 2014 23:49:25 +0200 Subject: [PATCH 1/2] [FIX] mail: access link generaTION Catch only the error related to the access of the linked record. Previous was hidding error to access the ir.config_parameter and eventual other errors from the orm. Uses SUPERUSER_ID to access instance URL (e.g. portal has no access to it). Fixes #4234 #4234 --- addons/mail/mail_mail.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/addons/mail/mail_mail.py b/addons/mail/mail_mail.py index b71176bcd08..19852e1b182 100644 --- a/addons/mail/mail_mail.py +++ b/addons/mail/mail_mail.py @@ -179,7 +179,10 @@ class mail_mail(osv.Model): related_user = partner.user_ids[0] try: self.pool.get(mail.model).check_access_rule(cr, related_user.id, [mail.res_id], 'read', context=context) - base_url = self.pool.get('ir.config_parameter').get_param(cr, uid, 'web.base.url') + except except_orm, e: + pass + else: + base_url = self.pool.get('ir.config_parameter').get_param(cr, SUPERUSER_ID, 'web.base.url') # the parameters to encode for the query and fragment part of url query = {'db': cr.dbname} fragment = { @@ -190,8 +193,6 @@ class mail_mail(osv.Model): url = urljoin(base_url, "?%s#%s" % (urlencode(query), urlencode(fragment))) text = _("""

Access this document directly in OpenERP

""") % url body = tools.append_content_to_html(body, ("

%s

" % text), plaintext=False) - except except_orm, e: - pass return body def send_get_mail_reply_to(self, cr, uid, mail, partner=None, context=None): From 60a361cd179e986fbe2ecb7f5cdd9f2379c6bde3 Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Mon, 15 Dec 2014 17:30:06 +0100 Subject: [PATCH 2/2] [FIX]web_gantt: value rendering with decimal separator other than dot --- addons/web_gantt/static/src/js/gantt.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/web_gantt/static/src/js/gantt.js b/addons/web_gantt/static/src/js/gantt.js index f30fa6a83e6..dc97aee4138 100644 --- a/addons/web_gantt/static/src/js/gantt.js +++ b/addons/web_gantt/static/src/js/gantt.js @@ -157,7 +157,7 @@ instance.web_gantt.GanttView = instance.web.View.extend({ self.fields[self.fields_view.arch.attrs.date_delay]); if (!tmp) return; - task_stop = task_start.clone().addMilliseconds(tmp * 60 * 60 * 1000); + task_stop = task_start.clone().addMilliseconds(instance.web.parse_value(tmp, {type:"float"}) * 60 * 60 * 1000); } var duration = (task_stop.getTime() - task_start.getTime()) / (1000 * 60 * 60); var id = _.uniqueId("gantt_task_");