Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
d39b681
[ADD] estate: created estate application and important files.
danal-odoo Nov 11, 2025
c1b9539
[IMP] estate: created models for estate application.
danal-odoo Nov 11, 2025
eb9e8d3
[IMP] estate: implimented security for model access.
danal-odoo Nov 11, 2025
0c74148
[IMP] estate: created views, menuitem and modified manifest file.
danal-odoo Nov 11, 2025
dfeb5ac
[IMP] estate: implemented form and model fields, code formation.
danal-odoo Nov 12, 2025
b8d60d4
[IMP] estate: added form and search with Filter and Group By function…
danal-odoo Nov 12, 2025
b3387a8
[IMP] estate: added offer, tag and type models and created views.
danal-odoo Nov 13, 2025
8013e8d
[IMP] estate: add compute, inverse and on chnage in estate offer model.
danal-odoo Nov 13, 2025
7519102
[IMP] estate: added restrictions and action in property offer.
danal-odoo Nov 14, 2025
7a9ac12
[IMP] estate: added sql constraints and python constraints, fixed off…
danal-odoo Nov 15, 2025
a16f98c
[IMP] estate: added stat button, inline views, list order
danal-odoo Nov 17, 2025
6098504
[IMP] estate: added inheritance and on create functions.
danal-odoo Nov 18, 2025
d5c1168
[ADD] estate: added Estate Account Module
danal-odoo Nov 18, 2025
cf8dd0a
[IMP] estate: added kanban view and optimized offer state button
danal-odoo Nov 18, 2025
b10034f
[IMP] estate: code formation as per odoo guidline
danal-odoo Nov 18, 2025
faedfa7
[IMP] awesome_owl: added counter ui in playground, added card,counter…
danal-odoo Nov 19, 2025
ff459f4
[IMP] awesome_owl: added markup(),props validation, sum counter
danal-odoo Nov 20, 2025
35610bc
[IMP] awesome_owl: added todo component.
danal-odoo Nov 21, 2025
4a394e3
[IMP] awesome_owl: added todo component and made card component dynamic.
danal-odoo Nov 24, 2025
12ab960
[IMP] awesome_dashboard: added layout component in dashboard.
danal-odoo Nov 24, 2025
8c73677
[IMP] awesome_dashboard: added customers and leads button.
danal-odoo Nov 24, 2025
ced1c9f
[IMP] awesome_dashboard: added DashboardItem component.
danal-odoo Nov 25, 2025
1a34266
[IMP] awesome_dashboard: added Chart and made dashboard lazyload.
danal-odoo Nov 27, 2025
38cc6e5
[IMP] awesome_dashboard: added popup to select item to show/hide.
danal-odoo Nov 27, 2025
5d27874
[IMP] estate: fixed state button layout.
danal-odoo Nov 28, 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
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -127,3 +127,10 @@ dmypy.json

# Pyre type checker
.pyre/

.eslintignore
.eslintrc.json
jsconfig.json
package.json
package-lock.json
node_modules/
3 changes: 3 additions & 0 deletions awesome_dashboard/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@
'web.assets_backend': [
'awesome_dashboard/static/src/**/*',
],
'awesome_dashboard.dashboard': [
'awesome_dashboard/static/src/dashboard/**/*',
],
},
'license': 'AGPL-3'
}
Binary file added awesome_dashboard/static/dashboard.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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.

91 changes: 91 additions & 0 deletions awesome_dashboard/static/src/dashboard/dashboard.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
import { Component, 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 "./dashboarditem/dashboarditem";
import { PieChart } from "./piechart/piechart";

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

setup() {
this.action = useService("action");
const statisticsService = useService("awesome_dashboard.statistics");
this.statistics = useState(statisticsService.state);
this.modalState = useState({ isOpen: false });
this.hiddenItems = useState({
ids: JSON.parse(
localStorage.getItem("hidden_dashboard_items") || "[]"
),
});
this.items = useState(
registry
.category("awesome_dashboard")
.getAll()
.filter((item) => !this.hiddenItems.ids.includes(item.id))
);
this.allItems = useState(
registry
.category("awesome_dashboard")
.getAll()
);
}

openCustomers() {
this.action.doAction({
type: "ir.actions.act_window",
name: "Customers",
res_model: "res.partner",
views: [
[false, "kanban"],
[false, "form"],
[false, "list"],
],
});
}

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

toggleModal() {
this.modalState.isOpen = !this.modalState.isOpen
}

toggleItem(event) {
const itemId = event.target.value;

if (event.target.checked) {
this.hiddenItems.ids = this.hiddenItems.ids.filter(
(id) => id !== itemId
);
} else {
this.hiddenItems.ids.push(itemId);
}
}

applySettings() {
localStorage.setItem(
"hidden_dashboard_items",
JSON.stringify(this.hiddenItems.ids)
);

this.items = registry
.category("awesome_dashboard")
.getAll()
.filter((item) => !this.hiddenItems.ids.includes(item.id));

this.toggleModal();
}
}

registry.category("lazy_components").add("awesome_dashboard.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:rgb(27, 29, 38)
}
60 changes: 60 additions & 0 deletions awesome_dashboard/static/src/dashboard/dashboard.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
<?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="control-panel-buttons">
<button class="btn btn-primary me-2" t-on-click="openCustomers">
Customers
</button>
<button class="btn btn-primary me-2" t-on-click="openLeads">
Leads
</button>
</t>

<t t-set-slot="control-panel-additional-actions">
<button type="button" class="btn btn-light p-1" t-on-click="toggleModal">
<i class="fa fa-fw fa-cog fs-5 text-muted"></i>
</button>
</t>

<div class="d-flex flex-wrap mt-1 text-center">
<t t-foreach="items" t-as="item" t-key="item.id">
<DashboardItem size="item.size">
<t t-set="itemProp" t-value="item.props ? item.props(this.statistics.data) : {'data': this.statistics.data}"/>
<t t-component="item.Component" t-props="itemProp" />
</DashboardItem>
</t>
</div>

<div class="modal fade d-block" t-att-class="(this.modalState.isOpen ? 'show': 'd-none')" tabindex="-1" role="dialog">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header d-flex justify-content-between">
<h5 class="modal-title">Dashboard Settings</h5>
</div>
<div class="modal-body">
<label>Select dashboard items:</label>
<div class="m-2">
<t t-foreach="this.allItems" t-as="item" t-key="item.id">
<div>
<input type="checkbox" class='me-2'
t-att-value="item.id"
t-att-checked="!hiddenItems.ids.includes(item.id)"
t-on-change="toggleItem"/>
<t t-esc="item.description"/>
</div>
</t>
</div>
</div>
<div class="modal-footer">
<button class="btn btn-primary me-2" t-on-click="applySettings">Apply</button>
<button class="btn btn-secondary" t-on-click="toggleModal">Cancel</button>
</div>
</div>
</div>
</div>
</Layout>
</t>

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

export const items = [
{
id: "average_quantity",
description: "Average amount of t-shirt",
Component: NumberCard,
props: (data) => ({
title: "Average amount of t-shirt by order this month",
value: data.average_quantity,
}),
},
{
id: "nb_new_orders",
description: "Number of new orders this month",
Component: NumberCard,
props: (data) => ({
title: "Number of new orders this month",
value: data.nb_new_orders,
}),
},
{
id: "nb_cancelled_orders",
description: "Number of cancelled orders this month",
Component: NumberCard,
props: (data) => ({
title: "Number of cancelled orders this month",
value: data.nb_cancelled_orders,
}),
},
{
id: "total_amount",
description: "Total amount of new orders this month",
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",
Component: PieChartCard,
props: (data) => ({
title: "Shirt orders by size",
value: data.orders_by_size,
}),
},
{
id: "average_time",
description:
"Average time for an order to go from ‘new’ to ‘sent’ or ‘cancelled’",
Component: NumberCard,
props: (data) => ({
title: "Average time for an order to go from ‘new’ to ‘sent’ or ‘cancelled’",
value: data.average_time,
}),
},
];

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

export class DashboardItem extends Component {
static template = "awesome_dashboard.DashboardItem";

static props = {
slots: {
type: Object,
shape: {
default: Object,
},
},
size: {
type: Number,
default: 1,
optional: true,
},
};
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8" ?>
<templates xml:space="preserve">

<t t-name="awesome_dashboard.DashboardItem">
<div class="card m-2" t-attf-style="width: {{ 18 * props.size }}rem; border-radius: 16px; height: fit-content;">
<div class="card-body">
<t t-slot="default"/>
</div>
</div>
</t>

</templates>
10 changes: 10 additions & 0 deletions awesome_dashboard/static/src/dashboard/numbercard/numbercard.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { Component } from "@odoo/owl";

export class NumberCard extends Component {
static template = "awesome_dashboard.NumberCard";

static props = {
title: String,
value: Number,
};
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8" ?>
<templates xml:space="preserve">
<t t-name="awesome_dashboard.NumberCard">
<h5 class="mb-0" t-esc="props.title"/>
<p class='fs-1 fw-bold text-success mb-0' t-esc="props.value"/>
</t>
</templates>
76 changes: 76 additions & 0 deletions awesome_dashboard/static/src/dashboard/piechart/piechart.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
import { Component, onWillStart, onPatched, useRef, onMounted } from "@odoo/owl";
import { loadJS } from "@web/core/assets";

export class PieChart extends Component {
static template = "awesome_dashboard.PieChart";
static props = {
items: {
type: Object,
optional: true,
default: () => { },
},
}

setup() {
this.chartRef = useRef("pie-canvas");
this.myPieChart = null;

onWillStart(async () => {
await loadJS("/web/static/lib/Chart/Chart.js");
});

onMounted(() => {
this.renderChart()
});

onPatched(() => {
this.renderChart()
});
}

renderChart() {
if (!this.chartRef.el) {
return;
}

if (this.myPieChart) {
this.myPieChart.destroy();
}

this.pieChartData = {
labels: ['M', 'S', 'XL'],
datasets: [{
label: 'Sales Count',
data: [this.props.items.m, this.props.items.s, this.props.items.xl],
backgroundColor: [
'rgba(255, 99, 132, 0.6)',
'rgba(54, 162, 235, 0.6)',
'rgba(255, 206, 86, 0.6)'
],
borderColor: [
'rgba(255, 99, 132, 1)',
'rgba(54, 162, 235, 1)',
'rgba(255, 206, 86, 1)'
],
borderWidth: 1
}]
};

this.pieChartOptions = {
responsive: true,
maintainAspectRatio: false,
plugins: {
legend: {
position: 'top',
}
}
};

this.myPieChart = new Chart(this.chartRef.el,
{
type: 'pie',
data: this.pieChartData,
options: this.pieChartOptions
});
}
}
Loading