Initial commit: Odoo 18.0-20251222 extra-addons
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
/*
|
||||
Copyright 2025 Akretion France (https://www.akretion.com/)
|
||||
@author: Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
*/
|
||||
|
||||
import {DashboardKanbanRecord} from "@account/views/account_dashboard_kanban/account_dashboard_kanban_record";
|
||||
import {DashboardKanbanRenderer} from "@account/views/account_dashboard_kanban/account_dashboard_kanban_renderer";
|
||||
import {kanbanView} from "@web/views/kanban/kanban_view";
|
||||
import {onWillStart} from "@odoo/owl";
|
||||
import {registry} from "@web/core/registry";
|
||||
import {useService} from "@web/core/utils/hooks";
|
||||
|
||||
export class DashboardKanbanRendererBanner extends DashboardKanbanRenderer {
|
||||
static template = "account_dashboard_banner.AccountDashboardBannerRenderer";
|
||||
static components = {
|
||||
...DashboardKanbanRenderer.components,
|
||||
KanbanRecord: DashboardKanbanRecord,
|
||||
};
|
||||
|
||||
setup() {
|
||||
super.setup();
|
||||
this.orm = useService("orm");
|
||||
|
||||
onWillStart(async () => {
|
||||
this.state.banner = await this.orm.call("account.dashboard.banner.cell", "get_banner_data");
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
export const accountDashboardKanbanBanner = {
|
||||
...kanbanView,
|
||||
Renderer: DashboardKanbanRendererBanner,
|
||||
};
|
||||
|
||||
registry.category("views").add("account_dashboard_kanban_banner", accountDashboardKanbanBanner);
|
||||
@@ -0,0 +1,27 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
Copyright 2025 Akretion France (https://www.akretion.com/)
|
||||
@author: Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
-->
|
||||
<templates xml:space="preserve">
|
||||
|
||||
<t t-name="account_dashboard_banner.AccountDashboardBannerRenderer" t-inherit="account.DashboardKanbanRenderer" t-inherit-mode="primary">
|
||||
<xpath expr="//div[hasclass('o_kanban_renderer')]" position="before">
|
||||
<div class="d-none d-md-flex position-sticky start-0 d-flex o_form_statusbar" id="dashboard_banner">
|
||||
<t t-foreach="Object.entries(state.banner)" t-as="cell_entry" t-key="cell_entry[0]">
|
||||
<t t-set="cell_data" t-value="cell_entry[1]"/>
|
||||
<div id="cell_banner_ok" t-if="!cell_data.warn" t-attf-class="o_arrow_button flex-grow-1 d-flex flex-column p-1 text-center" t-att-data-tooltip="cell_data['tooltip']">
|
||||
<strong class="mx-2" t-out="cell_data['label']"/>
|
||||
<span t-out="cell_data['value']" class="h2 m-0 text-primary"/>
|
||||
</div>
|
||||
<div id="cell_banner_warn" t-if="cell_data.warn" t-attf-class="o_arrow_button flex-grow-1 d-flex flex-column p-1 text-center alert alert-warning" t-att-data-tooltip="cell_data['tooltip']">
|
||||
<strong class="mx-2" t-out="cell_data['label']"/>
|
||||
<span t-out="cell_data['value']" class="h2 m-0 text-primary"/>
|
||||
</div>
|
||||
</t>
|
||||
</div>
|
||||
</xpath>
|
||||
</t>
|
||||
|
||||
</templates>
|
||||
Reference in New Issue
Block a user