Skip to content

Commit

Permalink
[FIX] base_export_manager: ListController corrected file
Browse files Browse the repository at this point in the history
  • Loading branch information
stefan-tecnativa committed Aug 7, 2023
1 parent f8880da commit f1b30ac
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 2 deletions.
2 changes: 1 addition & 1 deletion base_export_manager/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"license": "AGPL-3",
"assets": {
"web.assets_backend": [
"base_export_manager/static/src/views/list/list_controller.js",
"base_export_manager/static/src/views/list/list_controller.esm.js",
"base_export_manager/static/src/xml/base.xml",
],
},
Expand Down
2 changes: 1 addition & 1 deletion base_export_manager/models/ir_exports_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ def _inverse_name(self):
one.field_n(num, True)
] = one._get_field_id(model, field_name)
if any(parts):
# invalidate_cache -> in order to get actual value of field 'label'
# invalidate_recordset -> in order to get actual value of field 'label'
# in function '_check_name'
one.invalidate_recordset(["label"])
one._check_name()
Expand Down
21 changes: 21 additions & 0 deletions base_export_manager/static/src/views/list/list_controller.esm.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/** @odoo-module **/

import {ListController} from "@web/views/list/list_controller";
const {onWillRender} = owl;
import {patch} from "@web/core/utils/patch";
import {session} from "@web/session";

patch(ListController.prototype, "base_export_manager", {
setup() {
this._super(...arguments);
onWillRender(async () => {
if (this.isExportEnable) {
const is_export_enabled =
session.export_models.indexOf(this.model.root.resModel) !== -1;
if (!session.is_system && !is_export_enabled) {
this.isExportEnable = false;
}
}
});
},
});

0 comments on commit f1b30ac

Please sign in to comment.