[IMP] web_disable_export_group: Differenciate between the XLSX export and the standard export

This commit is contained in:
Enric Tobella
2021-10-26 17:06:13 +02:00
parent 52f03bd359
commit 8f16bbf3f8
7 changed files with 81 additions and 2 deletions

View File

@@ -37,6 +37,14 @@ odoo.define("web_disable_export_group", function(require) {
if (
!session.is_superuser &&
action &&
action.startsWith("export_xlsx") &&
!session.group_xlsx_export_data
) {
return false;
} else if (
!session.is_superuser &&
action &&
!action.startsWith("export_xlsx") &&
action.startsWith("export_") &&
!session.group_export_data
) {

View File

@@ -67,5 +67,34 @@ odoo.define("web_disable_export_group.tour", function(require) {
},
]
);
tour.register(
"export_tour_demo_xlsx",
{
test: true,
url:
"/web#model=ir.ui.view&view_type=list&cids=&action=base.action_ui_view",
},
[
{
content: "Check if 'Export all' button exists",
trigger: ".o_list_buttons:has(.o_list_export_xlsx)",
},
{
content: "Select all records",
trigger: ".custom-control-input:first",
},
{
content: "Open actions",
trigger: ".o_dropdown_toggler_btn",
},
{
content: "Check if Export button does not exist",
trigger:
'.o_control_panel div.o_dropdown_menu a:first:not(:contains("' +
_t("Export") +
'"))',
},
]
);
return {};
});