[MERGE] view_form.js: fixing the statusbar. if there is no domain defined, the statusbar mustn't try to concat with ('|',('id','=',...)) because it is creating a syntactically invalid domain

bzr revid: qdp-launchpad@openerp.com-20130314103233-icm1b664xrisy66k
This commit is contained in:
Quentin (OpenERP) 2013-03-14 11:32:33 +01:00
commit d4181a6625
1 changed files with 6 additions and 1 deletions

View File

@ -5335,7 +5335,12 @@ instance.web.form.FieldStatus = instance.web.form.AbstractField.extend({
},
calc_domain: function() {
var d = instance.web.pyeval.eval('domain', this.build_domain());
domain = ['|', ['id', '=', this.get('value')]].concat(d);
var domain = []; //if there is no domain defined, fetch all the records
if (d.length) {
domain = ['|',['id', '=', this.get('value')]].concat(d);
}
if (! _.isEqual(domain, this.get("evaluated_selection_domain"))) {
this.set("evaluated_selection_domain", domain);
}