$footer_cells.filter(_.sprintf('[data-field=%s]', column.id))
.html(openerp.base.format_cell(aggregation, column));
});
+ },
+ get_selected_ids: function() {
+ //TODO niv: this is false
+ debugger;
}
- // TODO: implement reorder (drag and drop rows)
});
openerp.base.ListView.List = openerp.base.Class.extend( /** @lends openerp.base.ListView.List# */{
/**
item.callback();
}
if (item.action) {
- item.action.flags = item.action.flags || {};
- item.action.flags.new_window = true;
- self.do_action(item.action);
+ var ids = self.widget_parent.get_selected_ids();
+ if (ids.length == 0) {
+ //TODO niv: maybe show a warning?
+ return false;
+ }
+ self.rpc("/base/action/load", {
+ action_id: item.action.id,
+ context: {
+ active_id: ids[0],
+ active_ids: ids,
+ active_model: self.widget_parent.dataset.model
+ }
+ }, function(result) {
+ result.result.flags = result.result.flags || {};
+ result.result.flags.new_window = true;
+ self.do_action(result.result);
+ });
}
return false;
});