Filter leaf domain of Reference fields

The domain of Reference fields must be filtered out for non-valid target
because the localization will remove the target part and thus generate an
invalid domain for the specific target.

issue4680
review11141003
This commit is contained in:
Cédric Krier committed 2015-03-30 22:37:52 +02:00
1 parent e2e6a9c004
commit e8e6fecc2d
2 files changed
+29

No files matched your search

+13
View File
@@ -2059,6 +2059,19 @@
},
validation_domains: function(record, pre_validate) {
return this.get_domains(record, pre_validate)[0];
},
get_domain: function(record) {
var model = null;
if (record._values[this.name]) {
model = record._values[this.name][0];
}
var domains = this.get_domains(record);
var screen_domain = domains[0];
var attr_domain = domains[1];
var inversion = new Sao.common.DomainInversion();
return inversion.concat([inversion.localize_domain(
inversion.filter_leaf(screen_domain, this.name, model)),
attr_domain]);
}
});