From 82518067412f736af4c7c91e3d8ce0ce14cf7e3f Mon Sep 17 00:00:00 2001 From: Jeremy Kersten Date: Fri, 21 Nov 2014 11:58:39 +0100 Subject: [PATCH] [FIX] web_calendar: improve the commit 787147d. This commit was fixing bug in other module that calendar which was open an event in popup view. Because browse/read by default was unable to read string id. The fix was too restrictif, because calendar need to read/browse string; we cannot cast this id in Int else we loose the virtual part. parseInt('12-20140512') -> 12. --- addons/web_calendar/static/src/js/web_calendar.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/addons/web_calendar/static/src/js/web_calendar.js b/addons/web_calendar/static/src/js/web_calendar.js index 2aa40c39455..20043acb459 100644 --- a/addons/web_calendar/static/src/js/web_calendar.js +++ b/addons/web_calendar/static/src/js/web_calendar.js @@ -820,10 +820,11 @@ openerp.web_calendar = function(instance) { } else { var pop = new instance.web.form.FormOpenPopup(this); - pop.show_element(this.dataset.model, parseInt(id), this.dataset.get_context(), { + var id_cast = parseInt(id).toString() == id ? parseInt(id) : id; + pop.show_element(this.dataset.model, id_cast, this.dataset.get_context(), { title: _.str.sprintf(_t("View: %s"),title), view_id: +this.open_popup_action, - res_id: id, + res_id: id_cast, target: 'new', readonly:true });