[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
This commit is contained in:
Damien Bouvy
2023-09-05 18:44:13 +00:00
parent 0a744accc2
commit b75fad0df9
@@ -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 = {