17 changed files with 347 additions and 539 deletions
@ -0,0 +1,52 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################# |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2022-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 fields, models |
|||
|
|||
|
|||
class ResConfigSettings(models.TransientModel): |
|||
_inherit = "res.config.settings" |
|||
out_of_stock = fields.Boolean(string="Out of stock", |
|||
config_parameter='inventory_stock_dashboard_odoo.out_of_stock', |
|||
help="Enable if out of stock") |
|||
out_of_stock_quantity = fields.Integer(string="Quantity", |
|||
config_parameter='inventory_stock_dashboard_odoo.out_of_stock_quantity', |
|||
required=True, |
|||
help="Set the minimum quantity for " |
|||
"considering a product as out " |
|||
"of stock.") |
|||
dead_stock_bol = fields.Boolean(string="Enable dead stock", |
|||
config_parameter='inventory_stock_dashboard_odoo.dead_stock_bol', |
|||
help="Enable if you want to consider dead " |
|||
"stock.") |
|||
dead_stock = fields.Integer(string="Dead stock", |
|||
config_parameter='inventory_stock_dashboard_odoo.dead_stock', |
|||
required=True, |
|||
help="Set the threshold quantity for " |
|||
"considering a product as dead stock.") |
|||
dead_stock_type = fields.Selection( |
|||
[('day', 'Day'), ('week', 'Week'), ('month', 'Month')], |
|||
string="Type", default='day', |
|||
config_parameter='inventory_stock_dashboard_odoo.dead_stock_type', |
|||
required=True, |
|||
help="Select the time period to determine dead stock based on product " |
|||
"sales.") |
@ -1,37 +0,0 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################# |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2022-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 fields, models |
|||
|
|||
|
|||
class ResConfiqSettingInherit(models.TransientModel): |
|||
_inherit = "res.config.settings" |
|||
out_of_stock = fields.Boolean(config_parameter='inventory_stock_dashboard_odoo.out_of_stock') |
|||
out_of_stock_quantity = fields.Integer(string="Quantity", |
|||
config_parameter='inventory_stock_dashboard_odoo.out_of_stock_quantity', |
|||
required=True) |
|||
dead_stock_bol = fields.Boolean(string="Dead Stock", |
|||
config_parameter='inventory_stock_dashboard_odoo.dead_stock_bol') |
|||
dead_stock = fields.Integer(config_parameter='inventory_stock_dashboard_odoo.dead_stock', required=True) |
|||
dead_stock_type = fields.Selection([('day', 'Day'), ('week', 'Week'), ('month', 'Month')], |
|||
string="Type", default='day', |
|||
config_parameter='inventory_stock_dashboard_odoo.dead_stock_type', required=True) |
@ -1,175 +1,191 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
|
|||
<templates id="template" xml:space="preserve"> |
|||
|
|||
<t t-name="Dashboard"> |
|||
<div class="oh_dashboards"> |
|||
<div class="container-fluid my-5 o_hr_dashboard"/> |
|||
<h1> |
|||
</h1> |
|||
</div> |
|||
</t> |
|||
|
|||
<t t-name="InventoryTiles"> |
|||
<div class="container-fluid py-5"> |
|||
<div class="row" id="set"> |
|||
</div> |
|||
</div> |
|||
<div class="accounts-dashboard-wrap"> |
|||
<div class="row main-section" id="new"> |
|||
</div> |
|||
</div> |
|||
</t> |
|||
|
|||
<t t-name="ProductSaleBarGraph"> |
|||
<div class="row mt-5 px-4" id="graphs"> |
|||
<div class="year_to_date_graph_div col-sm-12 col-md-6 my-4"> |
|||
<div class="chart-container card-shadow" id="tiles"> |
|||
<div style="height: 20px; max-height: 20px;"> |
|||
<h2>Top Moving Products</h2> |
|||
<div class="form-group col-2" id="top_product_button"> |
|||
<select id="top_product_selection" class="btn btn-primary"> |
|||
<option id="top_last_10_days" value="top_last_10_days" selected="selected">Last 10 Days</option> |
|||
<option id="top_last_30_days" value="top_last_30_days">Last 30 Days</option> |
|||
<option id="top_last_3_month" value="top_last_3_month">Last 3 Month</option> |
|||
<option id="top_last_year" value="top_last_year">Last Year</option> |
|||
</select> |
|||
</div> |
|||
<button class="btn_info" id="top_product_info" title="Show Details"> |
|||
<i class="fa fa-ellipsis-v"></i> |
|||
</button> |
|||
<table class="graph_details_table" id="pro_info"> |
|||
<tr> |
|||
<th>Products</th> |
|||
<th>Quantity Transfered</th> |
|||
</tr> |
|||
</table> |
|||
</div> |
|||
<hr/> |
|||
<div class="graph_canvas" style="margin-top: 30px;"> |
|||
<canvas id="canvaspie" height="500px" width="150px"/> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
|
|||
<div class="year_to_date_graph_div col-sm-12 col-md-6 my-4"> |
|||
<div class="chart-container card-shadow" id="tiles"> |
|||
<div style="height: 20px; max-height: 20px;"> |
|||
<h2>Product Categories</h2> |
|||
<button class="btn_info" id="pro_cate_info" title="Show Details"> |
|||
<i class="fa fa-ellipsis-v"></i> |
|||
</button> |
|||
|
|||
<table class="graph_details_table" id="category_table"> |
|||
<tr> |
|||
<th>Categories</th> |
|||
<th>Onhand Quantity</th> |
|||
</tr> |
|||
</table> |
|||
</div> |
|||
<hr/> |
|||
<div class="graph_canvas" style="margin-top: 30px;"> |
|||
<canvas id="product_category" height="500px" width="150px"/> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
|
|||
<div class="year_to_date_graph_div col-sm-12 col-md-6 my-4"> |
|||
<div class="chart-container card-shadow" id="tiles"> |
|||
<div style="height: 20px; max-height: 20px;" |
|||
<t t-name="Dashboard"> |
|||
<div class="oh_dashboards"> |
|||
<div class="container-fluid my-5 o_hr_dashboard"/> |
|||
<h1></h1> |
|||
</div> |
|||
</t> |
|||
<t t-name="InventoryTiles"> |
|||
<div class="container-fluid py-5"> |
|||
<div class="row" id="set"></div> |
|||
</div> |
|||
<div class="accounts-dashboard-wrap"> |
|||
<div class="row main-section" id="new"></div> |
|||
</div> |
|||
</t> |
|||
<t t-name="ProductSaleBarGraph"> |
|||
<div class="row mt-5 px-4" id="graphs"> |
|||
<div class="year_to_date_graph_div col-sm-12 col-md-6 my-4"> |
|||
<div class="chart-container card-shadow" id="tiles"> |
|||
<div style="height: 20px; max-height: 20px;"> |
|||
<h2>Top Moving Products</h2> |
|||
<div class="form-group col-2" |
|||
id="top_product_button"> |
|||
<select id="top_product_selection" |
|||
class="btn btn-primary"> |
|||
<option id="top_last_10_days" |
|||
value="top_last_10_days" |
|||
selected="selected">Last 10 Days</option> |
|||
<option id="top_last_30_days" |
|||
value="top_last_30_days">Last 30 Days</option> |
|||
<option id="top_last_3_month" |
|||
value="top_last_3_month">Last 3 Month</option> |
|||
<option id="top_last_year" |
|||
value="top_last_year">Last Year</option> |
|||
</select> |
|||
</div> |
|||
<button class="btn_info" id="top_product_info" |
|||
title="Show Details"> |
|||
<i class="fa fa-ellipsis-v"></i> |
|||
</button> |
|||
<table class="graph_details_table" id="pro_info"> |
|||
<tr> |
|||
<th>Products</th> |
|||
<th>Quantity Transfered</th> |
|||
</tr> |
|||
</table> |
|||
</div> |
|||
<hr/> |
|||
<div class="graph_canvas" style="margin-top: 30px;"> |
|||
<canvas id="canvaspie" height="500px" |
|||
width="150px"/> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="year_to_date_graph_div col-sm-12 col-md-6 my-4"> |
|||
<div class="chart-container card-shadow" id="tiles"> |
|||
<div style="height: 20px; max-height: 20px;"> |
|||
<h2>Product Categories</h2> |
|||
<button class="btn_info" id="pro_cate_info" |
|||
title="Show Details"> |
|||
<i class="fa fa-ellipsis-v"></i> |
|||
</button> |
|||
<table class="graph_details_table" id="category_table"> |
|||
<tr> |
|||
<th>Categories</th> |
|||
<th>Onhand Quantity</th> |
|||
</tr> |
|||
</table> |
|||
</div> |
|||
<hr/> |
|||
<div class="graph_canvas" style="margin-top: 30px;"> |
|||
<canvas id="product_category" height="500px" |
|||
width="150px"/> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="year_to_date_graph_div col-sm-12 col-md-6 my-4"> |
|||
<div class="chart-container card-shadow" id="tiles"> |
|||
<div style="height: 20px; max-height: 20px;" |
|||
class="d-flex justify-content-between align-items-center"> |
|||
<h2>Product Moves By Category</h2> |
|||
<div class="form-group col-2" id="product_move_select"> |
|||
<select id="product_move_selection" class="btn btn-primary"> |
|||
</select> |
|||
</div> |
|||
<button class="btn_info" id="product_move_info" title="Show Details"> |
|||
<i class="fa fa-ellipsis-v"></i> |
|||
</button> |
|||
<table class="graph_details_table" id="product_move_table"> |
|||
<tr> |
|||
<th>Products</th> |
|||
<th>Quantity Done</th> |
|||
</tr> |
|||
</table> |
|||
</div> |
|||
<hr/> |
|||
<div class="graph_canvas" style="margin-top: 30px;"> |
|||
<canvas id="product_move_graph" height="500px" width="150px"/> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
|
|||
<div class="year_to_date_graph_div col-sm-12 col-md-6 my-4"> |
|||
<div class="chart-container card-shadow" id="tiles"> |
|||
<div style="height: 20px; max-height: 20px;" |
|||
<h2>Product Moves By Category</h2> |
|||
<div class="form-group col-2" |
|||
id="product_move_select"> |
|||
<select id="product_move_selection" |
|||
class="btn btn-primary"></select> |
|||
</div> |
|||
<button class="btn_info" id="product_move_info" |
|||
title="Show Details"> |
|||
<i class="fa fa-ellipsis-v"></i> |
|||
</button> |
|||
<table class="graph_details_table" |
|||
id="product_move_table"> |
|||
<tr> |
|||
<th>Products</th> |
|||
<th>Quantity Done</th> |
|||
</tr> |
|||
</table> |
|||
</div> |
|||
<hr/> |
|||
<div class="graph_canvas" style="margin-top: 30px;"> |
|||
<canvas id="product_move_graph" height="500px" |
|||
width="150px"/> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="year_to_date_graph_div col-sm-12 col-md-6 my-4"> |
|||
<div class="chart-container card-shadow" id="tiles"> |
|||
<div style="height: 20px; max-height: 20px;" |
|||
class="d-flex justify-content-between align-items-center"> |
|||
<h2>Stock Moves By Location</h2> |
|||
|
|||
<div class="form-group col-2" id="stock_move_select"> |
|||
<select id="stock_moves_selection" class="btn btn-primary"> |
|||
<option id="last_10_days" value="last_10_days" selected="selected">Last 10 Days</option> |
|||
<option id="this_month" value="this_month">Last months</option> |
|||
<option id="last_3_month" value="last_3_month">Last 3 months</option> |
|||
<option id="last_year" value="last_year">Last Year</option> |
|||
</select> |
|||
</div> |
|||
<button class="btn_info" id="stock_move_info" title="Show Details"> |
|||
<i class="fa fa-ellipsis-v"></i> |
|||
</button> |
|||
<table class="graph_details_table" id="stock_move_table"> |
|||
<tr> |
|||
<th>Location</th> |
|||
<th>Stock Moves Count</th> |
|||
</tr> |
|||
</table> |
|||
</div> |
|||
<hr/> |
|||
<div class="graph_canvas" style="margin-top: 30px;"> |
|||
<canvas id="stock_moves" height="500px" width="150px"/> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
|
|||
<div class="year_to_date_graph_div col-sm-12 col-md-6 my-4"> |
|||
<div class="chart-container card-shadow" id="tiles"> |
|||
<div style="height: 20px; max-height: 20px;"> |
|||
<h2>Operation Types</h2> |
|||
<button class="btn_info" id="operation_type_info" title="Show Details"> |
|||
<i class="fa fa-ellipsis-v"></i> |
|||
</button> |
|||
|
|||
<table class="graph_details_table" id="operation_type_table"> |
|||
<tr> |
|||
<th>Operation Types</th> |
|||
<th>Transfer Count</th> |
|||
</tr> |
|||
</table> |
|||
</div> |
|||
<hr/> |
|||
<div class="graph_canvas" style="margin-top: 30px;"> |
|||
<canvas id="operation" height="500px" width="150px"/> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
|
|||
<div class="year_to_date_graph_div col-sm-12 col-md-6 my-4"> |
|||
<div class="chart-container card-shadow" id="tiles"> |
|||
<div style="height: 20px; max-height: 20px"> |
|||
<h2>Locations</h2> |
|||
</div> |
|||
<hr/> |
|||
<table style="margin-top: 30px;" class="table table-hover" id="location_table"> |
|||
<thead><tr><th> |
|||
<h2>Location</h2> |
|||
</th> |
|||
<th> |
|||
<h2 style="text-align: center;">On Hand Quantity</h2> |
|||
</th></tr></thead> |
|||
<tbody class="storage"></tbody> |
|||
</table> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</t> |
|||
<h2>Stock Moves By Location</h2> |
|||
<div class="form-group col-2" |
|||
id="stock_move_select"> |
|||
<select id="stock_moves_selection" |
|||
class="btn btn-primary"> |
|||
<option id="last_10_days" |
|||
value="last_10_days" |
|||
selected="selected">Last 10 Days</option> |
|||
<option id="this_month" value="this_month">Last months</option> |
|||
<option id="last_3_month" |
|||
value="last_3_month">Last 3 months</option> |
|||
<option id="last_year" value="last_year">Last Year</option> |
|||
</select> |
|||
</div> |
|||
<button class="btn_info" id="stock_move_info" |
|||
title="Show Details"> |
|||
<i class="fa fa-ellipsis-v"></i> |
|||
</button> |
|||
<table class="graph_details_table" |
|||
id="stock_move_table"> |
|||
<tr> |
|||
<th>Location</th> |
|||
<th>Stock Moves Count</th> |
|||
</tr> |
|||
</table> |
|||
</div> |
|||
<hr/> |
|||
<div class="graph_canvas" style="margin-top: 30px;"> |
|||
<canvas id="stock_moves" height="500px" |
|||
width="150px"/> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="year_to_date_graph_div col-sm-12 col-md-6 my-4"> |
|||
<div class="chart-container card-shadow" id="tiles"> |
|||
<div style="height: 20px; max-height: 20px;"> |
|||
<h2>Operation Types</h2> |
|||
<button class="btn_info" id="operation_type_info" |
|||
title="Show Details"> |
|||
<i class="fa fa-ellipsis-v"></i> |
|||
</button> |
|||
<table class="graph_details_table" |
|||
id="operation_type_table"> |
|||
<tr> |
|||
<th>Operation Types</th> |
|||
<th>Transfer Count</th> |
|||
</tr> |
|||
</table> |
|||
</div> |
|||
<hr/> |
|||
<div class="graph_canvas" style="margin-top: 30px;"> |
|||
<canvas id="operation" height="500px" width="150px"/> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="year_to_date_graph_div col-sm-12 col-md-6 my-4"> |
|||
<div class="chart-container card-shadow" id="tiles"> |
|||
<div style="height: 20px; max-height: 20px"> |
|||
<h2>Locations</h2> |
|||
</div> |
|||
<hr/> |
|||
<table style="margin-top: 30px;" class="table table-hover" |
|||
id="location_table"> |
|||
<thead> |
|||
<tr> |
|||
<th> |
|||
<h2>Location</h2> |
|||
</th> |
|||
<th> |
|||
<h2 style="text-align: center;">On Hand Quantity</h2> |
|||
</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody class="storage"></tbody> |
|||
</table> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</t> |
|||
</templates> |
|||
|
|||
|
@ -1,11 +1,10 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<odoo> |
|||
<record id="dashboard_action" model="ir.actions.client"> |
|||
<field name="name">Dashboard</field> |
|||
<field name="tag">inventory_dashboard_tag</field> |
|||
</record> |
|||
<menuitem id="dashboard" |
|||
name="Dashboard" |
|||
<field name="name">Dashboard</field> |
|||
<field name="tag">inventory_dashboard_tag</field> |
|||
</record> |
|||
<menuitem id="dashboard_menu_root" name="Dashboard" |
|||
parent="stock.menu_stock_root" |
|||
action="dashboard_action" |
|||
groups="stock.group_stock_user" |
@ -1,54 +0,0 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<odoo> |
|||
<data> |
|||
<record id="res_config_settings_view_form" model="ir.ui.view"> |
|||
<field name="name">res.config.settings.view.form.inherit</field> |
|||
<field name="model">res.config.settings</field> |
|||
<field name="priority" eval="99"/> |
|||
<field name="inherit_id" ref="stock.res_config_settings_view_form"/> |
|||
<field name="arch" type="xml"> |
|||
<div id="production_lot_info" position="after"> |
|||
<div class="app_settings_block"> |
|||
<h2>Dashboard</h2> |
|||
|
|||
<div class="row mt16 o_settings_container"> |
|||
<div class="col-12 col-lg-6 o_setting_box"> |
|||
<div class="o_setting_left_pane"> |
|||
<field name="out_of_stock"/> |
|||
</div> |
|||
<div class="o_setting_right_pane"> |
|||
<label for="out_of_stock"/> |
|||
<div class="text-muted"> |
|||
Set Your Out Of Stock Quantity |
|||
</div> |
|||
<field name="out_of_stock_quantity" |
|||
attrs="{'invisible': [('out_of_stock', '=', False)]}"/> |
|||
</div> |
|||
</div> |
|||
<div class="col-12 col-lg-6 o_setting_box"> |
|||
<div class="o_setting_left_pane"> |
|||
<field name="dead_stock_bol"/> |
|||
</div> |
|||
<div class="o_setting_right_pane"> |
|||
<label for="dead_stock_bol"/> |
|||
<div class="text-muted"> |
|||
Show Dead Stocks In Dashboard |
|||
</div> |
|||
<div> |
|||
<field name="dead_stock" |
|||
attrs="{'invisible': [('dead_stock_bol', '=', False)]}"/> |
|||
</div> |
|||
<div> |
|||
<field name="dead_stock_type" |
|||
attrs="{'invisible': [('dead_stock_bol', '=', False)]}"/> |
|||
<span attrs="{'invisible': [('dead_stock_bol', '=', False)]}">  Duration</span> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</field> |
|||
</record> |
|||
</data> |
|||
</odoo> |
@ -0,0 +1,53 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<odoo> |
|||
<record id="res_config_settings_view_form" model="ir.ui.view"> |
|||
<field name="name">res.config.settings.view.form.inherit.inventory.dashboard</field> |
|||
<field name="model">res.config.settings</field> |
|||
<field name="priority" eval="99"/> |
|||
<field name="inherit_id" ref="stock.res_config_settings_view_form"/> |
|||
<field name="arch" type="xml"> |
|||
<div id="production_lot_info" position="after"> |
|||
<div class="app_settings_block"> |
|||
<h2>Dashboard</h2> |
|||
<div class="row mt16 o_settings_container"> |
|||
<div class="col-12 col-lg-6 o_setting_box"> |
|||
<div class="o_setting_left_pane"> |
|||
<field name="out_of_stock"/> |
|||
</div> |
|||
<div class="o_setting_right_pane"> |
|||
<label for="out_of_stock"/> |
|||
<div class="text-muted"> |
|||
Set Your Out Of Stock Quantity |
|||
</div> |
|||
<field name="out_of_stock_quantity" |
|||
attrs="{'invisible': [('out_of_stock', '=', False)]}"/> |
|||
</div> |
|||
</div> |
|||
<div class="col-12 col-lg-6 o_setting_box"> |
|||
<div class="o_setting_left_pane"> |
|||
<field name="dead_stock_bol"/> |
|||
</div> |
|||
<div class="o_setting_right_pane"> |
|||
<label for="dead_stock_bol"/> |
|||
<div class="text-muted"> |
|||
Show Dead Stocks In Dashboard |
|||
</div> |
|||
<div> |
|||
<field name="dead_stock" |
|||
attrs="{'invisible': [('dead_stock_bol', '=', False)]}"/> |
|||
</div> |
|||
<div> |
|||
<field name="dead_stock_type" |
|||
attrs="{'invisible': [('dead_stock_bol', '=', False)]}"/> |
|||
<span attrs="{'invisible': [('dead_stock_bol', '=', False)]}"> |
|||
  Duration |
|||
</span> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</field> |
|||
</record> |
|||
</odoo> |
Loading…
Reference in new issue