diff --git a/pos_products_based_on_time/README.rst b/pos_products_based_on_time/README.rst new file mode 100755 index 000000000..c66936560 --- /dev/null +++ b/pos_products_based_on_time/README.rst @@ -0,0 +1,41 @@ +.. 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 Happy Hours | PoS Time Based Products | PoS Breakfast Lunch Dinner +======================= +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) inorder to get access to the new menu. + +Company +------- +* `Cybrosys Techno Solutions `__ + +Credits +------- +Developer: Nihala M K @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_products_based_on_time/__init__.py b/pos_products_based_on_time/__init__.py new file mode 100644 index 000000000..6a982338b --- /dev/null +++ b/pos_products_based_on_time/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Cybrosys Techno Solutions (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..04d7597ba --- /dev/null +++ b/pos_products_based_on_time/__manifest__.py @@ -0,0 +1,55 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Cybrosys Techno Solutions (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 | PoS Breakfast Lunch Dinner', + 'version': '16.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", + 'images': ['static/description/banner.png'], + 'license': 'AGPL-3', + 'installable': True, + 'auto_install': False, + 'application': False, + 'depends': ['base', 'point_of_sale', 'mail'], + 'data': [ + 'security/ir.model.access.csv', + 'security/security_rule.xml', + 'views/meals_planning_menu.xml' + + ], + 'assets': { + 'point_of_sale.assets': [ + 'pos_products_based_on_time/static/src/js/pos_planning.js', + 'pos_products_based_on_time/static/src/js/pos_model_load.js', + ], + }, +} 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..64ab5662f --- /dev/null +++ b/pos_products_based_on_time/doc/RELEASE_NOTES.md @@ -0,0 +1,7 @@ +## Module + +#### 20.02.2023 +#### Version 16.0.1.0.0 +#### ADD + +- Initial commit for PoS Happy Hours | PoS Time Based Products | PoS Breakfast Lunch Dinner 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..2c7c37ef1 --- /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: Cybrosys Techno Solutions (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..ea2cf9ede --- /dev/null +++ b/pos_products_based_on_time/models/meals_planning.py @@ -0,0 +1,105 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Cybrosys Techno Solutions (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 fields, models, api +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)') + menu_product_id = fields.Many2many('product.product', string='Product', + domain=[('available_in_pos', '=', True)]) + + state = fields.Selection([('activated', 'Activated'), + ('deactivated', 'Deactivated')], + default='deactivated') + company_id = fields.Many2one('res.company', string='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' + }) + + +class InheritPosSession(models.Model): + """inherit pos session for load models in pos""" + _inherit = 'pos.session' + + def _pos_ui_models_to_load(self): + """load Meals Planning and Menu.Meals model in pos.""" + result = super()._pos_ui_models_to_load() + new_model = 'meals.planning' + if new_model not in result: + result.append(new_model) + return result + + def _loader_params_meals_planning(self): + """ returning corresponding data to pos""" + data = [] + plan = self.env['meals.planning'].search([('state', '=', 'activated'), + ('pos_ids', 'in', self.ids)]) + for rec in plan: + data.append(rec.id) + + return { + 'search_params': { + 'domain': [('id', '=', data)], + 'fields': ['name', 'menu_product_id', 'time_from', 'time_to', + 'state', 'pos_ids'] + } + } + + def _loader_params_product_product(self): + """load product.product parameters""" + result = super()._loader_params_product_product() + result['search_params']['fields'].extend(['name', 'id']) + return result + + def _get_pos_ui_meals_planning(self, params): + return self.env['meals.planning'].search_read(**params['search_params']) 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..acb7ba47a --- /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,meals.planning.user,model_meals_planning,point_of_sale.group_pos_user,1,0,0,0 +access_meals_planning_manager,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/security_rule.xml b/pos_products_based_on_time/security/security_rule.xml new file mode 100644 index 000000000..683b517d9 --- /dev/null +++ b/pos_products_based_on_time/security/security_rule.xml @@ -0,0 +1,8 @@ + + + + multi company access for meals planning + + ['|',('company_id','=',False),('company_id', 'in', company_ids)] + + \ No newline at end of file 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/1.png b/pos_products_based_on_time/static/description/assets/modules/1.png new file mode 100644 index 000000000..5238bdeab Binary files /dev/null and b/pos_products_based_on_time/static/description/assets/modules/1.png differ diff --git a/pos_products_based_on_time/static/description/assets/modules/2.png b/pos_products_based_on_time/static/description/assets/modules/2.png new file mode 100644 index 000000000..1ae7cfe3b Binary files /dev/null and b/pos_products_based_on_time/static/description/assets/modules/2.png differ diff --git a/pos_products_based_on_time/static/description/assets/modules/3.png b/pos_products_based_on_time/static/description/assets/modules/3.png new file mode 100644 index 000000000..3c3ff1afb Binary files /dev/null and b/pos_products_based_on_time/static/description/assets/modules/3.png differ diff --git a/pos_products_based_on_time/static/description/assets/modules/4.png b/pos_products_based_on_time/static/description/assets/modules/4.png new file mode 100644 index 000000000..3fae4631e Binary files /dev/null and b/pos_products_based_on_time/static/description/assets/modules/4.png differ diff --git a/pos_products_based_on_time/static/description/assets/modules/5.gif b/pos_products_based_on_time/static/description/assets/modules/5.gif new file mode 100644 index 000000000..2a5f8e659 Binary files /dev/null and b/pos_products_based_on_time/static/description/assets/modules/5.gif differ diff --git a/pos_products_based_on_time/static/description/assets/modules/6.png b/pos_products_based_on_time/static/description/assets/modules/6.png new file mode 100644 index 000000000..7f2815273 Binary files /dev/null and b/pos_products_based_on_time/static/description/assets/modules/6.png differ diff --git a/pos_products_based_on_time/static/description/assets/screenshots/pro_plan1.png b/pos_products_based_on_time/static/description/assets/screenshots/pro_plan1.png new file mode 100644 index 000000000..a9ce47c5d Binary files /dev/null and b/pos_products_based_on_time/static/description/assets/screenshots/pro_plan1.png differ diff --git a/pos_products_based_on_time/static/description/assets/screenshots/pro_plan2.png b/pos_products_based_on_time/static/description/assets/screenshots/pro_plan2.png new file mode 100644 index 000000000..571e699cd Binary files /dev/null and b/pos_products_based_on_time/static/description/assets/screenshots/pro_plan2.png differ diff --git a/pos_products_based_on_time/static/description/assets/screenshots/pro_plan3.png b/pos_products_based_on_time/static/description/assets/screenshots/pro_plan3.png new file mode 100644 index 000000000..baa16d1c4 Binary files /dev/null and b/pos_products_based_on_time/static/description/assets/screenshots/pro_plan3.png differ diff --git a/pos_products_based_on_time/static/description/assets/screenshots/v16-hero.gif b/pos_products_based_on_time/static/description/assets/screenshots/v16-hero.gif new file mode 100644 index 000000000..964138cc3 Binary files /dev/null and b/pos_products_based_on_time/static/description/assets/screenshots/v16-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..4e7befe1f 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..35cfe0789 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..f2e069d43 --- /dev/null +++ b/pos_products_based_on_time/static/description/index.html @@ -0,0 +1,522 @@ +
+ +
+ +
+
+ Community +
+
+ Odoo.sh +
+
+
+ +
+
+
+ +

+ PoS Happy Hours | PoS Time Based Products | PoS Breakfast Lunch Dinner +

+

This module enables you to display time-based products in POS. The item will vary as time goes on.

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

Explore This + Module

+
+ + + + +
+
+ +
+

Overview +

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

Features

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

Screenshots +

+
+
+
+ +
+

Create Product Planning + +

+

Go to PoS -> Product -> Product Planning + -> You may create a product and mention the time here. + the only time the item will appear in pos +

+ + +
+ +
+

PoS Session

+

here the result +

+ +
+ + + + +
+
+ +
+

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/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..1e90577f3 --- /dev/null +++ b/pos_products_based_on_time/static/src/js/pos_model_load.js @@ -0,0 +1,31 @@ +odoo.define('pos_products_based_on_time.planning', function(require){ + "use strict"; + + var { PosGlobalState } = require('point_of_sale.models'); + const Registries = require('point_of_sale.Registries'); + + // Define a new class that extends PosGlobalState + const planning = (PosGlobalState) => class planning extends PosGlobalState { + /** + * Override the _processData method to preprocess the meals planning data + * before it is saved to the global state. + * @param {Object} loadedData - The data loaded from the backend. + */ + async _processData(loadedData) { + super._processData(...arguments) + + // Process the menu_product_id field of each meals planning record to include + // the actual product data instead of just the product ID. + let new_meal = [] + loadedData['meals.planning'].forEach((data) => { + data.menu_product_id = loadedData['product.product'].filter((meal) => data.menu_product_id.includes(meal.id)) + new_meal.push(data) + }) + // Update the meals planning data. + this.meals_planning = new_meal + } + } + + // Register the new planning class with the POS registry. + Registries.Model.extend(PosGlobalState, planning); +}); \ No newline at end of file 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..33acd685d --- /dev/null +++ b/pos_products_based_on_time/static/src/js/pos_planning.js @@ -0,0 +1,69 @@ +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. + * @returns {Array} A sorted array of product objects to be displayed. + */ + get productsToDisplay() { + let list = []; + var res_list = new Array(); + if (this.searchWord !== '') { + list = this.env.pos.db.search_product_in_category( + this.selectedCategoryId, + this.searchWord + ); + } else { + list = this.env.pos.db.get_product_by_category(this.selectedCategoryId); + } + + // Get the current time in hours and minutes. + const date = new Date(); + let hoursMin = date.getHours() + '.' + date.getMinutes(); + let time = Number(hoursMin) + + // Filter the meals planning data to find the menu products that are available + // for the current time. + let data = []; + this.env.pos.meals_planning.forEach(function(object) { + if (object.time_from < time && time < object.time_to) { + let plan_arr = null; + plan_arr = object.menu_product_id.flat(1) + data.push(plan_arr.map((meal) => meal.id)) + } + }) + + // Filter the list of products to only include products that are part of the + // available menu products for the current time. + if (data.length) { + list = list.filter(product => data.flat(1).includes(product.id)) + } + + // Sort the list of products by display name and return the sorted list. + return list.sort(function(a, b) { + return a.display_name.localeCompare(b.display_name) + }); + + } + } + // Register the new ProductsPlanning component with the POS registry. + Registries.Component.extend(ProductsWidget, ProductsPlanning); + + // Export the new ProductsPlanning class. + return ProductsPlanning; +}); \ No newline at end of file diff --git a/pos_products_based_on_time/views/meals_planning_menu.xml b/pos_products_based_on_time/views/meals_planning_menu.xml new file mode 100644 index 000000000..fb2fa3c0f --- /dev/null +++ b/pos_products_based_on_time/views/meals_planning_menu.xml @@ -0,0 +1,89 @@ + + + + + meals.planning + + + + + + + + + + + + + + + + meals_planning_tree_view + meals.planning + + + + + + + + + + + + meals_planning_form_view + meals.planning + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+
+
+
+ + + Product planning + meals.planning + tree,form + + + +
+