[FIX] Used json with binary/image controller

bzr revid: fme@openerp.com-20120809134851-3yl6skfch2q1f7q0
This commit is contained in:
Fabien Meghazi 2012-08-09 15:48:51 +02:00
parent 528c12774d
commit 1a3bd45961
1 changed files with 2 additions and 1 deletions

View File

@ -4616,8 +4616,9 @@ instance.web.form.FieldBinaryImage = instance.web.form.FieldBinary.extend({
if (this.get('value') && ! /^\d+(\.\d*)? \w+$/.test(this.get('value'))) {
url = 'data:image/png;base64,' + this.get('value');
} else if (this.get('value')) {
var id = escape(JSON.stringify(this.view.datarecord.id || null));
url = '/web/binary/image?session_id=' + this.session.session_id + '&model=' +
this.view.dataset.model +'&id=' + (this.view.datarecord.id || '') + '&field=' + this.name + '&t=' + (new Date().getTime());
this.view.dataset.model +'&id=' + id + '&field=' + this.name + '&t=' + (new Date().getTime());
} else {
url = "/web/static/src/img/placeholder.png";
}