diff --git a/pos_products_based_on_time/README.rst b/pos_products_based_on_time/README.rst new file mode 100755 index 000000000..ae1e25fce --- /dev/null +++ b/pos_products_based_on_time/README.rst @@ -0,0 +1,45 @@ +.. image:: https://img.shields.io/badge/licence-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. + +License +------- +Affero General Public License v3.0 (AGPL v3) +(https://www.gnu.org/licenses/agpl-3.0-standalone.html) + +Company +------- +* `Cybrosys Techno Solutions `__ + +Credits +------- +Developer: (V14) 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: ``__ \ No newline at end of file diff --git a/pos_products_based_on_time/__init__.py b/pos_products_based_on_time/__init__.py new file mode 100644 index 000000000..5ab86863a --- /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: 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..3a99b1916 --- /dev/null +++ b/pos_products_based_on_time/__manifest__.py @@ -0,0 +1,48 @@ +# -*- 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', + 'version': '14.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': ['base', 'point_of_sale', 'mail'], + 'data': [ + 'security/meals_planning_security.xml', + 'security/ir.model.access.csv', + 'views/meals_planning_views.xml', + 'views/assets.xml' + ], + '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..710571fae --- /dev/null +++ b/pos_products_based_on_time/doc/RELEASE_NOTES.md @@ -0,0 +1,6 @@ +## Module + +#### 14.07.2023 +#### Version 14.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..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..612af88bb --- /dev/null +++ b/pos_products_based_on_time/models/meals_planning.py @@ -0,0 +1,69 @@ +# -*- 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 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', + help='Available products', + domain=[('available_in_pos', '=', True)]) + state = fields.Selection([('activated', 'Activated'), + ('deactivated', 'Deactivated')], string='State', + help='Status of meals planning', + default='deactivated') + company_id = fields.Many2one('res.company', string='Company', + help='Company for this meals planning', + 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): + """Method of button activate to change state to activate""" + self.write({ + 'state': 'activated' + }) + + def action_deactivate_meals_plan(self): + """Method of button deactivate to 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..cbc66e0bb --- /dev/null +++ b/pos_products_based_on_time/security/meals_planning_security.xml @@ -0,0 +1,11 @@ + + + + + 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/approval_image.png b/pos_products_based_on_time/static/description/assets/modules/approval_image.png new file mode 100644 index 000000000..84fe94e80 Binary files /dev/null and b/pos_products_based_on_time/static/description/assets/modules/approval_image.png differ diff --git a/pos_products_based_on_time/static/description/assets/modules/dynamic_image.png b/pos_products_based_on_time/static/description/assets/modules/dynamic_image.png new file mode 100644 index 000000000..f55c47e0f Binary files /dev/null and b/pos_products_based_on_time/static/description/assets/modules/dynamic_image.png differ diff --git a/pos_products_based_on_time/static/description/assets/modules/list_view_image.png b/pos_products_based_on_time/static/description/assets/modules/list_view_image.png new file mode 100644 index 000000000..510d36ae9 Binary files /dev/null and b/pos_products_based_on_time/static/description/assets/modules/list_view_image.png differ diff --git a/pos_products_based_on_time/static/description/assets/modules/multiple_ref_image.png b/pos_products_based_on_time/static/description/assets/modules/multiple_ref_image.png new file mode 100644 index 000000000..3fe90e552 Binary files /dev/null and b/pos_products_based_on_time/static/description/assets/modules/multiple_ref_image.png differ diff --git a/pos_products_based_on_time/static/description/assets/modules/print_image.png b/pos_products_based_on_time/static/description/assets/modules/print_image.png new file mode 100644 index 000000000..b470725a1 Binary files /dev/null and b/pos_products_based_on_time/static/description/assets/modules/print_image.png differ diff --git a/pos_products_based_on_time/static/description/assets/modules/product_return_image.png b/pos_products_based_on_time/static/description/assets/modules/product_return_image.png new file mode 100644 index 000000000..3afc14722 Binary files /dev/null and b/pos_products_based_on_time/static/description/assets/modules/product_return_image.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..c9f3318f9 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..8cb68efa1 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..171cc74e5 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..59cef5c47 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..bf3ea33eb 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..180dc5b56 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..f83346265 --- /dev/null +++ b/pos_products_based_on_time/static/description/index.html @@ -0,0 +1,632 @@ +
+ +
+ +
+
+ Community +
+
+ Enterprise +
+
+ Odoo.sh +
+
+
+ +
+
+
+ +

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

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

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

+
+
+
+
+

+ Button Product Planning + +

+

+ Go to Point of Sale -> Products -> 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 +

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

+ 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..319300924 --- /dev/null +++ b/pos_products_based_on_time/static/src/js/pos_model_load.js @@ -0,0 +1,17 @@ +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'], + domain: function(self){ + return + ['&',['state','=','activated'],['pos_ids','in',self.config_id]]; + }, + loaded: function(self, meals) { + self.meals_planning = meals; + // Perform any additional actions after the model is loaded + }, + }]); +}); \ 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..f6f782e87 --- /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; +}); \ No newline at end of file diff --git a/pos_products_based_on_time/views/assets.xml b/pos_products_based_on_time/views/assets.xml new file mode 100644 index 000000000..d12043136 --- /dev/null +++ b/pos_products_based_on_time/views/assets.xml @@ -0,0 +1,13 @@ + + + +