diff --git a/pos_night_mode/README.rst b/pos_night_mode/README.rst new file mode 100755 index 000000000..95ffbf6c4 --- /dev/null +++ b/pos_night_mode/README.rst @@ -0,0 +1,48 @@ +.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 + +POS NIGHT MODE +======================= +This module helps you change the color theme of the pose to dark. + +Configuration +============= +Install this module. After that you will see a button from POS Chrome. Click on it to enable dark mode. + +Company +------- +* `Cybrosys Techno Solutions `__ + +License +------- +GNU Affero General Public License v3.0 (AGPL v3) +(https://www.gnu.org/licenses/agpl-3.0-standalone.html) + +Credits +------- +Developer: version 16: Ramees Jaman KT @cybrosys, + version 17: Ajith V @cybrosys, +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/pos_night_mode/__init__.py b/pos_night_mode/__init__.py new file mode 100755 index 000000000..d835c574d --- /dev/null +++ b/pos_night_mode/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies(). +# Author: Ajith V (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL 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 AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +################################################################################ +from . import models diff --git a/pos_night_mode/__manifest__.py b/pos_night_mode/__manifest__.py new file mode 100755 index 000000000..3868229c5 --- /dev/null +++ b/pos_night_mode/__manifest__.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies(). +# Author: Ajith V (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL 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 AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +################################################################################ +{ + 'name': 'POS Night Mode Theme', + 'version': '17.0.1.0.0', + 'summery': 'This module helps you change the color theme of the poin of sale to dark', + 'description': + """This module facilitates the transformation of the point-of-sale + color theme to a dark mode for enhanced visual comfort and aesthetics.""", + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': 'https://www.cybrosys.com', + "category": "Themes/Backend", + 'depends': ['base', 'point_of_sale'], + 'assets': { + 'point_of_sale._assets_pos': [ + 'pos_night_mode/static/src/js/**/*.js', + 'pos_night_mode/static/src/xml/button.xml', + 'pos_night_mode/static/src/scss/theme_style.scss' + ], + }, + 'images': [ + 'static/description/banner.jpg', + 'static/description/theme_screenshot.jpg', + ], + 'license': 'AGPL-3', + 'installable': True, + 'auto_install': False, + 'application': False, +} diff --git a/pos_night_mode/doc/RELEASE_NOTES.md b/pos_night_mode/doc/RELEASE_NOTES.md new file mode 100755 index 000000000..30d5b5e3d --- /dev/null +++ b/pos_night_mode/doc/RELEASE_NOTES.md @@ -0,0 +1,7 @@ +## Module + +#### 30.01.2024 +#### Version 17.0.1.0.0 +#### ADD + +- Initial commit POS Night Mode diff --git a/pos_night_mode/models/__init__.py b/pos_night_mode/models/__init__.py new file mode 100755 index 000000000..a9b6d5871 --- /dev/null +++ b/pos_night_mode/models/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies(). +# Author: Ajith V (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL 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 AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +################################################################################ +from . import res_users diff --git a/pos_night_mode/models/res_users.py b/pos_night_mode/models/res_users.py new file mode 100755 index 000000000..f901f5c8c --- /dev/null +++ b/pos_night_mode/models/res_users.py @@ -0,0 +1,48 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies(). +# Author: Ajith V (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL 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 AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +################################################################################ +from odoo import api, fields, models + + +class Users(models.Model): + """Inherit the res.Users model and add a new field""" + _inherit = 'res.users' + + """ Theme Config for night mode """ + mode_check = fields.Boolean(string="Active", + help="Enable / Disable checkbox") + + @api.model + def get_active(self): + """get the value of the mode_check field""" + return self.env.user.mode_check + + @api.model + def set_active(self): + """Set up the mode_check value""" + self.env.user.mode_check = True + return self.env.user.mode_check + + @api.model + def set_deactivate(self): + """Deactivating the value of mode check field""" + self.env.user.mode_check = False + return self.env.user.mode_check diff --git a/pos_night_mode/static/description/assets/cybro-icon.png b/pos_night_mode/static/description/assets/cybro-icon.png new file mode 100755 index 000000000..06e73e11d Binary files /dev/null and b/pos_night_mode/static/description/assets/cybro-icon.png differ diff --git a/pos_night_mode/static/description/assets/cybro-odoo.png b/pos_night_mode/static/description/assets/cybro-odoo.png new file mode 100755 index 000000000..ed02e07a4 Binary files /dev/null and b/pos_night_mode/static/description/assets/cybro-odoo.png differ diff --git a/pos_night_mode/static/description/assets/hero.gif b/pos_night_mode/static/description/assets/hero.gif new file mode 100755 index 000000000..94dde73a6 Binary files /dev/null and b/pos_night_mode/static/description/assets/hero.gif differ diff --git a/pos_night_mode/static/description/assets/icons/check.png b/pos_night_mode/static/description/assets/icons/check.png new file mode 100755 index 000000000..c8e85f51d Binary files /dev/null and b/pos_night_mode/static/description/assets/icons/check.png differ diff --git a/pos_night_mode/static/description/assets/icons/chevron.png b/pos_night_mode/static/description/assets/icons/chevron.png new file mode 100755 index 000000000..2089293d6 Binary files /dev/null and b/pos_night_mode/static/description/assets/icons/chevron.png differ diff --git a/pos_night_mode/static/description/assets/icons/cogs.png b/pos_night_mode/static/description/assets/icons/cogs.png new file mode 100755 index 000000000..95d0bad62 Binary files /dev/null and b/pos_night_mode/static/description/assets/icons/cogs.png differ diff --git a/pos_night_mode/static/description/assets/icons/consultation.png b/pos_night_mode/static/description/assets/icons/consultation.png new file mode 100755 index 000000000..8319d4baa Binary files /dev/null and b/pos_night_mode/static/description/assets/icons/consultation.png differ diff --git a/pos_night_mode/static/description/assets/icons/down.svg b/pos_night_mode/static/description/assets/icons/down.svg new file mode 100755 index 000000000..f21c36271 --- /dev/null +++ b/pos_night_mode/static/description/assets/icons/down.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/pos_night_mode/static/description/assets/icons/ecom-black.png b/pos_night_mode/static/description/assets/icons/ecom-black.png new file mode 100755 index 000000000..a9385ff13 Binary files /dev/null and b/pos_night_mode/static/description/assets/icons/ecom-black.png differ diff --git a/pos_night_mode/static/description/assets/icons/education-black.png b/pos_night_mode/static/description/assets/icons/education-black.png new file mode 100755 index 000000000..3eb09b27b Binary files /dev/null and b/pos_night_mode/static/description/assets/icons/education-black.png differ diff --git a/pos_night_mode/static/description/assets/icons/faq.png b/pos_night_mode/static/description/assets/icons/faq.png new file mode 100755 index 000000000..4250b5b81 Binary files /dev/null and b/pos_night_mode/static/description/assets/icons/faq.png differ diff --git a/pos_night_mode/static/description/assets/icons/feature.png b/pos_night_mode/static/description/assets/icons/feature.png new file mode 100755 index 000000000..ac7a785c0 Binary files /dev/null and b/pos_night_mode/static/description/assets/icons/feature.png differ diff --git a/pos_night_mode/static/description/assets/icons/hotel-black.png b/pos_night_mode/static/description/assets/icons/hotel-black.png new file mode 100755 index 000000000..130f613be Binary files /dev/null and b/pos_night_mode/static/description/assets/icons/hotel-black.png differ diff --git a/pos_night_mode/static/description/assets/icons/license.png b/pos_night_mode/static/description/assets/icons/license.png new file mode 100755 index 000000000..a5869797e Binary files /dev/null and b/pos_night_mode/static/description/assets/icons/license.png differ diff --git a/pos_night_mode/static/description/assets/icons/lifebuoy.png b/pos_night_mode/static/description/assets/icons/lifebuoy.png new file mode 100755 index 000000000..658d56ccc Binary files /dev/null and b/pos_night_mode/static/description/assets/icons/lifebuoy.png differ diff --git a/pos_night_mode/static/description/assets/icons/manufacturing-black.png b/pos_night_mode/static/description/assets/icons/manufacturing-black.png new file mode 100755 index 000000000..697eb0e9f Binary files /dev/null and b/pos_night_mode/static/description/assets/icons/manufacturing-black.png differ diff --git a/pos_night_mode/static/description/assets/icons/pos-black.png b/pos_night_mode/static/description/assets/icons/pos-black.png new file mode 100755 index 000000000..97c0f90c1 Binary files /dev/null and b/pos_night_mode/static/description/assets/icons/pos-black.png differ diff --git a/pos_night_mode/static/description/assets/icons/puzzle.png b/pos_night_mode/static/description/assets/icons/puzzle.png new file mode 100755 index 000000000..65cf854e7 Binary files /dev/null and b/pos_night_mode/static/description/assets/icons/puzzle.png differ diff --git a/pos_night_mode/static/description/assets/icons/restaurant-black.png b/pos_night_mode/static/description/assets/icons/restaurant-black.png new file mode 100755 index 000000000..4a35eb939 Binary files /dev/null and b/pos_night_mode/static/description/assets/icons/restaurant-black.png differ diff --git a/pos_night_mode/static/description/assets/icons/screenshot.png b/pos_night_mode/static/description/assets/icons/screenshot.png new file mode 100755 index 000000000..cef272529 Binary files /dev/null and b/pos_night_mode/static/description/assets/icons/screenshot.png differ diff --git a/pos_night_mode/static/description/assets/icons/service-black.png b/pos_night_mode/static/description/assets/icons/service-black.png new file mode 100755 index 000000000..301ab51cb Binary files /dev/null and b/pos_night_mode/static/description/assets/icons/service-black.png differ diff --git a/pos_night_mode/static/description/assets/icons/support.png b/pos_night_mode/static/description/assets/icons/support.png new file mode 100755 index 000000000..4f18b8b82 Binary files /dev/null and b/pos_night_mode/static/description/assets/icons/support.png differ diff --git a/pos_night_mode/static/description/assets/icons/test-1 - Copy.png b/pos_night_mode/static/description/assets/icons/test-1 - Copy.png new file mode 100755 index 000000000..f6a902663 Binary files /dev/null and b/pos_night_mode/static/description/assets/icons/test-1 - Copy.png differ diff --git a/pos_night_mode/static/description/assets/icons/test-2.png b/pos_night_mode/static/description/assets/icons/test-2.png new file mode 100755 index 000000000..08022c474 Binary files /dev/null and b/pos_night_mode/static/description/assets/icons/test-2.png differ diff --git a/pos_night_mode/static/description/assets/icons/trading-black.png b/pos_night_mode/static/description/assets/icons/trading-black.png new file mode 100755 index 000000000..9398ba2f1 Binary files /dev/null and b/pos_night_mode/static/description/assets/icons/trading-black.png differ diff --git a/pos_night_mode/static/description/assets/icons/training.png b/pos_night_mode/static/description/assets/icons/training.png new file mode 100755 index 000000000..884ca024d Binary files /dev/null and b/pos_night_mode/static/description/assets/icons/training.png differ diff --git a/pos_night_mode/static/description/assets/icons/update.png b/pos_night_mode/static/description/assets/icons/update.png new file mode 100755 index 000000000..ecbc5a01a Binary files /dev/null and b/pos_night_mode/static/description/assets/icons/update.png differ diff --git a/pos_night_mode/static/description/assets/icons/user.png b/pos_night_mode/static/description/assets/icons/user.png new file mode 100755 index 000000000..6ffb23d9f Binary files /dev/null and b/pos_night_mode/static/description/assets/icons/user.png differ diff --git a/pos_night_mode/static/description/assets/icons/video.png b/pos_night_mode/static/description/assets/icons/video.png new file mode 100755 index 000000000..576705b17 Binary files /dev/null and b/pos_night_mode/static/description/assets/icons/video.png differ diff --git a/pos_night_mode/static/description/assets/icons/whatsapp.png b/pos_night_mode/static/description/assets/icons/whatsapp.png new file mode 100755 index 000000000..d513a5356 Binary files /dev/null and b/pos_night_mode/static/description/assets/icons/whatsapp.png differ diff --git a/pos_night_mode/static/description/assets/icons/wrench.png b/pos_night_mode/static/description/assets/icons/wrench.png new file mode 100755 index 000000000..6c04dea0f Binary files /dev/null and b/pos_night_mode/static/description/assets/icons/wrench.png differ diff --git a/pos_night_mode/static/description/assets/night_mode_v16-.png b/pos_night_mode/static/description/assets/night_mode_v16-.png new file mode 100755 index 000000000..dc448b538 Binary files /dev/null and b/pos_night_mode/static/description/assets/night_mode_v16-.png differ diff --git a/pos_night_mode/static/description/assets/screenshots/all_orders.png b/pos_night_mode/static/description/assets/screenshots/all_orders.png new file mode 100755 index 000000000..b3a066885 Binary files /dev/null and b/pos_night_mode/static/description/assets/screenshots/all_orders.png differ diff --git a/pos_night_mode/static/description/assets/screenshots/customer_note.png b/pos_night_mode/static/description/assets/screenshots/customer_note.png new file mode 100755 index 000000000..515db6386 Binary files /dev/null and b/pos_night_mode/static/description/assets/screenshots/customer_note.png differ diff --git a/pos_night_mode/static/description/assets/screenshots/customer_screen.png b/pos_night_mode/static/description/assets/screenshots/customer_screen.png new file mode 100755 index 000000000..ef11f0d7f Binary files /dev/null and b/pos_night_mode/static/description/assets/screenshots/customer_screen.png differ diff --git a/pos_night_mode/static/description/assets/screenshots/main.png b/pos_night_mode/static/description/assets/screenshots/main.png new file mode 100755 index 000000000..e4e7e6b65 Binary files /dev/null and b/pos_night_mode/static/description/assets/screenshots/main.png differ diff --git a/pos_night_mode/static/description/assets/screenshots/orders.png b/pos_night_mode/static/description/assets/screenshots/orders.png new file mode 100755 index 000000000..a826e70a0 Binary files /dev/null and b/pos_night_mode/static/description/assets/screenshots/orders.png differ diff --git a/pos_night_mode/static/description/assets/screenshots/payment_screen.png b/pos_night_mode/static/description/assets/screenshots/payment_screen.png new file mode 100755 index 000000000..7032c2ab4 Binary files /dev/null and b/pos_night_mode/static/description/assets/screenshots/payment_screen.png differ diff --git a/pos_night_mode/static/description/assets/screenshots/product_info.png b/pos_night_mode/static/description/assets/screenshots/product_info.png new file mode 100755 index 000000000..15b766f93 Binary files /dev/null and b/pos_night_mode/static/description/assets/screenshots/product_info.png differ diff --git a/pos_night_mode/static/description/assets/screenshots/reciept_screen.png b/pos_night_mode/static/description/assets/screenshots/reciept_screen.png new file mode 100755 index 000000000..092477216 Binary files /dev/null and b/pos_night_mode/static/description/assets/screenshots/reciept_screen.png differ diff --git a/pos_night_mode/static/description/assets/y18.jpg b/pos_night_mode/static/description/assets/y18.jpg new file mode 100755 index 000000000..eea1714f2 Binary files /dev/null and b/pos_night_mode/static/description/assets/y18.jpg differ diff --git a/pos_night_mode/static/description/banner.jpg b/pos_night_mode/static/description/banner.jpg new file mode 100755 index 000000000..a503eb2d4 Binary files /dev/null and b/pos_night_mode/static/description/banner.jpg differ diff --git a/pos_night_mode/static/description/icon.png b/pos_night_mode/static/description/icon.png new file mode 100755 index 000000000..93d80d4e3 Binary files /dev/null and b/pos_night_mode/static/description/icon.png differ diff --git a/pos_night_mode/static/description/index.html b/pos_night_mode/static/description/index.html new file mode 100755 index 000000000..23935691f --- /dev/null +++ b/pos_night_mode/static/description/index.html @@ -0,0 +1,726 @@ + +
+
+
+

+ POS Night Mode Theme +

+

+ Pos Night Mode Theme Odoo V17.

+
+ + +
+

+ The app enables a user-friendly basic night mode theme for Odoo 17 + POS community and enterprise editions. + Enabling the Night mode theme in Odoo is very simple. + To enable, Click on the night mode icon displayed in the Chrome + section of POS App.To disable, Click again + the same icon. +

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

+ KEY Highlights +

+ + +
+
+
+
+ +
+
+

+ Easy to enable + / disable night mode.

+

You can + enable this theme by clicking the toggle button in + Chrome.

+
+
+
+
+
+
+ +
+
+

+ Night Mode For + All Pos Screens

+

The + theme will switch all Pos screens to night mode.

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

+ Screenshots +

+
+
+

+ Order Screen

+
+
+ +
+
+

+ Payment Screen

+
+
+ +
+
+

+ Receipt Screen

+
+
+ +
+
+

+ Popups

+
+
+ +
+
+

+ Product Info

+
+
+ +
+
+

+ Orders

+
+
+ +
+
+

+ Customer List Screen

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

Related Modules

+

Explore our related modules

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

+ 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? Get in touch. +

+
+
+
+
+
+ +
+
+

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/pos_night_mode/static/description/theme_screenshot.jpg b/pos_night_mode/static/description/theme_screenshot.jpg new file mode 100755 index 000000000..45026ddfb Binary files /dev/null and b/pos_night_mode/static/description/theme_screenshot.jpg differ diff --git a/pos_night_mode/static/src/js/Navbar_inherit.js b/pos_night_mode/static/src/js/Navbar_inherit.js new file mode 100755 index 000000000..caa7368bf --- /dev/null +++ b/pos_night_mode/static/src/js/Navbar_inherit.js @@ -0,0 +1,125 @@ +/** @odoo-module **/ +import { Navbar } from "@point_of_sale/app/navbar/navbar"; +import { jsonrpc } from "@web/core/network/rpc_service"; +import { patch } from "@web/core/utils/patch"; +import { useService } from "@web/core/utils/hooks"; + +patch(Navbar.prototype, { // include a function in navbar in pos + setup() { + super.setup() + this.orm = useService("orm"); + var self = this; + jsonrpc('/web/dataset/call_kw',{ + model:'res.users',method:'get_active', + args:[], + kwargs:{}, + }).then((res)=>{ + if(res){ + $("#fa-icon").removeClass("fa fa-moon-o").removeClass("moon-color").addClass("fa fa-sun-o").addClass("sun-color"); + self._OnNightTrue(); + } + else{ + $("#fa-icon").removeClass("sun-color").removeClass("fa fa-sun-o").addClass("fa fa-moon-o").addClass("moon-color"); + } + }); + }, + async OnClickMoon(){ //Added a function for click button change the pos color to black + var self = this; + var $buttonToggle = $('#button_toggle'); + var isPressed = $buttonToggle.attr('aria-pressed') === "true"; + $buttonToggle.attr('aria-pressed', !isPressed); + if(isPressed){ + $("#fa-icon").removeClass("fa fa-moon-o").removeClass("moon-color").addClass("fa fa-sun-o").addClass("sun-color"); + await jsonrpc('/web/dataset/call_kw',{ + model:'res.users',method: 'set_active', + args:[],kwargs:{}, + }).then((response) =>{ + self._OnNightTrue() + }); + } + else{ + $("#fa-icon").removeClass("sun-color").removeClass("fa fa-sun-o").addClass("fa fa-moon-o").addClass("moon-color"); + await jsonrpc('/web/dataset/call_kw',{ + model: 'res.users',method: 'set_deactivate', + args:[], kwargs:{}, + }).then((response) =>{ + $('style').remove() + }); + } + }, + async _OnNightTrue(){ //Added a function for click button change the pos color to black + var pos_element = document.querySelector('.pos') + var pos_product_list_modifier = document.createElement('style') + pos_product_list_modifier.innerHTML = '.pos{color:white;}'+'.pos .product { background-color:#3c3f41 !important;border:'+ + 'thin solid white;border-radius: 5px;}.pos .product .product-img img {background-image:'+ + 'linear-gradient(to bottom,white,#3c3f41) !important;}'+ + '.pos .product-list-container{background-color:#3c3f41 !important;}'+ + '.pos .product .price-tag {color:#F45976 !important;}'+ + '.pos .product .product-name{color:white}'+ + '.pos .order{background-color:#3c3f41}'+ + '.pos .rightpane{background-color:#3c3f41}'+ + '.pos .rightpane-header{background-color:#3c3f41;}'+ + '.pos .pos-content .product-screen .leftpane .pads .control-buttons .fw-bolder{color:white;}'+ + '.pos .breadcrumb-button{color:white}'+ + '.pos .category-simple-button{background-color:#3c3f41 !important;}'+ + '.pos .sb-product .pos-search-bar{background-color:#3c3f41 !important;}'+ + '.pos .rightpane-header .pos-search-bar input, .pos .partnerlist-screen'+ + '.pos-search-bar input{color:#adb7c1}'+ + '.pos .order .orderline .selected{background-color:darkgray !important}'+ + '.pos .order .orderline .info-list{color:#B3B7BF !important}'+ + '.pos .order .orderline .info-list em{color:#B3B7BF !important}'+ + '.pos .control-button{background-color:#3c3f41 !important;}'+ + '.pos .mode-button.selected-mode{background-color:#707375 !important;}'+ + '.pos .numpad button{background-color:#3c3f41;color:white;}'+ + '.pos .numpad button:hover{background-color:#f45976 !important;}'+ + '.pos .button.validation:hover{background-color:#f45976 !important;}'+ + '.pos .actionpad .button{background-color:#3c3f41;color:white;}'+ + '.pos .actionpad .button:hover{background-color:#f45976 !important;}'+ + '.pos .control-button:hover{background-color:#f45976 !important;}'+ + '.pos .modal-dialog .popup{background-color:#1e1f20 !important;}'+ + '.pos .popup .button{background:#8F3536;color: white !important};'+ + '.ticket-screen .controls button {background-color:white;color:black;}'+ + '.ticket-screen .pos-search-bar .filter{color:black}'+ + '.ticket-screen .pos-search-bar .filter .options{border-radius:5px}'+ + '.pos .order-container{background-color:#3c3f41 !important}'+ + '.pos .order-summary{background-color:#3c3f41 !important}'+ + '.pos .order-summary .subentry {color:white !important}'+ + '.pos .pos-content .product-screen .leftpane .pads .control-button .fa-undo{color:white !important}'+ + '.pos .partner-window{color:black;}'+ + '.pos .partnerlist-screen .partner-list thead > tr{background-color:#3c3f41;color:white}'+ + '.pos .partnerlist-screen tr.partner-line:hover{background-color:#f45976}'+ + '.pos .partner-list tr.partner-line.highlight{background-color:#017e84}'+ + '.screen .screen-content{background-color:#e0e2e6}'+ + '.pos .partnerlist-screen .pos-search-bar i{color:black;}'+ + '.pos .partnerlist-screen .pos-search-bar input{color:#2a2b2d;}'+ + '.screen .top-content .button.highlight{background-color:#017e84 !important;border-color:#3c3f41 !important;}'+ + '.screen .top-content{background-color:#3c3f41}'+ + '.pos .close-pos-popup header{background-color:rgb(56, 57, 58)}'+ + '.pos .popup .title{background-color:rgb(56, 57, 58)}'+ + '.pos .close-pos-popup .closing-notes{background-color:#c1c3c6}'+ + '.pos .opening-cash-control .opening-cash-notes{background-color:#c1c3c6}'+ + '.payment-screen .main-content{background:#3c3f41}'+ + '.paymentmethods .button{background:#3c3f41}'+ + '.pos .paymentline{background:#3c3f41}'+ + '.pos .paymentline.selected{background:#707375}'+ + '.pos .screen .button.next:not(.highlight){background:#e6e3e2;color:#017e84;}'+ + '.receipt-screen .default-view{background:#3c3f41}'+ + '.receipt-screen .default-view .actions .send-email input{background:#666668;color:white;}'+ + '.receipt-screen .default-view .actions .buttons .button{background:#666668}'+ + '.receipt-screen .default-view .actions .send-email button.send{background:#017e84;color:black}'+ + '.pos .pos-receipt-container > div{color:black}'+ + '.pos .popup.popup-error .button{background:#8F3536}'+ + '.pos .orders .order-row:nth-child(n){background:#3c3f41}'+ + '.pos .orders .order-row.highlight{background:#017e84}'+ + '.pos .orders .order-row:hover{background:#f45976;}'+ + '.pos .pos-content .product-screen .leftpane .bg-100:{background-color:#c1c3c6 !important}'+ + '.payment-screen .payment-buttons .button{background:#3c3f41;color:white;}'+ + '.payment-screen .payment-buttons .button:hover{background:#f45976}'+ + '.modal-title{color:white;}'+ + '.paymentmethod{color:white;}'+ + '.pos-receipt .order-container .orderline {background-color:white;}'+ + '.payment-infos{background-color:#71639e;}' + ; + pos_element.parentNode.insertBefore(pos_product_list_modifier, pos_element); + }, +}); diff --git a/pos_night_mode/static/src/scss/theme_style.scss b/pos_night_mode/static/src/scss/theme_style.scss new file mode 100755 index 000000000..e5c5594d9 --- /dev/null +++ b/pos_night_mode/static/src/scss/theme_style.scss @@ -0,0 +1,13 @@ +.fa-sun-o{ + color:#e8a214; + font-size: 130% !important; + background:white; +} +.fa-moon-o{ + font-size: 130% !important; + color:black; +} +#button_toggle{ + border: none; + background: none; +} diff --git a/pos_night_mode/static/src/xml/button.xml b/pos_night_mode/static/src/xml/button.xml new file mode 100755 index 000000000..970a9bab9 --- /dev/null +++ b/pos_night_mode/static/src/xml/button.xml @@ -0,0 +1,15 @@ +