mirror of
https://github.com/OCA/web.git
synced 2025-02-22 13:21:25 +02:00
[MIG] web_disable_export_group: Migration to 16.0
TT45881
This commit is contained in:
@@ -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"
|
||||
);
|
||||
});
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user