- $.when(this.dataset.read_slice(['state', 'action_id', 'category_id']),
- this.dataset.call('progress'))
- .then(this.on_records_loaded);
- },
- on_records_loaded: function (read_response, progress_response) {
- var records = read_response,
- progress = progress_response[0];
+ var self = this;
+ return this.user.read_index(['groups_id']).pipe(function (record) {
+ var todos_filter = [
+ ['type', '!=', 'automatic'],
+ '|', ['groups_id', '=', false],
+ ['groups_id', 'in', record['groups_id']]];
+ return $.when(
+ self.dataset.read_slice(['state', 'action_id', 'category_id'],{
+ domain: todos_filter }),
+ self.dataset.call('progress').pipe(
+ function (arg) { return arg; }, null))
+ }, null).then(this.on_records_loaded);