[FIX] data: _.find (prefered to older _.detect) may return undefined if no match and would trow an error when applying .values
Instead returns undefined which is handled below. This does not solve the issue when records are not loaded properly but gives a better information on the reason. bzr revid: mat@openerp.com-20140213085008-pnq4r0ebfl072u78
This commit is contained in:
@@ -848,7 +848,8 @@ instance.web.BufferedDataSet = instance.web.DataSetStatic.extend({
|
||||
});
|
||||
var return_records = function() {
|
||||
var records = _.map(ids, function(id) {
|
||||
return _.extend({}, _.detect(self.cache, function(c) {return c.id === id;}).values, {"id": id});
|
||||
var c = _.find(self.cache, function(c) {return c.id === id;});
|
||||
return _.isUndefined(c) ? c : _.extend({}, c.values, {"id": id});
|
||||
});
|
||||
if (self.debug_mode) {
|
||||
if (_.include(records, undefined)) {
|
||||
|
||||
Reference in New Issue
Block a user