[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.

This commit is contained in:
Jeremy Kersten 2014-11-21 11:58:39 +01:00
parent de641ccbf8
commit 8251806741
1 changed files with 3 additions and 2 deletions

View File

@ -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
});