[FIX] view_form: add context to search_count

Currently, the view_form search_count doesn't propagate the context, so when
searching on a translated field, the count can be different than the one we
would expect and get with a search in a current language different than en_US.

opw-628792 opw-630212 closes #5825
This commit is contained in:
Nicolas Lempereur 2015-03-18 15:32:54 +01:00
parent 7780004f95
commit d539be329e
1 changed files with 1 additions and 1 deletions

View File

@ -2574,7 +2574,7 @@ instance.web.form.FieldCharDomain = instance.web.form.AbstractField.extend(insta
var model = this.options.model || this.field_manager.get_field_value(this.options.model_field);
var domain = instance.web.pyeval.eval('domain', this.get('value'));
var ds = new instance.web.DataSetStatic(self, model, self.build_context());
ds.call('search_count', [domain]).then(function (results) {
ds.call('search_count', [domain, self.build_context()]).then(function (results) {
$('.oe_domain_count', self.$el).text(results + ' records selected');
if (self.get('effective_readonly')) {
$('button span', self.$el).text(' See selection');