[IMP] view_form: FieldStatus, calc_domain: if there is no domain defined, fetch all the records

bzr revid: chm@openerp.com-20130423140942-lu1cakf0a0rgf9pf
This commit is contained in:
Christophe Matthieu 2013-04-23 16:09:42 +02:00
parent 11ffa1be3b
commit 764b318143
1 changed files with 9 additions and 1 deletions

View File

@ -5306,7 +5306,15 @@ instance.web.form.FieldStatus = instance.web.form.AbstractField.extend({
},
calc_domain: function() {
var d = instance.web.pyeval.eval('domain', this.build_domain());
this.set("evaluated_selection_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);
}
},
/** Get the selection and render it
* selection: [[identifier, value_to_display], ...]