Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
51a3f88
[ADD] estate: Add module
nguyenntph Nov 18, 2025
a184c4a
[IMP] estate: Add name / expected price to property model
nguyenntph Nov 18, 2025
6500c2a
[IMP] estate: Add access right
nguyenntph Nov 18, 2025
812c7c1
[IMP] estate: Add UIs / Update fields
nguyenntph Nov 18, 2025
99bba1f
[IMP] estate: Fix xml indentation
nguyenntph Nov 19, 2025
f5deed0
[IMP] estate: Use date helper / Rename model
nguyenntph Nov 19, 2025
2ca4042
[IMP] estate: Add list / form / search UI
nguyenntph Nov 19, 2025
719f23a
[IMP] estate: Add perperty type / tag / offer
nguyenntph Nov 19, 2025
5051e18
[IMP] estate: Compute / Inverse field value
nguyenntph Nov 19, 2025
9deb164
[IMP] estate: Add actions
nguyenntph Nov 19, 2025
e23811d
[IMP] estate: Add validation conditions
nguyenntph Nov 19, 2025
829d49e
[IMP] estate: Sprinkes
nguyenntph Nov 19, 2025
979ac8f
[REF] estate: Update view files
nguyenntph Nov 20, 2025
dae9bd4
[IMP] estate: Sprinkles (cont)
nguyenntph Nov 20, 2025
5feba0e
[IMP] estate: Inheritance
nguyenntph Nov 20, 2025
6ffae9b
[ADD] estate_account: Init
nguyenntph Nov 20, 2025
30a5051
[IMP] estate_account: Create account move on sold properties
nguyenntph Nov 20, 2025
2e499ad
[IMP] estate: Kanban view
nguyenntph Nov 20, 2025
02624c7
[REF] estate: Refactor based on guidelines and feedbacks
nguyenntph Nov 21, 2025
22b5730
[FIX] awesome_owl: Fix missing css variables
clbr-odoo Nov 21, 2025
926b0c4
[FIX] awesome_dashboard: Get rid of the deprecated warning
clbr-odoo Nov 21, 2025
e531407
[IMP] awesome_owl: Add counter / card / sum
nguyenntph Nov 24, 2025
6e65136
[IMP] awesome_owl: Add todo list
nguyenntph Nov 24, 2025
10bb239
[IMP] awesome_owl: Add todo item
nguyenntph Nov 24, 2025
4b60b5c
[IMP] awesome_owl: Auto focus
nguyenntph Nov 24, 2025
6863899
[IMP] awesome_owl: Toggle / Delete items
nguyenntph Nov 24, 2025
6c47a44
[IMP] awesome_owl: Update styles
nguyenntph Nov 24, 2025
32d13f9
[IMP] awesome_owl: Card slot / toggle
nguyenntph Nov 24, 2025
cac97e2
[IMP] awesome_dashboard: Add Layout / navigation buttons
nguyenntph Nov 25, 2025
9db9c27
[IMP] awesome_dashboard: Dashboard item
nguyenntph Nov 25, 2025
f757c6d
[IMP] awesome_dashboard: Show statistics
nguyenntph Nov 25, 2025
37acf5f
[IMP] awesome_dashboard: statistics service
nguyenntph Nov 25, 2025
8750017
[IMP] awesome_dashboard: Add pie chart
nguyenntph Nov 25, 2025
e4bf1fb
[IMP] awesome_dashboard: real life update
nguyenntph Nov 25, 2025
868a1fa
[IMP] awesome_dashboard: Lazy load dashboard
nguyenntph Nov 26, 2025
ca9b0de
[IMP] awesome_dashboard: Generic dashboard
nguyenntph Nov 26, 2025
0a449a3
[IMP] awesome_dashboard: Fix reload
nguyenntph Nov 26, 2025
eadf4c3
[IMP] awesome_dashboard: Extensible dashboard
nguyenntph Nov 26, 2025
5d78b62
[IMP] awesome_dashboard: Allow selecting items in dashboard
nguyenntph Nov 26, 2025
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
3 changes: 3 additions & 0 deletions awesome_dashboard/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
'views/views.xml',
],
'assets': {
'awesome_dashboard.dashboard': [
'awesome_dashboard/static/src/dashboard/**/*',
],
'web.assets_backend': [
'awesome_dashboard/static/src/**/*',
],
Expand Down
2 changes: 1 addition & 1 deletion awesome_dashboard/controllers/controllers.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
logger = logging.getLogger(__name__)

class AwesomeDashboard(http.Controller):
@http.route('/awesome_dashboard/statistics', type='json', auth='user')
@http.route('/awesome_dashboard/statistics', type='jsonrpc', auth='user')
def get_statistics(self):
"""
Returns a dict of statistics about the orders:
Expand Down
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.

Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import { Component } from "@odoo/owl";
import { CheckBox } from "@web/core/checkbox/checkbox";
import { Dialog } from "@web/core/dialog/dialog";
import { registry } from "@web/core/registry";
import dashboard_items from "../dashboard_items";

export class ConfigurationDialog extends Component {
static template = "awesome_dashboard.ConfigurationDialog";
static components = { CheckBox, Dialog };
static props = {
items: Array,
close: Function,
enabled_items: Array,
setEnabledItems: Function,
};

setup() {
this.all_items = this.props.enabled_items;
}

toggleValue(item) {
if (this.all_items.includes(item)) {
this.all_items = this.all_items.filter(name => name !== item);
} else {
this.all_items = [...this.all_items, item];
}
}

onApply() {
this.props.setEnabledItems(this.all_items);
this.props.close();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8" ?>
<templates xml:space="preserve">

<t t-name="awesome_dashboard.ConfigurationDialog">
<Dialog
size="'md'"
title="'Dashboard items configuration'"
>
<p>Which cards do you wish to see?</p>
<t t-foreach="props.items" t-as="item" t-key="item.id">
<CheckBox
name="item.id"
value="props.enabled_items.includes(item.id)"
onChange="(cheked) => this.toggleValue(item.id)"
>
<t t-esc="item.description"/>
</CheckBox>
</t>
<t t-set-slot="footer">
<button class="btn btn-primary" t-on-click="onApply">
Apply
</button>
</t>
</Dialog>
</t>

</templates>
68 changes: 68 additions & 0 deletions awesome_dashboard/static/src/dashboard/dashboard.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
import { Component, onWillStart, reactive, useState } from "@odoo/owl";
import { registry } from "@web/core/registry";
import { useService } from "@web/core/utils/hooks";
import { Layout } from "@web/search/layout";
import { DashboardItem } from "./dashboard_item/dashboard_item";
import { PieChart } from "./pie_chart/pie_chart";
import { ConfigurationDialog } from "./configuration_dialog/configuration_dialog";
import dashboard_items from "./dashboard_items";

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

setup() {
this.action = useService("action");
this.state = reactive({ statistics: useService("statistics") });
this.items = registry.category("awesome_dashboard").getAll();
this.dialog = useService("dialog");
this.context = useState({ enabled_items: this.getEnabledItems() });
}

getEnabledItems() {
// Open all items by default
const stored_items = JSON.parse(
localStorage.getItem("enabled_items")
);
if (!stored_items) {
const all_items = this.items.map((item) => item.id);
this.setEnabledItems(all_items);
return all_items;
}
return stored_items || [];
}

setEnabledItems(values) {
localStorage.setItem("enabled_items", JSON.stringify(values));
this.context.enabled_items = values;
}

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

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

openConfiguration() {
this.dialog.add(
ConfigurationDialog,
{
items: this.items,
enabled_items: this.context.enabled_items,
setEnabledItems: this.setEnabledItems.bind(this),
},
);
}
}

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: gray;
}
36 changes: 36 additions & 0 deletions awesome_dashboard/static/src/dashboard/dashboard.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8" ?>
<templates xml:space="preserve">

<t t-name="awesome_dashboard.AwesomeDashboard">
<Layout
className="'o_dashboard h-100'"
display="{controlPanel: {}}"
>
<t t-set-slot="layout-buttons">
<button class="btn btn-primary" t-on-click="openCustomers">
Customers
</button>
<button class="btn btn-primary" t-on-click="openLeads">
Leads
</button>
</t>
<t t-set-slot="control-panel-additional-actions">
<button t-on-click="openConfiguration" class="btn">
<i class="fa fa-cog"/>
</button>
</t>
<div class="d-flex align-items-start flex-wrap">
<t t-foreach="items" t-as="item" t-key="item.id">
<DashboardItem
size="item.size || 1"
t-if="context.enabled_items.includes(item.id)"
>
<t t-set="itemProp" t-value="item.props ? item.props(state.statistics) : {'data': state.statistics}"/>
<t t-component="item.Component" t-props="itemProp" />
</DashboardItem>
</t>
</div>
</Layout>
</t>

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

export class DashboardItem extends Component {
static template = "awesome_dashboard.DashboardItem";
static props = {
size: { type: Number, default: 1 },
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8" ?>
<templates xml:space="preserve">

<t t-name="awesome_dashboard.DashboardItem">
<div class="card d-inline-block m-4" t-attf-style="width: {{props.size*18}}rem;">
<div class="card-body text-center">
<div class="card-title">
<h5>
<t t-slot="default">
Some content
</t>
</h5>
<h1 class="text-success">
<t t-slot="value"/>
</h1>
</div>
</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 { registry } from "@web/core/registry";
import { PieChartCard } from "./pie_chart_card/pie_chart_card";
import { NumberCard } from "./number_card/number_card";

const items = [
{
id: "average_quantity",
description: "Average amount of t-shirt",
size: 1,
Component: NumberCard,
props: (data) => ({
title: "Average amount of t-shirt by order this month",
value: data.average_quantity,
}),
},
{
id: "average_time",
description: "Average order time",
size: 2,
Component: NumberCard,
props: (data) => ({
title: "Average time for an order to go from 'new' to 'sent' or 'cancelled'",
value: data.average_time,
}),
},
{
id: "nb_new_orders",
description: "New orders",
size: 2,
Component: NumberCard,
props: (data) => ({
title: "Number of new orders this month",
value: data.nb_new_orders,
}),
},
{
id: "nb_cancelled_orders",
description: "Average amount of t-shirt",
size: 1,
Component: NumberCard,
props: (data) => ({
title: "Number of cancelled orders this month",
value: data.nb_cancelled_orders,
}),
},
{
id: "total_amount",
description: "Total new orders",
size: 1,
Component: NumberCard,
props: (data) => ({
title: "Total amount of new orders this month",
value: data.total_amount,
}),
},
{
id: "orders_by_size",
description: "Shirt orders by size",
size: 2,
Component: PieChartCard,
props: (data) => ({
title: "Shirt orders by size",
value: data.orders_by_size,
}),
},
]

items.forEach(item => {
registry.category("awesome_dashboard").add(item.id, item);
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { Component } from "@odoo/owl";

export class NumberCard extends Component {
static template = "awesome_dashboard.NumberCard";
static props = {
title: String,
value: Number,
}
}
16 changes: 16 additions & 0 deletions awesome_dashboard/static/src/dashboard/number_card/number_card.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8" ?>
<templates xml:space="preserve">

<t t-name="awesome_dashboard.NumberCard">
<div class="card-title">
<h5>
<t t-esc="props.title"/>
</h5>
<h1 class="text-success">
<t t-esc="props.value"/>
</h1>
</div>
</t>

</templates>

Loading