diff --git a/legal_case_management_dashboard/README.rst b/legal_case_management_dashboard/README.rst new file mode 100644 index 000000000..ac2fb26c5 --- /dev/null +++ b/legal_case_management_dashboard/README.rst @@ -0,0 +1,46 @@ +.. image:: https://img.shields.io/badge/licence-LGPL--3-green.svg + :target: https://www.gnu.org/licenses/lgpl-3.0-standalone.html + :alt: License: LGPL-3 + +Legal Case Management Dashboard +=============================== +This module helps to View Overview of the Legal Case Management firm. + +Configuration +------------- + - www.odoo.com/documentation/16.0/setup/install.html + - Install our custom addon with legal_case_management module. +Company +------- +* `Cybrosys Techno Solutions `__ + +License +------- +General Public License, Version 3 (LGPL v3). +(https://www.gnu.org/licenses/lgpl-3.0-standalone.html) + +Credits +------- +Developer: (V16) Mohammed Dilshad Tk, 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 `__ + +Further information +=================== +HTML Description: ``__ diff --git a/legal_case_management_dashboard/__init__.py b/legal_case_management_dashboard/__init__.py new file mode 100644 index 000000000..0fc14788e --- /dev/null +++ b/legal_case_management_dashboard/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Mohammed Dilshad Tk (odoo@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 . +# +############################################################################### +from . import controllers diff --git a/legal_case_management_dashboard/__manifest__.py b/legal_case_management_dashboard/__manifest__.py new file mode 100644 index 000000000..c5910daae --- /dev/null +++ b/legal_case_management_dashboard/__manifest__.py @@ -0,0 +1,54 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Mohammed Dilshad Tk (odoo@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 . +# +############################################################################### +{ + 'name': "Legal Case Management Dashboard", + 'version': '16.0.1.0.0', + 'category': 'Industries', + 'summary': """Legal Case Management Dashboard to get an overview of + legal case management module.""", + 'description': """This module helps you to view an detailed overview of all + working of the Legal Case Management management module with graphs and + dashboard clickable cards in odoo 16.""", + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': 'https://www.cybrosys.com', + 'depends': ['legal_case_management'], + 'data': [ + 'views/legal_case_management_dashboard_menus.xml', + ], + 'assets': { + 'web.assets_backend': [ + 'legal_case_management_dashboard/static/src/js/dashboard_action.js', + 'legal_case_management_dashboard/static/src/xml' + '/dashboard_template.xml', + 'legal_case_management_dashboard/static/src/css/style.css', + "https://www.gstatic.com/charts/loader.js", + "https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.9.4/Chart.js", + ], + }, + 'images': ['static/description/banner.png'], + 'license': 'LGPL-3', + 'installable': True, + 'auto_install': False, + 'application': False, +} diff --git a/legal_case_management_dashboard/controllers/__init__.py b/legal_case_management_dashboard/controllers/__init__.py new file mode 100644 index 000000000..cad0a8ab2 --- /dev/null +++ b/legal_case_management_dashboard/controllers/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Mohammed Dilshad Tk (odoo@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 . +# +############################################################################### +from . import legal_case_management_dashboard diff --git a/legal_case_management_dashboard/controllers/legal_case_management_dashboard.py b/legal_case_management_dashboard/controllers/legal_case_management_dashboard.py new file mode 100644 index 000000000..fa61bca45 --- /dev/null +++ b/legal_case_management_dashboard/controllers/legal_case_management_dashboard.py @@ -0,0 +1,262 @@ +"""Legal Case Management Dashboard""" +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Mohammed Dilshad Tk (odoo@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 . +# +############################################################################### +from datetime import date, timedelta +from odoo import fields, http +from odoo.http import request + + +class CaseDashboard(http.Controller): + """Values for chart and dashboard when filter not applied""" + + @http.route('/case/dashboard', type='json', auth='user') + def _get_case_dashboard_values(self): + """Values for charts, graph and dashboard cards without filtering""" + moves, inv, client, inv_list, lawyers = [], [], [], [], [] + data_list = [['Month', 'Income']] + stage_count = [['Stage', 'Cases']] + case_category = [['Category', 'Number']] + lawyer_object = None + draft_count, in_progress_count, invoiced_count, reject_count = 0, 0, 0, 0 + won_count, lost_count, cancel_count, inv_amt = 0, 0, 0, 0 + today_date = fields.Date.today() + cases = request.env['case.registration'].search([]) + # getting last 1 year month range for bar chart + for num in range(0, 13): + month_sub = timedelta(days=num * 30) + current_first_date = today_date.replace(day=5) + range_date = current_first_date - month_sub + first_day = range_date.replace(day=1) + last_day = range_date.replace(day=1) + timedelta(days=32) + last_day = last_day.replace(day=1) - timedelta(days=1) + month_name = range_date.strftime("%b") + monthly_invoice = 0 + for invoices in request.env['account.move'].search([]): + if invoices.case_ref: + inv_date = invoices.invoice_date + if first_day < inv_date < last_day: + monthly_invoice += invoices.amount_total + data_list.append([month_name, monthly_invoice]) + # Calculate count of case in different category's + for category_id in request.env['case.category'].search([]): + case_count = request.env['case.registration'].search_count( + [('case_category_id', '=', category_id.id)]) + case_category.append([category_id.name, case_count]) + for case in cases: + # lawyers.append(case.lawyer_id.id) + for invoices in request.env['account.move'].search([]): + if case.name == invoices.case_ref: + # add case name, amount invoiced into list then it look + # like [Case0001, 5500.5] + inv_list.append([case.name, invoices.amount_total]) + if case.state == 'draft': + draft_count += 1 + if case.state == 'in_progress': + in_progress_count += 1 + if case.state == 'invoiced': + invoiced_count += 1 + if case.state == 'reject': + reject_count += 1 + if case.state == 'won': + won_count += 1 + if case.state == 'lost': + lost_count += 1 + if case.state == 'cancel': + cancel_count += 1 + client.append(case.client_id.id) + for total_invoices in request.env['account.move'].search( + [('case_ref', '=', case.name)]): + if total_invoices: + inv.append(total_invoices) + moves.append(total_invoices.id) + inv_amt += total_invoices.amount_total + case_dict = {} + for case, amount in inv_list: + if case in case_dict: + case_dict[case] += amount # add amount to existing case + else: + case_dict[case] = amount # add new case to dictionary + # Add all invoice amount to each case names and in to list + total_inv_lis = [[case, amount] for case, amount in case_dict.items()] + sorted_cases = sorted(total_inv_lis, key=lambda case: case[1], + reverse=True) + top_10_cases = sorted_cases[:10] + # appending count of each stages into stage_count + stage_count.append(['Draft', draft_count]) + stage_count.append(['In Progress', in_progress_count]) + stage_count.append(['Invoiced', invoiced_count]) + stage_count.append(['Reject', reject_count]) + stage_count.append(['Won', won_count]) + stage_count.append(['Lost', lost_count]) + stage_count.append(['Cancel', cancel_count]) + evidence = request.env['legal.evidence'].search([]) + trial = request.env['legal.trial'].search([]) + lawyers = request.env['hr.employee'].search([]).filtered( + lambda employee: not employee.parent_id and + employee.is_lawyer is True) + # extract integer from lawyers list which contains false + lawyer_list = list(filter(lambda x: x is not False, lawyers)) + #append['Case', 'Revenue']in to 0th index of list for pass to donut chart + top_10_cases.insert(0, ['Case', 'Revenue']) + user_id = request.env.uid + login_user = request.env['res.users'].search( + [('employee_id.user_id', '=', user_id)]) + if login_user.has_group('legal_case_management.lawyer_access'): + if not login_user.has_group('legal_case_management.admin_access'): + lawyer_object = login_user.employee_id + else: + lawyer_object = None + return {'total_case': len(cases), + 'invoices': inv, + 'total_invoiced': round(inv_amt, 4), + 'lawyers': len(lawyer_list), + 'lawyer_ids': lawyer_list, + 'evidences': len(evidence), + 'trials': len(trial), + 'clients': len(list(set(client))),#remove duplicates from list + 'clients_in_case': client, + 'case_category': case_category, + 'data_list': data_list, + 'stage_count': stage_count, + 'invoice_list': total_inv_lis, + 'top_10_cases': top_10_cases, + 'user_id': user_id, + 'lawyer_object': lawyer_object, + } + +class AddLawyerSelectionFieldController(http.Controller): + """Add lawyers as selection values in Dashboard""" + + @http.route('/selection/field/lawyer', type='json', auth='user', + csrf=False) + def add_lawyer_selection_field(self): + """Adding lawyers to selection of filter""" + return [{'name': lawyer.name, + 'id': lawyer.id + } for lawyer in request.env['hr.employee'].search( + [('is_lawyer', '=', True), ('parent_id', '=', False)])] + + def date_filter(self): + """ Month filter for dashboard """ + today_date = fields.Date.today() + first_day_of_month = date(today_date.year, today_date.month, 1) + # subtract one day from the first day of the current month to get + # the last day of the previous month + last_day_of_last_month = first_day_of_month - timedelta(days=1) + six_months_ago = today_date - timedelta(days=30 * 6) + first_day_of_six_months_ago = date(six_months_ago.year, + six_months_ago.month, 1) + twelve_months_ago = today_date - timedelta(days=30 * 12) + first_day_of_twelve_months_ago = date(twelve_months_ago.year, + twelve_months_ago.month, 1) + return { + 'first_day_of_last_month': date(last_day_of_last_month.year, + last_day_of_last_month.month, 1), + 'last_day_of_last_month': last_day_of_last_month, + 'first_day_of_six_months_ago': first_day_of_six_months_ago, + 'first_day_of_twelve_months_ago': first_day_of_twelve_months_ago, + } + + @http.route('/dashboard/filter', type='json', auth='user') + def fetch_dashboard_filter_value(self, **kw): + """Lawyer wise and stage wise filter""" + trial_list, clients, case_list, evidence_list, lawyer_ids, inv_amt = [], \ + [], [], [], [], 0 + data = kw['data'] + if data['stage'] == 'null': + stage_list = ['draft', 'in_progress', 'invoiced', 'won', 'lost', + 'cancel'] + else: + stage_list = [data['stage']] + if data['lawyer'] == 'admin': + lawyer_list = [lawyer.id for lawyer in + request.env['hr.employee'].search( + [('is_lawyer', '=', True), + ('parent_id', '=', False)])] + else: + lawyer_list = [int(data['lawyer'])] + lawyer_list = [lawyer.id for lawyer in + request.env['hr.employee'].search( + [('id', 'in', lawyer_list)])] + if data['month_wise'] != 'null': + month_wise_list = [data['month_wise']] + filter_start_date = None + filter_end_date = self.date_filter() + filter_end_date = filter_end_date['last_day_of_last_month'] + if month_wise_list[0] == 'last_month': + filter_start_date = self.date_filter() + filter_start_date = filter_start_date['first_day_of_last_month'] + elif month_wise_list[0] == 'last_6_months': + filter_start_date = self.date_filter() + filter_start_date = filter_start_date[ + 'first_day_of_six_months_ago'] + elif month_wise_list[0] == 'last_12_months': + filter_start_date = self.date_filter() + filter_start_date = filter_start_date[ + 'first_day_of_twelve_months_ago'] + if data['lawyer'] == 'admin': + registration_ids = request.env['case.registration'].search( + [('start_date', '>=', filter_start_date), + ('start_date', '<=', filter_end_date), + ('state', 'in', stage_list)]) + else: + lawyer_list = data['lawyer'] + registration_ids = request.env['case.registration'].search( + [('start_date', '>=', filter_start_date), + ('start_date', '<=', filter_end_date), + ('state', 'in', stage_list), + ('lawyer_id.id', 'in', [lawyer_list])]) + lawyer_list = [lawyer.id for lawyer in + request.env['hr.employee'].search( + [('id', '=', lawyer_list)])] + else: + if data['lawyer'] == 'admin': + registration_ids = request.env['case.registration'].search( + [('state', 'in', stage_list)]) + lawyer_list = [lawyer.id for lawyer in + request.env['hr.employee'].search( + [('is_lawyer', '=', True), + ('parent_id', '=', False)])] + else: + registration_ids = request.env['case.registration'].search( + [('state', 'in', stage_list), + ('lawyer_id.id', 'in', lawyer_list)]) + for registration_id in registration_ids: + lawyer_ids.append(registration_id.lawyer_id.id) + case_list.append(registration_id.id) + clients.append(request.env['res.partner'].browse( + registration_id.client_id.id).id) + inv_amt += sum(request.env['account.move'].search( + [('case_ref', '=', registration_id.name)]).mapped( + 'amount_total')) + trial_list = [trial.id for trial in request.env['legal.trial'].search( + [('case_id.id', 'in', case_list), + ('case_id.lawyer_id.id', 'in', lawyer_list)])] + evidence_list = [evidence.id for evidence in + request.env['legal.evidence'].search( + [('case_id.id', 'in', case_list)])] + return {'total_case': case_list, + 'total_invoiced': round(inv_amt, 4), + 'lawyers': lawyer_ids, + 'evidences': evidence_list, + 'trials': trial_list, + 'clients': clients } diff --git a/legal_case_management_dashboard/doc/RELEASE_NOTES.md b/legal_case_management_dashboard/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..7211e16f8 --- /dev/null +++ b/legal_case_management_dashboard/doc/RELEASE_NOTES.md @@ -0,0 +1,7 @@ +## Module + +#### 18.09.2023 +#### Version 16.0.1.0.0 +#### ADD + +- Initial commit for Legal Case Management Dashboard diff --git a/legal_case_management_dashboard/static/description/assets/icons/check.png b/legal_case_management_dashboard/static/description/assets/icons/check.png new file mode 100644 index 000000000..c8e85f51d Binary files /dev/null and b/legal_case_management_dashboard/static/description/assets/icons/check.png differ diff --git a/legal_case_management_dashboard/static/description/assets/icons/chevron.png b/legal_case_management_dashboard/static/description/assets/icons/chevron.png new file mode 100644 index 000000000..2089293d6 Binary files /dev/null and b/legal_case_management_dashboard/static/description/assets/icons/chevron.png differ diff --git a/legal_case_management_dashboard/static/description/assets/icons/cogs.png b/legal_case_management_dashboard/static/description/assets/icons/cogs.png new file mode 100644 index 000000000..95d0bad62 Binary files /dev/null and b/legal_case_management_dashboard/static/description/assets/icons/cogs.png differ diff --git a/legal_case_management_dashboard/static/description/assets/icons/consultation.png b/legal_case_management_dashboard/static/description/assets/icons/consultation.png new file mode 100644 index 000000000..8319d4baa Binary files /dev/null and b/legal_case_management_dashboard/static/description/assets/icons/consultation.png differ diff --git a/legal_case_management_dashboard/static/description/assets/icons/ecom-black.png b/legal_case_management_dashboard/static/description/assets/icons/ecom-black.png new file mode 100644 index 000000000..a9385ff13 Binary files /dev/null and b/legal_case_management_dashboard/static/description/assets/icons/ecom-black.png differ diff --git a/legal_case_management_dashboard/static/description/assets/icons/education-black.png b/legal_case_management_dashboard/static/description/assets/icons/education-black.png new file mode 100644 index 000000000..3eb09b27b Binary files /dev/null and b/legal_case_management_dashboard/static/description/assets/icons/education-black.png differ diff --git a/legal_case_management_dashboard/static/description/assets/icons/hotel-black.png b/legal_case_management_dashboard/static/description/assets/icons/hotel-black.png new file mode 100644 index 000000000..130f613be Binary files /dev/null and b/legal_case_management_dashboard/static/description/assets/icons/hotel-black.png differ diff --git a/legal_case_management_dashboard/static/description/assets/icons/license.png b/legal_case_management_dashboard/static/description/assets/icons/license.png new file mode 100644 index 000000000..a5869797e Binary files /dev/null and b/legal_case_management_dashboard/static/description/assets/icons/license.png differ diff --git a/legal_case_management_dashboard/static/description/assets/icons/lifebuoy.png b/legal_case_management_dashboard/static/description/assets/icons/lifebuoy.png new file mode 100644 index 000000000..658d56ccc Binary files /dev/null and b/legal_case_management_dashboard/static/description/assets/icons/lifebuoy.png differ diff --git a/legal_case_management_dashboard/static/description/assets/icons/manufacturing-black.png b/legal_case_management_dashboard/static/description/assets/icons/manufacturing-black.png new file mode 100644 index 000000000..697eb0e9f Binary files /dev/null and b/legal_case_management_dashboard/static/description/assets/icons/manufacturing-black.png differ diff --git a/legal_case_management_dashboard/static/description/assets/icons/pos-black.png b/legal_case_management_dashboard/static/description/assets/icons/pos-black.png new file mode 100644 index 000000000..97c0f90c1 Binary files /dev/null and b/legal_case_management_dashboard/static/description/assets/icons/pos-black.png differ diff --git a/legal_case_management_dashboard/static/description/assets/icons/puzzle.png b/legal_case_management_dashboard/static/description/assets/icons/puzzle.png new file mode 100644 index 000000000..65cf854e7 Binary files /dev/null and b/legal_case_management_dashboard/static/description/assets/icons/puzzle.png differ diff --git a/legal_case_management_dashboard/static/description/assets/icons/restaurant-black.png b/legal_case_management_dashboard/static/description/assets/icons/restaurant-black.png new file mode 100644 index 000000000..4a35eb939 Binary files /dev/null and b/legal_case_management_dashboard/static/description/assets/icons/restaurant-black.png differ diff --git a/legal_case_management_dashboard/static/description/assets/icons/service-black.png b/legal_case_management_dashboard/static/description/assets/icons/service-black.png new file mode 100644 index 000000000..301ab51cb Binary files /dev/null and b/legal_case_management_dashboard/static/description/assets/icons/service-black.png differ diff --git a/legal_case_management_dashboard/static/description/assets/icons/trading-black.png b/legal_case_management_dashboard/static/description/assets/icons/trading-black.png new file mode 100644 index 000000000..9398ba2f1 Binary files /dev/null and b/legal_case_management_dashboard/static/description/assets/icons/trading-black.png differ diff --git a/legal_case_management_dashboard/static/description/assets/icons/training.png b/legal_case_management_dashboard/static/description/assets/icons/training.png new file mode 100644 index 000000000..884ca024d Binary files /dev/null and b/legal_case_management_dashboard/static/description/assets/icons/training.png differ diff --git a/legal_case_management_dashboard/static/description/assets/icons/update.png b/legal_case_management_dashboard/static/description/assets/icons/update.png new file mode 100644 index 000000000..ecbc5a01a Binary files /dev/null and b/legal_case_management_dashboard/static/description/assets/icons/update.png differ diff --git a/legal_case_management_dashboard/static/description/assets/icons/user.png b/legal_case_management_dashboard/static/description/assets/icons/user.png new file mode 100644 index 000000000..6ffb23d9f Binary files /dev/null and b/legal_case_management_dashboard/static/description/assets/icons/user.png differ diff --git a/legal_case_management_dashboard/static/description/assets/icons/wrench.png b/legal_case_management_dashboard/static/description/assets/icons/wrench.png new file mode 100644 index 000000000..6c04dea0f Binary files /dev/null and b/legal_case_management_dashboard/static/description/assets/icons/wrench.png differ diff --git a/legal_case_management_dashboard/static/description/assets/misc/categories.png b/legal_case_management_dashboard/static/description/assets/misc/categories.png new file mode 100644 index 000000000..bedf1e0b1 Binary files /dev/null and b/legal_case_management_dashboard/static/description/assets/misc/categories.png differ diff --git a/legal_case_management_dashboard/static/description/assets/misc/check-box.png b/legal_case_management_dashboard/static/description/assets/misc/check-box.png new file mode 100644 index 000000000..42caf24b9 Binary files /dev/null and b/legal_case_management_dashboard/static/description/assets/misc/check-box.png differ diff --git a/legal_case_management_dashboard/static/description/assets/misc/compass.png b/legal_case_management_dashboard/static/description/assets/misc/compass.png new file mode 100644 index 000000000..d5fed8faa Binary files /dev/null and b/legal_case_management_dashboard/static/description/assets/misc/compass.png differ diff --git a/legal_case_management_dashboard/static/description/assets/misc/corporate.png b/legal_case_management_dashboard/static/description/assets/misc/corporate.png new file mode 100644 index 000000000..2eb13edbf Binary files /dev/null and b/legal_case_management_dashboard/static/description/assets/misc/corporate.png differ diff --git a/legal_case_management_dashboard/static/description/assets/misc/customer-support.png b/legal_case_management_dashboard/static/description/assets/misc/customer-support.png new file mode 100644 index 000000000..79efc72ed Binary files /dev/null and b/legal_case_management_dashboard/static/description/assets/misc/customer-support.png differ diff --git a/legal_case_management_dashboard/static/description/assets/misc/cybrosys-logo.png b/legal_case_management_dashboard/static/description/assets/misc/cybrosys-logo.png new file mode 100644 index 000000000..cc3cc0ccf Binary files /dev/null and b/legal_case_management_dashboard/static/description/assets/misc/cybrosys-logo.png differ diff --git a/legal_case_management_dashboard/static/description/assets/misc/features.png b/legal_case_management_dashboard/static/description/assets/misc/features.png new file mode 100644 index 000000000..b41769f77 Binary files /dev/null and b/legal_case_management_dashboard/static/description/assets/misc/features.png differ diff --git a/legal_case_management_dashboard/static/description/assets/misc/logo.png b/legal_case_management_dashboard/static/description/assets/misc/logo.png new file mode 100644 index 000000000..478462d3e Binary files /dev/null and b/legal_case_management_dashboard/static/description/assets/misc/logo.png differ diff --git a/legal_case_management_dashboard/static/description/assets/misc/pictures.png b/legal_case_management_dashboard/static/description/assets/misc/pictures.png new file mode 100644 index 000000000..56d255fe9 Binary files /dev/null and b/legal_case_management_dashboard/static/description/assets/misc/pictures.png differ diff --git a/legal_case_management_dashboard/static/description/assets/misc/pie-chart.png b/legal_case_management_dashboard/static/description/assets/misc/pie-chart.png new file mode 100644 index 000000000..426e05244 Binary files /dev/null and b/legal_case_management_dashboard/static/description/assets/misc/pie-chart.png differ diff --git a/legal_case_management_dashboard/static/description/assets/misc/right-arrow.png b/legal_case_management_dashboard/static/description/assets/misc/right-arrow.png new file mode 100644 index 000000000..730984a06 Binary files /dev/null and b/legal_case_management_dashboard/static/description/assets/misc/right-arrow.png differ diff --git a/legal_case_management_dashboard/static/description/assets/misc/star.png b/legal_case_management_dashboard/static/description/assets/misc/star.png new file mode 100644 index 000000000..2eb9ab29f Binary files /dev/null and b/legal_case_management_dashboard/static/description/assets/misc/star.png differ diff --git a/legal_case_management_dashboard/static/description/assets/misc/support.png b/legal_case_management_dashboard/static/description/assets/misc/support.png new file mode 100644 index 000000000..4f18b8b82 Binary files /dev/null and b/legal_case_management_dashboard/static/description/assets/misc/support.png differ diff --git a/legal_case_management_dashboard/static/description/assets/misc/whatsapp.png b/legal_case_management_dashboard/static/description/assets/misc/whatsapp.png new file mode 100644 index 000000000..d513a5356 Binary files /dev/null and b/legal_case_management_dashboard/static/description/assets/misc/whatsapp.png differ diff --git a/legal_case_management_dashboard/static/description/assets/modules/advanced_dynamic_dashboard.png b/legal_case_management_dashboard/static/description/assets/modules/advanced_dynamic_dashboard.png new file mode 100644 index 000000000..f0e8c3a16 Binary files /dev/null and b/legal_case_management_dashboard/static/description/assets/modules/advanced_dynamic_dashboard.png differ diff --git a/legal_case_management_dashboard/static/description/assets/modules/odoo_dynamic_dashboard.png b/legal_case_management_dashboard/static/description/assets/modules/odoo_dynamic_dashboard.png new file mode 100644 index 000000000..f3c986fc1 Binary files /dev/null and b/legal_case_management_dashboard/static/description/assets/modules/odoo_dynamic_dashboard.png differ diff --git a/legal_case_management_dashboard/static/description/assets/modules/odoo_website_helpdesk_dashboard.png b/legal_case_management_dashboard/static/description/assets/modules/odoo_website_helpdesk_dashboard.png new file mode 100644 index 000000000..fa478cd14 Binary files /dev/null and b/legal_case_management_dashboard/static/description/assets/modules/odoo_website_helpdesk_dashboard.png differ diff --git a/legal_case_management_dashboard/static/description/assets/modules/product_management_app.png b/legal_case_management_dashboard/static/description/assets/modules/product_management_app.png new file mode 100644 index 000000000..b145c7a29 Binary files /dev/null and b/legal_case_management_dashboard/static/description/assets/modules/product_management_app.png differ diff --git a/legal_case_management_dashboard/static/description/assets/modules/project_dashboard_odoo.png b/legal_case_management_dashboard/static/description/assets/modules/project_dashboard_odoo.png new file mode 100644 index 000000000..6c8c8adc3 Binary files /dev/null and b/legal_case_management_dashboard/static/description/assets/modules/project_dashboard_odoo.png differ diff --git a/legal_case_management_dashboard/static/description/assets/modules/salon_management.png b/legal_case_management_dashboard/static/description/assets/modules/salon_management.png new file mode 100644 index 000000000..2a666bf79 Binary files /dev/null and b/legal_case_management_dashboard/static/description/assets/modules/salon_management.png differ diff --git a/legal_case_management_dashboard/static/description/assets/screenshots/1.png b/legal_case_management_dashboard/static/description/assets/screenshots/1.png new file mode 100644 index 000000000..75512a2cf Binary files /dev/null and b/legal_case_management_dashboard/static/description/assets/screenshots/1.png differ diff --git a/legal_case_management_dashboard/static/description/assets/screenshots/2.png b/legal_case_management_dashboard/static/description/assets/screenshots/2.png new file mode 100644 index 000000000..618e0398a Binary files /dev/null and b/legal_case_management_dashboard/static/description/assets/screenshots/2.png differ diff --git a/legal_case_management_dashboard/static/description/assets/screenshots/3.png b/legal_case_management_dashboard/static/description/assets/screenshots/3.png new file mode 100644 index 000000000..2caef114e Binary files /dev/null and b/legal_case_management_dashboard/static/description/assets/screenshots/3.png differ diff --git a/legal_case_management_dashboard/static/description/assets/screenshots/4.png b/legal_case_management_dashboard/static/description/assets/screenshots/4.png new file mode 100644 index 000000000..be7627338 Binary files /dev/null and b/legal_case_management_dashboard/static/description/assets/screenshots/4.png differ diff --git a/legal_case_management_dashboard/static/description/assets/screenshots/5.png b/legal_case_management_dashboard/static/description/assets/screenshots/5.png new file mode 100644 index 000000000..342a8f7ba Binary files /dev/null and b/legal_case_management_dashboard/static/description/assets/screenshots/5.png differ diff --git a/legal_case_management_dashboard/static/description/assets/screenshots/6.png b/legal_case_management_dashboard/static/description/assets/screenshots/6.png new file mode 100644 index 000000000..a71104531 Binary files /dev/null and b/legal_case_management_dashboard/static/description/assets/screenshots/6.png differ diff --git a/legal_case_management_dashboard/static/description/assets/screenshots/hero.gif b/legal_case_management_dashboard/static/description/assets/screenshots/hero.gif new file mode 100644 index 000000000..416410583 Binary files /dev/null and b/legal_case_management_dashboard/static/description/assets/screenshots/hero.gif differ diff --git a/legal_case_management_dashboard/static/description/banner.png b/legal_case_management_dashboard/static/description/banner.png new file mode 100644 index 000000000..a5d1557bf Binary files /dev/null and b/legal_case_management_dashboard/static/description/banner.png differ diff --git a/legal_case_management_dashboard/static/description/icon.png b/legal_case_management_dashboard/static/description/icon.png new file mode 100644 index 000000000..5508590aa Binary files /dev/null and b/legal_case_management_dashboard/static/description/icon.png differ diff --git a/legal_case_management_dashboard/static/description/icons/check.png b/legal_case_management_dashboard/static/description/icons/check.png new file mode 100644 index 000000000..c8e85f51d Binary files /dev/null and b/legal_case_management_dashboard/static/description/icons/check.png differ diff --git a/legal_case_management_dashboard/static/description/icons/chevron.png b/legal_case_management_dashboard/static/description/icons/chevron.png new file mode 100644 index 000000000..2089293d6 Binary files /dev/null and b/legal_case_management_dashboard/static/description/icons/chevron.png differ diff --git a/legal_case_management_dashboard/static/description/icons/cogs.png b/legal_case_management_dashboard/static/description/icons/cogs.png new file mode 100644 index 000000000..95d0bad62 Binary files /dev/null and b/legal_case_management_dashboard/static/description/icons/cogs.png differ diff --git a/legal_case_management_dashboard/static/description/icons/consultation.png b/legal_case_management_dashboard/static/description/icons/consultation.png new file mode 100644 index 000000000..8319d4baa Binary files /dev/null and b/legal_case_management_dashboard/static/description/icons/consultation.png differ diff --git a/legal_case_management_dashboard/static/description/icons/ecom-black.png b/legal_case_management_dashboard/static/description/icons/ecom-black.png new file mode 100644 index 000000000..a9385ff13 Binary files /dev/null and b/legal_case_management_dashboard/static/description/icons/ecom-black.png differ diff --git a/legal_case_management_dashboard/static/description/icons/education-black.png b/legal_case_management_dashboard/static/description/icons/education-black.png new file mode 100644 index 000000000..3eb09b27b Binary files /dev/null and b/legal_case_management_dashboard/static/description/icons/education-black.png differ diff --git a/legal_case_management_dashboard/static/description/icons/hotel-black.png b/legal_case_management_dashboard/static/description/icons/hotel-black.png new file mode 100644 index 000000000..130f613be Binary files /dev/null and b/legal_case_management_dashboard/static/description/icons/hotel-black.png differ diff --git a/legal_case_management_dashboard/static/description/icons/license.png b/legal_case_management_dashboard/static/description/icons/license.png new file mode 100644 index 000000000..a5869797e Binary files /dev/null and b/legal_case_management_dashboard/static/description/icons/license.png differ diff --git a/legal_case_management_dashboard/static/description/icons/lifebuoy.png b/legal_case_management_dashboard/static/description/icons/lifebuoy.png new file mode 100644 index 000000000..658d56ccc Binary files /dev/null and b/legal_case_management_dashboard/static/description/icons/lifebuoy.png differ diff --git a/legal_case_management_dashboard/static/description/icons/manufacturing-black.png b/legal_case_management_dashboard/static/description/icons/manufacturing-black.png new file mode 100644 index 000000000..697eb0e9f Binary files /dev/null and b/legal_case_management_dashboard/static/description/icons/manufacturing-black.png differ diff --git a/legal_case_management_dashboard/static/description/icons/pos-black.png b/legal_case_management_dashboard/static/description/icons/pos-black.png new file mode 100644 index 000000000..97c0f90c1 Binary files /dev/null and b/legal_case_management_dashboard/static/description/icons/pos-black.png differ diff --git a/legal_case_management_dashboard/static/description/icons/puzzle.png b/legal_case_management_dashboard/static/description/icons/puzzle.png new file mode 100644 index 000000000..65cf854e7 Binary files /dev/null and b/legal_case_management_dashboard/static/description/icons/puzzle.png differ diff --git a/legal_case_management_dashboard/static/description/icons/restaurant-black.png b/legal_case_management_dashboard/static/description/icons/restaurant-black.png new file mode 100644 index 000000000..4a35eb939 Binary files /dev/null and b/legal_case_management_dashboard/static/description/icons/restaurant-black.png differ diff --git a/legal_case_management_dashboard/static/description/icons/service-black.png b/legal_case_management_dashboard/static/description/icons/service-black.png new file mode 100644 index 000000000..301ab51cb Binary files /dev/null and b/legal_case_management_dashboard/static/description/icons/service-black.png differ diff --git a/legal_case_management_dashboard/static/description/icons/trading-black.png b/legal_case_management_dashboard/static/description/icons/trading-black.png new file mode 100644 index 000000000..9398ba2f1 Binary files /dev/null and b/legal_case_management_dashboard/static/description/icons/trading-black.png differ diff --git a/legal_case_management_dashboard/static/description/icons/training.png b/legal_case_management_dashboard/static/description/icons/training.png new file mode 100644 index 000000000..884ca024d Binary files /dev/null and b/legal_case_management_dashboard/static/description/icons/training.png differ diff --git a/legal_case_management_dashboard/static/description/icons/update.png b/legal_case_management_dashboard/static/description/icons/update.png new file mode 100644 index 000000000..ecbc5a01a Binary files /dev/null and b/legal_case_management_dashboard/static/description/icons/update.png differ diff --git a/legal_case_management_dashboard/static/description/icons/user.png b/legal_case_management_dashboard/static/description/icons/user.png new file mode 100644 index 000000000..6ffb23d9f Binary files /dev/null and b/legal_case_management_dashboard/static/description/icons/user.png differ diff --git a/legal_case_management_dashboard/static/description/icons/wrench.png b/legal_case_management_dashboard/static/description/icons/wrench.png new file mode 100644 index 000000000..6c04dea0f Binary files /dev/null and b/legal_case_management_dashboard/static/description/icons/wrench.png differ diff --git a/legal_case_management_dashboard/static/description/index.html b/legal_case_management_dashboard/static/description/index.html new file mode 100644 index 000000000..9a4b4be92 --- /dev/null +++ b/legal_case_management_dashboard/static/description/index.html @@ -0,0 +1,699 @@ +
+ +
+ +
+
+ Community +
+
+ Enterprise +
+
+ Odoo.sh +
+
+
+ + +
+
+
+

+ Legal Case Management Dashboard

+

+ Dashboard View Of Legal Case Management

+ + +
+
+
+
+ +
+
+ +
+

+ Explore This + Module

+
+ + + + +
+
+ +
+

+ Overview +

+
+
+
+ Legal Case Management Dashboard module helps you to see the Overview of + the Legal Case Management firm. Module shows + the total cases, clients, lawyers, trials, evidences, invoiced + amount.User can apply filtration for the cards based on stage wise, + lawyer wise and based on previous months. Then a chart shows cases in + different category's. Another chart shows most paid ten cases and their + invoice amount + and two graphs for view income in last one year and cases in different + stages.The Dashboard can be viewed in different formats one for the + Admin, lawyer and another for the clerk. + In the case of the Admin, the Dashboard will provide a complete insight + on the operations of the all records. Whereas in the case of the lawyer + they will only obtain certain of the details which they have been + assigned for them. +
+
+ + + +
+
+ +
+

+ Features +

+
+
+
+
+ + Clickable Dashboard Cards. +
+
+ + Graphs for View Last One Year Revenue +
+
+ + Cases in different Stages +
+
+ + Top 10 Invoiced Cases +
+
+
+
+ + Stage Wise Case Count Showing Graph +
+
+ + Lawyer Wise Filter +
+
+ + Stage Wise Filter +
+
+ + Previous Months Filter +
+
+
+ + + +
+
+ +
+

+ Screenshots +

+
+
+
+ +
+

+ Clickable dashboard cards

+

+ User can click on cards which redirects to corresponding + information.This will also change based on filtration

+ +

+ For example if clicked on Cases card it will redirect you to + corresponding cases

+ +
+
+

+ Stage wise filter

+

+ Stage wise filtration will change whole card details based on + selected stage

+ +
+ +
+

+ Lawyer wise filter

+

+ Lawyer wise filtration will change whole card details based on + selected lawyer

+ +
+
+

+ Previous months filter

+

+ Previous month wise filtration will change whole card details + based on selected previous month

+ +
+
+

+ Graphs and Charts

+

+ Shows most paid 10 cases, cases in different stages, last one + year revenue and case in different category

+ +
+
+
+ + + +
+
+ +
+

+ Related + Products +

+
+
+
+ +
+
+ + + + +
+
+ +
+

+ Our Services +

+
+ +
+
+
+
+ +
+
+ Odoo + Customization
+
+ +
+
+ +
+
+ Odoo + Implementation
+
+ +
+
+ +
+
+ Odoo + Support
+
+ + +
+
+ +
+
+ Hire + Odoo + Developer
+
+ +
+
+ +
+
+ Odoo + Integration
+
+ +
+
+ +
+
+ Odoo + Migration
+
+ + +
+
+ +
+
+ Odoo + Consultancy
+
+ +
+
+ +
+
+ Odoo + Implementation
+
+ +
+
+ +
+
+ Odoo + Licensing Consultancy
+
+
+ +
+ + + + + +
+
+ +
+

+ Our + Industries +

+
+ +
+
+
+
+ +
+ Trading +
+

+ Easily procure + and + sell your products

+
+
+ +
+
+ +
+ POS +
+

+ Easy + configuration + and convivial experience

+
+
+ +
+
+ +
+ Education +
+

+ A platform for + educational management

+
+
+ +
+
+ +
+ Manufacturing +
+

+ Plan, track and + schedule your operations

+
+
+ +
+
+ +
+ E-commerce & Website +
+

+ Mobile + friendly, + awe-inspiring product pages

+
+
+ +
+
+ +
+ Service Management +
+

+ Keep track of + services and invoice

+
+
+ +
+
+ +
+ Restaurant +
+

+ Run your bar or + restaurant methodically

+
+
+ +
+
+ +
+ Hotel Management +
+

+ An + all-inclusive + hotel management application

+
+
+
+
+ + + + +
+
+ +
+

+ Support +

+
+
+
+
+
+
+ +
+
+

Need Help?

+

Got questions or need help? + Get in touch.

+ +

+ odoo@cybrosys.com

+
+
+
+
+
+
+
+ +
+
+

WhatsApp

+

Say hi to us on WhatsApp!

+ +

+ +91 86068 + 27707

+
+
+
+
+
+
+
+ +
+
+
+ \ No newline at end of file diff --git a/legal_case_management_dashboard/static/src/css/style.css b/legal_case_management_dashboard/static/src/css/style.css new file mode 100644 index 000000000..91a5d0f0a --- /dev/null +++ b/legal_case_management_dashboard/static/src/css/style.css @@ -0,0 +1,32 @@ +.container-fluid{ + height: 100%; + width: 100%; +} +#mychart{ + width: 600%; + max-width: 500px; +} +.dbox { + position: relative; + border-radius: 4px; + text-align: center; + border-radius: 20px; + box-shadow: 0px 2px 4px 0px rgba(222, 222, 222, 1); +} +.dbox__body { + padding: 50px 20px; +} +.dbox__count { + font-size: 25px; + color: black; + font-weight: 300; +} +.dbox__title { + font-size: 13px; + color: black; +} +.dbox__action { + transform: translateY(-50%) translateX(-50%); + position: absolute; + left: 50%; +} diff --git a/legal_case_management_dashboard/static/src/image/brief_case.png b/legal_case_management_dashboard/static/src/image/brief_case.png new file mode 100644 index 000000000..8487e85b7 Binary files /dev/null and b/legal_case_management_dashboard/static/src/image/brief_case.png differ diff --git a/legal_case_management_dashboard/static/src/image/client.jpg b/legal_case_management_dashboard/static/src/image/client.jpg new file mode 100644 index 000000000..eb4e88da1 Binary files /dev/null and b/legal_case_management_dashboard/static/src/image/client.jpg differ diff --git a/legal_case_management_dashboard/static/src/image/dollar_img.png b/legal_case_management_dashboard/static/src/image/dollar_img.png new file mode 100644 index 000000000..f7638f51e Binary files /dev/null and b/legal_case_management_dashboard/static/src/image/dollar_img.png differ diff --git a/legal_case_management_dashboard/static/src/image/evidence-img.png b/legal_case_management_dashboard/static/src/image/evidence-img.png new file mode 100644 index 000000000..642e7e7e8 Binary files /dev/null and b/legal_case_management_dashboard/static/src/image/evidence-img.png differ diff --git a/legal_case_management_dashboard/static/src/image/img_trial.png b/legal_case_management_dashboard/static/src/image/img_trial.png new file mode 100644 index 000000000..20c9f98f9 Binary files /dev/null and b/legal_case_management_dashboard/static/src/image/img_trial.png differ diff --git a/legal_case_management_dashboard/static/src/image/lawyer img.png b/legal_case_management_dashboard/static/src/image/lawyer img.png new file mode 100644 index 000000000..4201ee9cf Binary files /dev/null and b/legal_case_management_dashboard/static/src/image/lawyer img.png differ diff --git a/legal_case_management_dashboard/static/src/js/dashboard_action.js b/legal_case_management_dashboard/static/src/js/dashboard_action.js new file mode 100644 index 000000000..3e2b788d5 --- /dev/null +++ b/legal_case_management_dashboard/static/src/js/dashboard_action.js @@ -0,0 +1,345 @@ +odoo.define('legal_case_management_dashboard.case_dashboard', function(require) { + "use strict"; + var AbstractAction = require('web.AbstractAction'); + var core = require('web.core'); + var rpc = require('web.rpc'); + var ajax = require('web.ajax'); + var _t = core._t; + var cases_list; + var trial_list; + var evidence_list; + var lawyer_list; + var client_list; + var total_client; + var CaseDashBoard = AbstractAction.extend({ + contentTemplate: 'CaseDashBoard', + events: { + 'click #total_case': '_OnClickTotalCase', + 'click #total_trials': '_OnClickTotalTrials', + 'click #total_evidences': '_OnClickTotalEvidences', + 'click #total_lawyers': '_OnClickTotalLawyers', + 'click #total_clients': '_OnClickTotalClients', + 'change #lawyer_wise': '_OnchangeSelection', + 'change #stage_wise': '_OnchangeSelection', + 'change #month_wise': '_OnchangeSelection', + }, + // Click function of case card + _OnClickTotalCase: function(e) { + if (cases_list) { + this.do_action({ + name: _t("Total Cases"), + type: 'ir.actions.act_window', + res_model: 'case.registration', + view_mode: 'tree,form', + views: [ + [false, 'list'], + [false, 'form'] + ], + domain: [ + ['id', 'in', cases_list] + ], + context: { + create: false + }, + target: 'current', + }) + } else { + this.do_action({ + name: _t("Total Cases"), + type: 'ir.actions.act_window', + res_model: 'case.registration', + view_mode: 'tree,form', + views: [ + [false, 'list'], + [false, 'form'] + ], + context: { + create: false + }, + target: 'current', + }) + } + }, + // Click function of trial card + _OnClickTotalTrials: function(e) { + if (trial_list) { + this.do_action({ + name: _t("Total Trials"), + type: 'ir.actions.act_window', + res_model: 'legal.trial', + view_mode: 'tree,form', + views: [ + [false, 'list'], + [false, 'form'] + ], + domain: [ + ['id', 'in', trial_list] + ], + context: { + create: false + }, + target: 'current', + }) + } else { + this.do_action({ + name: _t("Total Trials"), + type: 'ir.actions.act_window', + res_model: 'legal.trial', + view_mode: 'tree,form', + views: [ + [false, 'list'], + [false, 'form'] + ], + context: { + create: false + }, + target: 'current', + }) + } + }, + // Click function of evidence card + _OnClickTotalEvidences: function(e) { + if (evidence_list) { + this.do_action({ + name: _t("Total Evidences"), + type: 'ir.actions.act_window', + res_model: 'legal.evidence', + view_mode: 'tree,form', + views: [ + [false, 'list'], + [false, 'form'] + ], + domain: [ + ['id', 'in', evidence_list] + ], + context: { + create: false + }, + target: 'current', + }) + } else { + this.do_action({ + name: _t("Total Evidences"), + type: 'ir.actions.act_window', + res_model: 'legal.evidence', + view_mode: 'tree,form', + views: [ + [false, 'list'], + [false, 'form'] + ], + context: { + create: false + }, + target: 'current', + }) + } + }, + //Click function of lawyers card + _OnClickTotalLawyers: function(e) { + if (lawyer_list) { + this.do_action({ + name: _t("Total Lawyers"), + type: 'ir.actions.act_window', + res_model: 'hr.employee', + view_mode: 'tree,form', + views: [ + [false, 'list'], + [false, 'form'] + ], + domain: [ + ['id', 'in', lawyer_list] + ], + context: { + create: false + }, + target: 'current', + }) + } else { + this.do_action({ + name: _t("Total Lawyers"), + type: 'ir.actions.act_window', + res_model: 'hr.employee', + view_mode: 'tree,form', + views: [ + [false, 'list'], + [false, 'form'] + ], + domain: [ + ['is_lawyer', '=', true], + ['parent_id', '=', false] + ], + context: { + create: false + }, + target: 'current', + }) + } + }, + // Click function of clients card + _OnClickTotalClients: function(e) { + if (client_list) { + this.do_action({ + name: _t("Total Clients"), + type: 'ir.actions.act_window', + res_model: 'res.partner', + view_mode: 'tree,form', + views: [ + [false, 'list'], + [false, 'form'] + ], + domain: [ + ['id', 'in', client_list] + ], + context: { + create: false + }, + target: 'current', + }) + } else if (total_client) { + this.do_action({ + name: _t("Total Clients"), + type: 'ir.actions.act_window', + res_model: 'res.partner', + view_mode: 'tree,form', + views: [ + [false, 'list'], + [false, 'form'] + ], + domain: [ + ['id', 'in', total_client] + ], + context: { + create: false + }, + target: 'current', + }) + } + }, + // Onchange filters + _OnchangeSelection: function() { + var lawyer_filter = $('#lawyer_wise') + .val() + var stage_filter = $('#stage_wise') + .val() + var date_filter = $('#month_wise') + .val() + var data = { + 'stage': stage_filter, + 'lawyer': lawyer_filter, + 'month_wise': date_filter + } + ajax.jsonRpc('/dashboard/filter', 'call', { + 'data': data + }) + .then(function(value) { + cases_list = value.total_case + trial_list = value.trials + evidence_list = value.evidences + lawyer_list = value.lawyers + client_list = value.clients + document.getElementById("total_cases") + .innerHTML = value.total_case.length; + document.getElementById("total_invoices") + .innerHTML = value.total_invoiced; + document.getElementById("trials_count") + .innerHTML = value.trials.length; + document.getElementById("evidences_count") + .innerHTML = value.evidences.length; + document.getElementById("lawyers_count") + .innerHTML = value.lawyers.length; + document.getElementById("clients_count") + .innerHTML = value.clients.length; + }) + }, + CaseManagementDashboard: {}, + //Get datas to dashboard while opening the dashboard + willStart: function() { + var self =this; + var promise = ajax.rpc('/case/dashboard', {}) + .then((result) => { + this.CaseManagementDashboard = result; + total_client = result.clients_in_case + //Graphs starts here + google.charts.load('current', { + 'packages': ['corechart'] + }); + google.charts.setOnLoadCallback(drawChart); + function drawChart() { + try{ + // Pie chart starts + var data = google.visualization.arrayToDataTable(result['case_category']); + var optionss = { + 'backgroundColor': 'transparent', + is3D: true + }; + var chart = new google.visualization.PieChart(document.getElementById('pie_chart')); + chart.draw(data, optionss); + // Pie chart end + //Donut chart start + var datas = google.visualization.arrayToDataTable(result.top_10_cases); + var options = { + 'backgroundColor': 'transparent', + pieHole: 0.5 + }; + var charts = new google.visualization.PieChart(document.getElementById('donut_chart')); + charts.draw(datas, options); + //Donut chart end + //Linechart start + var datas = google.visualization.arrayToDataTable(result['data_list']); + var optionss = { + 'backgroundColor': 'transparent', + legend: 'none', + bar: { + groupWidth: "40%" + }, + }; + var charts = new google.visualization.LineChart(document.getElementById('mygraph')); + charts.draw(datas, optionss); + //Linechart end + //Column chart start + var column_data = google.visualization.arrayToDataTable(result.stage_count); + var column_options = { + 'backgroundColor': 'transparent', + legend: 'none', + bar: { + groupWidth: "40%" + }, + }; + var column_chart = new google.visualization.ColumnChart(document.getElementById('column_graph')); + column_chart.draw(column_data, column_options); + //column chart end + }catch (e) { + self.willStart() + } + } + }); + return Promise.all([ + this._super.apply(this, arguments), promise + ]); + }, + //Set a title for the dashboard and call the function which adds the + //lawyer's to the lawyer selection field + start: function() { + var self = this; + this.set("title", 'Dashboard'); + return this._super() + .then(function() { + self.render_filter(); + }); + }, + render_filter: function() { + //Add lawyers to lawyers selection field + ajax.rpc('/selection/field/lawyer', {}) + .then((result) => { + var lawyer_list = result + $(lawyer_list) + .each(function(lawyer) { + $('#lawyer_wise') + .append(""); + }); + }) + }, + }) + core.action_registry.add('case_dashboard_tags', CaseDashBoard); + return CaseDashBoard; +}) diff --git a/legal_case_management_dashboard/static/src/xml/dashboard_template.xml b/legal_case_management_dashboard/static/src/xml/dashboard_template.xml new file mode 100644 index 000000000..6e0dc347b --- /dev/null +++ b/legal_case_management_dashboard/static/src/xml/dashboard_template.xml @@ -0,0 +1,204 @@ + + diff --git a/legal_case_management_dashboard/views/legal_case_management_dashboard_menus.xml b/legal_case_management_dashboard/views/legal_case_management_dashboard_menus.xml new file mode 100644 index 000000000..104465a47 --- /dev/null +++ b/legal_case_management_dashboard/views/legal_case_management_dashboard_menus.xml @@ -0,0 +1,12 @@ + + + + + Dashboard + case_dashboard_tags + + + +