diff --git a/pos_alternative_products/README.rst b/pos_alternative_products/README.rst new file mode 100644 index 000000000..78ac14c60 --- /dev/null +++ b/pos_alternative_products/README.rst @@ -0,0 +1,47 @@ +.. image:: https://img.shields.io/badge/licence-LGPL--3-green.svg + :target: https://www.gnu.org/licenses/lgpl-3.0-standalone.html + :alt: License: LGPL-3 + +Alternative Products in Pos +=========================== +This module helps to choose the alternative product if +the selected product's available quantity is less than or equal to zero. + +Configuration +============= +* No additional configurations needed + +Company +------- +* `Cybrosys Techno Solutions `__ + +License +------- +General Public License, Version 3 (LGPL v3). +(http://www.gnu.org/licenses/lgpl-3.0-standalone.html) + +Credits +------- +* Developer: (V16) Gayathri V 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_alternative_products/__init__.py b/pos_alternative_products/__init__.py new file mode 100644 index 000000000..120b0ece8 --- /dev/null +++ b/pos_alternative_products/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Ammu Raj(odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from . import models diff --git a/pos_alternative_products/__manifest__.py b/pos_alternative_products/__manifest__.py new file mode 100644 index 000000000..049fb756a --- /dev/null +++ b/pos_alternative_products/__manifest__.py @@ -0,0 +1,51 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Ammu Raj(odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +{ + 'name': 'Alternative Products in Pos', + 'version': '15.0.1.0.0', + 'category': 'Point of Sale', + 'summary': "We can select alternative product , when a product have zero" + "available quantity in pos.", + 'description': "This module helps to choose the alternative product if the" + "selected product's available quantity is less than or" + "equal to zero.", + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': 'https://www.cybrosys.com', + 'depends': ['point_of_sale', 'pos_sale', 'website_sale'], + 'assets': { + 'point_of_sale.assets': [ + 'pos_alternative_products/static/src/js/models.js', + 'pos_alternative_products/static/src/js/ProductScreen.js', + 'pos_alternative_products/static/src/js/AbstractAwaitablePopup.js' + ], + 'web.assets_qweb': [ + 'pos_alternative_products/static/src/xml/alternative_pop_up_templates.xml' + ], + }, + 'images': ['static/description/banner.png'], + 'license': 'LGPL-3', + 'installable': True, + 'auto_install': False, + 'application': False, +} diff --git a/pos_alternative_products/doc/RELEASE_NOTES.md b/pos_alternative_products/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..d0ebe1736 --- /dev/null +++ b/pos_alternative_products/doc/RELEASE_NOTES.md @@ -0,0 +1,6 @@ +## Module + +#### 03.06.2024 +#### Version 15.0.1.0.0 +##### ADD +- Initial commit for Alternative Products in Pos diff --git a/pos_alternative_products/models/__init__.py b/pos_alternative_products/models/__init__.py new file mode 100644 index 000000000..39be30e6b --- /dev/null +++ b/pos_alternative_products/models/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Ammu Raj(odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from . import stock_quant diff --git a/pos_alternative_products/models/stock_quant.py b/pos_alternative_products/models/stock_quant.py new file mode 100644 index 000000000..5c5481e2f --- /dev/null +++ b/pos_alternative_products/models/stock_quant.py @@ -0,0 +1,63 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Ammu Raj(odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from odoo import models + + +class PosStock(models.Model): + """This class is used to compute the quantity and returns the product""" + _inherit = 'stock.quant' + + def pos_stock_product(self, id): + """It is used to check the available quantity of the selected product""" + val = self.env['product.product'].browse(id) + if val.qty_available <= 0: + return 0 + else: + return val + + def pos_alternative_product(self, alter_id, code): + """It is used to take the corresponding product in the + product.product""" + pos_product = 0 + if code: + product_id = self.env['product.product'].search( + [('product_tmpl_id', '=', alter_id), + ('default_code', '=', code)], limit=1) + if product_id: + pos_product = self.product_in_pos(product_id.id) + + return pos_product + else: + product_id = self.env['product.product'].search( + [('product_tmpl_id', '=', alter_id)], limit=1) + if product_id: + pos_product = self.product_in_pos(product_id.id) + return pos_product + + def product_in_pos(self, id): + """This is used to check tha product is available in pos""" + available_pos = self.env['product.product'].browse( + id).available_in_pos + if available_pos: + return id + else: + return 0 diff --git a/pos_alternative_products/static/description/assets/icons/check.png b/pos_alternative_products/static/description/assets/icons/check.png new file mode 100644 index 000000000..c8e85f51d Binary files /dev/null and b/pos_alternative_products/static/description/assets/icons/check.png differ diff --git a/pos_alternative_products/static/description/assets/icons/chevron.png b/pos_alternative_products/static/description/assets/icons/chevron.png new file mode 100644 index 000000000..2089293d6 Binary files /dev/null and b/pos_alternative_products/static/description/assets/icons/chevron.png differ diff --git a/pos_alternative_products/static/description/assets/icons/cogs.png b/pos_alternative_products/static/description/assets/icons/cogs.png new file mode 100644 index 000000000..95d0bad62 Binary files /dev/null and b/pos_alternative_products/static/description/assets/icons/cogs.png differ diff --git a/pos_alternative_products/static/description/assets/icons/consultation.png b/pos_alternative_products/static/description/assets/icons/consultation.png new file mode 100644 index 000000000..8319d4baa Binary files /dev/null and b/pos_alternative_products/static/description/assets/icons/consultation.png differ diff --git a/pos_alternative_products/static/description/assets/icons/ecom-black.png b/pos_alternative_products/static/description/assets/icons/ecom-black.png new file mode 100644 index 000000000..a9385ff13 Binary files /dev/null and b/pos_alternative_products/static/description/assets/icons/ecom-black.png differ diff --git a/pos_alternative_products/static/description/assets/icons/education-black.png b/pos_alternative_products/static/description/assets/icons/education-black.png new file mode 100644 index 000000000..3eb09b27b Binary files /dev/null and b/pos_alternative_products/static/description/assets/icons/education-black.png differ diff --git a/pos_alternative_products/static/description/assets/icons/hotel-black.png b/pos_alternative_products/static/description/assets/icons/hotel-black.png new file mode 100644 index 000000000..130f613be Binary files /dev/null and b/pos_alternative_products/static/description/assets/icons/hotel-black.png differ diff --git a/pos_alternative_products/static/description/assets/icons/license.png b/pos_alternative_products/static/description/assets/icons/license.png new file mode 100644 index 000000000..a5869797e Binary files /dev/null and b/pos_alternative_products/static/description/assets/icons/license.png differ diff --git a/pos_alternative_products/static/description/assets/icons/lifebuoy.png b/pos_alternative_products/static/description/assets/icons/lifebuoy.png new file mode 100644 index 000000000..658d56ccc Binary files /dev/null and b/pos_alternative_products/static/description/assets/icons/lifebuoy.png differ diff --git a/pos_alternative_products/static/description/assets/icons/logo.png b/pos_alternative_products/static/description/assets/icons/logo.png new file mode 100644 index 000000000..478462d3e Binary files /dev/null and b/pos_alternative_products/static/description/assets/icons/logo.png differ diff --git a/pos_alternative_products/static/description/assets/icons/manufacturing-black.png b/pos_alternative_products/static/description/assets/icons/manufacturing-black.png new file mode 100644 index 000000000..697eb0e9f Binary files /dev/null and b/pos_alternative_products/static/description/assets/icons/manufacturing-black.png differ diff --git a/pos_alternative_products/static/description/assets/icons/pos-black.png b/pos_alternative_products/static/description/assets/icons/pos-black.png new file mode 100644 index 000000000..97c0f90c1 Binary files /dev/null and b/pos_alternative_products/static/description/assets/icons/pos-black.png differ diff --git a/pos_alternative_products/static/description/assets/icons/puzzle.png b/pos_alternative_products/static/description/assets/icons/puzzle.png new file mode 100644 index 000000000..65cf854e7 Binary files /dev/null and b/pos_alternative_products/static/description/assets/icons/puzzle.png differ diff --git a/pos_alternative_products/static/description/assets/icons/restaurant-black.png b/pos_alternative_products/static/description/assets/icons/restaurant-black.png new file mode 100644 index 000000000..4a35eb939 Binary files /dev/null and b/pos_alternative_products/static/description/assets/icons/restaurant-black.png differ diff --git a/pos_alternative_products/static/description/assets/icons/service-black.png b/pos_alternative_products/static/description/assets/icons/service-black.png new file mode 100644 index 000000000..301ab51cb Binary files /dev/null and b/pos_alternative_products/static/description/assets/icons/service-black.png differ diff --git a/pos_alternative_products/static/description/assets/icons/trading-black.png b/pos_alternative_products/static/description/assets/icons/trading-black.png new file mode 100644 index 000000000..9398ba2f1 Binary files /dev/null and b/pos_alternative_products/static/description/assets/icons/trading-black.png differ diff --git a/pos_alternative_products/static/description/assets/icons/training.png b/pos_alternative_products/static/description/assets/icons/training.png new file mode 100644 index 000000000..884ca024d Binary files /dev/null and b/pos_alternative_products/static/description/assets/icons/training.png differ diff --git a/pos_alternative_products/static/description/assets/icons/update.png b/pos_alternative_products/static/description/assets/icons/update.png new file mode 100644 index 000000000..ecbc5a01a Binary files /dev/null and b/pos_alternative_products/static/description/assets/icons/update.png differ diff --git a/pos_alternative_products/static/description/assets/icons/user.png b/pos_alternative_products/static/description/assets/icons/user.png new file mode 100644 index 000000000..6ffb23d9f Binary files /dev/null and b/pos_alternative_products/static/description/assets/icons/user.png differ diff --git a/pos_alternative_products/static/description/assets/icons/wrench.png b/pos_alternative_products/static/description/assets/icons/wrench.png new file mode 100644 index 000000000..6c04dea0f Binary files /dev/null and b/pos_alternative_products/static/description/assets/icons/wrench.png differ diff --git a/pos_alternative_products/static/description/assets/misc/categories.png b/pos_alternative_products/static/description/assets/misc/categories.png new file mode 100644 index 000000000..bedf1e0b1 Binary files /dev/null and b/pos_alternative_products/static/description/assets/misc/categories.png differ diff --git a/pos_alternative_products/static/description/assets/misc/check-box.png b/pos_alternative_products/static/description/assets/misc/check-box.png new file mode 100644 index 000000000..42caf24b9 Binary files /dev/null and b/pos_alternative_products/static/description/assets/misc/check-box.png differ diff --git a/pos_alternative_products/static/description/assets/misc/compass.png b/pos_alternative_products/static/description/assets/misc/compass.png new file mode 100644 index 000000000..d5fed8faa Binary files /dev/null and b/pos_alternative_products/static/description/assets/misc/compass.png differ diff --git a/pos_alternative_products/static/description/assets/misc/corporate.png b/pos_alternative_products/static/description/assets/misc/corporate.png new file mode 100644 index 000000000..2eb13edbf Binary files /dev/null and b/pos_alternative_products/static/description/assets/misc/corporate.png differ diff --git a/pos_alternative_products/static/description/assets/misc/customer-support.png b/pos_alternative_products/static/description/assets/misc/customer-support.png new file mode 100644 index 000000000..79efc72ed Binary files /dev/null and b/pos_alternative_products/static/description/assets/misc/customer-support.png differ diff --git a/pos_alternative_products/static/description/assets/misc/cybrosys-logo.png b/pos_alternative_products/static/description/assets/misc/cybrosys-logo.png new file mode 100644 index 000000000..cc3cc0ccf Binary files /dev/null and b/pos_alternative_products/static/description/assets/misc/cybrosys-logo.png differ diff --git a/pos_alternative_products/static/description/assets/misc/features.png b/pos_alternative_products/static/description/assets/misc/features.png new file mode 100644 index 000000000..b41769f77 Binary files /dev/null and b/pos_alternative_products/static/description/assets/misc/features.png differ diff --git a/pos_alternative_products/static/description/assets/misc/logo.png b/pos_alternative_products/static/description/assets/misc/logo.png new file mode 100644 index 000000000..478462d3e Binary files /dev/null and b/pos_alternative_products/static/description/assets/misc/logo.png differ diff --git a/pos_alternative_products/static/description/assets/misc/pictures.png b/pos_alternative_products/static/description/assets/misc/pictures.png new file mode 100644 index 000000000..56d255fe9 Binary files /dev/null and b/pos_alternative_products/static/description/assets/misc/pictures.png differ diff --git a/pos_alternative_products/static/description/assets/misc/pie-chart.png b/pos_alternative_products/static/description/assets/misc/pie-chart.png new file mode 100644 index 000000000..426e05244 Binary files /dev/null and b/pos_alternative_products/static/description/assets/misc/pie-chart.png differ diff --git a/pos_alternative_products/static/description/assets/misc/right-arrow.png b/pos_alternative_products/static/description/assets/misc/right-arrow.png new file mode 100644 index 000000000..730984a06 Binary files /dev/null and b/pos_alternative_products/static/description/assets/misc/right-arrow.png differ diff --git a/pos_alternative_products/static/description/assets/misc/star.png b/pos_alternative_products/static/description/assets/misc/star.png new file mode 100644 index 000000000..2eb9ab29f Binary files /dev/null and b/pos_alternative_products/static/description/assets/misc/star.png differ diff --git a/pos_alternative_products/static/description/assets/misc/support.png b/pos_alternative_products/static/description/assets/misc/support.png new file mode 100644 index 000000000..4f18b8b82 Binary files /dev/null and b/pos_alternative_products/static/description/assets/misc/support.png differ diff --git a/pos_alternative_products/static/description/assets/misc/whatsapp.png b/pos_alternative_products/static/description/assets/misc/whatsapp.png new file mode 100644 index 000000000..d513a5356 Binary files /dev/null and b/pos_alternative_products/static/description/assets/misc/whatsapp.png differ diff --git a/pos_alternative_products/static/description/assets/modules/1.png b/pos_alternative_products/static/description/assets/modules/1.png new file mode 100644 index 000000000..8c466b995 Binary files /dev/null and b/pos_alternative_products/static/description/assets/modules/1.png differ diff --git a/pos_alternative_products/static/description/assets/modules/2.png b/pos_alternative_products/static/description/assets/modules/2.png new file mode 100644 index 000000000..a7019103f Binary files /dev/null and b/pos_alternative_products/static/description/assets/modules/2.png differ diff --git a/pos_alternative_products/static/description/assets/modules/3.png b/pos_alternative_products/static/description/assets/modules/3.png new file mode 100644 index 000000000..9dc1b57ba Binary files /dev/null and b/pos_alternative_products/static/description/assets/modules/3.png differ diff --git a/pos_alternative_products/static/description/assets/modules/4.png b/pos_alternative_products/static/description/assets/modules/4.png new file mode 100644 index 000000000..4891e5422 Binary files /dev/null and b/pos_alternative_products/static/description/assets/modules/4.png differ diff --git a/pos_alternative_products/static/description/assets/modules/5.png b/pos_alternative_products/static/description/assets/modules/5.png new file mode 100644 index 000000000..976445cef Binary files /dev/null and b/pos_alternative_products/static/description/assets/modules/5.png differ diff --git a/pos_alternative_products/static/description/assets/modules/6.png b/pos_alternative_products/static/description/assets/modules/6.png new file mode 100644 index 000000000..b1775ba95 Binary files /dev/null and b/pos_alternative_products/static/description/assets/modules/6.png differ diff --git a/pos_alternative_products/static/description/assets/screenshots/1.png b/pos_alternative_products/static/description/assets/screenshots/1.png new file mode 100644 index 000000000..9762e7428 Binary files /dev/null and b/pos_alternative_products/static/description/assets/screenshots/1.png differ diff --git a/pos_alternative_products/static/description/assets/screenshots/2.png b/pos_alternative_products/static/description/assets/screenshots/2.png new file mode 100644 index 000000000..866566fbd Binary files /dev/null and b/pos_alternative_products/static/description/assets/screenshots/2.png differ diff --git a/pos_alternative_products/static/description/assets/screenshots/3.png b/pos_alternative_products/static/description/assets/screenshots/3.png new file mode 100644 index 000000000..e788beede Binary files /dev/null and b/pos_alternative_products/static/description/assets/screenshots/3.png differ diff --git a/pos_alternative_products/static/description/assets/screenshots/hero.gif b/pos_alternative_products/static/description/assets/screenshots/hero.gif new file mode 100644 index 000000000..52a569f51 Binary files /dev/null and b/pos_alternative_products/static/description/assets/screenshots/hero.gif differ diff --git a/pos_alternative_products/static/description/banner.png b/pos_alternative_products/static/description/banner.png new file mode 100644 index 000000000..b7f5538db Binary files /dev/null and b/pos_alternative_products/static/description/banner.png differ diff --git a/pos_alternative_products/static/description/icon.png b/pos_alternative_products/static/description/icon.png new file mode 100644 index 000000000..e17056ea1 Binary files /dev/null and b/pos_alternative_products/static/description/icon.png differ diff --git a/pos_alternative_products/static/description/images/arrows-transparent.png b/pos_alternative_products/static/description/images/arrows-transparent.png new file mode 100644 index 000000000..f2973bb02 Binary files /dev/null and b/pos_alternative_products/static/description/images/arrows-transparent.png differ diff --git a/pos_alternative_products/static/description/images/cybro_logo.png b/pos_alternative_products/static/description/images/cybro_logo.png new file mode 100644 index 000000000..bb309114c Binary files /dev/null and b/pos_alternative_products/static/description/images/cybro_logo.png differ diff --git a/pos_alternative_products/static/description/images/icons/ecom.png b/pos_alternative_products/static/description/images/icons/ecom.png new file mode 100644 index 000000000..6e720d50e Binary files /dev/null and b/pos_alternative_products/static/description/images/icons/ecom.png differ diff --git a/pos_alternative_products/static/description/images/icons/education.png b/pos_alternative_products/static/description/images/icons/education.png new file mode 100644 index 000000000..f0de98eb0 Binary files /dev/null and b/pos_alternative_products/static/description/images/icons/education.png differ diff --git a/pos_alternative_products/static/description/images/icons/hotel.png b/pos_alternative_products/static/description/images/icons/hotel.png new file mode 100644 index 000000000..917c6a63e Binary files /dev/null and b/pos_alternative_products/static/description/images/icons/hotel.png differ diff --git a/pos_alternative_products/static/description/images/icons/manufacturing.png b/pos_alternative_products/static/description/images/icons/manufacturing.png new file mode 100644 index 000000000..68c3722f8 Binary files /dev/null and b/pos_alternative_products/static/description/images/icons/manufacturing.png differ diff --git a/pos_alternative_products/static/description/images/icons/pos.png b/pos_alternative_products/static/description/images/icons/pos.png new file mode 100644 index 000000000..600bfe4f9 Binary files /dev/null and b/pos_alternative_products/static/description/images/icons/pos.png differ diff --git a/pos_alternative_products/static/description/images/icons/restaurant.png b/pos_alternative_products/static/description/images/icons/restaurant.png new file mode 100644 index 000000000..680acf29e Binary files /dev/null and b/pos_alternative_products/static/description/images/icons/restaurant.png differ diff --git a/pos_alternative_products/static/description/images/icons/service.png b/pos_alternative_products/static/description/images/icons/service.png new file mode 100644 index 000000000..bfbe7a6d2 Binary files /dev/null and b/pos_alternative_products/static/description/images/icons/service.png differ diff --git a/pos_alternative_products/static/description/images/icons/trading.png b/pos_alternative_products/static/description/images/icons/trading.png new file mode 100644 index 000000000..a741219b5 Binary files /dev/null and b/pos_alternative_products/static/description/images/icons/trading.png differ diff --git a/pos_alternative_products/static/description/index.html b/pos_alternative_products/static/description/index.html new file mode 100755 index 000000000..cd450132e --- /dev/null +++ b/pos_alternative_products/static/description/index.html @@ -0,0 +1,625 @@ +
+ +
+ +
+
+ Odoo.sh +
+
+ Community +
+
+ Enterprise +
+
+
+ +
+
+
+ +

+ Alternative Products in Pos

+

+ A Module For Choosing Alternative Products If The Selected Product Quantity Is Zero. +

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

+ Explore This + Module

+
+ + + + +
+
+ +
+

+ Overview +

+
+
+
+ Pos Alternative Product module is used to choose the alternative product, if the selected product quantity is zero. +
+
+ + + +
+
+ +
+

+ Features +

+
+
+
+
+ + We can choose the alternative products if the selected product quantity is zero. +
+
+
+ + + +
+
+ +
+

+ Screenshots +

+
+
+
+
+

+ Choose the Alternative Products.

+

+ Add alternative products when the product having on-hand quantity less than or equal to zero. +

+ +
+
+

+ Go to pos and select the product a popup will be appeared with the alternative product.

+ +
+
+

+ If we want to add the product on our order either we can add or we can skip.

+ +
+
+ + + +
+
+

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_alternative_products/static/src/js/AbstractAwaitablePopup.js b/pos_alternative_products/static/src/js/AbstractAwaitablePopup.js new file mode 100644 index 000000000..50ce3614e --- /dev/null +++ b/pos_alternative_products/static/src/js/AbstractAwaitablePopup.js @@ -0,0 +1,47 @@ +odoo.define('pos_alternative_products.AlternativeProductPopup', function (require) { + 'use strict'; + //Which is used to add pop up for alternative products. + const { useListener } = require("@web/core/utils/hooks"); + const AbstractAwaitablePopup = require('point_of_sale.AbstractAwaitablePopup'); + const Registries = require('point_of_sale.Registries'); + const { _t } = require('web.core'); + var rpc = require('web.rpc'); + //Alternative product pop up + class AlternativeProduct extends AbstractAwaitablePopup { + setup() { + super.setup(); + useListener('click-product', this._clickProduct); + } + async _clickProduct(item){ + var response = await this.rpc({ + model: 'stock.quant', + method: "pos_alternative_product", + args:[,item.detail.id,item.detail.default_code] + }) + if (response!=0) + { + var product = await this.env.pos.db.get_product_by_id(parseInt(response)); + this.env.pos.get_order().add_product(product); + this.trigger('close-popup', { + popupId: this.props.id, + response: { confirmed: true, payload: null}, + }); + } + else{ + this.showPopup('ErrorPopup', { + title: this.env._t('Product Missing'), + body: this.env._t('Make sure that the product is available in pos'), + }); + } + } + } + //Create AlternativeProduct popup + AlternativeProduct.template = 'AlternativeProduct'; + AlternativeProduct.defaultProps = { + cancelText: 'Cancel', + title: 'Alternative Product', + body: '', + }; + Registries.Component.add(AlternativeProduct); + return AlternativeProduct; +}); diff --git a/pos_alternative_products/static/src/js/ProductScreen.js b/pos_alternative_products/static/src/js/ProductScreen.js new file mode 100644 index 000000000..512f4cc93 --- /dev/null +++ b/pos_alternative_products/static/src/js/ProductScreen.js @@ -0,0 +1,49 @@ +odoo.define('pos_alternative_products.AlternativeProductScreen', function(require) { + 'use strict'; +//By extending the product screen + const Registries = require('point_of_sale.Registries'); + const ProductScreen = require('point_of_sale.ProductScreen'); + const { format } = require('web.field_utils'); + var { Gui } = require('point_of_sale.Gui'); + const NumberBuffer = require('point_of_sale.NumberBuffer'); + var core = require('web.core'); + var _t = core._t; + var { PosGlobalState } = require('point_of_sale.models'); + const AlternativeProduct = ProductScreen => + class extends ProductScreen { + //Overrides the click function of the product + async _clickProduct(event) { + var alter_products = this.env.pos.product_template.filter(function(dataObj){ + return event.detail.alternative_product_ids.includes (dataObj.id) + }) + for(var i=0; i < alter_products.length; i++){ + alter_products[i]['image_url'] = window.location.origin + "/web/image/product.template/" + alter_products[i].id + "/image_128"; + } + var response = await this.rpc({ + model: 'stock.quant', + method: "pos_stock_product", + args:[,event.detail.id] + }) + if (response == 0){ + Gui.showPopup("AlternativeProduct", { + title: this.env._t('Alternative Product'), + cancelText: this.env._t("Cancel"), + body: alter_products, + });} + else{ + if (!this.currentOrder) { + this.env.pos.add_new_order(); + } + const product = event.detail; + const options = await this._getAddProductOptions(product); + // Do not add product if options is undefined. + if (!options) return; + // Add the product after having the extra information. + await this.currentOrder.add_product(product, options); + NumberBuffer.reset(); + } + } + } + Registries.Component.extend(ProductScreen, AlternativeProduct); + return ProductScreen; + }); diff --git a/pos_alternative_products/static/src/js/models.js b/pos_alternative_products/static/src/js/models.js new file mode 100644 index 000000000..4a7719ced --- /dev/null +++ b/pos_alternative_products/static/src/js/models.js @@ -0,0 +1,15 @@ +odoo.define('pos_alternative_products.models', function(require) { + "use strict"; + var models = require('point_of_sale.models'); + /** + * Loading the required model and fields + */ + models.load_fields('product.product', 'alternative_product_ids'); + models.load_models({ + model: 'product.template', + fields: ['display_name', 'default_code'], + loaded: function(self, product_template) { + self.product_template = product_template; + } + }); +}); diff --git a/pos_alternative_products/static/src/xml/alternative_pop_up_templates.xml b/pos_alternative_products/static/src/xml/alternative_pop_up_templates.xml new file mode 100644 index 000000000..a43eb028b --- /dev/null +++ b/pos_alternative_products/static/src/xml/alternative_pop_up_templates.xml @@ -0,0 +1,37 @@ + + + + + + +