mirror of
https://github.com/OCA/web.git
synced 2025-02-22 13:21:25 +02:00
[MIG] web_pivot_computed_measure: Migration to 16.0
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
/** @odoo-module **/
|
||||
/* Copyright 2024 Tecnativa - Carlos Roca
|
||||
* License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html) */
|
||||
|
||||
import {PivotController} from "@web/views/pivot/pivot_controller";
|
||||
import {patch} from "@web/core/utils/patch";
|
||||
import {DropdownItemCustomMeasure} from "../dropdown_item_custom_measure/dropdown_item_custom_measure.esm";
|
||||
|
||||
patch(PivotController.prototype, "web_pivot_computed_measure.PivotController", {
|
||||
/**
|
||||
* Add computed_measures to context key to avoid loosing info when saving the
|
||||
* filter to favorites.
|
||||
*
|
||||
* @override
|
||||
*/
|
||||
getContext() {
|
||||
var res = this._super(...arguments);
|
||||
res.pivot_computed_measures = this.model._computed_measures;
|
||||
return res;
|
||||
},
|
||||
});
|
||||
|
||||
PivotController.components = {
|
||||
...PivotController.components,
|
||||
DropdownItemCustomMeasure,
|
||||
};
|
||||
@@ -4,8 +4,8 @@
|
||||
* License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html) */
|
||||
|
||||
import {PivotModel} from "@web/views/pivot/pivot_model";
|
||||
import {patch} from "web.utils";
|
||||
import {computeReportMeasures} from "@web/views/helpers/utils";
|
||||
import {patch} from "@web/core/utils/patch";
|
||||
import {computeReportMeasures} from "@web/views/utils";
|
||||
import {evalOperation} from "../helpers/utils.esm";
|
||||
|
||||
patch(PivotModel.prototype, "web_pivot_computed_measure.PivotModel", {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html) */
|
||||
|
||||
import {PivotRenderer} from "@web/views/pivot/pivot_renderer";
|
||||
import {patch} from "web.utils";
|
||||
import {patch} from "@web/core/utils/patch";
|
||||
|
||||
patch(PivotRenderer.prototype, "web_pivot_computed_measure.PivotRenderer", {
|
||||
getFormattedValue(cell) {
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
/** @odoo-module **/
|
||||
/* Copyright 2022 Tecnativa - Carlos Roca
|
||||
* License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html) */
|
||||
|
||||
import {PivotView} from "@web/views/pivot/pivot_view";
|
||||
import {patch} from "web.utils";
|
||||
|
||||
patch(PivotView.prototype, "web_pivot_computed_measure.PivotView", {
|
||||
/**
|
||||
* Add computed_measures to context key to avoid loosing info when saving the
|
||||
* filter to favorites.
|
||||
*
|
||||
* @override
|
||||
*/
|
||||
getContext() {
|
||||
var res = this._super(...arguments);
|
||||
res.pivot_computed_measures = this.model._computed_measures;
|
||||
return res;
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user