@ -0,0 +1,42 @@ |
|||||
|
.. image:: https://img.shields.io/badge/license-LGPL--3-green.svg |
||||
|
:target: https://www.gnu.org/licenses/lgpl-3.0-standalone.html |
||||
|
:alt: License: LGPL-3 |
||||
|
|
||||
|
Sale Mini Dashboard |
||||
|
=================== |
||||
|
This module allow to displaying the count of quotations and sale orders, total amount for sale orders and total amount for quotations. |
||||
|
|
||||
|
Company |
||||
|
------- |
||||
|
* `Cybrosys Techno Solutions <https://cybrosys.com/>`__ |
||||
|
|
||||
|
License |
||||
|
------- |
||||
|
* Lesser General Public License, Version 3 (LGPL v3). |
||||
|
(https://www.gnu.org/licenses/lgpl-3.0-standalone.html) |
||||
|
|
||||
|
Credits |
||||
|
------- |
||||
|
Developer: (V17) Dhanya B, Contact : odoo@cybrosys.com |
||||
|
|
||||
|
Contacts |
||||
|
-------- |
||||
|
* Mail Contact : odoo@cybrosys.com |
||||
|
* Website : https://cybrosys.com |
||||
|
|
||||
|
Bug Tracker |
||||
|
----------- |
||||
|
Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. |
||||
|
|
||||
|
Maintainer |
||||
|
========== |
||||
|
.. image:: https://cybrosys.com/images/logo.png |
||||
|
:target: https://cybrosys.com |
||||
|
|
||||
|
This module is maintained by Cybrosys Technologies. |
||||
|
|
||||
|
For support and more information, please visit `Our Website <https://cybrosys.com/>`__ |
||||
|
|
||||
|
Further information |
||||
|
=================== |
||||
|
HTML Description: `<static/description/index.html>`__ |
@ -0,0 +1,22 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################# |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
||||
|
# Author: Cybrosys Techno Solutions(<https://www.cybrosys.com>) |
||||
|
# |
||||
|
# You can modify it under the terms of the GNU LESSER |
||||
|
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. |
||||
|
# |
||||
|
# This program is distributed in the hope that it will be useful, |
||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. |
||||
|
# |
||||
|
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE |
||||
|
# (LGPL v3) along with this program. |
||||
|
# If not, see <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################# |
||||
|
from . import models |
@ -0,0 +1,48 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################# |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
||||
|
# Author: Cybrosys Techno Solutions(<https://www.cybrosys.com>) |
||||
|
# |
||||
|
# You can modify it under the terms of the GNU LESSER |
||||
|
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. |
||||
|
# |
||||
|
# This program is distributed in the hope that it will be useful, |
||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. |
||||
|
# |
||||
|
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE |
||||
|
# (LGPL v3) along with this program. |
||||
|
# If not, see <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################# |
||||
|
{ |
||||
|
'name': 'Sale Mini Dashboard', |
||||
|
'version': '18.0.1.0.0', |
||||
|
'category': 'Sales', |
||||
|
'summary': 'Mini dashboard for Sales, Displays the total amount and count' |
||||
|
' of Quotations and Sale Orders', |
||||
|
'description': """This module is developed for displaying the count of |
||||
|
quotations and sale orders, total amount for sale orders and total |
||||
|
amount for quotations.""", |
||||
|
'author': 'Cybrosys Techno Solutions', |
||||
|
'company': 'Cybrosys Techno Solutions', |
||||
|
'maintainer': 'Cybrosys Techno Solutions', |
||||
|
'website': 'https://www.cybrosys.com', |
||||
|
'depends': ['base', 'sale_management'], |
||||
|
'data': ['views/sale_order_views.xml'], |
||||
|
'assets': { |
||||
|
'web.assets_backend': [ |
||||
|
'sale_mini_dashboard/static/src/xml/*.xml', |
||||
|
'sale_mini_dashboard/static/src/js/*.js', |
||||
|
], |
||||
|
}, |
||||
|
'images': ['static/description/banner.png'], |
||||
|
'license': 'LGPL-3', |
||||
|
'installable': True, |
||||
|
'auto_install': False, |
||||
|
'application': False, |
||||
|
} |
@ -0,0 +1,7 @@ |
|||||
|
## Module <sale_mini_dashboard> |
||||
|
|
||||
|
#### 24.09.2024 |
||||
|
#### Version 18.0.1.0.0 |
||||
|
#### ADD |
||||
|
|
||||
|
- Initial commit for Sale Mini Dashboard |
@ -0,0 +1,22 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################# |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
||||
|
# Author: Cybrosys Techno Solutions(<https://www.cybrosys.com>) |
||||
|
# |
||||
|
# You can modify it under the terms of the GNU LESSER |
||||
|
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. |
||||
|
# |
||||
|
# This program is distributed in the hope that it will be useful, |
||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. |
||||
|
# |
||||
|
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE |
||||
|
# (LGPL v3) along with this program. |
||||
|
# If not, see <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################# |
||||
|
from . import sale_order |
@ -0,0 +1,68 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################# |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
||||
|
# Author: Cybrosys Techno Solutions(<https://www.cybrosys.com>) |
||||
|
# |
||||
|
# You can modify it under the terms of the GNU LESSER |
||||
|
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. |
||||
|
# |
||||
|
# This program is distributed in the hope that it will be useful, |
||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. |
||||
|
# |
||||
|
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE |
||||
|
# (LGPL v3) along with this program. |
||||
|
# If not, see <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################# |
||||
|
from odoo import api, models |
||||
|
from odoo.tools import format_amount |
||||
|
|
||||
|
|
||||
|
class SaleOrder(models.Model): |
||||
|
"""Inherited the model for adding the dashboard values""" |
||||
|
_inherit = 'sale.order' |
||||
|
|
||||
|
@api.model |
||||
|
def get_dashboard_values(self): |
||||
|
"""This method returns values to the dashboard in sale order views.""" |
||||
|
result = { |
||||
|
'total_orders': 0, |
||||
|
'draft_orders': 0, |
||||
|
'sale_orders': 0, |
||||
|
'my_orders': 0, |
||||
|
'my_draft_orders': 0, |
||||
|
'my_sale_orders': 0, |
||||
|
'total_sale_amount': 0, |
||||
|
'total_draft_amount': 0, |
||||
|
} |
||||
|
sale_order = self.env['sale.order'] |
||||
|
user = self.env.user |
||||
|
result['total_orders'] = sale_order.search_count([]) |
||||
|
result['draft_orders'] = sale_order.search_count( |
||||
|
[('state', 'in', ['draft', 'sent'])]) |
||||
|
result['sale_orders'] = sale_order.search_count( |
||||
|
[('state', 'in', ['sale', 'done'])]) |
||||
|
result['my_orders'] = sale_order.search_count( |
||||
|
[('user_id', '=', user.id)]) |
||||
|
result['my_draft_orders'] = sale_order.search_count( |
||||
|
[('user_id', '=', user.id), ('state', 'in', ['draft', 'sent'])]) |
||||
|
result['my_sale_orders'] = sale_order.search_count( |
||||
|
[('user_id', '=', user.id), ('state', 'in', ['sale', 'done'])]) |
||||
|
order_sum = """select sum(amount_total) from sale_order where state |
||||
|
in ('sale', 'done')""" |
||||
|
self._cr.execute(order_sum) |
||||
|
res = self.env.cr.fetchone() |
||||
|
result['total_sale_amount'] = format_amount(self.env, res[0] or 0, |
||||
|
self.env.company.currency_id) |
||||
|
draft_sum = """select sum(amount_total) from sale_order where state |
||||
|
in ('draft', 'sent')""" |
||||
|
self._cr.execute(draft_sum) |
||||
|
res = self.env.cr.fetchone() |
||||
|
result['total_draft_amount'] = format_amount(self.env, res[0] or 0, |
||||
|
self.env.company.currency_id) |
||||
|
return result |
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 28 KiB |
After Width: | Height: | Size: 628 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 210 KiB |
After Width: | Height: | Size: 209 KiB |
After Width: | Height: | Size: 109 KiB |
After Width: | Height: | Size: 495 B |
After Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 624 B |
After Width: | Height: | Size: 136 KiB |
After Width: | Height: | Size: 214 KiB |
After Width: | Height: | Size: 36 KiB |
After Width: | Height: | Size: 3.6 KiB |
After Width: | Height: | Size: 310 B |
After Width: | Height: | Size: 929 B |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 3.3 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 17 KiB |
After Width: | Height: | Size: 542 B |
After Width: | Height: | Size: 576 B |
After Width: | Height: | Size: 733 B |
After Width: | Height: | Size: 4.3 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 4.0 KiB |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 286 KiB |
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 911 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 600 B |
After Width: | Height: | Size: 673 B |
After Width: | Height: | Size: 2.0 KiB |
After Width: | Height: | Size: 462 B |
After Width: | Height: | Size: 2.1 KiB |
After Width: | Height: | Size: 926 B |
After Width: | Height: | Size: 9.0 KiB |
After Width: | Height: | Size: 23 KiB |
After Width: | Height: | Size: 7.0 KiB |
After Width: | Height: | Size: 878 B |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 653 B |
After Width: | Height: | Size: 800 B |
After Width: | Height: | Size: 905 B |
After Width: | Height: | Size: 189 KiB |
After Width: | Height: | Size: 4.3 KiB |
After Width: | Height: | Size: 839 B |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 5.9 KiB |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 34 KiB |
After Width: | Height: | Size: 26 KiB |
After Width: | Height: | Size: 3.8 KiB |
After Width: | Height: | Size: 23 KiB |
After Width: | Height: | Size: 1.9 KiB |
After Width: | Height: | Size: 2.3 KiB |
After Width: | Height: | Size: 427 B |
After Width: | Height: | Size: 627 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 988 B |
After Width: | Height: | Size: 3.7 KiB |
After Width: | Height: | Size: 5.0 KiB |
After Width: | Height: | Size: 875 B |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 912 KiB |
After Width: | Height: | Size: 1.3 MiB |
After Width: | Height: | Size: 46 KiB |
After Width: | Height: | Size: 44 KiB |
After Width: | Height: | Size: 46 KiB |
After Width: | Height: | Size: 85 KiB |
After Width: | Height: | Size: 150 KiB |
After Width: | Height: | Size: 88 KiB |
After Width: | Height: | Size: 150 KiB |
After Width: | Height: | Size: 109 KiB |
After Width: | Height: | Size: 68 KiB |
After Width: | Height: | Size: 80 KiB |
After Width: | Height: | Size: 880 KiB |
After Width: | Height: | Size: 86 KiB |
After Width: | Height: | Size: 11 KiB |
@ -0,0 +1,51 @@ |
|||||
|
/** @odoo-module */ |
||||
|
import { useService } from "@web/core/utils/hooks"; |
||||
|
const { Component, onWillStart } = owl; |
||||
|
|
||||
|
/** |
||||
|
* Sale Dashboard component for managing sales data and filters. |
||||
|
* @extends Component |
||||
|
*/ |
||||
|
export class SaleDashBoard extends Component { |
||||
|
/** |
||||
|
* Setup method for initializing the component. |
||||
|
*/ |
||||
|
setup() { |
||||
|
// Get references to Odoo services
|
||||
|
this.orm = useService("orm"); |
||||
|
this.action = useService("action"); |
||||
|
|
||||
|
// Fetch sales data when the component is about to start
|
||||
|
onWillStart(async () => { |
||||
|
this.saleData = await this.orm.call( |
||||
|
"sale.order", |
||||
|
"get_dashboard_values" |
||||
|
); |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* This method clears the current search query and activates |
||||
|
* the filters found in the `filter_name` attribute from the pressed button. |
||||
|
* @param {Event} ev - The event object from the button press. |
||||
|
*/ |
||||
|
setSearchContext(ev) { |
||||
|
// Extract filter names from the button attribute
|
||||
|
let filter_name = ev.currentTarget.getAttribute("filter_name"); |
||||
|
let filters = filter_name.split(','); |
||||
|
|
||||
|
// Get search items based on the specified filter names
|
||||
|
let searchItems = this.env.searchModel.getSearchItems((item) => filters.includes(item.name)); |
||||
|
|
||||
|
// Clear the current search query
|
||||
|
this.env.searchModel.query = []; |
||||
|
|
||||
|
// Activate filters in the search model
|
||||
|
for (const item of searchItems) { |
||||
|
this.env.searchModel.toggleSearchItem(item.id); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
// Template for the SaleDashBoard component
|
||||
|
SaleDashBoard.template = 'sale_mini_dashboard.SaleDashboard'; |
@ -0,0 +1,30 @@ |
|||||
|
/** @odoo-module **/ |
||||
|
import { registry } from "@web/core/registry"; |
||||
|
import { kanbanView } from '@web/views/kanban/kanban_view'; |
||||
|
import { KanbanRenderer } from '@web/views/kanban/kanban_renderer'; |
||||
|
import { SaleDashBoard } from '@sale_mini_dashboard/js/sale_dashboard'; |
||||
|
|
||||
|
/** |
||||
|
* Sale Dashboard Kanban Renderer class, extending the base KanbanRenderer. |
||||
|
* @extends KanbanRenderer |
||||
|
*/ |
||||
|
export class SaleDashBoardKanbanRenderer extends KanbanRenderer {}; |
||||
|
|
||||
|
// Template for the SaleDashBoardKanbanRenderer component
|
||||
|
SaleDashBoardKanbanRenderer.template = 'sale_mini_dashboard.SaleKanbanView'; |
||||
|
|
||||
|
// Components used by SaleDashBoardKanbanRenderer
|
||||
|
SaleDashBoardKanbanRenderer.components = Object.assign({}, KanbanRenderer.components, { SaleDashBoard }); |
||||
|
|
||||
|
/** |
||||
|
* Sale Dashboard Kanban View configuration. |
||||
|
* @type {Object} |
||||
|
*/ |
||||
|
export const SaleDashBoardKanbanView = { |
||||
|
...kanbanView, |
||||
|
// Use the custom SaleDashBoardKanbanRenderer as the renderer for the kanban view
|
||||
|
Renderer: SaleDashBoardKanbanRenderer, |
||||
|
}; |
||||
|
|
||||
|
// Register the Sale Dashboard Kanban View in the "views" category of the registry
|
||||
|
registry.category("views").add("sale_dashboard_kanban", SaleDashBoardKanbanView); |
@ -0,0 +1,30 @@ |
|||||
|
/** @odoo-module **/ |
||||
|
import { registry } from "@web/core/registry"; |
||||
|
import { listView } from "@web/views/list/list_view"; |
||||
|
import { ListRenderer } from "@web/views/list/list_renderer"; |
||||
|
import { SaleDashBoard } from '@sale_mini_dashboard/js/sale_dashboard'; |
||||
|
|
||||
|
/** |
||||
|
* Sale Dashboard Renderer class for list view, extending the base ListRenderer. |
||||
|
* @extends ListRenderer |
||||
|
*/ |
||||
|
export class SaleDashBoardRenderer extends ListRenderer {}; |
||||
|
|
||||
|
// Template for the SaleDashBoardRenderer component
|
||||
|
SaleDashBoardRenderer.template = 'sale_mini_dashboard.SaleListView'; |
||||
|
|
||||
|
// Components used by SaleDashBoardRenderer
|
||||
|
SaleDashBoardRenderer.components = Object.assign({}, ListRenderer.components, { SaleDashBoard }); |
||||
|
|
||||
|
/** |
||||
|
* Sale Dashboard List View configuration. |
||||
|
* @type {Object} |
||||
|
*/ |
||||
|
export const SaleDashBoardListView = { |
||||
|
...listView, |
||||
|
// Use the custom SaleDashBoardRenderer as the renderer for the list view
|
||||
|
Renderer: SaleDashBoardRenderer, |
||||
|
}; |
||||
|
|
||||
|
// Register the Sale Dashboard List View in the "views" category of the registry
|
||||
|
registry.category("views").add("sale_dashboard_list", SaleDashBoardListView); |
@ -0,0 +1,124 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8" ?> |
||||
|
<!--Template of dashboard--> |
||||
|
<templates> |
||||
|
<t t-name="sale_mini_dashboard.SaleDashboard" owl="1"> |
||||
|
<div class="o_sale_dashboard container-fluid py-4 border-bottom bg-white"> |
||||
|
<div class="row justify-content-between gap-3 gap-lg-0"> |
||||
|
<div class="col-12 col-lg-5 col-xl-5 col-xxl-4 flex-grow-1 flex-lg-grow-0 flex-shrink-0"> |
||||
|
<div class="grid gap-4"> |
||||
|
<div class="g-col-3 g-col-sm-2 d-flex align-items-center py-2 justify-content-end text-end justify-content-lg-start text-lg-start"> |
||||
|
All Orders |
||||
|
</div> |
||||
|
<div class="g-col-9 g-col-sm-10 grid gap-1" |
||||
|
style="display: flex; max-width:510px;"> |
||||
|
<div class="g-col-4 p-0" |
||||
|
t-on-click="setSearchContext" |
||||
|
title="All Draft Quotations" |
||||
|
filter_name="total" style="width: 180px;"> |
||||
|
<a href="#" |
||||
|
class="btn btn-primary w-100 h-100 border-0 rounded-0 text-capitalize fw-normal"> |
||||
|
<div class="fs-2" |
||||
|
t-out="saleData['total_orders']"/> |
||||
|
Total |
||||
|
</a> |
||||
|
</div> |
||||
|
<div class="g-col-4 p-0" |
||||
|
t-on-click="setSearchContext" |
||||
|
title="All Waiting RFQs" |
||||
|
filter_name="draft" |
||||
|
style="width: 180px;"> |
||||
|
<a href="#" |
||||
|
class="btn btn-primary w-100 h-100 border-0 rounded-0 text-capitalize fw-normal"> |
||||
|
<div class="fs-2" |
||||
|
t-out="saleData['draft_orders']"/> |
||||
|
Quotations |
||||
|
</a> |
||||
|
</div> |
||||
|
<div class="g-col-4 p-0" |
||||
|
t-on-click="setSearchContext" |
||||
|
title="Sales Orders" filter_name="sales" |
||||
|
style="width: 180px;"> |
||||
|
<a href="#" |
||||
|
class="btn btn-primary w-100 h-100 border-0 rounded-0 text-capitalize fw-normal"> |
||||
|
<div class="fs-2" |
||||
|
t-out="saleData['sale_orders']"/> |
||||
|
Orders |
||||
|
</a> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="grid gap-4"> |
||||
|
<div class="g-col-3 g-col-sm-2 d-flex align-items-center py-2 justify-content-end text-end justify-content-lg-start text-lg-start"> |
||||
|
My Orders |
||||
|
</div> |
||||
|
<div class="g-col-9 g-col-sm-10 grid gap-2 mt-2" |
||||
|
style="display: flex; max-width:510px;"> |
||||
|
<div class="g-col-4 p-0" |
||||
|
t-on-click="setSearchContext" |
||||
|
title="My Total Orders" |
||||
|
filter_name="my_quotation" |
||||
|
style="height: 57.75px; width: 166px; font-size: 24px;"> |
||||
|
<a href="#" |
||||
|
class="btn btn-light d-flex align-items-center w-100 h-100 p-0 border-0 bg-100 fw-normal"> |
||||
|
<div class="w-100 p-2" |
||||
|
style="font-size: 1.625rem !important;" |
||||
|
t-out="saleData['my_orders']"/> |
||||
|
</a> |
||||
|
</div> |
||||
|
<div class="g-col-4 p-0" |
||||
|
t-on-click="setSearchContext" |
||||
|
title="My Draft Quotation" |
||||
|
filter_name="my_draft" |
||||
|
style="height: 57.75px; width: 166px; font-size: 24px;"> |
||||
|
<a href="#" |
||||
|
class="btn btn-light d-flex align-items-center w-100 h-100 p-0 border-0 bg-100 fw-normal"> |
||||
|
<div class="w-100 p-2" |
||||
|
style="font-size: 1.625rem !important;" |
||||
|
t-out="saleData['my_draft_orders']"/> |
||||
|
</a> |
||||
|
</div> |
||||
|
<div class="g-col-4 p-0" t-on-click="setSearchContext" title="My Sale Orders" |
||||
|
filter_name="my_sale_orders" style="height: 57.75px; width: 166px; font-size: 24px;"> |
||||
|
<a href="#" |
||||
|
class="btn btn-light d-flex align-items-center w-100 h-100 p-0 border-0 bg-100 fw-normal"> |
||||
|
<div class="w-100 p-2" style="font-size: 1.625rem !important;" |
||||
|
t-out="saleData['my_sale_orders']"/> |
||||
|
</a> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="col-12 col-lg-7 col-xl-6 col-xxl-5 flex-shrink-0"> |
||||
|
<div class="d-flex flex-column justify-content-between gap-2 h-100"> |
||||
|
<div class="grid gap-2 h-100"> |
||||
|
<div class="g-col-6 g-col-md-6 grid gap-1 gap-md-4"> |
||||
|
<div class="g-col-12 g-col-sm-4 g-col-lg-6 d-flex align-items-center justify-content-center text-center justify-content-md-end text-md-end mt-4 mt-md-0"> |
||||
|
Total of Sale Orders |
||||
|
</div> |
||||
|
<div class="g-col-12 g-col-sm-8 g-col-lg-5 d-flex align-items-center justify-content-center py-2 bg-light"> |
||||
|
<strong> |
||||
|
<span> |
||||
|
<t t-out="saleData['total_sale_amount']"/> |
||||
|
</span> |
||||
|
</strong> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="g-col-6 g-col-md-6 grid gap-1 gap-md-4"> |
||||
|
<div class="g-col-12 g-col-sm-4 g-col-lg-6 d-flex align-items-center py-2 justify-content-center text-center justify-content-md-end text-md-end mt-4 mt-md-0"> |
||||
|
Total of Quotations |
||||
|
</div> |
||||
|
<div class="g-col-12 g-col-sm-8 g-col-lg-6 d-flex align-items-center justify-content-center py-2 bg-light"> |
||||
|
<strong> |
||||
|
<span> |
||||
|
<t t-out="saleData['total_draft_amount']"/> |
||||
|
</span> |
||||
|
</strong> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</t> |
||||
|
</templates> |
@ -0,0 +1,11 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8" ?> |
||||
|
<!--Displaying dashboard in kanban view--> |
||||
|
<templates> |
||||
|
<t t-name="sale_mini_dashboard.SaleKanbanView" |
||||
|
t-inherit="web.KanbanRenderer" t-inherit-mode="primary" owl="1"> |
||||
|
<xpath expr="//div[hasclass('o_kanban_renderer')]" |
||||
|
position="before"> |
||||
|
<SaleDashBoard/> |
||||
|
</xpath> |
||||
|
</t> |
||||
|
</templates> |
@ -0,0 +1,10 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8" ?> |
||||
|
<!--Displaying dashboard in list view--> |
||||
|
<templates> |
||||
|
<t t-name="sale_mini_dashboard.SaleListView" |
||||
|
t-inherit="web.ListRenderer" t-inherit-mode="primary" owl="1"> |
||||
|
<xpath expr="//t[@t-call='web.ActionHelper']" position="replace"> |
||||
|
<SaleDashBoard/> |
||||
|
</xpath> |
||||
|
</t> |
||||
|
</templates> |
@ -0,0 +1,49 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8" ?> |
||||
|
<odoo> |
||||
|
<!--Adding the dashboard in list view--> |
||||
|
<record id="view_quotation_tree_with_onboarding" model="ir.ui.view"> |
||||
|
<field name="name">sale.order.view.tree.inherit.sale.mini.dashboard</field> |
||||
|
<field name="model">sale.order</field> |
||||
|
<field name="inherit_id" |
||||
|
ref="sale.view_quotation_tree_with_onboarding"/> |
||||
|
<field name="arch" type="xml"> |
||||
|
<xpath expr="//list" position="attributes"> |
||||
|
<attribute name="js_class">sale_dashboard_list</attribute> |
||||
|
</xpath> |
||||
|
</field> |
||||
|
</record> |
||||
|
<!--Adding the dashboard in kanban view--> |
||||
|
<record id="view_sale_order_kanban" model="ir.ui.view"> |
||||
|
<field name="name">sale.order.view.kanban.inherit.sale.mini.dashboard</field> |
||||
|
<field name="model">sale.order</field> |
||||
|
<field name="inherit_id" ref="sale.view_sale_order_kanban"/> |
||||
|
<field name="arch" type="xml"> |
||||
|
<xpath expr="//kanban" position="attributes"> |
||||
|
<attribute name="js_class">sale_dashboard_kanban</attribute> |
||||
|
</xpath> |
||||
|
</field> |
||||
|
</record> |
||||
|
<!--Adding additional filters used in mini dashboard--> |
||||
|
<record id="sale_order_view_search_inherit_quotation" model="ir.ui.view"> |
||||
|
<field name="name">sale.order.view.search.inherit.sale.mini.dashboard</field> |
||||
|
<field name="model">sale.order</field> |
||||
|
<field name="inherit_id" |
||||
|
ref="sale.sale_order_view_search_inherit_quotation"/> |
||||
|
<field name="arch" type="xml"> |
||||
|
<filter name="my_quotation" position="replace"> |
||||
|
<filter string="My Total Orders" name="my_quotation" |
||||
|
domain="[('user_id', '=', uid)]"/> |
||||
|
<filter string="My Quotations" name="my_draft" |
||||
|
domain="[('user_id', '=', uid),('state', 'in', ['draft','sent'])]"/> |
||||
|
<filter string="My Orders" name="my_sale_orders" |
||||
|
domain="[('user_id', '=', uid),('state','in',('sale','done'))]"/> |
||||
|
<separator/> |
||||
|
</filter> |
||||
|
<filter name="sales" position="after"> |
||||
|
<filter string="Total Orders" name="total" |
||||
|
domain="[]"/> |
||||
|
<separator/> |
||||
|
</filter> |
||||
|
</field> |
||||
|
</record> |
||||
|
</odoo> |