From b75fad0df9a3df46b84a87a35b5879d5e346e882 Mon Sep 17 00:00:00 2001 From: Damien Bouvy Date: Tue, 29 Aug 2023 11:40:04 +0200 Subject: [PATCH] [IMP] base_automation: modular kanban header action This commit makes it possible to have the same 'Automation' button hook in this module (in community) and in web_enterprise (which is in the Enterprise edition, as one may have guessed). The purpose of the override in web_enterprise is to promote Odoo Studio as the module to install to enjoy automations. Including this Studio promotion in Odoo CE makes little sense, especially since only base_automation is actually needed. Therefore we needed to have both a promotion button in EE and an actual button in CE but not both when base_automation was installed along with web_enterprise. This commit simply adds an intermediary function on the KanbanHeader component, which calls an indirect function that is only defined in base_automation. In that way, the web_enterprise module can override the intermediary function and can check the existence of the indirect function. Task-3085360 Part-of: odoo/odoo#114352 --- addons/base_automation/static/src/kanban_header_patch.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/addons/base_automation/static/src/kanban_header_patch.js b/addons/base_automation/static/src/kanban_header_patch.js index 3a203babc7c..52a2b1591dc 100644 --- a/addons/base_automation/static/src/kanban_header_patch.js +++ b/addons/base_automation/static/src/kanban_header_patch.js @@ -67,6 +67,10 @@ patch(KanbanHeader.prototype, { }, async openAutomations() { + return this._openAutomations(); + }, + + async _openAutomations() { const domain = [["model", "=", this.props.list.resModel]]; const modelId = await this.orm.search("ir.model", domain, { limit: 1 }); const context = {