diff --git a/pos_products_based_on_time/README.rst b/pos_products_based_on_time/README.rst new file mode 100755 index 000000000..ec4501008 --- /dev/null +++ b/pos_products_based_on_time/README.rst @@ -0,0 +1,49 @@ +.. image:: https://img.shields.io/badge/license-AGPL--3-blue.svg + :target: https://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 + +POS HAPPY HOURS | POS TIME BASED PRODUCTS +========================================= +This module enables you to display time-based products in POS. The item will +vary as time goes on. + +Configuration +============= +The user should be added to the security group: Administrator(Point of sale) +in order to get access to the new menu. + +Company +------- +* `Cybrosys Techno Solutions `__ + +License +------- +Affero General Public License v3.0 (AGPL v3) +https://www.gnu.org/licenses/agpl-3.0-standalone.html + +Credits +------- +Developer: (V15) Ruksana P , 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_products_based_on_time/__init__.py b/pos_products_based_on_time/__init__.py new file mode 100644 index 000000000..e9db4493e --- /dev/null +++ b/pos_products_based_on_time/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Ruksana P (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_products_based_on_time/__manifest__.py b/pos_products_based_on_time/__manifest__.py new file mode 100644 index 000000000..d09cdb37e --- /dev/null +++ b/pos_products_based_on_time/__manifest__.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Ruksana P (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 HAPPY HOURS | POS TIME BASED PRODUCTS', + 'version': '15.0.1.0.0', + 'category': 'Point of Sale', + 'summary': """ This module enables you to display time-based products in + POS. The item will vary as time goes on""", + 'description': """ With the help of this module, you can display time-based + products in POS. With time, the item will change. The product can be + mentioned by the user in the pos configuration. The user can specify the + product there""", + 'author': "Cybrosys Techno Solutions", + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': "https://www.cybrosys.com", + 'depends': ['point_of_sale', 'mail'], + 'data': [ + 'security/meals_planning_security.xml', + 'security/ir.model.access.csv', + 'views/meals_planning_views.xml' + ], + 'assets': { + 'point_of_sale.assets': [ + 'pos_products_based_on_time/static/src/js/pos_model_load.js', + 'pos_products_based_on_time/static/src/js/pos_planning.js', + ], + }, + 'images': ['static/description/banner.png'], + 'license': 'AGPL-3', + 'installable': True, + 'auto_install': False, + 'application': False, +} diff --git a/pos_products_based_on_time/doc/RELEASE_NOTES.md b/pos_products_based_on_time/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..148a800b1 --- /dev/null +++ b/pos_products_based_on_time/doc/RELEASE_NOTES.md @@ -0,0 +1,6 @@ +## Module + +#### 09.08.2023 +#### Version 15.0.1.0.0 +#### ADD +- Initial commit for POS HAPPY HOURS | POS TIME BASED PRODUCTS diff --git a/pos_products_based_on_time/models/__init__.py b/pos_products_based_on_time/models/__init__.py new file mode 100644 index 000000000..0b829e92f --- /dev/null +++ b/pos_products_based_on_time/models/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Ruksana P (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 meals_planning diff --git a/pos_products_based_on_time/models/meals_planning.py b/pos_products_based_on_time/models/meals_planning.py new file mode 100644 index 000000000..f81cfc744 --- /dev/null +++ b/pos_products_based_on_time/models/meals_planning.py @@ -0,0 +1,70 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Ruksana P (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, _ +from odoo.exceptions import ValidationError + + +class MealsPlanning(models.Model): + """By using this model user can specify the time range and pos session""" + _name = 'meals.planning' + _description = "Product Planning" + _inherit = ['mail.thread', 'mail.activity.mixin'] + + name = fields.Char(string='Name', required=True, + help='Name for Product Planning', copy=False) + pos_ids = fields.Many2many('pos.config', string='Shops', copy=False, + help='Choose PoS Sessions', required=True) + time_from = fields.Float(string='From', required=True, + help='Add from time(24hr)') + time_to = fields.Float(string='To', required=True, help='Add to time(24hr)') + product_ids = fields.Many2many('product.product', string='Product', + domain=[('available_in_pos', '=', True)], + help='Choose products that should be ' + 'displayed') + state = fields.Selection([('activated', 'Activated'), + ('deactivated', 'Deactivated')], + default='deactivated', string='Status', + help='Status of meals planning') + company_id = fields.Many2one('res.company', string='Company', + help='Choose the company', + default=lambda self: self.env.company) + + @api.constrains('time_from', 'time_to') + def _check_time_range(self): + """Validation for from time and to time""" + if self.time_from >= self.time_to: + raise ValidationError(_('From time must be less than to time!')) + if self.time_from > 24.0 or self.time_to > 24.0: + raise ValidationError(_( + 'Time value greater than 24 is not valid!')) + + def action_activate_meals_plan(self): + """Change state to activate""" + self.write({ + 'state': 'activated' + }) + + def action_deactivate_meals_plan(self): + """Change state to deactivate""" + self.write({ + 'state': 'deactivated' + }) diff --git a/pos_products_based_on_time/security/ir.model.access.csv b/pos_products_based_on_time/security/ir.model.access.csv new file mode 100644 index 000000000..6294c2934 --- /dev/null +++ b/pos_products_based_on_time/security/ir.model.access.csv @@ -0,0 +1,3 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access_meals_planning_user,access.meals.planning.user,model_meals_planning,point_of_sale.group_pos_user,1,0,0,0 +access_meals_planning_manager,access.meals.planning.manager,model_meals_planning,point_of_sale.group_pos_manager,1,1,1,1 diff --git a/pos_products_based_on_time/security/meals_planning_security.xml b/pos_products_based_on_time/security/meals_planning_security.xml new file mode 100644 index 000000000..998c7f7a2 --- /dev/null +++ b/pos_products_based_on_time/security/meals_planning_security.xml @@ -0,0 +1,14 @@ + + + + + + multi company access for meals planning + + + ['|',('company_id','=',False),('company_id', + 'in', company_ids)] + + + + diff --git a/pos_products_based_on_time/static/description/assets/icons/check.png b/pos_products_based_on_time/static/description/assets/icons/check.png new file mode 100644 index 000000000..c8e85f51d Binary files /dev/null and b/pos_products_based_on_time/static/description/assets/icons/check.png differ diff --git a/pos_products_based_on_time/static/description/assets/icons/chevron.png b/pos_products_based_on_time/static/description/assets/icons/chevron.png new file mode 100644 index 000000000..2089293d6 Binary files /dev/null and b/pos_products_based_on_time/static/description/assets/icons/chevron.png differ diff --git a/pos_products_based_on_time/static/description/assets/icons/cogs.png b/pos_products_based_on_time/static/description/assets/icons/cogs.png new file mode 100644 index 000000000..95d0bad62 Binary files /dev/null and b/pos_products_based_on_time/static/description/assets/icons/cogs.png differ diff --git a/pos_products_based_on_time/static/description/assets/icons/consultation.png b/pos_products_based_on_time/static/description/assets/icons/consultation.png new file mode 100644 index 000000000..8319d4baa Binary files /dev/null and b/pos_products_based_on_time/static/description/assets/icons/consultation.png differ diff --git a/pos_products_based_on_time/static/description/assets/icons/ecom-black.png b/pos_products_based_on_time/static/description/assets/icons/ecom-black.png new file mode 100644 index 000000000..a9385ff13 Binary files /dev/null and b/pos_products_based_on_time/static/description/assets/icons/ecom-black.png differ diff --git a/pos_products_based_on_time/static/description/assets/icons/education-black.png b/pos_products_based_on_time/static/description/assets/icons/education-black.png new file mode 100644 index 000000000..3eb09b27b Binary files /dev/null and b/pos_products_based_on_time/static/description/assets/icons/education-black.png differ diff --git a/pos_products_based_on_time/static/description/assets/icons/hotel-black.png b/pos_products_based_on_time/static/description/assets/icons/hotel-black.png new file mode 100644 index 000000000..130f613be Binary files /dev/null and b/pos_products_based_on_time/static/description/assets/icons/hotel-black.png differ diff --git a/pos_products_based_on_time/static/description/assets/icons/license.png b/pos_products_based_on_time/static/description/assets/icons/license.png new file mode 100644 index 000000000..a5869797e Binary files /dev/null and b/pos_products_based_on_time/static/description/assets/icons/license.png differ diff --git a/pos_products_based_on_time/static/description/assets/icons/lifebuoy.png b/pos_products_based_on_time/static/description/assets/icons/lifebuoy.png new file mode 100644 index 000000000..658d56ccc Binary files /dev/null and b/pos_products_based_on_time/static/description/assets/icons/lifebuoy.png differ diff --git a/pos_products_based_on_time/static/description/assets/icons/manufacturing-black.png b/pos_products_based_on_time/static/description/assets/icons/manufacturing-black.png new file mode 100644 index 000000000..697eb0e9f Binary files /dev/null and b/pos_products_based_on_time/static/description/assets/icons/manufacturing-black.png differ diff --git a/pos_products_based_on_time/static/description/assets/icons/pos-black.png b/pos_products_based_on_time/static/description/assets/icons/pos-black.png new file mode 100644 index 000000000..97c0f90c1 Binary files /dev/null and b/pos_products_based_on_time/static/description/assets/icons/pos-black.png differ diff --git a/pos_products_based_on_time/static/description/assets/icons/puzzle.png b/pos_products_based_on_time/static/description/assets/icons/puzzle.png new file mode 100644 index 000000000..65cf854e7 Binary files /dev/null and b/pos_products_based_on_time/static/description/assets/icons/puzzle.png differ diff --git a/pos_products_based_on_time/static/description/assets/icons/restaurant-black.png b/pos_products_based_on_time/static/description/assets/icons/restaurant-black.png new file mode 100644 index 000000000..4a35eb939 Binary files /dev/null and b/pos_products_based_on_time/static/description/assets/icons/restaurant-black.png differ diff --git a/pos_products_based_on_time/static/description/assets/icons/service-black.png b/pos_products_based_on_time/static/description/assets/icons/service-black.png new file mode 100644 index 000000000..301ab51cb Binary files /dev/null and b/pos_products_based_on_time/static/description/assets/icons/service-black.png differ diff --git a/pos_products_based_on_time/static/description/assets/icons/trading-black.png b/pos_products_based_on_time/static/description/assets/icons/trading-black.png new file mode 100644 index 000000000..9398ba2f1 Binary files /dev/null and b/pos_products_based_on_time/static/description/assets/icons/trading-black.png differ diff --git a/pos_products_based_on_time/static/description/assets/icons/training.png b/pos_products_based_on_time/static/description/assets/icons/training.png new file mode 100644 index 000000000..884ca024d Binary files /dev/null and b/pos_products_based_on_time/static/description/assets/icons/training.png differ diff --git a/pos_products_based_on_time/static/description/assets/icons/update.png b/pos_products_based_on_time/static/description/assets/icons/update.png new file mode 100644 index 000000000..ecbc5a01a Binary files /dev/null and b/pos_products_based_on_time/static/description/assets/icons/update.png differ diff --git a/pos_products_based_on_time/static/description/assets/icons/user.png b/pos_products_based_on_time/static/description/assets/icons/user.png new file mode 100644 index 000000000..6ffb23d9f Binary files /dev/null and b/pos_products_based_on_time/static/description/assets/icons/user.png differ diff --git a/pos_products_based_on_time/static/description/assets/icons/wrench.png b/pos_products_based_on_time/static/description/assets/icons/wrench.png new file mode 100644 index 000000000..6c04dea0f Binary files /dev/null and b/pos_products_based_on_time/static/description/assets/icons/wrench.png differ diff --git a/pos_products_based_on_time/static/description/assets/misc/categories.png b/pos_products_based_on_time/static/description/assets/misc/categories.png new file mode 100644 index 000000000..bedf1e0b1 Binary files /dev/null and b/pos_products_based_on_time/static/description/assets/misc/categories.png differ diff --git a/pos_products_based_on_time/static/description/assets/misc/check-box.png b/pos_products_based_on_time/static/description/assets/misc/check-box.png new file mode 100644 index 000000000..42caf24b9 Binary files /dev/null and b/pos_products_based_on_time/static/description/assets/misc/check-box.png differ diff --git a/pos_products_based_on_time/static/description/assets/misc/compass.png b/pos_products_based_on_time/static/description/assets/misc/compass.png new file mode 100644 index 000000000..d5fed8faa Binary files /dev/null and b/pos_products_based_on_time/static/description/assets/misc/compass.png differ diff --git a/pos_products_based_on_time/static/description/assets/misc/corporate.png b/pos_products_based_on_time/static/description/assets/misc/corporate.png new file mode 100644 index 000000000..2eb13edbf Binary files /dev/null and b/pos_products_based_on_time/static/description/assets/misc/corporate.png differ diff --git a/pos_products_based_on_time/static/description/assets/misc/customer-support.png b/pos_products_based_on_time/static/description/assets/misc/customer-support.png new file mode 100644 index 000000000..79efc72ed Binary files /dev/null and b/pos_products_based_on_time/static/description/assets/misc/customer-support.png differ diff --git a/pos_products_based_on_time/static/description/assets/misc/cybrosys-logo.png b/pos_products_based_on_time/static/description/assets/misc/cybrosys-logo.png new file mode 100644 index 000000000..cc3cc0ccf Binary files /dev/null and b/pos_products_based_on_time/static/description/assets/misc/cybrosys-logo.png differ diff --git a/pos_products_based_on_time/static/description/assets/misc/features.png b/pos_products_based_on_time/static/description/assets/misc/features.png new file mode 100644 index 000000000..b41769f77 Binary files /dev/null and b/pos_products_based_on_time/static/description/assets/misc/features.png differ diff --git a/pos_products_based_on_time/static/description/assets/misc/logo.png b/pos_products_based_on_time/static/description/assets/misc/logo.png new file mode 100644 index 000000000..478462d3e Binary files /dev/null and b/pos_products_based_on_time/static/description/assets/misc/logo.png differ diff --git a/pos_products_based_on_time/static/description/assets/misc/pictures.png b/pos_products_based_on_time/static/description/assets/misc/pictures.png new file mode 100644 index 000000000..56d255fe9 Binary files /dev/null and b/pos_products_based_on_time/static/description/assets/misc/pictures.png differ diff --git a/pos_products_based_on_time/static/description/assets/misc/pie-chart.png b/pos_products_based_on_time/static/description/assets/misc/pie-chart.png new file mode 100644 index 000000000..426e05244 Binary files /dev/null and b/pos_products_based_on_time/static/description/assets/misc/pie-chart.png differ diff --git a/pos_products_based_on_time/static/description/assets/misc/right-arrow.png b/pos_products_based_on_time/static/description/assets/misc/right-arrow.png new file mode 100644 index 000000000..730984a06 Binary files /dev/null and b/pos_products_based_on_time/static/description/assets/misc/right-arrow.png differ diff --git a/pos_products_based_on_time/static/description/assets/misc/star.png b/pos_products_based_on_time/static/description/assets/misc/star.png new file mode 100644 index 000000000..2eb9ab29f Binary files /dev/null and b/pos_products_based_on_time/static/description/assets/misc/star.png differ diff --git a/pos_products_based_on_time/static/description/assets/misc/support.png b/pos_products_based_on_time/static/description/assets/misc/support.png new file mode 100644 index 000000000..4f18b8b82 Binary files /dev/null and b/pos_products_based_on_time/static/description/assets/misc/support.png differ diff --git a/pos_products_based_on_time/static/description/assets/misc/whatsapp.png b/pos_products_based_on_time/static/description/assets/misc/whatsapp.png new file mode 100644 index 000000000..d513a5356 Binary files /dev/null and b/pos_products_based_on_time/static/description/assets/misc/whatsapp.png differ diff --git a/pos_products_based_on_time/static/description/assets/modules/booking_order.png b/pos_products_based_on_time/static/description/assets/modules/booking_order.png new file mode 100644 index 000000000..7e98cc546 Binary files /dev/null and b/pos_products_based_on_time/static/description/assets/modules/booking_order.png differ diff --git a/pos_products_based_on_time/static/description/assets/modules/custom_receipt.png b/pos_products_based_on_time/static/description/assets/modules/custom_receipt.png new file mode 100644 index 000000000..7724c168e Binary files /dev/null and b/pos_products_based_on_time/static/description/assets/modules/custom_receipt.png differ diff --git a/pos_products_based_on_time/static/description/assets/modules/login_pos.png b/pos_products_based_on_time/static/description/assets/modules/login_pos.png new file mode 100644 index 000000000..ad079cfcc Binary files /dev/null and b/pos_products_based_on_time/static/description/assets/modules/login_pos.png differ diff --git a/pos_products_based_on_time/static/description/assets/modules/mrp_orders.png b/pos_products_based_on_time/static/description/assets/modules/mrp_orders.png new file mode 100644 index 000000000..512a7bf44 Binary files /dev/null and b/pos_products_based_on_time/static/description/assets/modules/mrp_orders.png differ diff --git a/pos_products_based_on_time/static/description/assets/modules/multi_barcode.png b/pos_products_based_on_time/static/description/assets/modules/multi_barcode.png new file mode 100644 index 000000000..8eb017a8d Binary files /dev/null and b/pos_products_based_on_time/static/description/assets/modules/multi_barcode.png differ diff --git a/pos_products_based_on_time/static/description/assets/modules/pos_dashboard.png b/pos_products_based_on_time/static/description/assets/modules/pos_dashboard.png new file mode 100644 index 000000000..4ce834012 Binary files /dev/null and b/pos_products_based_on_time/static/description/assets/modules/pos_dashboard.png differ diff --git a/pos_products_based_on_time/static/description/assets/screenshots/1.png b/pos_products_based_on_time/static/description/assets/screenshots/1.png new file mode 100644 index 000000000..75ee77327 Binary files /dev/null and b/pos_products_based_on_time/static/description/assets/screenshots/1.png differ diff --git a/pos_products_based_on_time/static/description/assets/screenshots/2.png b/pos_products_based_on_time/static/description/assets/screenshots/2.png new file mode 100644 index 000000000..f4174e18a Binary files /dev/null and b/pos_products_based_on_time/static/description/assets/screenshots/2.png differ diff --git a/pos_products_based_on_time/static/description/assets/screenshots/3.png b/pos_products_based_on_time/static/description/assets/screenshots/3.png new file mode 100644 index 000000000..cbd9aedfe Binary files /dev/null and b/pos_products_based_on_time/static/description/assets/screenshots/3.png differ diff --git a/pos_products_based_on_time/static/description/assets/screenshots/hero.gif b/pos_products_based_on_time/static/description/assets/screenshots/hero.gif new file mode 100644 index 000000000..326ece50c Binary files /dev/null and b/pos_products_based_on_time/static/description/assets/screenshots/hero.gif differ diff --git a/pos_products_based_on_time/static/description/banner.png b/pos_products_based_on_time/static/description/banner.png new file mode 100644 index 000000000..19525b034 Binary files /dev/null and b/pos_products_based_on_time/static/description/banner.png differ diff --git a/pos_products_based_on_time/static/description/icon.png b/pos_products_based_on_time/static/description/icon.png new file mode 100644 index 000000000..2dcfb76e8 Binary files /dev/null and b/pos_products_based_on_time/static/description/icon.png differ diff --git a/pos_products_based_on_time/static/description/index.html b/pos_products_based_on_time/static/description/index.html new file mode 100644 index 000000000..8f7193826 --- /dev/null +++ b/pos_products_based_on_time/static/description/index.html @@ -0,0 +1,637 @@ +
+ +
+ +
+
+ Community +
+
+ Enterprise +
+
+ Odoo.sh +
+
+
+ + +
+
+
+ +

+ POS HAPPY HOURS | POS TIME BASED PRODUCTS +

+

+ Display Time Based Products In + POS. The Item Will Vary As Time Goes On.

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

+ Explore This + Module

+
+ + + + +
+
+ +
+

+ Overview +

+
+
+
+ In the Point of Sale (POS) system, we can also control the displaying of + products at specified times by incorporating product scheduling features. +
+
+ + + +
+
+ +
+

+ Features

+
+
+
+
+ + The pos product will change in accordance with the time. +
+
+ + Changing the product without ending the session or refreshing +
+
+
+
+
+ + + +
+
+ +
+

+ Screenshots +

+
+
+
+
+

+ Button Product Planning +

+

+ Go to Point of Sale -> Product -> Product Planning + -> We can create a time planning for products. +

+ +
+
+

+ Create Product Planning

+

+ Here we can mention the time interval and products those to + be appeared on that time interval +

+ +
+
+

+ PoS Session

+

+ In the pos session only the activated products are visible + in the activated time interval +

+ +
+ + + +
+
+ +
+

+ Related + Products +

+
+
+
+

Suggested + 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

+
+
+
+
+
+
+
+ +
+
+
+
+
+ diff --git a/pos_products_based_on_time/static/src/js/pos_model_load.js b/pos_products_based_on_time/static/src/js/pos_model_load.js new file mode 100644 index 000000000..3ebf200b4 --- /dev/null +++ b/pos_products_based_on_time/static/src/js/pos_model_load.js @@ -0,0 +1,19 @@ +odoo.define('pos_products_based_on_time.planning', function(require){ + "use strict"; +// To load new model 'meals.planning' to pos + var models = require('point_of_sale.models'); + models.load_models([{ + model: 'meals.planning', + fields: ['time_from', 'time_to','product_ids','state','pos_ids'], + // The domain filter function checks for records where the given + // conditions are satisfied + domain: function(self){ + return ['&',['state','=','activated'], + ['pos_ids','in',self.config_id]]; + }, + // Load specific fields from this model based on a domain filter, + loaded: function(self, meals) { + self.meals_planning = meals; + }, + }]); +}); diff --git a/pos_products_based_on_time/static/src/js/pos_planning.js b/pos_products_based_on_time/static/src/js/pos_planning.js new file mode 100644 index 000000000..4cedc63b5 --- /dev/null +++ b/pos_products_based_on_time/static/src/js/pos_planning.js @@ -0,0 +1,48 @@ +odoo.define('pos_products_based_on_time.ProductsPlanning', function(require) { + 'use strict'; + + const ProductsWidget = require('point_of_sale.ProductsWidget'); + const Registries = require('point_of_sale.Registries'); + // Define a new class that extends ProductsWidget + const ProductsPlanning = (ProductsWidget) => class extends ProductsWidget { +// Override the setup method to perform any additional setup logic. + setup() { + super.setup(...arguments); + } + /** + * Override the productsToDisplay getter method to filter the list of products + * based on the current time and the meals planning data. + */ + get productsToDisplay() { + let allProducts = []; + if (this.searchWord !== '') { + allProducts = this.env.pos.db.search_product_in_category( + this.selectedCategoryId, + this.searchWord + ); + } else { + allProducts = this.env.pos.db.get_product_by_category(this.selectedCategoryId); + } + const date = new Date(); + let hoursMin = date.getHours() + '.' + date.getMinutes(); + let time = Number(hoursMin) + let currentProducts = []; + this.env.pos.meals_planning.forEach(function(object) { + if (object.time_from < time && time < object.time_to) { + currentProducts = object.product_ids.flat(1) + } + }) + // Filter the list of products to only include products that are part of the + // Available menu products for the current time. + if (currentProducts.length) { + allProducts = allProducts.filter(product => currentProducts.flat(1).includes(product.id)) + } + // Sort the list of products by display name and return the sorted list. + return allProducts.sort(function(firstProduct, secondProduct) { + return firstProduct.display_name.localeCompare(secondProduct.display_name) + }); + } + } + Registries.Component.extend(ProductsWidget, ProductsPlanning); + return ProductsPlanning; +}); diff --git a/pos_products_based_on_time/views/meals_planning_views.xml b/pos_products_based_on_time/views/meals_planning_views.xml new file mode 100644 index 000000000..86834aae9 --- /dev/null +++ b/pos_products_based_on_time/views/meals_planning_views.xml @@ -0,0 +1,101 @@ + + + + + meals.planning.view.search + meals.planning + + + + + + + + + + + + + + + + meals.planning.view.tree + meals.planning + + + + + + + + + + + + meals.planning.view.form + meals.planning + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+
+
+
+ + + Product Planning + meals.planning + tree,form + + +