[MIG] web_disable_export_group: Migration to 16.0

TT45881
This commit is contained in:
David
2024-03-04 17:48:12 +01:00
parent 750a8babb2
commit 111944e008
9 changed files with 48 additions and 32 deletions

View File

@@ -1,19 +1,20 @@
/** @odoo-module **/
/* Copyright 2018 Tecnativa - David Vidal
License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl). */
import ListController from "web.ListController";
import session from "web.session";
import {ListController} from "@web/views/list/list_controller";
import {onWillStart} from "@odoo/owl";
import {patch} from "@web/core/utils/patch";
ListController.include({
init() {
patch(ListController.prototype, "disable_export_group", {
setup() {
this._super(...arguments);
this.isExportXlsEnable = false;
},
async willStart() {
const res = await this._super(...arguments);
this.isExportXlsEnable = await session.user_has_group(
"web_disable_export_group.group_export_xlsx_data"
);
return res;
onWillStart(async () => {
this.isExportEnable = await this.userService.hasGroup(
"base.group_allow_export"
);
this.isExportXlsEnable = await this.userService.hasGroup(
"web_disable_export_group.group_export_xlsx_data"
);
});
},
});