From 7568f0df5116107fb2fcf3b112149f7f86b1a522 Mon Sep 17 00:00:00 2001 From: david-s73 Date: Thu, 25 Jul 2024 16:01:06 +0200 Subject: [PATCH] [MIG] base_export_manager: Migration to 17 --- base_export_manager/__manifest__.py | 2 +- base_export_manager/hooks.py | 5 ++--- base_export_manager/models/ir_model_access.py | 2 +- .../static/src/views/list/list_controller.esm.js | 6 +++--- base_export_manager/views/ir_exports.xml | 14 +++++++------- 5 files changed, 14 insertions(+), 15 deletions(-) diff --git a/base_export_manager/__manifest__.py b/base_export_manager/__manifest__.py index 328f6dd847..b2f1925d08 100644 --- a/base_export_manager/__manifest__.py +++ b/base_export_manager/__manifest__.py @@ -7,7 +7,7 @@ { "name": "Manage model export profiles", "category": "Personalization", - "version": "16.0.1.0.1", + "version": "17.0.1.0.0", "depends": ["web"], "data": [ "views/ir_exports.xml", diff --git a/base_export_manager/hooks.py b/base_export_manager/hooks.py index 8eddbb8387..636b7e2d51 100644 --- a/base_export_manager/hooks.py +++ b/base_export_manager/hooks.py @@ -1,9 +1,9 @@ # Copyright 2016 Jairo Llopis # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from odoo import SUPERUSER_ID, api +from odoo import api -def post_init_hook(cr, registry): +def post_init_hook(env): """Loaded after installing the module. ``ir.exports.line.name`` was before a char field, and now it is a computed @@ -11,7 +11,6 @@ def post_init_hook(cr, registry): inconsistencies. """ with api.Environment.manage(): - env = api.Environment(cr, SUPERUSER_ID, {}) env["ir.exports.line"].search( [ ("field1_id", "=", False), diff --git a/base_export_manager/models/ir_model_access.py b/base_export_manager/models/ir_model_access.py index bb06801028..f850451093 100644 --- a/base_export_manager/models/ir_model_access.py +++ b/base_export_manager/models/ir_model_access.py @@ -9,5 +9,5 @@ class IrModelAccess(models.Model): _inherit = "ir.model.access" # WARN: This can't be used in 'check()' - # See https://github.com/odoo/odoo/blob/0b6a2569920b6584652c39b3465998649fe305b4/odoo/addons/base/models/ir_model.py#L1496 # noqa: B950 + # See https://github.com/odoo/odoo/blob/0b6a2569920b6584652c39b3465998649fe305b4/odoo/addons/base/models/ir_model.py#L1496 # noqa: E501 perm_export = fields.Boolean("Export Access", default=True) diff --git a/base_export_manager/static/src/views/list/list_controller.esm.js b/base_export_manager/static/src/views/list/list_controller.esm.js index 4e8bd9d341..e59624c4ab 100644 --- a/base_export_manager/static/src/views/list/list_controller.esm.js +++ b/base_export_manager/static/src/views/list/list_controller.esm.js @@ -1,13 +1,13 @@ /** @odoo-module **/ import {ListController} from "@web/views/list/list_controller"; -const {onWillRender} = owl; +import {onWillRender} from "@odoo/owl"; import {patch} from "@web/core/utils/patch"; import {session} from "@web/session"; -patch(ListController.prototype, "base_export_manager", { +patch(ListController.prototype, { setup() { - this._super(...arguments); + super.setup(...arguments); onWillRender(async () => { if (this.isExportEnable) { const is_export_enabled = diff --git a/base_export_manager/views/ir_exports.xml b/base_export_manager/views/ir_exports.xml index 2fe29fb4a1..b26d7a83fa 100644 --- a/base_export_manager/views/ir_exports.xml +++ b/base_export_manager/views/ir_exports.xml @@ -44,10 +44,10 @@ > - - - - + + + +