Skip to content
Open
Show file tree
Hide file tree
Changes from 31 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
220c8f5
[IMP] awesome_owl: add counter on page
djoewie Apr 24, 2026
ba0852d
[MOV] awesome_owl: move counter to own class
djoewie Apr 27, 2026
ac3da2c
[IMP] awesome_owl: add card
djoewie Apr 27, 2026
d201888
[IMP] awesome_owl: markup in display
djoewie Apr 27, 2026
bb195b5
[IMP] awesome_owl: add prop validation
djoewie Apr 27, 2026
e5cf19c
[IMP] awesome_owl: add total of counters
djoewie Apr 27, 2026
0233cdf
[IMP] awesome_owl: add visualisation of a todolist
djoewie Apr 27, 2026
43be439
[IMP] awesome_owl: mark completed items
djoewie Apr 27, 2026
4ccb0fc
[IMP] awesome_owl: make adding todo's possible
djoewie Apr 27, 2026
b1703e6
[IMP] awesome_owl: autofocus input field
djoewie Apr 27, 2026
3bfc874
[IMP] awesome_owl: toggeling todos
djoewie Apr 27, 2026
752c640
[CLN] awesome_owl: follow naming convention
djoewie Apr 27, 2026
c517440
[IMP] awesome_owl: make deleting todoitems possible
djoewie Apr 27, 2026
09e67bb
[IMP] awesome_owl: introduction to slots
djoewie Apr 27, 2026
206c82e
[IMP] awesome_owl: add option to hide card content
djoewie Apr 27, 2026
64a8839
[IMP] awesome_dashboard: a new layout
djoewie Apr 27, 2026
a758675
[IMP] awesome_dashboard: Add some buttons for quick navigation
djoewie Apr 27, 2026
73580ef
[IMP] awesome_dashboard: add dashboard items
djoewie Apr 28, 2026
f8efc82
[IMP] awesome_dashboard: add statistics on dashboard
djoewie Apr 28, 2026
949c551
[IMP] awesome_dashboard: caching the results
djoewie Apr 28, 2026
2affcf3
[IMP] awesome_dashboard: add pie-chart
djoewie Apr 28, 2026
cf78101
[CLN] awesome_owl: code convention camelcase for refs
djoewie Apr 28, 2026
286bd29
[CLN] awesome_dashboard: coding convention
djoewie Apr 28, 2026
1f1e971
[FIX] awesome_dashboard: piechart need to be destroyed before creatin…
djoewie Apr 28, 2026
dc7faf0
[IMP] awesome_dashboard: real life update
djoewie Apr 28, 2026
f127f24
[IMP] awesome_dashboard: lazy loading of module
djoewie Apr 28, 2026
416de43
[IMP] awesome_dashboard: make dashboard generic
djoewie Apr 28, 2026
0ede26b
[CLN] awesome_dashboard: improve readability of pie_chart
djoewie Apr 28, 2026
8b8558a
[IMP] awesome_dashboard: use a registry for the dashboard items
djoewie Apr 29, 2026
6dfb3d4
[IMP] awesome_dashboard: make dashboard items hideable
djoewie Apr 29, 2026
61531ba
[IMP] awesome_dashboard: add dutch translations
djoewie Apr 29, 2026
0dc5636
[CLN] estate: add a webcontroller
djoewie May 5, 2026
483de30
[MOV] estate: dashboard in its own file
djoewie May 5, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion awesome_dashboard/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@
'assets': {
'web.assets_backend': [
'awesome_dashboard/static/src/**/*',
('remove', 'awesome_dashboard/static/src/dashboard/**/*'),
],
'awesome_dashboard.dashboard': [
'awesome_dashboard/static/src/dashboard/**/*',
],
},
'license': 'AGPL-3'
'license': 'AGPL-3',
}
117 changes: 117 additions & 0 deletions awesome_dashboard/i18n/nl.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * awesome_dashboard
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 19.0+e\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2026-04-29 12:41+0000\n"
"PO-Revision-Date: 2026-04-29 12:41+0000\n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"

#. module: awesome_dashboard
#. odoo-javascript
#: code:addons/awesome_dashboard/static/src/dashboard/dashboard_items.js:0
msgid "Amount of orders this month"
msgstr "Aantal orders per maand"

#. module: awesome_dashboard
#. odoo-javascript
#: code:addons/awesome_dashboard/static/src/dashboard/dashboard.xml:0
msgid "Apply"
msgstr "Opslaan"

#. module: awesome_dashboard
#. odoo-javascript
#: code:addons/awesome_dashboard/static/src/dashboard/dashboard_items.js:0
msgid "Average amount of t-shirt"
msgstr "Gemiddeld aantal t-shirt"

#. module: awesome_dashboard
#. odoo-javascript
#: code:addons/awesome_dashboard/static/src/dashboard/dashboard_items.js:0
msgid "Average amount of t-shirt by order this month"
msgstr "Gemiddeld aantal t-shirts per bestelling deze maand"

#. module: awesome_dashboard
#. odoo-javascript
#: code:addons/awesome_dashboard/static/src/dashboard/dashboard_items.js:0
msgid "Average time for an order"
msgstr "Gemiddelde tijd voor een order"

#. module: awesome_dashboard
#. odoo-javascript
#: code:addons/awesome_dashboard/static/src/dashboard/dashboard_items.js:0
msgid "Average time for an order to go from new to sent or canceled"
msgstr "Gemiddelde tijd voor een bestelling om van nieuw naar verzonden of geannuleerd te gaan"

#. module: awesome_dashboard
#: model:ir.ui.menu,name:awesome_dashboard.menu_root
msgid "Awesome Dashboard"
msgstr "Magisch overzicht"

#. module: awesome_dashboard
#. odoo-javascript
#: code:addons/awesome_dashboard/static/src/dashboard/dashboard_items.js:0
msgid "Canceled orders this month"
msgstr "Geannulleerde orders deze maand"

#. module: awesome_dashboard
#. odoo-javascript
#: code:addons/awesome_dashboard/static/src/dashboard/dashboard.xml:0
msgid "Customers"
msgstr "Klanten"

#. module: awesome_dashboard
#: model:ir.actions.client,name:awesome_dashboard.dashboard
#: model:ir.ui.menu,name:awesome_dashboard.dashboard_menu
msgid "Dashboard"
msgstr "Overzicht"

#. module: awesome_dashboard
#. odoo-javascript
#: code:addons/awesome_dashboard/static/src/dashboard/dashboard.js:0
msgid "Dashboard items configuration"
msgstr "Dashboard items configureren"

#. module: awesome_dashboard
#. odoo-javascript
#: code:addons/awesome_dashboard/static/src/dashboard/dashboard.xml:0
msgid "Leads"
msgstr "Prospecten"

#. module: awesome_dashboard
#. odoo-javascript
#: code:addons/awesome_dashboard/static/src/dashboard/dashboard_items.js:0
msgid "New orders this month"
msgstr "Nieuwe bestellingen deze maand"

#. module: awesome_dashboard
#. odoo-javascript
#: code:addons/awesome_dashboard/static/src/dashboard/dashboard_items.js:0
msgid "Number of canceled orders this month"
msgstr "Aantal geannuleerde bestellingen deze maand"

#. module: awesome_dashboard
#. odoo-javascript
#: code:addons/awesome_dashboard/static/src/dashboard/dashboard_items.js:0
msgid "Number of new orders this month"
msgstr "Aantal nieuwe orders deze maand"

#. module: awesome_dashboard
#. odoo-javascript
#: code:addons/awesome_dashboard/static/src/dashboard/dashboard_items.js:0
msgid "Shirt orders by size"
msgstr "Shirt bestellingen per maat"

#. module: awesome_dashboard
#. odoo-javascript
#: code:addons/awesome_dashboard/static/src/dashboard/dashboard_items.js:0
msgid "Total amount of orders this month"
msgstr "Totaal aantal bestellingen deze maand"
8 changes: 0 additions & 8 deletions awesome_dashboard/static/src/dashboard.js

This file was deleted.

8 changes: 0 additions & 8 deletions awesome_dashboard/static/src/dashboard.xml

This file was deleted.

70 changes: 70 additions & 0 deletions awesome_dashboard/static/src/dashboard/dashboard.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
import { Component, useRef, useState } from "@odoo/owl";
import { registry } from "@web/core/registry";
import { Layout } from "@web/search/layout";
import { useService } from "@web/core/utils/hooks";
import { DashboardItem } from "./dashboard_item/dashboard_item";
import { Dialog } from "@web/core/dialog/dialog";
import { CheckBox } from "@web/core/checkbox/checkbox";
import { _t } from "@web/core/l10n/translation";

class AwesomeDashboard extends Component {
static template = "awesome_dashboard.AwesomeDashboard";
static components = {Layout, DashboardItem};

setup() {
this.action = useService("action");
this.statistics = useState(useService("awesome_dashboard.statistics").loadStatistics);
this.dialogService = useService("dialog");
this.items = registry.category("awesome_dashboard").getAll();
this.state = useState({
disabled: localStorage.getItem("awesome_dashboard_disabled")?.split(',') || []
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume this was the disabled items on the menu. In that case I would name the variable disabledItems / disabledMenus or something. disabled sounds like it's a boolean.

});
}

openCustomers() {
this.action.doAction("base.action_partner_form");
}

openLeads() {
this.action.doAction({
type: 'ir.actions.act_window', target: 'current', res_model: 'crm.lead', views: [[false, "list"], [false, 'form'],],
});
}

updateDashboard(disabled) {
this.state.disabled = disabled;
}

openDialog() {
this.dialog = this.dialogService.add(
DashboardConfiguration,
{items: this.items, disabled: this.state.disabled, doneUpdating: this.updateDashboard.bind(this)},
{});
}
}

class DashboardConfiguration extends Component {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it should have its own file

static template = "awesome_dashboard.DashboardConfiguration";
static components = {Dialog, CheckBox, _t};
static props = ["close", "items", "disabled", "doneUpdating"];


setup() {
this.options = useRef("options");
this.items = useState(this.props.items.map(item => ({...item, disabled: this.props.disabled.includes(item.id)})));
this.title = _t('Dashboard items configuration');
}

updateDisabled(item, checked) {
item.disabled = !checked;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see here disabled is used as a boolean for the item. but at the same time it's the list of items that are disabled. It's a bit confusing

}

apply() {
const disabled = this.items.filter(item => item.disabled).map(item => item.id);
localStorage.setItem("awesome_dashboard_disabled", disabled);
this.props.doneUpdating(disabled);
this.props.close();
}
}

registry.category("lazy_components").add("AwesomeDashboard", AwesomeDashboard);
3 changes: 3 additions & 0 deletions awesome_dashboard/static/src/dashboard/dashboard.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.o_dashboard {
background-color: darkgrey;
}
35 changes: 35 additions & 0 deletions awesome_dashboard/static/src/dashboard/dashboard.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<templates xml:space="preserve">

<t t-name="awesome_dashboard.AwesomeDashboard">
<Layout display="{ controlPanel: {} }" className="'o_dashboard h-100'">
<t t-set-slot="layout-buttons">
<button type="button" class="btn btn-primary" t-on-click="openCustomers">Customers</button>
<button type="button" class="btn btn-primary" t-on-click="openLeads">Leads</button>
</t>
<t t-set-slot="control-panel-additional-actions">
<button t-on-click="openDialog" class="btn p-0"><i class="fa fa-fw fa-cog"/></button>
</t>
<t t-set-slot="default" t-if="statistics.isLoaded">
<t t-foreach="items" t-as="item" t-key="item.id">
<DashboardItem t-if="!state.disabled.includes(item.id)" size="item.size || 1">
<t t-set="itemProp" t-value="item.props ? item.props(statistics) : {'data': statistics}"/>
<t t-component="item.Component" t-props="itemProp"/>
</DashboardItem>
</t>
</t>
</Layout>
</t>
<t t-name="awesome_dashboard.DashboardConfiguration">
<Dialog title="title">
<form t-ref="options">
<t t-foreach="items" t-as="item" t-key="item.id">
<CheckBox value="!item.disabled" onChange="state => updateDisabled(item,state)"><t t-out="item.description"/></CheckBox>
</t>
</form>
<t t-set-slot="footer">
<button type="button" class="btn btn-primary" t-on-click="apply">Apply</button>
</t>
</Dialog>
</t>

</templates>
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { Component } from "@odoo/owl";

export class DashboardItem extends Component {
static template = "awesome_dashboard.DashboardItem";
static props = {
size: {
type: Number,
optional: true,
},
slots: {
type: Object,
shape: {default: true},
}
};
static defaultProps = {
size: 1,
};
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<templates xml:space="preserve">

<t t-name="awesome_dashboard.DashboardItem">
<div class="card d-inline-block" t-att-style="'width: '+(18*props.size)+'rem;'">
<div class="card-body">
<p class="card-text">
<t t-slot="default"/>
</p>
</div>
</div>
</t>

</templates>
70 changes: 70 additions & 0 deletions awesome_dashboard/static/src/dashboard/dashboard_items.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
import { NumberCard } from "./number_card/number_card";
import { PieChartCard } from "./pie_chart_card/pie_chart_card";
import { registry } from "@web/core/registry";
import { _t } from "@web/core/l10n/translation";

export let items = [
{
id: "average_quantity",
description: _t("Average amount of t-shirt"),
Component: NumberCard,
// size and props are optionals
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need for this comment everywhere

size: 3,
props: (data) => ({
title: _t("Average amount of t-shirt by order this month"),
value: data.average_quantity
}),
},
{
id: "average_time",
description: _t("Average time for an order"),
Component: NumberCard,
// size and props are optionals
props: (data) => ({
title: _t("Average time for an order to go from new to sent or canceled"),
value: data.average_time
}),
},
{
id: "nb_new_orders",
description: _t("New orders this month"),
Component: NumberCard,
// size and props are optionals
props: (data) => ({
title: _t("Number of new orders this month"),
value: data.nb_new_orders
}),
}, {
id: "nb_cancelled_orders",
description: _t("Canceled orders this month"),
Component: NumberCard,
// size and props are optionals
props: (data) => ({
title: _t("Number of canceled orders this month"),
value: data.nb_cancelled_orders
}),
},
{
id: "total_amount",
description: _t("Amount of orders this month"),
Component: NumberCard,
// size and props are optionals
props: (data) => ({
title: _t("Total amount of orders this month"),
value: data.total_amount
}),
},
{
id: "orders_by_size",
description: _t("Shirt orders by size"),
Component: PieChartCard,
// size and props are optionals
props: (data) => ({
title: _t("Shirt orders by size"),
values: data.orders_by_size
}),
},

];

items.forEach(item => registry.category("awesome_dashboard").add(item.id, item));
13 changes: 13 additions & 0 deletions awesome_dashboard/static/src/dashboard/number_card/number_card.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { Component } from "@odoo/owl";

export class NumberCard extends Component {
static template = "awesome_dashboard.NumberCard";
static props = {
title: {
type: String,
},
value: {
type: Number,
}
};
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<templates xml:space="preserve">
<t t-name="awesome_dashboard.NumberCard">
<t t-out="props.title"/>
<div class="text-center text-success display-6 fw-bold"><t t-out="props.value"/></div>
</t>
</templates>
Loading