-
Notifications
You must be signed in to change notification settings - Fork 2.2k
[ADD] estate: added core functionality and improvement awesome_dashboard #827
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
arat-odoo
wants to merge
15
commits into
odoo:18.0
Choose a base branch
from
odoo-dev:18.0-training-arat
base: 18.0
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
0076e86
[ADD] estate: created first module
arat-odoo 2ee782d
[IMP] estate: created three models and established relationships betw…
arat-odoo f8820d6
[IMP] estate: implement constraints , onchanges/inverse function , bu…
arat-odoo c845f0d
[IMP] estate: improvement estate module and created estateAccount br…
arat-odoo 1323afd
[IMP] estate_account: created invoice the sold property
arat-odoo 49d271d
[IMP] estate: added security and regarding access rules
arat-odoo 33676c7
[IMP] estate: added data through xml files and implement message func…
arat-odoo 92c8ef0
[IMP] estate: created kanban views of estate
arat-odoo dc5db72
[IMP] estate: added pdf report functionality
arat-odoo ef5f00d
[IMP] estate: improve PDF report added test case of property , offer
arat-odoo ba744e5
[IMP] awesome_owl: created counter and card component with markup tag
arat-odoo e7296bc
[IMP] awesome_owl: created todoList functionality and implement slots
arat-odoo 3d8b5a7
[IMP] awesome_dashboard: created layout,button,add dashboard item,add…
arat-odoo 13a2b85
[IMP] awesome_dashboard: add piechart real time update,make dynamic d…
arat-odoo c4079fd
[IMP] awesome_dashboard: added settings in dashboard
arat-odoo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
from . import models | ||
from . import controllers |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,29 @@ | ||
# -*- coding: utf-8 -*- | ||
{ | ||
'name': "Awesome Dashboard", | ||
|
||
'summary': """ | ||
"name": "Awesome Dashboard", | ||
"summary": """ | ||
Starting module for "Discover the JS framework, chapter 2: Build a dashboard" | ||
""", | ||
|
||
'description': """ | ||
"description": """ | ||
Starting module for "Discover the JS framework, chapter 2: Build a dashboard" | ||
""", | ||
|
||
'author': "Odoo", | ||
'website': "https://www.odoo.com/", | ||
'category': 'Tutorials/AwesomeDashboard', | ||
'version': '0.1', | ||
'application': True, | ||
'installable': True, | ||
'depends': ['base', 'web', 'mail', 'crm'], | ||
|
||
'data': [ | ||
'views/views.xml', | ||
"author": "Odoo", | ||
"website": "https://www.odoo.com/", | ||
"category": "Tutorials/AwesomeDashboard", | ||
"version": "0.1", | ||
"application": True, | ||
"installable": True, | ||
"depends": ["base", "web", "mail", "crm"], | ||
"data": [ | ||
"views/views.xml", | ||
], | ||
'assets': { | ||
'web.assets_backend': [ | ||
'awesome_dashboard/static/src/**/*', | ||
"assets": { | ||
"web.assets_backend": [ | ||
"awesome_dashboard/static/src/**/*", | ||
], | ||
"awesome_dashboard.dashboard": [ | ||
"awesome_dashboard/static/src/dashboard/**/*", | ||
], | ||
}, | ||
'license': 'AGPL-3' | ||
"license": "AGPL-3", | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * awesome_dashboard | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 18.0+e\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"POT-Creation-Date: 2025-06-24 12:17+0000\n" | ||
"PO-Revision-Date: 2025-06-24 12:17+0000\n" | ||
"Last-Translator: \n" | ||
"Language-Team: Hindi\n" | ||
"Language: hi\n" | ||
"MIME-Version: 1.0\n" | ||
"Content-Type: text/plain; charset=UTF-8\n" | ||
"Content-Transfer-Encoding: 8bit\n" | ||
"Plural-Forms: nplurals=2; plural=(n != 1);\n" | ||
|
||
#. module: awesome_dashboard | ||
#. odoo-javascript | ||
#: code:addons/awesome_dashboard/static/src/dashboard/dashboardSetting/dashboard_setting.xml:0 | ||
msgid "Apply" | ||
msgstr "लागू करें" | ||
|
||
#. module: awesome_dashboard | ||
#: model:ir.ui.menu,name:awesome_dashboard.menu_root | ||
msgid "Awesome Dashboard" | ||
msgstr "ऑसम डैशबोर्ड" | ||
|
||
#. module: awesome_dashboard | ||
#. odoo-javascript | ||
#: code:addons/awesome_dashboard/static/src/dashboard/dashboardSetting/dashboard_setting.xml:0 | ||
msgid "Cancel" | ||
msgstr "रद्द करें" | ||
|
||
#. module: awesome_dashboard | ||
#. odoo-javascript | ||
#: code:addons/awesome_dashboard/static/src/dashboard/dashboard.xml:0 | ||
msgid "Customers" | ||
msgstr "ग्राहक" | ||
|
||
#. module: awesome_dashboard | ||
#: model:ir.actions.client,name:awesome_dashboard.dashboard | ||
#: model:ir.ui.menu,name:awesome_dashboard.dashboard_menu | ||
msgid "Dashboard" | ||
msgstr "डैशबोर्ड" | ||
|
||
#. module: awesome_dashboard | ||
#. odoo-javascript | ||
#: code:addons/awesome_dashboard/static/src/dashboard/dashboard.xml:0 | ||
msgid "Dashboard Settings" | ||
msgstr "डैशबोर्ड सेटिंग्स" | ||
|
||
#. module: awesome_dashboard | ||
#. odoo-javascript | ||
#: code:addons/awesome_dashboard/static/src/dashboard/dashboard.xml:0 | ||
msgid "Leads" | ||
msgstr "लीड्स" | ||
|
||
#. module: awesome_dashboard | ||
#. odoo-javascript | ||
#: code:addons/awesome_dashboard/static/src/dashboard/piechartcard/piechartcard.xml:0 | ||
msgid "Loading chart..." | ||
msgstr "चार्ट लोड हो रहा है..." | ||
|
||
#. module: awesome_dashboard | ||
#. odoo-javascript | ||
#: code:addons/awesome_dashboard/static/src/dashboard/dashboardSetting/dashboard_setting.xml:0 | ||
msgid "Select items to display on your dashboard:" | ||
msgstr "अपने डैशबोर्ड पर प्रदर्शित करने के लिए आइटम चुनें:" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import res_users |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
from odoo import fields, models, api | ||
|
||
|
||
class ResUsers(models.Model): | ||
_inherit = "res.users" | ||
|
||
dashboard_disabled_items = fields.Char(default="") | ||
|
||
@api.model | ||
def set_dashboard_settings(self, disable_item_ids): | ||
if self.env.user: | ||
items = ",".join(map(str, disable_item_ids)) | ||
self.env.user.sudo().write({"dashboard_disabled_items": items}) | ||
return True | ||
return False | ||
|
||
@api.model | ||
def get_dashboard_settings(self): | ||
if self.env.user and self.env.user.dashboard_disabled_items: | ||
return self.env.user.dashboard_disabled_items.split(",") | ||
return [] |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
import { Component, useState, 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/dashboard_item"; | ||
import { Piechart } from "./pieChart/pieChart"; | ||
import { DashboardSettings } from "./dashboardSetting/dashboard_setting"; | ||
import { rpc } from "@web/core/network/rpc"; | ||
|
||
class AwesomeDashboard extends Component { | ||
static template = "awesome_dashboard.AwesomeDashboard"; | ||
static components = { Layout, DashboardItem, Piechart }; | ||
|
||
setup() { | ||
const dashboardItemsRegistryData = registry.category("awesome_dashboard"); | ||
this.action = useService("action"); | ||
this.items = dashboardItemsRegistryData.getAll(); | ||
this.statisticServices = useService("awesome_dashboard.statistics"); | ||
this.state = useState({ statistic: this.statisticServices.statistic }); | ||
this.dialogService = useService("dialog"); | ||
this.displayData = useState({ | ||
disabledItems: [], | ||
isLoading: true, | ||
}); | ||
onWillStart(async () => { | ||
try { | ||
// this.displayData.isLoading = true; | ||
const fetchedDisabledItems = await rpc( | ||
"/web/dataset/call_kw/res.users/get_dashboard_settings", | ||
{ | ||
model: "res.users", | ||
method: "get_dashboard_settings", | ||
args: [], | ||
kwargs: {}, | ||
} | ||
); | ||
this.displayData.disabledItems = fetchedDisabledItems; | ||
} catch (error) { | ||
console.error( | ||
"Error loading initial dashboard settings from server:", | ||
error | ||
); | ||
this.displayData.disabledItems = []; | ||
} finally { | ||
this.displayData.isLoading = false; | ||
} | ||
}); | ||
} | ||
openCustomers() { | ||
this.action.doAction("base.action_partner_form"); | ||
} | ||
|
||
async openLeads(activity) { | ||
this.action.doAction({ | ||
type: "ir.actions.act_window", | ||
name: "Journal Entry", | ||
target: "current", | ||
res_id: activity.res_id, | ||
res_model: "crm.lead", | ||
views: [ | ||
[false, "list"], | ||
[false, "form"], | ||
], | ||
}); | ||
} | ||
|
||
updateConfiguration(newUncheckedItems) { | ||
this.displayData.disabledItems.length = 0; | ||
this.displayData.disabledItems.push(...newUncheckedItems); | ||
} | ||
|
||
openSetting() { | ||
this.dialogService.add(DashboardSettings, { | ||
items: this.items, | ||
initialUncheckedItems: this.state.uncheckedItems, | ||
updateConfiguration: this.updateConfiguration.bind(this), | ||
}); | ||
} | ||
} | ||
|
||
registry.category("lazy_components").add("AwesomeDashboard", AwesomeDashboard); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
.o_dashboard{ | ||
background-color: burlywood; | ||
} | ||
|
||
.o_dashboard_stat_block { | ||
text-align: center; | ||
margin-bottom: 24px; | ||
} | ||
|
||
.o_dashboard_stat_label { | ||
font-weight: normal; | ||
margin-bottom: 10px; | ||
display: block; | ||
} | ||
|
||
.o_dashboard_stat_value { | ||
font-size: 48px; | ||
color: #228B22; | ||
font-weight: bold; | ||
} | ||
|
||
.o_dashboard_item { | ||
background: #fff; | ||
border-radius: 0.75rem; | ||
box-shadow: 0 2px 8px rgba(0,0,0,0.07); | ||
padding: 1rem; | ||
margin: 1rem; | ||
display: inline-flex; | ||
justify-content: center; | ||
vertical-align: top; | ||
min-height: 3rem; | ||
} | ||
|
||
@media (max-width: 426px) { | ||
.o_dashboard_item { | ||
width: 100% !important; | ||
display: flex; | ||
margin-left: 0.5rem; | ||
margin-right: 0.5rem; | ||
box-sizing: border-box; | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?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="control-panel-create-button"> | ||
<button t-on-click="openCustomers" type="button" class="btn btn-primary" title="Customers">Customers</button> | ||
<button t-on-click="openLeads" type="button" class="btn btn-primary" title="Customers">Leads</button> | ||
</t> | ||
<t t-set-slot="control-panel-additional-actions"> | ||
<button class="btn btn-light" title="Dashboard Settings" t-on-click="openSetting"> | ||
<i class="fa fa-cog"></i> | ||
</button> | ||
</t> | ||
<div class="d-flex flex-wrap"> | ||
<t t-foreach="items" t-as="item" t-key="item.id"> | ||
<DashboardItem t-if="(displayData.disabledItems || []).includes(item.id) === false" size="item.size || 1"> | ||
<t t-set="itemProp" t-value="item.props ? item.props(this.state.statistic) : {'data': this.state.statistic}"/> | ||
<t t-component="item.Component" t-props="itemProp" /> | ||
</DashboardItem> | ||
</t> | ||
</div> | ||
</Layout> | ||
</t> | ||
</templates> |
15 changes: 15 additions & 0 deletions
15
awesome_dashboard/static/src/dashboard/dashboardItem/dashboard_item.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { Component } from "@odoo/owl"; | ||
export class DashboardItem extends Component { | ||
static template = "awesome_dashboard.DashboardItem"; | ||
static props = { | ||
slots: { | ||
type: Object, | ||
shape: { default: true }, | ||
}, | ||
size: { | ||
type: Number, | ||
default: 1, | ||
optional:true | ||
}, | ||
}; | ||
} |
11 changes: 11 additions & 0 deletions
11
awesome_dashboard/static/src/dashboard/dashboardItem/dashboard_item.xml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<templates xml:space="preserve"> | ||
<t t-name="awesome_dashboard.DashboardItem"> | ||
<div t-attf-class="o_dashboard_item" | ||
t-attf-style="width: #{18 * itemSize}rem; background: #fff; border-radius: 0.75rem; box-shadow: 0 2px 8px rgba(0,0,0,0.07); padding: 1rem; margin: 1rem; display: inline-flex; justify-content: center; vertical-align: top; min-height: 3rem;"> | ||
<div class="card-body"> | ||
<t t-slot="default"/> | ||
</div> | ||
</div> | ||
</t> | ||
</templates> |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unnecessary changes