diff --git a/odex25_base/ks_dashboard_ninja/__manifest__.py b/odex25_base/ks_dashboard_ninja/__manifest__.py
index 08d603de1..965281476 100644
--- a/odex25_base/ks_dashboard_ninja/__manifest__.py
+++ b/odex25_base/ks_dashboard_ninja/__manifest__.py
@@ -1,12 +1,12 @@
# -*- coding: utf-8 -*-
{
- 'name': 'Dashboard Ninja',
+ 'name': 'Dashboard Ninja With AI',
- 'summary': """
+ 'summary': """
Ksolves Dashboard Ninja gives you a wide-angle view of your business that you might have missed. Get smart visual data with interactive and engaging dashboards for your Odoo ERP. Odoo Dashboard, CRM Dashboard, Inventory Dashboard, Sales Dashboard, Account Dashboard, Invoice Dashboard, Revamp Dashboard, Best Dashboard, Odoo Best Dashboard, Odoo Apps Dashboard, Best Ninja Dashboard, Analytic Dashboard, Pre-Configured Dashboard, Create Dashboard, Beautiful Dashboard, Customized Robust Dashboard, Predefined Dashboard, Multiple Dashboards, Advance Dashboard, Beautiful Powerful Dashboards, Chart Graphs Table View, All In One Dynamic Dashboard, Accounting Stock Dashboard, Pie Chart Dashboard, Modern Dashboard, Dashboard Studio, Dashboard Builder, Dashboard Designer, Odoo Studio. Revamp your Odoo Dashboard like never before! It is one of the best dashboard odoo apps in the market.
""",
- 'description': """
+ 'description': """
Dashboard Ninja v14.0,
Odoo Dashboard,
Dashboard,
@@ -63,35 +63,48 @@ Dashboard Ninja v14.0,
odoo dashboard module
""",
- 'author': 'Ksolves India Ltd.',
+ 'author': 'Ksolves India Ltd.',
- 'license': 'OPL-1',
+ 'license': 'OPL-1',
- 'currency': 'EUR',
+ 'currency': 'EUR',
- 'price': '272.25',
- 'website': 'https://store.ksolves.com/',
+ 'price': '287.19',
- 'maintainer': 'Ksolves India Ltd.',
+ 'website': 'https://store.ksolves.com/',
- 'live_test_url': 'https://dn15demo.kappso.com/web/demo_login',
+ 'maintainer': 'Ksolves India Ltd.',
- 'category': 'Tools',
+ 'live_test_url': 'https://dn15demo.kappso.com/web#cids=1&menu_id=599&ks_dashboard_id=1&action=835',
- 'version': '14.0.1.7.2',
+ 'category': 'Tools',
- 'support': 'sales@ksolves.com',
+ 'version': '14.0.2.0.0',
- 'images': ['static/description/banner.gif'],
+ 'support': 'sales@ksolves.com',
- 'depends': ['base', 'web', 'base_setup', 'bus'],
+ 'images': ['static/description/Independence_sale.jpg'],
- 'data': ['security/ir.model.access.csv', 'security/ks_security_groups.xml', 'data/ks_default_data.xml', 'wizard/ks_create_dashboard_wizard_view.xml', 'wizard/ks_duplicate_dashboard_wiz_view.xml', 'views/ks_dashboard_ninja_view.xml', 'views/ks_dashboard_ninja_item_view.xml', 'views/ks_dashboard_ninja_assets.xml', 'views/ks_dashboard_action.xml', 'views/ks_import_dashboard_view.xml'],
+ 'depends': ['base', 'web', 'base_setup', 'bus'],
- 'qweb': ['static/src/xml/ks_dn_global_filter.xml', 'static/src/xml/ks_dashboard_ninja_templates.xml', 'static/src/xml/ks_dashboard_ninja_item_templates.xml', 'static/src/xml/ks_dashboard_ninja_item_theme.xml', 'static/src/xml/ks_widget_toggle.xml', 'static/src/xml/ks_dashboard_pro.xml', 'static/src/xml/ks_import_list_view_template.xml', 'static/src/xml/ks_quick_edit_view.xml', 'static/src/xml/ks_to_do_template.xml'],
+ 'data': ['security/ir.model.access.csv', 'security/ks_security_groups.xml', 'data/ks_default_data.xml',
+ 'data/dn_data.xml',
+ 'wizard/ks_create_dashboard_wizard_view.xml', 'wizard/ks_duplicate_dashboard_wiz_view.xml',
+ 'views/ks_dashboard_ninja_view.xml', 'views/ks_dashboard_ninja_item_view.xml', 'views/res_settings.xml',
+ 'views/ks_dashboard_ninja_assets.xml',
+ 'views/ks_dashboard_action.xml',
+ 'views/ks_import_dashboard_view.xml', 'views/ks_ai_dashboard.xml', 'views/ks_key_fetch.xml',
+ 'views/ks_whole_ai_dashboard.xml'],
- 'demo': ['demo/ks_dashboard_ninja_demo.xml'],
+ 'qweb': ['static/src/xml/ks_dn_global_filter.xml', 'static/src/xml/ks_dashboard_ninja_templates.xml',
+ 'static/src/xml/ks_dashboard_ninja_item_templates.xml', 'static/src/xml/ks_ai_dash_button.xml',
+ 'static/src/xml/ks_dashboard_ninja_item_theme.xml',
+ 'static/src/xml/ks_widget_toggle.xml', 'static/src/xml/ks_dashboard_pro.xml',
+ 'static/src/xml/ks_import_list_view_template.xml', 'static/src/xml/ks_quick_edit_view.xml',
+ 'static/src/xml/ks_to_do_template.xml', 'static/src/xml/ks_keyword_selection.xml'],
- 'uninstall_hook': 'uninstall_hook',
+ 'demo': ['demo/ks_dashboard_ninja_demo.xml'],
+
+ 'uninstall_hook': 'uninstall_hook',
}
diff --git a/odex25_base/ks_dashboard_ninja/common_lib/ks_date_filter_selections.py b/odex25_base/ks_dashboard_ninja/common_lib/ks_date_filter_selections.py
index 92caf0d0b..9ed0eab48 100644
--- a/odex25_base/ks_dashboard_ninja/common_lib/ks_date_filter_selections.py
+++ b/odex25_base/ks_dashboard_ninja/common_lib/ks_date_filter_selections.py
@@ -32,9 +32,75 @@ def ks_get_date(ks_date_filter_selection, self, type):
series = ks_date_filter_selection
if ks_date_filter_selection in ['t_fiscal_year', 'n_fiscal_year', 'ls_fiscal_year']:
- return eval("ks_date_series_" + series.split("_")[0])(series.split("_")[1], timezone, type,self)
+ function_name = globals()["ks_date_series_" + series.split("_")[0]]
+ return function_name(series.split("_")[1], timezone, type, self)
else:
- return eval("ks_date_series_" + series.split("_")[0])(series.split("_")[1], timezone, type, self)
+ function_name = globals()["ks_date_series_" + series.split("_")[0]]
+ return function_name(series.split("_")[1], timezone, type, self)
+
+def ks_date_series_td(ks_date_selection, timezone, type, self=None):
+ ks_function_name = globals()["ks_get_date_range_from_td_" + ks_date_selection]
+ return ks_function_name(timezone, type, self)
+
+def ks_get_date_range_from_td_year(timezone, type,self):
+ ks_date_data = {}
+ date = datetime.now(pytz.timezone(timezone))
+ year = date.year
+ start_date = datetime(year, 1, 1)
+ end_date = date
+ if type == 'date':
+ ks_date_data["selected_start_date"] = datetime.strptime(start_date.strftime("%Y-%m-%d"), '%Y-%m-%d')
+ ks_date_data["selected_end_date"] = datetime.strptime(end_date.strftime("%Y-%m-%d"), '%Y-%m-%d')
+ else:
+ ks_date_data["selected_start_date"] = ks_convert_into_utc(start_date, timezone)
+ ks_date_data["selected_end_date"] = ks_convert_into_utc(end_date, timezone)
+ return ks_date_data
+
+def ks_get_date_range_from_td_month(timezone, type,self):
+ ks_date_data = {}
+
+ date = datetime.now(pytz.timezone(timezone))
+ year = date.year
+ month = date.month
+ start_date = datetime(year, month, 1)
+ end_date = date
+ if type == 'date':
+ ks_date_data["selected_start_date"] = datetime.strptime(start_date.strftime("%Y-%m-%d"), '%Y-%m-%d')
+ ks_date_data["selected_end_date"] = datetime.strptime(end_date.strftime("%Y-%m-%d"), '%Y-%m-%d')
+ else:
+ ks_date_data["selected_start_date"] = ks_convert_into_utc(start_date, timezone)
+ ks_date_data["selected_end_date"] = ks_convert_into_utc(end_date, timezone)
+ return ks_date_data
+def ks_get_date_range_from_td_week(timezone, type,self):
+ ks_date_data = {}
+ lang = self.env['res.lang']._lang_get(self.env.user.lang)
+ week_start = lang.week_start
+ start_Date = rrule.weekday(int(week_start) - 1)
+ start_date = datetime.today() + relativedelta(weekday=start_Date(-1))
+ end_date = datetime.now(pytz.timezone(timezone))
+ start_date = datetime.strptime(start_date.strftime("%Y-%m-%d"), '%Y-%m-%d')
+ if type == 'date':
+ ks_date_data["selected_start_date"] = start_date
+ end_date = datetime.strptime(end_date.strftime("%Y-%m-%d"), '%Y-%m-%d')
+ ks_date_data["selected_end_date"] = end_date
+ else:
+ ks_date_data["selected_start_date"] = ks_convert_into_utc(start_date, timezone)
+ ks_date_data["selected_end_date"] = ks_convert_into_utc(end_date, timezone)
+ return ks_date_data
+def ks_get_date_range_from_td_quarter(timezone, type,self):
+ ks_date_data = {}
+ date = datetime.now(pytz.timezone(timezone))
+ year = date.year
+ quarter = int((date.month - 1) / 3) + 1
+ start_date = datetime(year, 3 * quarter - 2, 1)
+ end_date = date
+ if type == 'date':
+ ks_date_data["selected_start_date"] = datetime.strptime(start_date.strftime("%Y-%m-%d"), '%Y-%m-%d')
+ ks_date_data["selected_end_date"] = datetime.strptime(end_date.strftime("%Y-%m-%d"), '%Y-%m-%d')
+ else:
+ ks_date_data["selected_start_date"] = ks_convert_into_utc(start_date, timezone)
+ ks_date_data["selected_end_date"] = ks_convert_into_utc(end_date, timezone)
+ return ks_date_data
# Last Specific Days Ranges : 7, 30, 90, 365
@@ -65,18 +131,18 @@ def ks_date_series_l(ks_date_selection, timezone, type, self=None):
# Current Date Ranges : Week, Month, Quarter, year
def ks_date_series_t(ks_date_selection, timezone, type, self=None):
- return eval("ks_get_date_range_from_" + ks_date_selection)("current", timezone, type,self)
-
+ ks_function_name = globals()["ks_get_date_range_from_" + ks_date_selection]
+ return ks_function_name("current", timezone, type, self)
# Previous Date Ranges : Week, Month, Quarter, year
def ks_date_series_ls(ks_date_selection, timezone, type,self=None):
- return eval("ks_get_date_range_from_" + ks_date_selection)("previous", timezone, type,self)
-
+ ks_function_name = globals()["ks_get_date_range_from_" + ks_date_selection]
+ return ks_function_name("previous", timezone, type, self)
# Next Date Ranges : Day, Week, Month, Quarter, year
def ks_date_series_n(ks_date_selection, timezone, type,self=None):
- return eval("ks_get_date_range_from_" + ks_date_selection)("next", timezone, type, self)
-
+ ks_function_name = globals()["ks_get_date_range_from_" + ks_date_selection]
+ return ks_function_name("next", timezone, type, self)
def ks_get_date_range_from_day(date_state, timezone, type,self):
ks_date_data = {}
@@ -234,6 +300,17 @@ def ks_get_date_range_from_pastwithout(date_state, self_tz, type,self):
else:
ks_date_data["selected_end_date"] = ks_convert_into_utc(date, self_tz)
return ks_date_data
+def ks_get_date_range_from_pastuntil(date_state, self_tz, type, self):
+ ks_date_data = {}
+ date = datetime.now(pytz.timezone(self_tz))
+ date = date - timedelta(days=30)
+ if type == 'date':
+ ks_date_data["selected_end_date"] = datetime.strptime(date.strftime("%Y-%m-%d"), '%Y-%m-%d')
+ else:
+ ks_date_data["selected_end_date"] = ks_convert_into_utc(date, self_tz)
+ ks_date_data["selected_start_date"] = False
+ return ks_date_data
+
def ks_get_date_range_from_future(date_state, self_tz, type,self):
diff --git a/odex25_base/ks_dashboard_ninja/controllers/__init__.py b/odex25_base/ks_dashboard_ninja/controllers/__init__.py
index ebae4a8ed..18e8d57e5 100644
--- a/odex25_base/ks_dashboard_ninja/controllers/__init__.py
+++ b/odex25_base/ks_dashboard_ninja/controllers/__init__.py
@@ -1,4 +1,4 @@
from . import ks_chart_export
from . import ks_list_export
-
-from . import ks_dashboard_export
\ No newline at end of file
+from . import ks_dashboard_export
+from . import ks_login
\ No newline at end of file
diff --git a/odex25_base/ks_dashboard_ninja/controllers/ks_list_export.py b/odex25_base/ks_dashboard_ninja/controllers/ks_list_export.py
index c9620837f..c81ae6afa 100644
--- a/odex25_base/ks_dashboard_ninja/controllers/ks_list_export.py
+++ b/odex25_base/ks_dashboard_ninja/controllers/ks_list_export.py
@@ -27,8 +27,8 @@ class KsListExport(ExportFormat, http.Controller):
'context', 'params')(
params)
list_data = json.loads(list_data)
+ item = request.env['ks_dashboard_ninja.item'].browse(int(item_id))
if ks_export_boolean:
- item = request.env['ks_dashboard_ninja.item'].browse(int(item_id))
ks_timezone = item._context.get('tz') or item.env.user.tz
if not ks_timezone:
ks_tzone = os.environ.get('TZ')
diff --git a/odex25_base/ks_dashboard_ninja/controllers/ks_login.py b/odex25_base/ks_dashboard_ninja/controllers/ks_login.py
new file mode 100644
index 000000000..be9b0ef48
--- /dev/null
+++ b/odex25_base/ks_dashboard_ninja/controllers/ks_login.py
@@ -0,0 +1,37 @@
+from odoo.http import Controller, request, route
+from odoo.addons.web.controllers.main import Home
+from odoo import http, tools
+
+
+class KsHome(Home):
+
+ # this is for handle the color and font at login time
+ @http.route('/web/login', type='http', auth="none")
+ def web_login(self, redirect=None, **kw):
+ res = super(KsHome, self).web_login(redirect, **kw)
+
+ ksis_enterprise = request.env['res.company'].sudo().ks_check_is_enterprise()
+
+
+ if ksis_enterprise:
+ template = request.env.ref("ks_dashboard_ninja.ks_dn_load_assets")
+ template.sudo().write({
+ 'active': False
+ })
+ active_template = request.env.ref("ks_dashboard_ninja.ks_dn_load_assets_en")
+ active_template.sudo().write({
+ 'active': True
+ })
+ else:
+ template = request.env.ref("ks_dashboard_ninja.ks_dn_load_assets_en")
+ template.sudo().write({
+ 'active': False
+ })
+ active_template = request.env.ref("ks_dashboard_ninja.ks_dn_load_assets")
+ active_template.sudo().write({
+ 'active': True
+ })
+ return res
+
+
+
diff --git a/odex25_base/ks_dashboard_ninja/data/dn_data.xml b/odex25_base/ks_dashboard_ninja/data/dn_data.xml
new file mode 100644
index 000000000..040edcef7
--- /dev/null
+++ b/odex25_base/ks_dashboard_ninja/data/dn_data.xml
@@ -0,0 +1,9 @@
+
+
+
+