diff --git a/pos_pro_cross_selling/README.rst b/pos_pro_cross_selling/README.rst new file mode 100644 index 000000000..d81151a0c --- /dev/null +++ b/pos_pro_cross_selling/README.rst @@ -0,0 +1,50 @@ +.. image:: https://img.shields.io/badge/license-AGPL--3-blue.svg + :target: https://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 + +POS Cross-Selling +================= +This module allow to Manage POS Cross Selling products and use them in +Point of Sales in Odoo. + +Configuration +============= +The user should be added to the security group: Administrator(Point of Sale) +inorder to get access to the new menu. + +License +======= +GNU AFFERO GENERAL PUBLIC LICENSE, Version 3 (AGPLv3) +(http://www.gnu.org/licenses/agpl-3.0-standalone.html) + +Company +------- +* `Cybrosys Techno Solutions `__ + +Credits +------- +Developer: (V16) Megha K @cybrosys, + (V15) Sabeel B @cybrosys, + Contact: odoo@cybrosys.com + +Contacts +-------- +* Mail Contact : odoo@cybrosys.com +* Website : https://cybrosys.com + +Bug Tracker +----------- +Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. + +Maintainer +========== +.. image:: https://cybrosys.com/images/logo.png + :target: https://cybrosys.com + +This module is maintained by Cybrosys Technologies. + +For support and more information, please visit `Our Website `__ + +Further information +=================== +HTML Description: ``__ diff --git a/pos_pro_cross_selling/__init__.py b/pos_pro_cross_selling/__init__.py new file mode 100644 index 000000000..eabe227ba --- /dev/null +++ b/pos_pro_cross_selling/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# 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 for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################# +from . import models diff --git a/pos_pro_cross_selling/__manifest__.py b/pos_pro_cross_selling/__manifest__.py new file mode 100644 index 000000000..2080a7a69 --- /dev/null +++ b/pos_pro_cross_selling/__manifest__.py @@ -0,0 +1,54 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# 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 for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################# +{ + 'name': 'POS Cross-Selling', + 'version': '15.0.1.0.0', + 'category': 'Point Of Sale', + 'summary': 'Cross Selling products in pos', + 'description': "This module is used for cross selling products in pos. " + "We can manage and use the cross-selling product in pos", + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': 'https://www.cybrosys.com', + 'depends': ['point_of_sale'], + 'data': [ + 'security/ir.model.access.csv', + 'views/pos_cross_selling_views.xml', + ], + 'assets': { + 'point_of_sale.assets': [ + '/pos_pro_cross_selling/static/src/js/CrossProduct.js', + '/pos_pro_cross_selling/static/src/js/ProductItem.js', + '/pos_pro_cross_selling/static/src/scss/cross_product.scss' + ], + 'web.assets_qweb': [ + 'pos_pro_cross_selling/static/src/xml/cross_product_templates.xml', + ], + }, + 'images': ['static/description/banner.png'], + 'license': 'AGPL-3', + 'installable': True, + 'auto_install': False, + 'application': False, +} diff --git a/pos_pro_cross_selling/doc/RELEASE_NOTES.md b/pos_pro_cross_selling/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..3b3764a0d --- /dev/null +++ b/pos_pro_cross_selling/doc/RELEASE_NOTES.md @@ -0,0 +1,7 @@ +## Module + +#### 02.08.2024 +#### Version 15.0.1.0.0 +#### ADD + +- Initial commit for POS Cross-Selling diff --git a/pos_pro_cross_selling/models/__init__.py b/pos_pro_cross_selling/models/__init__.py new file mode 100644 index 000000000..c4277b221 --- /dev/null +++ b/pos_pro_cross_selling/models/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# 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 for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################# +from . import pos_cross_selling diff --git a/pos_pro_cross_selling/models/pos_cross_selling.py b/pos_pro_cross_selling/models/pos_cross_selling.py new file mode 100644 index 000000000..fe7b263bc --- /dev/null +++ b/pos_pro_cross_selling/models/pos_cross_selling.py @@ -0,0 +1,97 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# 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 for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################# +from odoo import api, fields, models, _ +from odoo.exceptions import ValidationError + + +class PosCrossSelling(models.Model): + """Model Pos Cross-Selling Products""" + _name = 'pos.cross.selling' + _description = 'POS Cross-Selling' + _rec_name = 'product_id' + + product_id = fields.Many2one('product.product', + domain=[('available_in_pos', '=', 'True')], + required=True, string='Product Name', + help="Product details") + active = fields.Boolean(string='Active', + help="To check the cross selling is active or not", + default=True) + pos_cross_product_ids = fields.One2many('pos.cross.selling.line', + 'pos_cross_product_id', + string='Pos Cross products', + help="Pos Cross products") + + @api.constrains('product_id') + def _check_product_id(self): + """This method for avoid multiple creation of pos + cross-selling products""" + for rec in self: + pos = self.env['pos.cross.selling'].search( + [('product_id', '=', rec.product_id.id)]) + if len(pos) > 1: + raise ValidationError(_('Already exist a cross product with the' + ' %s product ') % rec.product_id.name) + + @api.constrains('pos_cross_product_ids') + def _check_pos_cross_product_ids(self): + """This method for add cross product lines""" + for rec in self: + if len(rec.pos_cross_product_ids) < 0: + raise ValidationError(_("Please add the cross products lines")) + + def get_cross_selling_products(self, product_id): + """ + Getting the required values for the tables + and return the values to that template + """ + cross = self.env['pos.cross.selling'].search( + [('product_id', '=', product_id)]) + vals = [] + for rec in cross.pos_cross_product_ids: + vals.append({ + 'id': rec.product_id.id, + 'image': '/web/image?model=product.product&field=image_128&id=' + + str(rec.product_id.id), + 'name': rec.product_id.name, + 'symbol': rec.product_id.cost_currency_id.symbol, + 'price': rec.product_id.lst_price, + 'selected': False}) + return vals + + +class PosCrossSellingLine(models.Model): + """Pos Cross-Selling Products Line""" + _name = 'pos.cross.selling.line' + _description = 'POS Cross-Selling Product Line' + + product_id = fields.Many2one('product.product', + domain=[('available_in_pos', '=', 'True')], + required=True, string='Product Name', + help="Product details") + active = fields.Boolean(string='Active', + help="To check the cross selling is active or not", + default=True) + pos_cross_product_id = fields.Many2one('pos.cross.selling', + string='Pos Cross products', + help="Pos Cross products") diff --git a/pos_pro_cross_selling/security/ir.model.access.csv b/pos_pro_cross_selling/security/ir.model.access.csv new file mode 100644 index 000000000..2ed79d1cb --- /dev/null +++ b/pos_pro_cross_selling/security/ir.model.access.csv @@ -0,0 +1,5 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access_pos_cross_selling,access.pos.cross.selling,model_pos_cross_selling,base.group_user,1,0,0,0 +access_pos_cross_selling_line,access.pos.cross.selling.line,model_pos_cross_selling_line,base.group_user,1,0,0,0 +access_pos_cross_selling,access.pos.cross.selling,model_pos_cross_selling,point_of_sale.group_pos_manager,1,1,1,1 +access_pos_cross_selling_line,access.pos.cross.selling.line,model_pos_cross_selling_line,point_of_sale.group_pos_manager,1,1,1,1 diff --git a/pos_pro_cross_selling/static/description/assets/icons/check.png b/pos_pro_cross_selling/static/description/assets/icons/check.png new file mode 100644 index 000000000..c8e85f51d Binary files /dev/null and b/pos_pro_cross_selling/static/description/assets/icons/check.png differ diff --git a/pos_pro_cross_selling/static/description/assets/icons/chevron.png b/pos_pro_cross_selling/static/description/assets/icons/chevron.png new file mode 100644 index 000000000..2089293d6 Binary files /dev/null and b/pos_pro_cross_selling/static/description/assets/icons/chevron.png differ diff --git a/pos_pro_cross_selling/static/description/assets/icons/cogs.png b/pos_pro_cross_selling/static/description/assets/icons/cogs.png new file mode 100644 index 000000000..95d0bad62 Binary files /dev/null and b/pos_pro_cross_selling/static/description/assets/icons/cogs.png differ diff --git a/pos_pro_cross_selling/static/description/assets/icons/consultation.png b/pos_pro_cross_selling/static/description/assets/icons/consultation.png new file mode 100644 index 000000000..8319d4baa Binary files /dev/null and b/pos_pro_cross_selling/static/description/assets/icons/consultation.png differ diff --git a/pos_pro_cross_selling/static/description/assets/icons/ecom-black.png b/pos_pro_cross_selling/static/description/assets/icons/ecom-black.png new file mode 100644 index 000000000..a9385ff13 Binary files /dev/null and b/pos_pro_cross_selling/static/description/assets/icons/ecom-black.png differ diff --git a/pos_pro_cross_selling/static/description/assets/icons/education-black.png b/pos_pro_cross_selling/static/description/assets/icons/education-black.png new file mode 100644 index 000000000..3eb09b27b Binary files /dev/null and b/pos_pro_cross_selling/static/description/assets/icons/education-black.png differ diff --git a/pos_pro_cross_selling/static/description/assets/icons/hotel-black.png b/pos_pro_cross_selling/static/description/assets/icons/hotel-black.png new file mode 100644 index 000000000..130f613be Binary files /dev/null and b/pos_pro_cross_selling/static/description/assets/icons/hotel-black.png differ diff --git a/pos_pro_cross_selling/static/description/assets/icons/license.png b/pos_pro_cross_selling/static/description/assets/icons/license.png new file mode 100644 index 000000000..a5869797e Binary files /dev/null and b/pos_pro_cross_selling/static/description/assets/icons/license.png differ diff --git a/pos_pro_cross_selling/static/description/assets/icons/lifebuoy.png b/pos_pro_cross_selling/static/description/assets/icons/lifebuoy.png new file mode 100644 index 000000000..658d56ccc Binary files /dev/null and b/pos_pro_cross_selling/static/description/assets/icons/lifebuoy.png differ diff --git a/pos_pro_cross_selling/static/description/assets/icons/logo.png b/pos_pro_cross_selling/static/description/assets/icons/logo.png new file mode 100644 index 000000000..478462d3e Binary files /dev/null and b/pos_pro_cross_selling/static/description/assets/icons/logo.png differ diff --git a/pos_pro_cross_selling/static/description/assets/icons/manufacturing-black.png b/pos_pro_cross_selling/static/description/assets/icons/manufacturing-black.png new file mode 100644 index 000000000..697eb0e9f Binary files /dev/null and b/pos_pro_cross_selling/static/description/assets/icons/manufacturing-black.png differ diff --git a/pos_pro_cross_selling/static/description/assets/icons/pos-black.png b/pos_pro_cross_selling/static/description/assets/icons/pos-black.png new file mode 100644 index 000000000..97c0f90c1 Binary files /dev/null and b/pos_pro_cross_selling/static/description/assets/icons/pos-black.png differ diff --git a/pos_pro_cross_selling/static/description/assets/icons/puzzle.png b/pos_pro_cross_selling/static/description/assets/icons/puzzle.png new file mode 100644 index 000000000..65cf854e7 Binary files /dev/null and b/pos_pro_cross_selling/static/description/assets/icons/puzzle.png differ diff --git a/pos_pro_cross_selling/static/description/assets/icons/restaurant-black.png b/pos_pro_cross_selling/static/description/assets/icons/restaurant-black.png new file mode 100644 index 000000000..4a35eb939 Binary files /dev/null and b/pos_pro_cross_selling/static/description/assets/icons/restaurant-black.png differ diff --git a/pos_pro_cross_selling/static/description/assets/icons/service-black.png b/pos_pro_cross_selling/static/description/assets/icons/service-black.png new file mode 100644 index 000000000..301ab51cb Binary files /dev/null and b/pos_pro_cross_selling/static/description/assets/icons/service-black.png differ diff --git a/pos_pro_cross_selling/static/description/assets/icons/trading-black.png b/pos_pro_cross_selling/static/description/assets/icons/trading-black.png new file mode 100644 index 000000000..9398ba2f1 Binary files /dev/null and b/pos_pro_cross_selling/static/description/assets/icons/trading-black.png differ diff --git a/pos_pro_cross_selling/static/description/assets/icons/training.png b/pos_pro_cross_selling/static/description/assets/icons/training.png new file mode 100644 index 000000000..884ca024d Binary files /dev/null and b/pos_pro_cross_selling/static/description/assets/icons/training.png differ diff --git a/pos_pro_cross_selling/static/description/assets/icons/update.png b/pos_pro_cross_selling/static/description/assets/icons/update.png new file mode 100644 index 000000000..ecbc5a01a Binary files /dev/null and b/pos_pro_cross_selling/static/description/assets/icons/update.png differ diff --git a/pos_pro_cross_selling/static/description/assets/icons/user.png b/pos_pro_cross_selling/static/description/assets/icons/user.png new file mode 100644 index 000000000..6ffb23d9f Binary files /dev/null and b/pos_pro_cross_selling/static/description/assets/icons/user.png differ diff --git a/pos_pro_cross_selling/static/description/assets/icons/wrench.png b/pos_pro_cross_selling/static/description/assets/icons/wrench.png new file mode 100644 index 000000000..6c04dea0f Binary files /dev/null and b/pos_pro_cross_selling/static/description/assets/icons/wrench.png differ diff --git a/pos_pro_cross_selling/static/description/assets/screenshots/scrn_01.png b/pos_pro_cross_selling/static/description/assets/screenshots/scrn_01.png new file mode 100644 index 000000000..90683954a Binary files /dev/null and b/pos_pro_cross_selling/static/description/assets/screenshots/scrn_01.png differ diff --git a/pos_pro_cross_selling/static/description/assets/screenshots/scrn_02.png b/pos_pro_cross_selling/static/description/assets/screenshots/scrn_02.png new file mode 100644 index 000000000..b8650dcae Binary files /dev/null and b/pos_pro_cross_selling/static/description/assets/screenshots/scrn_02.png differ diff --git a/pos_pro_cross_selling/static/description/assets/screenshots/scrn_03.png b/pos_pro_cross_selling/static/description/assets/screenshots/scrn_03.png new file mode 100644 index 000000000..f6822e315 Binary files /dev/null and b/pos_pro_cross_selling/static/description/assets/screenshots/scrn_03.png differ diff --git a/pos_pro_cross_selling/static/description/assets/screenshots/scrn_04.png b/pos_pro_cross_selling/static/description/assets/screenshots/scrn_04.png new file mode 100644 index 000000000..8753da782 Binary files /dev/null and b/pos_pro_cross_selling/static/description/assets/screenshots/scrn_04.png differ diff --git a/pos_pro_cross_selling/static/description/assets/screenshots/scrn_05.png b/pos_pro_cross_selling/static/description/assets/screenshots/scrn_05.png new file mode 100644 index 000000000..ee8a185d5 Binary files /dev/null and b/pos_pro_cross_selling/static/description/assets/screenshots/scrn_05.png differ diff --git a/pos_pro_cross_selling/static/description/banner.png b/pos_pro_cross_selling/static/description/banner.png new file mode 100644 index 000000000..9b65b82b6 Binary files /dev/null and b/pos_pro_cross_selling/static/description/banner.png differ diff --git a/pos_pro_cross_selling/static/description/icon.png b/pos_pro_cross_selling/static/description/icon.png new file mode 100644 index 000000000..93afb62a8 Binary files /dev/null and b/pos_pro_cross_selling/static/description/icon.png differ diff --git a/pos_pro_cross_selling/static/description/images/checked.png b/pos_pro_cross_selling/static/description/images/checked.png new file mode 100644 index 000000000..e6c63d582 Binary files /dev/null and b/pos_pro_cross_selling/static/description/images/checked.png differ diff --git a/pos_pro_cross_selling/static/description/images/hero.gif b/pos_pro_cross_selling/static/description/images/hero.gif new file mode 100644 index 000000000..2be587a4c Binary files /dev/null and b/pos_pro_cross_selling/static/description/images/hero.gif differ diff --git a/pos_pro_cross_selling/static/description/images/logo.png b/pos_pro_cross_selling/static/description/images/logo.png new file mode 100644 index 000000000..478462d3e Binary files /dev/null and b/pos_pro_cross_selling/static/description/images/logo.png differ diff --git a/pos_pro_cross_selling/static/description/images/modules/1.png b/pos_pro_cross_selling/static/description/images/modules/1.png new file mode 100644 index 000000000..b50130c7d Binary files /dev/null and b/pos_pro_cross_selling/static/description/images/modules/1.png differ diff --git a/pos_pro_cross_selling/static/description/images/modules/2.png b/pos_pro_cross_selling/static/description/images/modules/2.png new file mode 100644 index 000000000..3ad04ecfd Binary files /dev/null and b/pos_pro_cross_selling/static/description/images/modules/2.png differ diff --git a/pos_pro_cross_selling/static/description/images/modules/3.png b/pos_pro_cross_selling/static/description/images/modules/3.png new file mode 100644 index 000000000..30ad58232 Binary files /dev/null and b/pos_pro_cross_selling/static/description/images/modules/3.png differ diff --git a/pos_pro_cross_selling/static/description/images/modules/4.png b/pos_pro_cross_selling/static/description/images/modules/4.png new file mode 100644 index 000000000..492980ad0 Binary files /dev/null and b/pos_pro_cross_selling/static/description/images/modules/4.png differ diff --git a/pos_pro_cross_selling/static/description/images/modules/5.png b/pos_pro_cross_selling/static/description/images/modules/5.png new file mode 100644 index 000000000..1ae7cfe3b Binary files /dev/null and b/pos_pro_cross_selling/static/description/images/modules/5.png differ diff --git a/pos_pro_cross_selling/static/description/images/modules/6.png b/pos_pro_cross_selling/static/description/images/modules/6.png new file mode 100644 index 000000000..499b1a72f Binary files /dev/null and b/pos_pro_cross_selling/static/description/images/modules/6.png differ diff --git a/pos_pro_cross_selling/static/description/images/s1.png b/pos_pro_cross_selling/static/description/images/s1.png new file mode 100644 index 000000000..1f343b57c Binary files /dev/null and b/pos_pro_cross_selling/static/description/images/s1.png differ diff --git a/pos_pro_cross_selling/static/description/images/s2.png b/pos_pro_cross_selling/static/description/images/s2.png new file mode 100644 index 000000000..e78c183b5 Binary files /dev/null and b/pos_pro_cross_selling/static/description/images/s2.png differ diff --git a/pos_pro_cross_selling/static/description/images/s3.png b/pos_pro_cross_selling/static/description/images/s3.png new file mode 100644 index 000000000..98489aa2c Binary files /dev/null and b/pos_pro_cross_selling/static/description/images/s3.png differ diff --git a/pos_pro_cross_selling/static/description/images/s4.png b/pos_pro_cross_selling/static/description/images/s4.png new file mode 100644 index 000000000..641d8ceb5 Binary files /dev/null and b/pos_pro_cross_selling/static/description/images/s4.png differ diff --git a/pos_pro_cross_selling/static/description/images/s5.png b/pos_pro_cross_selling/static/description/images/s5.png new file mode 100644 index 000000000..62d384b99 Binary files /dev/null and b/pos_pro_cross_selling/static/description/images/s5.png differ diff --git a/pos_pro_cross_selling/static/description/images/s6.png b/pos_pro_cross_selling/static/description/images/s6.png new file mode 100644 index 000000000..a21ea0d18 Binary files /dev/null and b/pos_pro_cross_selling/static/description/images/s6.png differ diff --git a/pos_pro_cross_selling/static/description/images/s7.png b/pos_pro_cross_selling/static/description/images/s7.png new file mode 100644 index 000000000..d088be560 Binary files /dev/null and b/pos_pro_cross_selling/static/description/images/s7.png differ diff --git a/pos_pro_cross_selling/static/description/index.html b/pos_pro_cross_selling/static/description/index.html new file mode 100644 index 000000000..b104d5e6a --- /dev/null +++ b/pos_pro_cross_selling/static/description/index.html @@ -0,0 +1,612 @@ +
+
+
+
+ +
+
+
+ Community +
+
+ Enterprise +
+
+ Odoo.sh +
+ +
+
+
+
+ +
+
+ +
+
+

POS Cross-Selling

+

+ POS Cross-Selling Products +

+ +
+
+ + + +
+
+

Overview

+
+

+ This module is used to manage different POS Cross-Selling and use them in Point of Sales in Odoo. +

+
+
+ + + + +
+
+

Key Features

+
+
+ + +
+ +
+ +

+ Enterprise and Community compatible. +

+
+ +
+ +

+ Create & Configure Cross-Selling Products. +

+
+ +
+ +

+ Cross-Selling Apply on POS. +

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

Screenshots

+
+ + +
+
+

+ 01

+
+
+

+ POS Cross-Selling +

+

+ Under Point of Sale --> Configuration-->POS Cross-Selling. From this menu configure Cross-selling Products. +

+ +
+
+ + + + + +
+
+

+ 02

+
+
+

+ Cross-Selling Product Configuration. + +

+

+ Configure the cross-selling products. + +

+ +
+
+ + + + +
+
+

+ 03

+
+
+

+ POS Screen +

+

+ When we click on a product, if it has cross-selling products, a popup will open. + +

+ +
+
+ + + + +
+
+

+ 04

+
+
+

+ Select the Products +

+

+ Select the products in the popup, then click the confirm button. +

+ +
+
+ + + + + +
+
+

+ 05

+
+
+

+ Cross-Selling Products In oder line . +

+

+ In the order line we can view the Cross-Selling Products. +

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

Suggested Products

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

Our Services

+
+
+ +
+
+ +
+
Odoo + Customization
+
+ +
+
+ +
+
Odoo + Implementation
+
+ +
+
+ +
+
Odoo + Support
+
+ + +
+
+ +
+
Hire + Odoo + Developer
+
+ +
+
+ +
+
Odoo + Integration
+
+ +
+
+ +
+
Odoo + Migration
+
+ + +
+
+ +
+
Odoo + Consultancy
+
+ +
+
+ +
+
Odoo + Implementation
+
+ +
+
+ +
+
Odoo + Licensing Consultancy
+
+
+
+ + + +
+
+
+

Our Industries

+
+
+ +
+
+ +
+ Trading +
+

+ Easily procure + and + sell your products

+
+
+ +
+
+ +
+ POS +
+

+ Easy + configuration + and convivial experience

+
+
+ +
+
+ +
+ Education +
+

+ A platform for + educational management

+
+
+ +
+
+ +
+ Manufacturing +
+

+ Plan, track and + schedule your operations

+
+
+ +
+
+ +
+ E-commerce & Website +
+

+ Mobile + friendly, + awe-inspiring product pages

+
+
+ +
+
+ +
+ Service Management +
+

+ Keep track of + services and invoice

+
+
+ +
+
+ +
+ Restaurant +
+

+ Run your bar or + restaurant methodically

+
+
+ +
+
+ +
+ Hotel Management +
+

+ An + all-inclusive + hotel management application

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

Need Help?

+
+
+
+ + +
+ +
+ +
+ +
+ WhatsApp +
+
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+
+
+ + + +
+
\ No newline at end of file diff --git a/pos_pro_cross_selling/static/src/js/CrossProduct.js b/pos_pro_cross_selling/static/src/js/CrossProduct.js new file mode 100644 index 000000000..e92cc0f7c --- /dev/null +++ b/pos_pro_cross_selling/static/src/js/CrossProduct.js @@ -0,0 +1,56 @@ +odoo.define('pos_pro_cross_selling.CrossProducts', function (require) { + 'use strict'; + + const AbstractAwaitablePopup = require('point_of_sale.AbstractAwaitablePopup'); + const Registries = require('point_of_sale.Registries'); + const { + useListener + } = require("@web/core/utils/hooks"); + const PosComponent = require('point_of_sale.PosComponent'); + const ProductItem = require('point_of_sale.ProductItem'); + var models = require('point_of_sale.models'); + + class CrossProducts extends AbstractAwaitablePopup { + constructor() { + super(...arguments); + useListener('click-product', this._onClickOrder); + } + + confirm() { + // Adding Products into the order line + super.confirm(); + var product = this.props.products + for (var i = 0; i < product.length; i++) { + if (product[i].selected == true) { + this.env.pos.get_order().add_product(this.env.pos.db.product_by_id[product[i].id]); + } + } + } + + _onClickOrder(event, product) { + // Selecting or deselecting cross-sell products + const products = this.props.products; + const id = product.id; + const $ribbonElements = $(".ribbon-3"); + + products.forEach(prod => { + if (prod.id === id) { + prod.selected = !prod.selected; // Toggle selected state + $ribbonElements.each(function () { + const $element = $(this); + if ($element.data('id') === id) { + $element.css('display', prod.selected ? 'block' : 'none'); + } + }); + } + }); + } + } + //products popup template + CrossProducts.template = 'CrossProducts'; + CrossProducts.defaultProps = { + cancelKey: false + }; + Registries.Component.add(CrossProducts); + return CrossProducts; +}); \ No newline at end of file diff --git a/pos_pro_cross_selling/static/src/js/ProductItem.js b/pos_pro_cross_selling/static/src/js/ProductItem.js new file mode 100644 index 000000000..ccff44e67 --- /dev/null +++ b/pos_pro_cross_selling/static/src/js/ProductItem.js @@ -0,0 +1,33 @@ +odoo.define('pos_pro_cross_selling.product_addons', function (require) { + "use strict"; + const Registries = require('point_of_sale.Registries'); + var rpc = require('web.rpc'); + const ProductScreen = require('point_of_sale.ProductScreen'); + // Class for pos products + const PosProductAddons = (ProductScreen) => + class extends ProductScreen { + constructor() { + super(...arguments); + } + async _clickProduct(event) { + // Click Function for the products, It opens the pop up + super._clickProduct(...arguments) + const product = event.detail; + var self = this; + rpc.query({ + model: 'pos.cross.selling', + method: 'get_cross_selling_products', + args: [[],product.id], + }).then(function (result) { + if (result.length > 0) { + self.showPopup('CrossProducts',{ + products: result, + }); + } + }); + } + } + + Registries.Component.extend(ProductScreen, PosProductAddons); + return ProductScreen; +}); diff --git a/pos_pro_cross_selling/static/src/scss/cross_product.scss b/pos_pro_cross_selling/static/src/scss/cross_product.scss new file mode 100644 index 000000000..e130d2fb6 --- /dev/null +++ b/pos_pro_cross_selling/static/src/scss/cross_product.scss @@ -0,0 +1,20 @@ + +.extra-price{ +position: absolute; + top: 2px; + right: 2px; + vertical-align: top; + color: white; + line-height: 13px; + background: #ff6a6a; + padding: 2px 5px; + border-radius: 2px; +} +.ribbon-3 { + width: 30%; + color: white; + background: #5c723f; +} +.cross-price-tag{ + font-size: 15px; +} diff --git a/pos_pro_cross_selling/static/src/xml/cross_product_templates.xml b/pos_pro_cross_selling/static/src/xml/cross_product_templates.xml new file mode 100644 index 000000000..69ff1249b --- /dev/null +++ b/pos_pro_cross_selling/static/src/xml/cross_product_templates.xml @@ -0,0 +1,51 @@ + + + + + + + diff --git a/pos_pro_cross_selling/views/pos_cross_selling_views.xml b/pos_pro_cross_selling/views/pos_cross_selling_views.xml new file mode 100644 index 000000000..11cc89f61 --- /dev/null +++ b/pos_pro_cross_selling/views/pos_cross_selling_views.xml @@ -0,0 +1,68 @@ + + + + + POS Cross-Selling + pos.cross.selling + tree,form + +

+ Create a new record for pos cross-selling +

+
+
+ + pos.cross.selling.view.form + pos.cross.selling + +
+
+
+ + + + + + + + + + + + + + + + + + + + +
+
+
+ + pos.cross.selling.view.tree + pos.cross.selling + + + + + + + + + pos.cross.selling + + + + + + + +