diff --git a/addons_extensions/base_custom/__init__.py b/addons_extensions/base_custom/__init__.py new file mode 100644 index 000000000..43559cd9a --- /dev/null +++ b/addons_extensions/base_custom/__init__.py @@ -0,0 +1 @@ +from . import models \ No newline at end of file diff --git a/addons_extensions/base_custom/__manifest__.py b/addons_extensions/base_custom/__manifest__.py new file mode 100644 index 000000000..4a5527eb0 --- /dev/null +++ b/addons_extensions/base_custom/__manifest__.py @@ -0,0 +1,31 @@ +# -*- coding: utf-8 -*- + +{ + 'name': 'Base Changes', + 'category': 'Base', + 'version': '1.1', + 'author': 'Seshi Kanth', + 'summary': 'Changes of the form', + 'description': 'This module contains form changes.', + 'depends': [ + 'base', + 'web', + ], + + 'data': [ + # 'views/user_menu.xml', + ], + + 'assets': { + 'web.assets_backend': [ + 'base_custom/static/src/css/backend.css', + 'base_custom/static/src/js/user_menu_patch.js', + 'base_custom/static/src/js/hide_user_menu.js', + 'base_custom/static/src/xml/user_menu.xml', + ], + }, + + 'installable': True, + 'application': True, + 'license': 'LGPL-3', +} \ No newline at end of file diff --git a/addons_extensions/base_custom/models/__init__.py b/addons_extensions/base_custom/models/__init__.py new file mode 100644 index 000000000..8164bedcc --- /dev/null +++ b/addons_extensions/base_custom/models/__init__.py @@ -0,0 +1 @@ +from . import ir_http \ No newline at end of file diff --git a/addons_extensions/base_custom/models/ir_http.py b/addons_extensions/base_custom/models/ir_http.py new file mode 100644 index 000000000..8d4b1cdb3 --- /dev/null +++ b/addons_extensions/base_custom/models/ir_http.py @@ -0,0 +1,17 @@ +from odoo import models + + +class IrHttp(models.AbstractModel): + _inherit = "ir.http" + + def session_info(self): + session_info = super().session_info() + + employee = self.env.user.employee_id + + session_info.update({ + "employee_name": employee.name or self.env.user.name, + "employee_designation": employee.job_id.name if employee.job_id else "", + }) + + return session_info \ No newline at end of file diff --git a/addons_extensions/base_custom/static/src/css/backend.css b/addons_extensions/base_custom/static/src/css/backend.css new file mode 100644 index 000000000..5db0b894a --- /dev/null +++ b/addons_extensions/base_custom/static/src/css/backend.css @@ -0,0 +1,23 @@ +.o_switch_company_menu .oe_topbar_name{ + display: none !important; +} + +.oe_topbar_name{ + display:flex; + flex-direction:column; + line-height:1.2; +} + +.oe_topbar_name .fw-bold{ + font-size:13px; + font-weight:600; +} + +.oe_topbar_name .designation{ + font-size:11px; + color:#7b7b7b; +} + +.text-muted { + color: #000000 !important; +} \ No newline at end of file diff --git a/addons_extensions/base_custom/static/src/js/hide_user_menu.js b/addons_extensions/base_custom/static/src/js/hide_user_menu.js new file mode 100644 index 000000000..3316e803f --- /dev/null +++ b/addons_extensions/base_custom/static/src/js/hide_user_menu.js @@ -0,0 +1,18 @@ +/** @odoo-module **/ + +import { registry } from "@web/core/registry"; + +const userMenuRegistry = registry.category("user_menuitems"); + +const itemsToHide = [ + "documentation", + "support", + "shortcuts", + "odoo_account", +]; + +for (const item of itemsToHide) { + if (userMenuRegistry.contains(item)) { + userMenuRegistry.remove(item); + } +} \ No newline at end of file diff --git a/addons_extensions/base_custom/static/src/js/user_menu_patch.js b/addons_extensions/base_custom/static/src/js/user_menu_patch.js new file mode 100644 index 000000000..4c8225155 --- /dev/null +++ b/addons_extensions/base_custom/static/src/js/user_menu_patch.js @@ -0,0 +1,23 @@ +/** @odoo-module **/ + +import { patch } from "@web/core/utils/patch"; +import { UserMenu } from "@web/webclient/user_menu/user_menu"; +import { session } from "@web/session"; + +patch(UserMenu.prototype, { + + setup() { + super.setup(); + + this.employeeName = session.employee_name; + this.employeeDesignation = session.employee_designation; + }, + + get employeeInfo() { + return { + employeeName: this.employeeName, + employeeDesignation: this.employeeDesignation, + }; + }, + +}); \ No newline at end of file diff --git a/addons_extensions/base_custom/static/src/xml/user_menu.xml b/addons_extensions/base_custom/static/src/xml/user_menu.xml new file mode 100644 index 000000000..f271304a6 --- /dev/null +++ b/addons_extensions/base_custom/static/src/xml/user_menu.xml @@ -0,0 +1,28 @@ + + + + + + + + + + +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
\ No newline at end of file diff --git a/addons_extensions/hrms_emp_dashboard/static/src/xml/hrms_emp_dashboard.xml b/addons_extensions/hrms_emp_dashboard/static/src/xml/hrms_emp_dashboard.xml index 5c60d1564..3b361e71a 100644 --- a/addons_extensions/hrms_emp_dashboard/static/src/xml/hrms_emp_dashboard.xml +++ b/addons_extensions/hrms_emp_dashboard/static/src/xml/hrms_emp_dashboard.xml @@ -52,7 +52,7 @@
- + Period