diff --git a/pos_multi_variant/README.rst b/pos_multi_variant/README.rst new file mode 100644 index 000000000..21c8e7747 --- /dev/null +++ b/pos_multi_variant/README.rst @@ -0,0 +1,44 @@ +.. 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 Product Multi variant +========================= +* Configure products having variants + +Installation +============ +- www.odoo.com/documentation/16.0/setup/install.html +- Install our custom addon + +License +------- +GNU AFFERO GENERAL PUBLIC LICENSE, Version 3 (AGPLv3) +(https://www.gnu.org/licenses/agpl-3.0-standalone.html) + +Company +------- +* `Cybrosys Techno Solutions `__ + +Credits +------- +* Developer: (V16) Akhil Ashok, Contact : odoo@cybrosys.com + +Contacts +-------- +* Mail Contact : odoo@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 + +For support and more information, please visit https://www.cybrosys.com + +Further information +=================== +HTML Description: ``__ diff --git a/pos_multi_variant/__init__.py b/pos_multi_variant/__init__.py new file mode 100644 index 000000000..727eb6127 --- /dev/null +++ b/pos_multi_variant/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Akhil Ashok() +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################# +from . import models diff --git a/pos_multi_variant/__manifest__.py b/pos_multi_variant/__manifest__.py new file mode 100644 index 000000000..ac06c2618 --- /dev/null +++ b/pos_multi_variant/__manifest__.py @@ -0,0 +1,59 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Akhil Ashok() +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################# +{ + 'name': "POS Product Multi variant", + 'version': '16.0.1.0.0', + 'category': 'Point of Sale', + 'summary': """POS Multi-variant module is an advanced way for managing + product variants from the point of sale application""", + 'description': """POS Multi-variant module is an advanced way for managing + product variants from the point of sale application. The module helps the + user to configure product variants straightfrom POS. User can set extra + price, also activate/inactivate the option for variants. As multi-variant + products are displayed with a label, it comes easy for the user to sort + which is multi-variant and which is not. User can confirm the variant type + to POS orders.""", + '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/product_template_views.xml'], + 'assets': { + 'point_of_sale.assets': [ + 'pos_multi_variant/static/src/css/label.css', + 'pos_multi_variant/static/src/js/models.js', + 'pos_multi_variant/static/src/js/product_variant_orderline.js', + 'pos_multi_variant/static/src/js/ProductPopup.js', + 'pos_multi_variant/static/src/js/ProductScreen.js', + 'pos_multi_variant/static/src/xml/label.xml', + 'pos_multi_variant/static/src/xml/popup.xml' + ], + }, + 'images': ['static/description/banner.png'], + 'license': 'AGPL-3', + 'installable': True, + 'auto_install': False, + 'application': False, +} diff --git a/pos_multi_variant/doc/RELEASE_NOTES.md b/pos_multi_variant/doc/RELEASE_NOTES.md new file mode 100755 index 000000000..943eb5d86 --- /dev/null +++ b/pos_multi_variant/doc/RELEASE_NOTES.md @@ -0,0 +1,9 @@ +## Module + +#### 12.10.2023 +#### Version 16.0.1.0.0 +##### ADD +- Initial commit for POS Product Multi variant + + + diff --git a/pos_multi_variant/models/__init__.py b/pos_multi_variant/models/__init__.py new file mode 100644 index 000000000..3cb2769c0 --- /dev/null +++ b/pos_multi_variant/models/__init__.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Akhil Ashok() +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################# +from . import product_template +from . import pos_session +from . import variants_tree diff --git a/pos_multi_variant/models/pos_session.py b/pos_multi_variant/models/pos_session.py new file mode 100644 index 000000000..66ae666b0 --- /dev/null +++ b/pos_multi_variant/models/pos_session.py @@ -0,0 +1,106 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Akhil Ashok() +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################# +from odoo import models + + +class PosSession(models.Model): + """Model Inherits to add Load models and fields""" + _inherit = 'pos.session' + + def _pos_ui_models_to_load(self): + """ + Overrides the _pos_ui_models_to_load method to include additional models + required for the POS UI. + :return: A list of models to load for the POS UI. + :rtype: list[str] + """ + result = super()._pos_ui_models_to_load() + result.append('variants.tree') + result.append('product.attribute.value') + return result + + def _loader_params_variants_tree(self): + """ + Returns the loader parameters for the 'variants.tree' model. + + :return: The loader parameters. + :rtype: dict + """ + return { + 'search_params': { + 'fields': ["value_ids", "attribute_id", "variants_id", + "extra_price"], + }, + } + + def _loader_params_product_attribute_value(self): + """ + Returns the loader parameters for the 'product.attribute.value' model. + + :return: The loader parameters. + :rtype: dict + """ + return { + 'search_params': { + 'fields': ["id", "name"], + }, + } + + def _get_pos_ui_variants_tree(self, params): + """ + Fetches and returns the records from the 'variants.tree' + model based on the specified search parameters. + + :param params: The parameters for the search operation. + :type params: dict + :return: The fetched records. + :rtype: list + """ + return self.env['variants.tree'].search_read(**params['search_params']) + + def _get_pos_ui_product_attribute_value(self, params): + """ + Fetches and returns the records from the 'product.attribute.value' + model based on the specified search parameters. + + :param params: The parameters for the search operation. + :type params: dict + :return: The fetched records. + :rtype: list + """ + return self.env['product.attribute.value'].search_read( + **params['search_params']) + + def _loader_params_product_product(self): + """ + Returns the parameters for loading the 'product.product' model. + + Extends the base method to include additional fields 'pos_variants' and + 'variant_line_ids' in the search parameters. + + :return: The loader parameters. + :rtype: dict + """ + result = super()._loader_params_product_product() + result['search_params']['fields'].extend( + ['is_pos_variants', 'variant_line_ids']) + return result diff --git a/pos_multi_variant/models/product_template.py b/pos_multi_variant/models/product_template.py new file mode 100644 index 000000000..fe89de6cd --- /dev/null +++ b/pos_multi_variant/models/product_template.py @@ -0,0 +1,33 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Akhil Ashok() +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################# +from odoo import fields, models + + +class ProductTemplate(models.Model): + """To enable POS variants and configure different variants""" + _inherit = 'product.template' + + is_pos_variants = fields.Boolean(string='Pos variants', default=False, + help="Enable Pos variants") + variant_line_ids = fields.One2many('variants.tree', 'variants_id', + string="Configure Variants", + help="Select pos product variants") diff --git a/pos_multi_variant/models/variants_tree.py b/pos_multi_variant/models/variants_tree.py new file mode 100644 index 000000000..c90a782f7 --- /dev/null +++ b/pos_multi_variant/models/variants_tree.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Akhil Ashok() +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################# +from odoo import fields, models + + +class VariantsTree(models.Model): + """ + Model representing a variants tree. + This model is used to define the different variants of a product + template based on attributes and their values. + Each variant is associated with a product template and has an attribute, + a set of values, an extra price, and an + active flag. + """ + _name = 'variants.tree' + _description = "Choose Attributes And Values" + + variants_id = fields.Many2one('product.template', string="Variants", + help="Choose variants") + attribute_id = fields.Many2one('product.attribute', string='Attribute', + ondelete='restrict', required=True, + index=True, help="Choose Attribute") + value_ids = fields.Many2many('product.attribute.value', string='Values', + help="Choose value") + extra_price = fields.Float(string="Price Extra", + help="Add extra Price for variants") diff --git a/pos_multi_variant/security/ir.model.access.csv b/pos_multi_variant/security/ir.model.access.csv new file mode 100644 index 000000000..ddc6ae4c6 --- /dev/null +++ b/pos_multi_variant/security/ir.model.access.csv @@ -0,0 +1,2 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access_variants_tree, access.variants.tree,model_variants_tree,base.group_user,1,1,1,1 diff --git a/pos_multi_variant/static/description/assets/icons/check.png b/pos_multi_variant/static/description/assets/icons/check.png new file mode 100644 index 000000000..c8e85f51d Binary files /dev/null and b/pos_multi_variant/static/description/assets/icons/check.png differ diff --git a/pos_multi_variant/static/description/assets/icons/chevron.png b/pos_multi_variant/static/description/assets/icons/chevron.png new file mode 100644 index 000000000..2089293d6 Binary files /dev/null and b/pos_multi_variant/static/description/assets/icons/chevron.png differ diff --git a/pos_multi_variant/static/description/assets/icons/cogs.png b/pos_multi_variant/static/description/assets/icons/cogs.png new file mode 100644 index 000000000..95d0bad62 Binary files /dev/null and b/pos_multi_variant/static/description/assets/icons/cogs.png differ diff --git a/pos_multi_variant/static/description/assets/icons/consultation.png b/pos_multi_variant/static/description/assets/icons/consultation.png new file mode 100644 index 000000000..8319d4baa Binary files /dev/null and b/pos_multi_variant/static/description/assets/icons/consultation.png differ diff --git a/pos_multi_variant/static/description/assets/icons/ecom-black.png b/pos_multi_variant/static/description/assets/icons/ecom-black.png new file mode 100644 index 000000000..a9385ff13 Binary files /dev/null and b/pos_multi_variant/static/description/assets/icons/ecom-black.png differ diff --git a/pos_multi_variant/static/description/assets/icons/education-black.png b/pos_multi_variant/static/description/assets/icons/education-black.png new file mode 100644 index 000000000..3eb09b27b Binary files /dev/null and b/pos_multi_variant/static/description/assets/icons/education-black.png differ diff --git a/pos_multi_variant/static/description/assets/icons/hotel-black.png b/pos_multi_variant/static/description/assets/icons/hotel-black.png new file mode 100644 index 000000000..130f613be Binary files /dev/null and b/pos_multi_variant/static/description/assets/icons/hotel-black.png differ diff --git a/pos_multi_variant/static/description/assets/icons/license.png b/pos_multi_variant/static/description/assets/icons/license.png new file mode 100644 index 000000000..a5869797e Binary files /dev/null and b/pos_multi_variant/static/description/assets/icons/license.png differ diff --git a/pos_multi_variant/static/description/assets/icons/lifebuoy.png b/pos_multi_variant/static/description/assets/icons/lifebuoy.png new file mode 100644 index 000000000..658d56ccc Binary files /dev/null and b/pos_multi_variant/static/description/assets/icons/lifebuoy.png differ diff --git a/pos_multi_variant/static/description/assets/icons/manufacturing-black.png b/pos_multi_variant/static/description/assets/icons/manufacturing-black.png new file mode 100644 index 000000000..697eb0e9f Binary files /dev/null and b/pos_multi_variant/static/description/assets/icons/manufacturing-black.png differ diff --git a/pos_multi_variant/static/description/assets/icons/pos-black.png b/pos_multi_variant/static/description/assets/icons/pos-black.png new file mode 100644 index 000000000..97c0f90c1 Binary files /dev/null and b/pos_multi_variant/static/description/assets/icons/pos-black.png differ diff --git a/pos_multi_variant/static/description/assets/icons/puzzle.png b/pos_multi_variant/static/description/assets/icons/puzzle.png new file mode 100644 index 000000000..65cf854e7 Binary files /dev/null and b/pos_multi_variant/static/description/assets/icons/puzzle.png differ diff --git a/pos_multi_variant/static/description/assets/icons/restaurant-black.png b/pos_multi_variant/static/description/assets/icons/restaurant-black.png new file mode 100644 index 000000000..4a35eb939 Binary files /dev/null and b/pos_multi_variant/static/description/assets/icons/restaurant-black.png differ diff --git a/pos_multi_variant/static/description/assets/icons/service-black.png b/pos_multi_variant/static/description/assets/icons/service-black.png new file mode 100644 index 000000000..301ab51cb Binary files /dev/null and b/pos_multi_variant/static/description/assets/icons/service-black.png differ diff --git a/pos_multi_variant/static/description/assets/icons/trading-black.png b/pos_multi_variant/static/description/assets/icons/trading-black.png new file mode 100644 index 000000000..9398ba2f1 Binary files /dev/null and b/pos_multi_variant/static/description/assets/icons/trading-black.png differ diff --git a/pos_multi_variant/static/description/assets/icons/training.png b/pos_multi_variant/static/description/assets/icons/training.png new file mode 100644 index 000000000..884ca024d Binary files /dev/null and b/pos_multi_variant/static/description/assets/icons/training.png differ diff --git a/pos_multi_variant/static/description/assets/icons/update.png b/pos_multi_variant/static/description/assets/icons/update.png new file mode 100644 index 000000000..ecbc5a01a Binary files /dev/null and b/pos_multi_variant/static/description/assets/icons/update.png differ diff --git a/pos_multi_variant/static/description/assets/icons/user.png b/pos_multi_variant/static/description/assets/icons/user.png new file mode 100644 index 000000000..6ffb23d9f Binary files /dev/null and b/pos_multi_variant/static/description/assets/icons/user.png differ diff --git a/pos_multi_variant/static/description/assets/icons/wrench.png b/pos_multi_variant/static/description/assets/icons/wrench.png new file mode 100644 index 000000000..6c04dea0f Binary files /dev/null and b/pos_multi_variant/static/description/assets/icons/wrench.png differ diff --git a/pos_multi_variant/static/description/assets/misc/categories.png b/pos_multi_variant/static/description/assets/misc/categories.png new file mode 100644 index 000000000..bedf1e0b1 Binary files /dev/null and b/pos_multi_variant/static/description/assets/misc/categories.png differ diff --git a/pos_multi_variant/static/description/assets/misc/check-box.png b/pos_multi_variant/static/description/assets/misc/check-box.png new file mode 100644 index 000000000..42caf24b9 Binary files /dev/null and b/pos_multi_variant/static/description/assets/misc/check-box.png differ diff --git a/pos_multi_variant/static/description/assets/misc/compass.png b/pos_multi_variant/static/description/assets/misc/compass.png new file mode 100644 index 000000000..d5fed8faa Binary files /dev/null and b/pos_multi_variant/static/description/assets/misc/compass.png differ diff --git a/pos_multi_variant/static/description/assets/misc/corporate.png b/pos_multi_variant/static/description/assets/misc/corporate.png new file mode 100644 index 000000000..2eb13edbf Binary files /dev/null and b/pos_multi_variant/static/description/assets/misc/corporate.png differ diff --git a/pos_multi_variant/static/description/assets/misc/customer-support.png b/pos_multi_variant/static/description/assets/misc/customer-support.png new file mode 100644 index 000000000..79efc72ed Binary files /dev/null and b/pos_multi_variant/static/description/assets/misc/customer-support.png differ diff --git a/pos_multi_variant/static/description/assets/misc/cybrosys-logo.png b/pos_multi_variant/static/description/assets/misc/cybrosys-logo.png new file mode 100644 index 000000000..cc3cc0ccf Binary files /dev/null and b/pos_multi_variant/static/description/assets/misc/cybrosys-logo.png differ diff --git a/pos_multi_variant/static/description/assets/misc/features.png b/pos_multi_variant/static/description/assets/misc/features.png new file mode 100644 index 000000000..b41769f77 Binary files /dev/null and b/pos_multi_variant/static/description/assets/misc/features.png differ diff --git a/pos_multi_variant/static/description/assets/misc/logo.png b/pos_multi_variant/static/description/assets/misc/logo.png new file mode 100644 index 000000000..478462d3e Binary files /dev/null and b/pos_multi_variant/static/description/assets/misc/logo.png differ diff --git a/pos_multi_variant/static/description/assets/misc/pictures.png b/pos_multi_variant/static/description/assets/misc/pictures.png new file mode 100644 index 000000000..56d255fe9 Binary files /dev/null and b/pos_multi_variant/static/description/assets/misc/pictures.png differ diff --git a/pos_multi_variant/static/description/assets/misc/pie-chart.png b/pos_multi_variant/static/description/assets/misc/pie-chart.png new file mode 100644 index 000000000..426e05244 Binary files /dev/null and b/pos_multi_variant/static/description/assets/misc/pie-chart.png differ diff --git a/pos_multi_variant/static/description/assets/misc/right-arrow.png b/pos_multi_variant/static/description/assets/misc/right-arrow.png new file mode 100644 index 000000000..730984a06 Binary files /dev/null and b/pos_multi_variant/static/description/assets/misc/right-arrow.png differ diff --git a/pos_multi_variant/static/description/assets/misc/star.png b/pos_multi_variant/static/description/assets/misc/star.png new file mode 100644 index 000000000..2eb9ab29f Binary files /dev/null and b/pos_multi_variant/static/description/assets/misc/star.png differ diff --git a/pos_multi_variant/static/description/assets/misc/support.png b/pos_multi_variant/static/description/assets/misc/support.png new file mode 100644 index 000000000..4f18b8b82 Binary files /dev/null and b/pos_multi_variant/static/description/assets/misc/support.png differ diff --git a/pos_multi_variant/static/description/assets/misc/whatsapp.png b/pos_multi_variant/static/description/assets/misc/whatsapp.png new file mode 100644 index 000000000..d513a5356 Binary files /dev/null and b/pos_multi_variant/static/description/assets/misc/whatsapp.png differ diff --git a/pos_multi_variant/static/description/assets/modules/1.png b/pos_multi_variant/static/description/assets/modules/1.png new file mode 100644 index 000000000..58112878c Binary files /dev/null and b/pos_multi_variant/static/description/assets/modules/1.png differ diff --git a/pos_multi_variant/static/description/assets/modules/2.png b/pos_multi_variant/static/description/assets/modules/2.png new file mode 100644 index 000000000..48b2cf6e3 Binary files /dev/null and b/pos_multi_variant/static/description/assets/modules/2.png differ diff --git a/pos_multi_variant/static/description/assets/modules/3.png b/pos_multi_variant/static/description/assets/modules/3.png new file mode 100644 index 000000000..aa46c8029 Binary files /dev/null and b/pos_multi_variant/static/description/assets/modules/3.png differ diff --git a/pos_multi_variant/static/description/assets/modules/4.png b/pos_multi_variant/static/description/assets/modules/4.png new file mode 100644 index 000000000..913b6b8f5 Binary files /dev/null and b/pos_multi_variant/static/description/assets/modules/4.png differ diff --git a/pos_multi_variant/static/description/assets/modules/5.png b/pos_multi_variant/static/description/assets/modules/5.png new file mode 100644 index 000000000..e2254a4ac Binary files /dev/null and b/pos_multi_variant/static/description/assets/modules/5.png differ diff --git a/pos_multi_variant/static/description/assets/modules/6.png b/pos_multi_variant/static/description/assets/modules/6.png new file mode 100644 index 000000000..b4cf611d1 Binary files /dev/null and b/pos_multi_variant/static/description/assets/modules/6.png differ diff --git a/pos_multi_variant/static/description/assets/screenshots/hero.gif b/pos_multi_variant/static/description/assets/screenshots/hero.gif new file mode 100644 index 000000000..e3ad61edc Binary files /dev/null and b/pos_multi_variant/static/description/assets/screenshots/hero.gif differ diff --git a/pos_multi_variant/static/description/assets/screenshots/pm1.png b/pos_multi_variant/static/description/assets/screenshots/pm1.png new file mode 100644 index 000000000..b9a5a9758 Binary files /dev/null and b/pos_multi_variant/static/description/assets/screenshots/pm1.png differ diff --git a/pos_multi_variant/static/description/assets/screenshots/pm2.png b/pos_multi_variant/static/description/assets/screenshots/pm2.png new file mode 100644 index 000000000..ade83530a Binary files /dev/null and b/pos_multi_variant/static/description/assets/screenshots/pm2.png differ diff --git a/pos_multi_variant/static/description/assets/screenshots/pm3.png b/pos_multi_variant/static/description/assets/screenshots/pm3.png new file mode 100644 index 000000000..e0559d448 Binary files /dev/null and b/pos_multi_variant/static/description/assets/screenshots/pm3.png differ diff --git a/pos_multi_variant/static/description/assets/screenshots/pm4.png b/pos_multi_variant/static/description/assets/screenshots/pm4.png new file mode 100644 index 000000000..2533a4360 Binary files /dev/null and b/pos_multi_variant/static/description/assets/screenshots/pm4.png differ diff --git a/pos_multi_variant/static/description/assets/screenshots/pm5.png b/pos_multi_variant/static/description/assets/screenshots/pm5.png new file mode 100644 index 000000000..74e6a718f Binary files /dev/null and b/pos_multi_variant/static/description/assets/screenshots/pm5.png differ diff --git a/pos_multi_variant/static/description/assets/screenshots/pm6.png b/pos_multi_variant/static/description/assets/screenshots/pm6.png new file mode 100644 index 000000000..e65e441a0 Binary files /dev/null and b/pos_multi_variant/static/description/assets/screenshots/pm6.png differ diff --git a/pos_multi_variant/static/description/banner.png b/pos_multi_variant/static/description/banner.png new file mode 100644 index 000000000..be9d3602c Binary files /dev/null and b/pos_multi_variant/static/description/banner.png differ diff --git a/pos_multi_variant/static/description/icon.png b/pos_multi_variant/static/description/icon.png new file mode 100644 index 000000000..8812ce90e Binary files /dev/null and b/pos_multi_variant/static/description/icon.png differ diff --git a/pos_multi_variant/static/description/index.html b/pos_multi_variant/static/description/index.html new file mode 100644 index 000000000..1f80d6b0b --- /dev/null +++ b/pos_multi_variant/static/description/index.html @@ -0,0 +1,566 @@ +
+ +
+ +
+
+ Community +
+
+ Enterprise +
+
+
+ +
+
+
+ +

POS Product Multi Variant

+

Configure Multi-Variant Products For POS.

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

Explore This + Module

+
+ + + + +
+
+ +
+

Overview +

+
+
+
+ POS Multi-variant module is an advanced way for managing product variants from the point of sale application. + The module helps the user to configure product variants straight from POS. User can set extra price, also activate/inactivate the option for variants. + As multi-variant products are displayed with a label, it comes easy for the user to sort which is multi-variant and which is not. + User can confirm the variant type to POS orders. +
+ + + +
+
+ +
+

Features +

+
+
+
+
+ + Multi-variant option in product configuration. +
+
+ + Option for activating/inactivating variant types in POS. +
+
+ + Easy selection of variant type from wizard. +
+
+ + Option for adding extra price for the variant. +
+
+ + Notification for multi-variant products in POS. +
+
+ + Displays variant details in order receipt and order. +
+
+
+ + + +
+
+ +
+

Screenshots +

+
+
+
+ +
+

Products -> Enable POS variants and Configure variants.

+

After installation, go to Products -> Enable POS variants option. + Here you have an option to configure different variants.

+ +
+ +
+

See multi-variant products

+

Open the POS session, you can see the product with multi-variants.

+ +
+ +
+

Variant selection window pop-up

+

Variant selection window pop-ups, upon selecting a product having multi-variants.

+ +
+
+

Choose desired variants

+

User can see invoice is validated automatically and sent message is linked with chatter which is sent to customer.

+ +
+
+

Confirmed variants get listed in the POS order list.

+

On confirming the variants, it gets listed in the order list of POS session.

+ +
+
+

Variant details in the order receipt

+

The order receipt will be shown as below.

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

Related + Products +

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

Our Services +

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

Our + Industries +

+
+ +
+
+
+
+ +
+ Trading +
+

+ Easily procure + and + sell your products

+
+
+ +
+
+ +
+ POS +
+

+ Easy + configuration + and convivial experience

+
+
+ +
+
+ +
+ Education +
+

+ A platform for + educational management

+
+
+ +
+
+ +
+ Manufacturing +
+

+ Plan, track and + schedule your operations

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

+ Mobile + friendly, + awe-inspiring product pages

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

+ Keep track of + services and invoice

+
+
+ +
+
+ +
+ Restaurant +
+

+ Run your bar or + restaurant methodically

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

+ An + all-inclusive + hotel management application

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

Support +

+
+
+
+
+
+
+ +
+
+

Need Help?

+

Got questions or need help? Get in touch.

+ +

+ odoo@cybrosys.com

+
+
+
+
+
+
+
+ +
+
+

WhatsApp

+

Say hi to us on WhatsApp!

+ +

+91 86068 + 27707

+
+
+
+
+
+
+
+ +
+
+
+
+ \ No newline at end of file diff --git a/pos_multi_variant/static/src/css/label.css b/pos_multi_variant/static/src/css/label.css new file mode 100644 index 000000000..977f72571 --- /dev/null +++ b/pos_multi_variant/static/src/css/label.css @@ -0,0 +1,67 @@ +.pos .product .variant { + position: absolute; + top: 50px; + left: 2px; + right: 2px; + vertical-align: top; + color: white; + line-height: 13px; + background: #0070F7; + padding: 2px 5px; + border-radius: 2px; +} + +.variants{ + position: absolute; + bottom: -11px; + left: 2px; + right: 2px; + vertical-align: top; + color: white; + line-height: 40px; + background: #1b9c99; + padding: 2px 5px; + border-radius: 2px; +} +.extra-price{ +position: absolute; + top: 2px; + right: 2px; + vertical-align: top; + color: #000; + line-height: 13px; + background: #FFACAC; + padding: 7px 5px; + border-radius: 2px; +} +.tag{ +background-color:#d7d7d7; +font-style: italic; +} +.variant-selected{ + position: absolute; + bottom: 23px; + left: 2px; + right: 2px; + vertical-align: top; + color: white; + line-height: 13px; + font-size: 15px; + background: #0831b3; + padding: 2px 5px; + border-radius: 2px; +} +.custom-pos-label{ + width: 100%; + position: absolute; + top: 45%; + left: 0; + background: #30E3DF; + height: 20px; + display: block; + line-height: 100%; + display: flex; + justify-content: center; + align-items: center; + color: #03001C; +} \ No newline at end of file diff --git a/pos_multi_variant/static/src/js/ProductPopup.js b/pos_multi_variant/static/src/js/ProductPopup.js new file mode 100644 index 000000000..7db458c1f --- /dev/null +++ b/pos_multi_variant/static/src/js/ProductPopup.js @@ -0,0 +1,75 @@ +odoo.define('pos_multi_variant.ProductsPopup', function(require) { + 'use strict'; + /* This JavaScript code defines the ProductsPopup component, which extends + * the ProductItem class from the point_of_sale module. It represents a popup + * for selecting product variants. + */ + const Registries = require('point_of_sale.Registries'); + const { useListener } = require("@web/core/utils/hooks"); + const ProductItem = require('point_of_sale.ProductItem'); + + class ProductsPopup extends ProductItem { + setup() { + super.setup(); + useListener('click','.confirm', this.click_confirm); + useListener('click','.product', this.select_variant); + useListener('click','.cancel', this.click_cancel); + } + select_variant(e) { + var order = this.env.pos.get_order() + var self = e.composedPath ? e.composedPath()[2] : e.path[2]; + var action = $(self).find('.action').text(); + var category = $(self).find('.action').data('category'); + $('.product-img').find('.variant-selected').each(function () + { if($(this).data('category') == category) + { $(this).text("").removeClass('variant-selected'); + $(self).find('.action').text("Selected").addClass('variant-selected'); + } + }); + $(self).find('.action').text("Selected").addClass('variant-selected'); + var add = $(self).find('.extra-price').text().substr(1).slice(0, -2); + var type = $(self).find('.variants').text(); + $(self).find('.variant-selected').attr('data-price', add); + $(self).find('.variant-selected').attr('data-type', type); + } + click_confirm(e){ + var price = 0.00 + var order = this.env.pos.get_order() + var selected_orderline = order.get_selected_orderline() + var variants = [] + this.env.pos.selectedOrder.selected_orderline.product_variants=variants + $('.product-img').find('.variant-selected').each(function () + { + var add = this.previousSibling.innerHTML; + add = add.slice(3) + price += parseFloat(add) + if (order.selected_orderline.product.is_pos_variants){ + variants.push({ + 'extra_price': add, + 'type': $(this).data('type'), + }) + }; + }) + selected_orderline.price_manually_set = true; + selected_orderline.price += price + this.env.posbus.trigger('close-popup', { + popupId: this.props.id + }); + } + click_cancel(){ + this.env.posbus.trigger('close-popup', { + popupId: this.props.id + }); + } + imageUrl() { + return `/web/image?model=product.product&field=image_1920&id=${this.props.product_tmpl_id}&unique=1`; + } + async _clickProduct(event) { + } + } + ProductsPopup.template = 'ProductsPopUp'; + ProductsPopup.defaultProps = {}; + Registries.Component.add(ProductsPopup); + return ProductsPopup; +}); + diff --git a/pos_multi_variant/static/src/js/ProductScreen.js b/pos_multi_variant/static/src/js/ProductScreen.js new file mode 100644 index 000000000..660e73323 --- /dev/null +++ b/pos_multi_variant/static/src/js/ProductScreen.js @@ -0,0 +1,62 @@ +odoo.define('pos_multi_variant.ProductScreen', function(require) { + 'use strict'; + /* This JavaScript code extends the ProductScreen class from the point_of_sale module. + * It adds functionality for handling product clicks and displaying the ProductsPopup + * for selecting variants. + */ + var ProductScreen = require('point_of_sale.ProductScreen'); + const Registries = require('point_of_sale.Registries'); + const NumberBuffer = require('point_of_sale.NumberBuffer'); + var rpc = require('web.rpc'); + const ProductScreenExtend = (ProductScreen) => + class extends ProductScreen { + constructor() { + super(...arguments); + } + async _clickProduct(event) { + await super._clickProduct(...arguments) + if (!this.currentOrder) { + this.env.pos.add_new_order(); + } + const product = event.detail; + var variant_product = '' + await rpc.query({ + model: 'variants.tree', + method: 'search_read', + fields: ['extra_price','attribute_id','value_ids', 'variants_id'], + args: [[['variants_id','=',event.detail.product_tmpl_id]]] + }).then(function (data) { + variant_product = data + }); + var li=[] + for(var i=0; i class VariantsPosGlobalState extends PosGlobalState { + async _processData(loadedData) { + + await super._processData(...arguments); + + this.variants_tree = loadedData['variants.tree']; + this.product_attribute_value = loadedData['product.attribute.value']; + } + } + Registries.Model.extend(PosGlobalState, VariantsPosGlobalState); +}); diff --git a/pos_multi_variant/static/src/js/product_variant_orderline.js b/pos_multi_variant/static/src/js/product_variant_orderline.js new file mode 100644 index 000000000..4fdf5c644 --- /dev/null +++ b/pos_multi_variant/static/src/js/product_variant_orderline.js @@ -0,0 +1,34 @@ +odoo.define('pos_order_question.Orderline', function(require) { + 'use strict'; + /* This JavaScript code defines the PosMultiVariantOrderline class + * extending the Orderline class from the point_of_sale.models module. + * It adds additional functionality related to product variants. + */ + var { + Orderline, + } = require('point_of_sale.models'); + var utils = require('web.utils'); + const Registries = require('point_of_sale.Registries'); + + const PosMultiVariantOrderline = (Orderline) => class PosMultiVariantOrderline extends Orderline { + + constructor(obj, options) { + super(...arguments); + this.product_variants = this.product_variants || []; + } + export_as_JSON() { + const json = super.export_as_JSON(...arguments); + json.product_variants = this.product_variants || []; + return json; + } + export_for_printing() { + var line = super.export_for_printing(...arguments); + line.product_variants = this.product_variants; + return line; + } + } + Registries.Model.extend(Orderline, PosMultiVariantOrderline); +}); + + + diff --git a/pos_multi_variant/static/src/xml/label.xml b/pos_multi_variant/static/src/xml/label.xml new file mode 100644 index 000000000..b77b82001 --- /dev/null +++ b/pos_multi_variant/static/src/xml/label.xml @@ -0,0 +1,37 @@ + + + + + + + Multi-variant + + + + + + + +

+ + : + +

+
+
+
+ + + + +
+ + () + +
+
+
+
+
diff --git a/pos_multi_variant/static/src/xml/popup.xml b/pos_multi_variant/static/src/xml/popup.xml new file mode 100644 index 000000000..99c12b9b6 --- /dev/null +++ b/pos_multi_variant/static/src/xml/popup.xml @@ -0,0 +1,57 @@ + + + + +