Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MIG] web disable export group: Migration to 17.0 #2925

Open
wants to merge 31 commits into
base: 17.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
79f7aa4
Add module web_disable_export_group
astirpe Dec 27, 2016
86086ff
[MIG] web_disable_group_export: Migration to 11.0
chienandalu Jul 16, 2018
02b19bd
[MIG] web_disable_export_group: Migration to 12.0
tarteo Oct 2, 2018
84d4164
[IMP] web_disable_export_group: Tests
tarteo Nov 6, 2018
4a08c47
[FIX] Tests
Tardo Feb 25, 2019
39a1a97
Added translation using Weblate (Chinese (Simplified))
liweijie0812 Sep 1, 2019
c2d138f
Translated using Weblate (Chinese (Simplified))
liweijie0812 Sep 1, 2019
eed8493
Added translation using Weblate (Croatian)
badbole Dec 2, 2019
9289133
Translated using Weblate (Croatian)
badbole Dec 2, 2019
1a30736
[UPD] README.rst
OCA-git-bot Jul 13, 2020
89de596
[UPD] README.rst
OCA-git-bot Jul 14, 2020
6555ce5
Added translation using Weblate (Spanish)
claudiagn Jul 23, 2020
ebd63d0
Translated using Weblate (Spanish)
claudiagn Jul 23, 2020
331107e
Added translation using Weblate (Portuguese)
pedrocs-exo Oct 16, 2020
6192d74
Translated using Weblate (Portuguese)
pedrocs-exo Oct 16, 2020
faa8858
[IMP] web_disable_export_group: black, isort, prettier
joao-p-marques Oct 20, 2020
981f50e
[MIG] web_disable_export_group: Migration to 13.0
joao-p-marques Oct 21, 2020
c1fc34c
[MIG] web_disable_export_group: Migration to 14.0
Kev-Roche Jan 6, 2021
7b90569
[IMP] web_disable_export_group: Disable 'export all' button
Tardo Jul 7, 2021
cc57ce5
[IMP] web_disable_export_group: Differenciate between the XLSX export…
etobella Oct 26, 2021
5d33b02
[OU-FIX] web_disable_export_group: Proper migration scripts
pedrobaeza Nov 14, 2022
2c13b96
[OU] web_disable_export_group: Fix when migration happened on 13.0
etobella Nov 22, 2022
5cab520
[MIG] web_disable_export_group: Migration to 15.0
chienandalu Jun 21, 2023
149416f
Translated using Weblate (Spanish)
Ivorra78 Nov 19, 2023
a5c096e
[MIG] web_disable_export_group: Migration to 16.0
chienandalu Mar 4, 2024
fbb9d17
[UPD] Update web_disable_export_group.pot
Mar 5, 2024
ac85c71
Update translation files
weblate Mar 5, 2024
95b1b41
Added translation using Weblate (Italian)
mymage Mar 5, 2024
fced56d
Translated using Weblate (Italian)
mymage Mar 5, 2024
72ec86f
[IMP] web_disable_export_group: pre-commit auto fixes
Aug 22, 2024
d051024
[MIG] web_disable_export_group: Migration to 17.0
Aug 30, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions web_disable_export_group/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ Contributors
- Víctor Martínez
- David Vidal

- SodexisTeam [email protected]

Maintainers
-----------

Expand Down
1 change: 0 additions & 1 deletion web_disable_export_group/models/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
from . import ir_http
from . import models
20 changes: 0 additions & 20 deletions web_disable_export_group/models/ir_http.py

This file was deleted.

1 change: 1 addition & 0 deletions web_disable_export_group/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@
- Alexandre Díaz
- Víctor Martínez
- David Vidal
- SodexisTeam <[email protected]>
1 change: 1 addition & 0 deletions web_disable_export_group/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,7 @@ <h2><a class="toc-backref" href="#toc-entry-6">Contributors</a></h2>
<li>David Vidal</li>
</ul>
</li>
<li>SodexisTeam <a class="reference external" href="mailto:dev&#64;sodexis.com">dev&#64;sodexis.com</a></li>
</ul>
</div>
<div class="section" id="maintainers">
Expand Down
26 changes: 0 additions & 26 deletions web_disable_export_group/static/src/js/abstract_controller.esm.js

This file was deleted.

27 changes: 15 additions & 12 deletions web_disable_export_group/static/src/js/list_controller.esm.js
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe change the filename to export_all.esm.js

Original file line number Diff line number Diff line change
@@ -1,20 +1,23 @@
/** @odoo-module **/
/* Copyright 2018 Tecnativa - David Vidal
License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl). */
import {ListController} from "@web/views/list/list_controller";
import {onWillStart} from "@odoo/owl";
import {archParseBoolean} from "@web/views/utils";
import {exportAllItem} from "@web/views/list/export_all/export_all";
import {patch} from "@web/core/utils/patch";

patch(ListController.prototype, "disable_export_group", {
setup() {
this._super(...arguments);
onWillStart(async () => {
this.isExportEnable = await this.userService.hasGroup(
"base.group_allow_export"
);
this.isExportXlsEnable = await this.userService.hasGroup(
patch(exportAllItem, {
async isDisplayed(env) {
const ExportEnable = super.isDisplayed(...arguments);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The super function is async, so you must call it with await

Suggested change
const ExportEnable = super.isDisplayed(...arguments);
const ExportEnable = await super.isDisplayed(...arguments);

const ExportXlsEnable =
env.config.viewType === "list" &&
!env.model.root.selection.length &&
(await env.model.user.hasGroup(
"web_disable_export_group.group_export_xlsx_data"
);
});
)) &&
archParseBoolean(env.config.viewArch.getAttribute("export_xlsx"), true);
if (ExportXlsEnable) {
return ExportXlsEnable;
}
return ExportEnable;
Comment on lines +18 to +21
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's the same:

Suggested change
if (ExportXlsEnable) {
return ExportXlsEnable;
}
return ExportEnable;
return ExportXlsEnable || ExportEnable ;

On the picky side, the usual convention is that local variables are declared with lower_case (snake_case) (e.g: export_xls_enable) and PascalCase is usually used for classes

},
});
17 changes: 0 additions & 17 deletions web_disable_export_group/static/src/xml/export_xls_views.xml

This file was deleted.

Loading