[REVERT] 4164 revid:dle@openerp.com-20140326113036-g9yv3jj6yetwxvg8: this fix actually works in saas-3, but not in 7.0, as search_read method is not part of the orm
bzr revid: dle@openerp.com-20140326123513-jkful2m1n2zjgdmv
This commit is contained in:
parent
76aa47b133
commit
649ef3ed21
|
@ -951,20 +951,14 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM
|
|||
} else {
|
||||
var fields = _.keys(self.fields_view.fields);
|
||||
fields.push('display_name');
|
||||
// Use of search_read instead of read to check if we can still read the record (security rules)
|
||||
return self.dataset.call('search_read', [[['id', '=', self.dataset.ids[self.dataset.index]]], fields],
|
||||
return self.dataset.read_index(fields,
|
||||
{
|
||||
context: {
|
||||
'bin_size': true,
|
||||
'future_display_name': true
|
||||
}
|
||||
}).then(function(r) {
|
||||
if (_.isEmpty(r)){
|
||||
self.do_action('history_back');
|
||||
}
|
||||
else{
|
||||
self.trigger('load_record', r[0]);
|
||||
}
|
||||
self.trigger('load_record', r);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
|
|
@ -528,14 +528,13 @@ instance.web.ListView = instance.web.View.extend( /** @lends instance.web.ListVi
|
|||
},
|
||||
reload_record: function (record) {
|
||||
var self = this;
|
||||
// Use of search_read instead of read to check if we can still read the record (security rules)
|
||||
return this.dataset.call('search_read', [
|
||||
[['id', '=', record.get('id')]],
|
||||
return this.dataset.read_ids(
|
||||
[record.get('id')],
|
||||
_.pluck(_(this.columns).filter(function (r) {
|
||||
return r.tag === 'field';
|
||||
}), 'name')]
|
||||
}), 'name')
|
||||
).done(function (records) {
|
||||
var values = _.isEmpty(records) ? undefined : records[0];
|
||||
var values = records[0];
|
||||
if (!values) {
|
||||
self.records.remove(record);
|
||||
return;
|
||||
|
|
Loading…
Reference in New Issue