diff --git a/pos_alternative_products/README.rst b/pos_alternative_products/README.rst new file mode 100644 index 000000000..a598046c1 --- /dev/null +++ b/pos_alternative_products/README.rst @@ -0,0 +1,50 @@ +.. image:: https://img.shields.io/badge/license-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 +============= +- www.odoo.com/documentation/17.0/setup/install.html +- Install our custom addon + +Company +------- +* `Cybrosys Techno Solutions `__ + +License +------- +General Public License, Version 3 (LGPL v3). +(http://www.gnu.org/licenses/lgpl-3.0-standalone.html) + +Credits +------- +* Developers: (V17) SRUTHI PAVITHRAN, + (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..f63ca0dc9 --- /dev/null +++ b/pos_alternative_products/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2025-TODAY Cybrosys Technologies() +# Author: Sruthi Pavithran (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..9d8128a33 --- /dev/null +++ b/pos_alternative_products/__manifest__.py @@ -0,0 +1,48 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2025-TODAY Cybrosys Technologies() +# Author: Sruthi Pavithran (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': '17.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', 'website_sale'], + 'assets': { + 'point_of_sale._assets_pos': [ + 'pos_alternative_products/static/src/js/ProductScreen.js', + 'pos_alternative_products/static/src/js/AbstractAwaitablePopup.js', + 'pos_alternative_products/static/src/xml/alternative_pop_up_templates.xml', + ], + }, + 'images': ['static/description/banner.jpg'], + '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..5b7017c41 --- /dev/null +++ b/pos_alternative_products/doc/RELEASE_NOTES.md @@ -0,0 +1,6 @@ +## Module + +#### 19.04.2025 +#### Version 17.0.1.0.0 +##### ADD +- Initial commit for POS Alternative Products diff --git a/pos_alternative_products/models/__init__.py b/pos_alternative_products/models/__init__.py new file mode 100644 index 000000000..517322b33 --- /dev/null +++ b/pos_alternative_products/models/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2025-TODAY Cybrosys Technologies() +# Author: Sruthi Pavithran (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 pos_session +from . import stock_quant diff --git a/pos_alternative_products/models/pos_session.py b/pos_alternative_products/models/pos_session.py new file mode 100644 index 000000000..aa3f2a2a0 --- /dev/null +++ b/pos_alternative_products/models/pos_session.py @@ -0,0 +1,55 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2025-TODAY Cybrosys Technologies() +# Author: Sruthi Pavithran (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 api, models + + +class PosSession(models.Model): + """This is used to load the models and fields to pos session""" + _inherit = 'pos.session' + + @api.model + def _pos_ui_models_to_load(self): + """This is used to load a new model to pos session""" + result = super()._pos_ui_models_to_load() + result += [ + 'product.template', + ] + return result + + def _loader_params_product_template(self): + """This is used to load the model fields""" + return { + 'search_params': { + 'fields': ['display_name', 'default_code'], + } + } + + def _get_pos_ui_product_template(self, params): + """This is used to load the model""" + return self.env['product.template'].search_read( + **params['search_params']) + + def _loader_params_product_product(self): + """To load the parameter""" + result = super()._loader_params_product_product() + result['search_params']['fields'].append('alternative_product_ids') + return result diff --git a/pos_alternative_products/models/stock_quant.py b/pos_alternative_products/models/stock_quant.py new file mode 100644 index 000000000..6018a0a36 --- /dev/null +++ b/pos_alternative_products/models/stock_quant.py @@ -0,0 +1,66 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2025-TODAY Cybrosys Technologies() +# Author: Sruthi Pavithran (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 api, models + + +class StockQuant(models.Model): + """This class is used to compute the quantity and returns the product""" + _inherit = 'stock.quant' + + @api.model + 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 + + @api.model + 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), + ], 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 + + @api.model + 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 100755 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 100755 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 100755 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 100755 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 100755 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 100755 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 100755 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 100755 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 100755 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 100755 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 100755 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 100755 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 100755 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 100755 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 100755 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 100755 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 100755 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 100755 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 100755 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 100755 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/Cybrosys R.png b/pos_alternative_products/static/description/assets/misc/Cybrosys R.png new file mode 100755 index 000000000..da4058087 Binary files /dev/null and b/pos_alternative_products/static/description/assets/misc/Cybrosys R.png differ diff --git a/pos_alternative_products/static/description/assets/misc/email.svg b/pos_alternative_products/static/description/assets/misc/email.svg new file mode 100755 index 000000000..15291cdc3 --- /dev/null +++ b/pos_alternative_products/static/description/assets/misc/email.svg @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/pos_alternative_products/static/description/assets/misc/phone.svg b/pos_alternative_products/static/description/assets/misc/phone.svg new file mode 100755 index 000000000..b7bd7f251 --- /dev/null +++ b/pos_alternative_products/static/description/assets/misc/phone.svg @@ -0,0 +1,3 @@ + + + diff --git a/pos_alternative_products/static/description/assets/misc/star (1) 2.svg b/pos_alternative_products/static/description/assets/misc/star (1) 2.svg new file mode 100755 index 000000000..5ae9f507a --- /dev/null +++ b/pos_alternative_products/static/description/assets/misc/star (1) 2.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/pos_alternative_products/static/description/assets/misc/support (1) 1.svg b/pos_alternative_products/static/description/assets/misc/support (1) 1.svg new file mode 100755 index 000000000..7d37a8f30 --- /dev/null +++ b/pos_alternative_products/static/description/assets/misc/support (1) 1.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/pos_alternative_products/static/description/assets/misc/support-email.svg b/pos_alternative_products/static/description/assets/misc/support-email.svg new file mode 100755 index 000000000..eb70370d6 --- /dev/null +++ b/pos_alternative_products/static/description/assets/misc/support-email.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/pos_alternative_products/static/description/assets/misc/tick-mark.svg b/pos_alternative_products/static/description/assets/misc/tick-mark.svg new file mode 100755 index 000000000..2dbb40187 --- /dev/null +++ b/pos_alternative_products/static/description/assets/misc/tick-mark.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/pos_alternative_products/static/description/assets/misc/whatsapp 1.svg b/pos_alternative_products/static/description/assets/misc/whatsapp 1.svg new file mode 100755 index 000000000..0bfaf8fc6 --- /dev/null +++ b/pos_alternative_products/static/description/assets/misc/whatsapp 1.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/pos_alternative_products/static/description/assets/misc/whatsapp.svg b/pos_alternative_products/static/description/assets/misc/whatsapp.svg new file mode 100755 index 000000000..b618aea1d --- /dev/null +++ b/pos_alternative_products/static/description/assets/misc/whatsapp.svg @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 100755 index 000000000..5ecc4d883 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 100755 index 000000000..05ed3ee8c 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 100755 index 000000000..5514bb8d4 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 100755 index 000000000..38ea1f663 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 100755 index 000000000..dcbd0cb06 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 100755 index 000000000..05ed3ee8c 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/alternative_product.png b/pos_alternative_products/static/description/assets/screenshots/alternative_product.png new file mode 100644 index 000000000..587d4ba75 Binary files /dev/null and b/pos_alternative_products/static/description/assets/screenshots/alternative_product.png differ diff --git a/pos_alternative_products/static/description/assets/screenshots/alternative_product_1.png b/pos_alternative_products/static/description/assets/screenshots/alternative_product_1.png new file mode 100644 index 000000000..54f1aa6bf Binary files /dev/null and b/pos_alternative_products/static/description/assets/screenshots/alternative_product_1.png differ diff --git a/pos_alternative_products/static/description/assets/screenshots/alternative_product_2.png b/pos_alternative_products/static/description/assets/screenshots/alternative_product_2.png new file mode 100644 index 000000000..cbd269786 Binary files /dev/null and b/pos_alternative_products/static/description/assets/screenshots/alternative_product_2.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..e887c40c1 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.jpg b/pos_alternative_products/static/description/banner.jpg new file mode 100644 index 000000000..44e20ca67 Binary files /dev/null and b/pos_alternative_products/static/description/banner.jpg 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..f941645a1 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 100644 index 000000000..d678ced69 --- /dev/null +++ b/pos_alternative_products/static/description/index.html @@ -0,0 +1,635 @@ + + + + + + Odoo App 3 Index + + + + + + + + +
+
+
+
+
+ +
+
+
+ Community +
+
+ Enterprise +
+
+
+
+
+
+

+ Alternative Products in Pos

+

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

+
+ +
+
+
+
+
+

+ Key Highlights +

+
+
+
+
+
+ +
+
+

+ Select Alternative Product

+

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

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

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

+
+
+
+
+
+
+
    +
  • + Add alternative products when the product having on-hand + quantity less than or equal to zero. +
  • +
+
+
+
+
+
+
Version + 17.0.1.0.0|Released on:15th Feb 2025 +
+

+ Initial Commit for Alternative Products in Pos.

+
+
+
+
+
+
+
+

+ Related Products

+
+
+ +
+
+

+ Our Services

+ +
+
+
+
+
+
+
+
+ service-icon +
+
+

Odoo + Customization

+
+
+
+
+
+
+ service-icon +
+
+

Odoo + Implementation

+
+
+
+
+
+
+ service-icon +
+
+

Odoo + Support

+
+
+
+
+
+
+ service-icon +
+
+

Hire + Odoo Developer

+
+
+
+
+ +
+
+ service-icon +
+
+

Odoo + Integration

+
+
+
+
+
+
+ service-icon +
+
+

Odoo + Migration

+
+
+
+
+
+
+ service-icon +
+
+

Odoo + Consultancy

+
+
+
+
+
+
+ service-icon +
+
+

Odoo + Implementation

+
+
+
+
+
+
+ service-icon +
+
+

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 + 99456767686 +
+
+
+
+
+
+
+
+
+ + + + + + 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..eedb80eda --- /dev/null +++ b/pos_alternative_products/static/src/js/AbstractAwaitablePopup.js @@ -0,0 +1,42 @@ +/** @odoo-module **/ + +import { AbstractAwaitablePopup } from "@point_of_sale/app/popup/abstract_awaitable_popup"; +import { usePos } from "@point_of_sale/app/store/pos_hook"; +import { Component } from "@odoo/owl"; +import { useService } from "@web/core/utils/hooks"; +import { ErrorPopup } from "@point_of_sale/app/errors/popups/error_popup"; +import { _t } from "@web/core/l10n/translation"; + +export class AlternativeProduct extends AbstractAwaitablePopup { + static template = "pos_alternative_products.AlternativeProduct"; + static defaultProps = { + cancelText: 'Cancel', + title: 'Alternative Product', + body: '', + }; + setup() { + super.setup(); + this.pos = usePos(); + this.orm = useService("orm"); + this.popup = useService("popup"); + + } + async clickProduct(item){ + var response = await this.orm.call("stock.quant", "pos_alternative_product", [item.id, item.default_code,]); + if (response.length!=0) + { + var product = await this.pos.db.get_product_by_id(parseInt(response)); + this.pos.get_order().add_product(product); + super.confirm(); + } + else{ + await this.popup.add(ErrorPopup, { + title: _t("Product Missing"), + body: _t("Make sure that the product is available in pos."), + }); + } + } + cancel() { + super.cancel(); + } +} 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..73af78552 --- /dev/null +++ b/pos_alternative_products/static/src/js/ProductScreen.js @@ -0,0 +1,43 @@ +/** @odoo-module **/ + +import { PosStore } from "@point_of_sale/app/store/pos_store"; +import { patch } from "@web/core/utils/patch"; +import { ProductScreen } from "@point_of_sale/app/screens/product_screen/product_screen"; +import { AlternativeProduct } from "./AbstractAwaitablePopup"; +import { useService } from "@web/core/utils/hooks"; +import { _t } from "@web/core/l10n/translation"; + + +patch(PosStore.prototype, { + async _processData(loadedData) { + //@override + await super._processData(...arguments); + this.product_template = loadedData['product.template']; + }, + async addProductToCurrentOrder(product, options = {}) { + // Generate a popup when clicking on a product having alternative products + const alter_products = this.product_template.filter(function(dataObj){ + return product.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.orm.call('stock.quant','pos_stock_product', [product.id]); + if (response && alter_products.length > 0){ + this.popup.add(AlternativeProduct, { + title: _t('Alternative Product'), + cancelText: _t("Cancel"), + body: alter_products + }); + } + else if (response == 0 && alter_products.length == 0) { + this.popup.add(AlternativeProduct, { + title: _t('Not in Stock'), + cancelText: _t("Cancel"), + }); + } + else{ + return super.addProductToCurrentOrder(...arguments); + } + }, +}); 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..81bb131de --- /dev/null +++ b/pos_alternative_products/static/src/xml/alternative_pop_up_templates.xml @@ -0,0 +1,39 @@ + + + + + + +