diff options
| author | Olivier Dony <odo@openerp.com> | 2017-06-01 01:46:13 +0200 |
|---|---|---|
| committer | Olivier Dony <odo@openerp.com> | 2017-06-01 01:46:13 +0200 |
| commit | 5d2869cbc812f716e3115b5efb9bd1c3082f47b7 (patch) | |
| tree | 364844fc326f0d095997120d10d83e67fdf341e9 /addons/web/static/src/js/views/pivot/pivot_controller.js | |
| parent | 04111cae39e36015d3c8494f52b110ab5ab6ad80 (diff) | |
| parent | ba15df47cb25625cb0921cba554aa0879048c90a (diff) | |
[MERGE] Forward-port saas-16 up to ba15df47cb25625cb0921cba554aa0879048c90a
Diffstat (limited to 'addons/web/static/src/js/views/pivot/pivot_controller.js')
| -rw-r--r-- | addons/web/static/src/js/views/pivot/pivot_controller.js | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/addons/web/static/src/js/views/pivot/pivot_controller.js b/addons/web/static/src/js/views/pivot/pivot_controller.js index f132704a475..fb175aa1934 100644 --- a/addons/web/static/src/js/views/pivot/pivot_controller.js +++ b/addons/web/static/src/js/views/pivot/pivot_controller.js @@ -74,8 +74,9 @@ var PivotController = AbstractController.extend({ //-------------------------------------------------------------------------- /** - * We save the current measure and group bys, so we can restore the view - * when we save the current state in the search view. + * Returns the current measures and groupbys, so we can restore the view + * when we save the current state in the search view, or when we add it to + * the dashboard. * * @override method from AbstractController * @returns {Object} @@ -84,8 +85,8 @@ var PivotController = AbstractController.extend({ var state = this.model.get(); return { pivot_measures: state.measures, - pivot_column_groupby: state.data.main_col.groupbys, - pivot_row_groupby: state.data.main_row.groupbys, + pivot_column_groupby: state.colGroupBys, + pivot_row_groupby: state.rowGroupBys, }; }, /** @@ -126,6 +127,7 @@ var PivotController = AbstractController.extend({ return; } framework.blockUI(); + table.title = this.title; session.get_file({ url: '/web/pivot/export_xls', data: {data: JSON.stringify(table)}, @@ -218,8 +220,9 @@ var PivotController = AbstractController.extend({ this.update({}, {reload: false}); } if ($target.hasClass('o_pivot_expand_button')) { - this.model.expandAll(); - this.update({reload: false}); + this.model + .expandAll() + .then(this.update.bind(this, {}, {reload: false})); } if ($target.parents('.o_pivot_measures_list').length) { var parent = $target.parent(); |
