Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
19545d8
[ADD] real_estate: complete Chapters 1–6 of Odoo tutorial
rugot-odoo Dec 31, 2025
b30b91c
[FIX] real_estate : Delete .idea directory
rugot-odoo Jan 1, 2026
f0334f2
[FIX] real_estate: Implement many2one, one2many, and many2many relati…
rugot-odoo Jan 2, 2026
967fd9a
[ADD] real_estate: Implement many2one, one2many, and many2many relati…
rugot-odoo Jan 2, 2026
fe80498
[ADD] real_estate: complete onchange, depends and ondelete decorators
rugot-odoo Jan 5, 2026
e725c5f
[ADD] real_estate: Implement many2one, one2many, and many2many relati…
rugot-odoo Jan 5, 2026
828453e
[ADD] real_estate: complete onchange, depends and ondelete decorators
rugot-odoo Jan 5, 2026
b5296de
[ADD] real_estate: add actions, business logic, and property type
rugot-odoo Jan 6, 2026
fedc96f
[ADD] real_estate: constraints, statusbar widget, and inline list views
rugot-odoo Jan 7, 2026
63068b7
[ADD] real_estate: Property maintenance requests and validations
rugot-odoo Jan 12, 2026
bd01dfa
[ADD] real_estate: estate: enhance UI with sprinkles improvements
rugot-odoo Jan 12, 2026
f72a66a
[ADD] real_estate: implement inheritance and cross-module chapters 1…
rugot-odoo Jan 16, 2026
c9b8123
[ADD] real_estate: add read_fetch method and finalize tutorials 14 & 15
rugot-odoo Jan 20, 2026
d052826
[ADD] real_estate : access groups, categories, privileges + finish 7…
rugot-odoo Jan 23, 2026
87d4023
[ADD] real_estate : Load demo data and implement Todo List component…
rugot-odoo Jan 30, 2026
cf3e70b
[ADD] real_estate: Added mail templates and QWeb report templates
rugot-odoo Feb 3, 2026
535153e
[ADD] real_estate: complete JS dashboard + automate property & CRM w…
rugot-odoo Feb 6, 2026
42b0d63
[IMP] real_estate: improvments
rugot-odoo Feb 12, 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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ downloads/
eggs/
.eggs/
lib/
.idea/
lib64/
parts/
sdist/
Expand Down
14 changes: 9 additions & 5 deletions awesome_dashboard/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,14 @@
'data': [
'views/views.xml',
],
'assets': {
'web.assets_backend': [
'awesome_dashboard/static/src/**/*',
],
},
"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'
}
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.

108 changes: 108 additions & 0 deletions awesome_dashboard/static/src/dashboard/dashboard.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
/** @odoo-module **/

import { Component, useState, onMounted, onWillStart } 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 { rpc } from "@web/core/network/rpc";
//import { items } from "./dashboard_items";
import { Dialog } from "@web/core/dialog/dialog";
import { CheckBox } from "@web/core/checkbox/checkbox";
import { browser } from "@web/core/browser/browser";
import { _t } from "@web/core/l10n/translation";

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

setup() {
this.action = useService("action");
this.dialog = useService("dialog");
this.statistics = useState(useService("awesome_dashboard.statistics"));
this.state = useState({
disabledItems:
browser.localStorage.getItem("disabledDashboardItems")?.split(",") ||
[],
loading: true,
});
// this.items = items;
this.items = registry.category("awesome_dashboard").getAll();
onMounted(async () => {
await new Promise((res) => setTimeout(res, 1000));
this.state.loading = false;
});
// onWillStart(async () => {
// this.statistics = await rpc("/awesome_dashboard/statistics");
// console.log(this.statistics)
// });
// onWillStart(async () => {
// this.statistics = await this.statisticsService.loadStatistics();
// console.log(this.statistics)
// });

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

openLeads() {
this.action.doAction({
type: "ir.actions.act_window",
name: _t("Leads"),
res_model: "crm.lead",
views: [
[false, "list"],
[false, "form"]
],
target: "current",
});
}
openConfiguration() {
this.dialog.add(ConfigurationDialog, {
items: this.items,
disabledItems: this.state.disabledItems,
onUpdateConfiguration: this.updateConfiguration.bind(this),
});
}

updateConfiguration(newDisabledItems) {
this.state.disabledItems = newDisabledItems;
}
}

class ConfigurationDialog extends Component {
static template = "awesome_dashboard.ConfigurationDialog";
static components = { Dialog, CheckBox };
static props = ["close", "items", "disabledItems", "onUpdateConfiguration"];

setup() {
this.items = useState(this.props.items.map((item) => {
return {
...item,
enabled: !this.props.disabledItems.includes(item.id),
}
}));
}

done() {
this.props.close();
}

onChange(checked, changedItem) {
changedItem.enabled = checked;
const newDisabledItems = Object.values(this.items).filter(
(item) => !item.enabled
).map((item) => item.id)

browser.localStorage.setItem(
"disabledDashboardItems",
newDisabledItems,
);

this.props.onUpdateConfiguration(newDisabledItems);
}
}
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: #d3d3d3;
// }
93 changes: 93 additions & 0 deletions awesome_dashboard/static/src/dashboard/dashboard.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
<?xml version="1.0" encoding="UTF-8"?>
<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 class="btn btn-primary me-2" t-on-click="openCustomer">
Customers
</button>
<button class="btn btn-secondary" t-on-click="openLeads">
Leads
</button>
</t>
<t t-set-slot="control-panel-additional-actions">
<button t-on-click="openConfiguration" class="btn p-0 ms-1 border-0">
<i class="fa fa-cog"></i>
</button>
</t>

<t t-if="state.loading">
<div class="d-flex justify-content-center mt-5">
<div class="spinner-border text-primary" role="status">
</div>
</div>
</t>
<t t-else="">
<div class="bg-secondary text-white p-2 mt-3">
<div class="d-flex flex-wrap" t-if="statistics.isReady">
<!-- <DashboardItem>-->
<!-- Average Quantity-->
<!-- <div class="fs-1 fw-bold text-success text-center">-->
<!-- <t t-esc="statistics.average_quantity"/>-->
<!-- </div>-->
<!-- </DashboardItem>-->
<!-- <DashboardItem>-->
<!-- Average Time-->
<!-- <div class="fs-1 fw-bold text-success text-center">-->
<!-- <t t-esc="statistics.average_time"/>-->
<!-- </div>-->
<!-- </DashboardItem>-->
<!-- <DashboardItem>-->
<!-- Number of new orders-->
<!-- <div class="fs-1 fw-bold text-success text-center">-->
<!-- <t t-esc="statistics.nb_new_orders"/>-->
<!-- </div>-->
<!-- </DashboardItem>-->
<!-- <DashboardItem>-->
<!-- Number of cancelled orders-->
<!-- <div class="fs-1 fw-bold text-success text-center">-->
<!-- <t t-esc="statistics.nb_cancelled_orders"/>-->
<!-- </div>-->
<!-- </DashboardItem>-->
<!-- <DashboardItem>-->
<!-- Total amount of new orders-->
<!-- <div class="fs-1 fw-bold text-success text-center">-->
<!-- <t t-esc="statistics.total_amount"/>-->
<!-- </div>-->
<!-- </DashboardItem>-->
<!-- <DashboardItem size="2">-->
<!-- Shirt orders by size-->
<!-- <PieChart data="statistics.orders_by_size" label="'Shirt orders by size'"/>-->
<!-- </DashboardItem>-->
<t t-foreach="items" t-as="item" t-key="item.id">
<DashboardItem t-if="!state.disabledItems.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>
</div>
</div>
</t>

</Layout>
</t>
<t t-name="awesome_dashboard.ConfigurationDialog">
<Dialog title="'Dashboard items configuration'">
Which cards do you whish to see ?
<t t-foreach="items" t-as="item" t-key="item.id">
<CheckBox value="item.enabled" onChange="(ev) => this.onChange(ev, item)">
<t t-esc="item.description"/>
</CheckBox>
</t>
<t t-set-slot="footer">
<button class="btn btn-primary" t-on-click="done">
Done
</button>
</t>
</Dialog>
</t>


</templates>
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/** @odoo-module **/

import { Component } from "@odoo/owl";

export class DashboardItem extends Component {
static template = "awesome_dashboard.AwesomeDashboardItem";
static props = {
size: { type: Number, optional: true, default: 1 },
slots: {
type: Object,
},
};
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<templates xml:space="preserve">
<t t-name="awesome_dashboard.AwesomeDashboardItem">
<div class="card m-2 border-dark" t-attf-style="width: {{18*props.size}}rem;">
<div class="card-body">
<t t-slot="default"/>
</div>
</div>
</t>
</templates>
64 changes: 64 additions & 0 deletions awesome_dashboard/static/src/dashboard/dashboard_items.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
import { NumberCard } from "./number_card/number_card";
import { PieChartCard } from "./pie_chart_card/pie_chart_card";
import { registry } from "@web/core/registry";

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: "average_time",
description: "Average time for an order",
Component: NumberCard,
props: (data) => ({
title: "Average time for an order to go from 'new' to 'sent' or 'cancelled'",
value: data.average_time,
})
},
{
id: "number_new_orders",
description: "New orders this month",
Component: NumberCard,
props: (data) => ({
title: "Number of new orders this month",
value: data.nb_new_orders,
})
},
{
id: "cancelled_orders",
description: "Cancelled orders this month",
Component: NumberCard,
props: (data) => ({
title: "Number of cancelled orders this month",
value: data.nb_cancelled_orders,
})
},
{
id: "amount_new_orders",
description: "amount orders this month",
Component: NumberCard,
props: (data) => ({
title: "Total amount of new orders this month",
value: data.total_amount,
})
},
{
id: "pie_chart",
description: "Shirt orders by size",
Component: PieChartCard,
size: 2,
props: (data) => ({
title: "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,9 @@
<?xml version="1.0" encoding="UTF-8" ?>
<templates xml:space="preserve">
<t t-name="awesome_dashboard.NumberCard" owl="1">
<t t-esc="props.title"/>
<div class="fs-1 fw-bold text-success text-center">
<t t-esc="props.value"/>
</div>
</t>
</templates>
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { Component } from "@odoo/owl";
import { PieChart } from "../piechart/pie_chart"

export class PieChartCard extends Component {
static template = "awesome_dashboard.PieChartCard";
static components = { PieChart };
static props = {
title: {
type: String,
},
values: {
type: Object,
},
};
}
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.PieChartCard" owl="1">
<t t-esc="props.title"/>
<PieChart data="props.values" label="''"/>
</t>
</templates>
Loading