diff --git a/pos_product_create_edit/README.rst b/pos_product_create_edit/README.rst new file mode 100644 index 000000000..7eeeda3a5 --- /dev/null +++ b/pos_product_create_edit/README.rst @@ -0,0 +1,42 @@ +.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg + :target: https://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 + +POS Product Create Edit +======================= +This module helps you Create or Edit products directly from POS. + +Configuration +============= +* No additional configurations needed. + +License +------- +General Public License, Version 3 (AGPL v3). +(https://www.gnu.org/licenses/agpl-3.0-standalone.html) + +Company +------- +* `Cybrosys Techno Solutions `__ + +Credits +------- +Developer: (V17) Vishnu Kp, 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 + +This module is maintained by Cybrosys Technologies. + +For support and more information, please visit `Our Website `__ + +Further information +=================== +HTML Description: ``__ diff --git a/pos_product_create_edit/__init__.py b/pos_product_create_edit/__init__.py new file mode 100644 index 000000000..c0c0beab5 --- /dev/null +++ b/pos_product_create_edit/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies(). +# Author: Vishnu K P(odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . + +################################################################################ +from . import models diff --git a/pos_product_create_edit/__manifest__.py b/pos_product_create_edit/__manifest__.py new file mode 100644 index 000000000..0113d45cc --- /dev/null +++ b/pos_product_create_edit/__manifest__.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies(). +# Author: Vishnu K P(odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . + +################################################################################ +{ + 'name': 'POS Product Create Edit', + 'version': '17.0.1.0.0', + 'category': 'Point of Sale', + 'summary': 'This Module will help to create and edit products directly from point of sale.', + 'description': """This module will help you to add product manually and + edit products directly from point of sale.""", + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': 'https://www.cybrosys.com', + 'depends': ['base', 'point_of_sale'], + 'assets': { + 'point_of_sale._assets_pos': [ + 'pos_product_create_edit/static/src/js/*', + 'pos_product_create_edit/static/src/xml/*', + 'pos_product_create_edit/static/src/css/*', + ], + }, + 'images': ['static/description/banner.jpg'], + 'license': 'AGPL-3', + 'installable': True, + 'application': False, + 'auto_install': False, +} diff --git a/pos_product_create_edit/doc/RELEASE_NOTES.md b/pos_product_create_edit/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..c8d0935dd --- /dev/null +++ b/pos_product_create_edit/doc/RELEASE_NOTES.md @@ -0,0 +1,7 @@ +## Module + +#### 08.05.2024 +#### Version 17.0.1.0.0 +#### ADD + +- Initial Commit POS Product Create Edit diff --git a/pos_product_create_edit/models/__init__.py b/pos_product_create_edit/models/__init__.py new file mode 100644 index 000000000..269deec59 --- /dev/null +++ b/pos_product_create_edit/models/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies(). +# Author: Vishnu K P(odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . + +################################################################################ +from . import product_product diff --git a/pos_product_create_edit/models/product_product.py b/pos_product_create_edit/models/product_product.py new file mode 100644 index 000000000..54c393c37 --- /dev/null +++ b/pos_product_create_edit/models/product_product.py @@ -0,0 +1,63 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies(). +# Author: Vishnu K P(odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . + +################################################################################ +from odoo import api, models + + +class ProductProduct(models.Model): + _inherit = 'product.product' + + @api.model + def create_from_ui(self, payload): + """ Create or modify a Product from the point of sale ui. + Product contains the Product's fields. """ + + base64_content = payload.get('image_1920', False) + image = base64_content.split(',', 1)[-1] + if payload.get('pos_categ_ids') and isinstance( + payload.get('pos_categ_ids'), str): + pos_categ_ids = [int(item) for item in + payload.get('pos_categ_ids').split(',')] + else: + pos_categ_ids = payload.get('pos_categ_ids') + product_id = payload.get('id') + values = { + 'name': payload.get('name'), + 'image_1920': image, + 'standard_price': float( + payload.get('standard_price')) if payload.get( + 'standard_price') else 0, + 'lst_price': float(payload.get('lst_price')) if payload.get( + 'lst_price') else 0, + 'pos_categ_ids': pos_categ_ids if payload.get( + 'pos_categ_ids') and payload.get( + 'pos_categ_ids') != '0' else False, + 'default_code': payload.get('default_code'), + 'available_in_pos': True + } + if payload.get('image_1920') == "": + del values['image_1920'] + if product_id: # Modifying existing product + self.browse(product_id).write(values) + else: + product = self.create(values) + product_id = product.id + return product_id diff --git a/pos_product_create_edit/static/description/assets/icons/check.png b/pos_product_create_edit/static/description/assets/icons/check.png new file mode 100644 index 000000000..c8e85f51d Binary files /dev/null and b/pos_product_create_edit/static/description/assets/icons/check.png differ diff --git a/pos_product_create_edit/static/description/assets/icons/chevron.png b/pos_product_create_edit/static/description/assets/icons/chevron.png new file mode 100644 index 000000000..2089293d6 Binary files /dev/null and b/pos_product_create_edit/static/description/assets/icons/chevron.png differ diff --git a/pos_product_create_edit/static/description/assets/icons/cogs.png b/pos_product_create_edit/static/description/assets/icons/cogs.png new file mode 100644 index 000000000..95d0bad62 Binary files /dev/null and b/pos_product_create_edit/static/description/assets/icons/cogs.png differ diff --git a/pos_product_create_edit/static/description/assets/icons/consultation.png b/pos_product_create_edit/static/description/assets/icons/consultation.png new file mode 100644 index 000000000..8319d4baa Binary files /dev/null and b/pos_product_create_edit/static/description/assets/icons/consultation.png differ diff --git a/pos_product_create_edit/static/description/assets/icons/ecom-black.png b/pos_product_create_edit/static/description/assets/icons/ecom-black.png new file mode 100644 index 000000000..a9385ff13 Binary files /dev/null and b/pos_product_create_edit/static/description/assets/icons/ecom-black.png differ diff --git a/pos_product_create_edit/static/description/assets/icons/education-black.png b/pos_product_create_edit/static/description/assets/icons/education-black.png new file mode 100644 index 000000000..3eb09b27b Binary files /dev/null and b/pos_product_create_edit/static/description/assets/icons/education-black.png differ diff --git a/pos_product_create_edit/static/description/assets/icons/hotel-black.png b/pos_product_create_edit/static/description/assets/icons/hotel-black.png new file mode 100644 index 000000000..130f613be Binary files /dev/null and b/pos_product_create_edit/static/description/assets/icons/hotel-black.png differ diff --git a/pos_product_create_edit/static/description/assets/icons/license.png b/pos_product_create_edit/static/description/assets/icons/license.png new file mode 100644 index 000000000..a5869797e Binary files /dev/null and b/pos_product_create_edit/static/description/assets/icons/license.png differ diff --git a/pos_product_create_edit/static/description/assets/icons/lifebuoy.png b/pos_product_create_edit/static/description/assets/icons/lifebuoy.png new file mode 100644 index 000000000..658d56ccc Binary files /dev/null and b/pos_product_create_edit/static/description/assets/icons/lifebuoy.png differ diff --git a/pos_product_create_edit/static/description/assets/icons/manufacturing-black.png b/pos_product_create_edit/static/description/assets/icons/manufacturing-black.png new file mode 100644 index 000000000..697eb0e9f Binary files /dev/null and b/pos_product_create_edit/static/description/assets/icons/manufacturing-black.png differ diff --git a/pos_product_create_edit/static/description/assets/icons/pos-black.png b/pos_product_create_edit/static/description/assets/icons/pos-black.png new file mode 100644 index 000000000..97c0f90c1 Binary files /dev/null and b/pos_product_create_edit/static/description/assets/icons/pos-black.png differ diff --git a/pos_product_create_edit/static/description/assets/icons/puzzle.png b/pos_product_create_edit/static/description/assets/icons/puzzle.png new file mode 100644 index 000000000..65cf854e7 Binary files /dev/null and b/pos_product_create_edit/static/description/assets/icons/puzzle.png differ diff --git a/pos_product_create_edit/static/description/assets/icons/restaurant-black.png b/pos_product_create_edit/static/description/assets/icons/restaurant-black.png new file mode 100644 index 000000000..4a35eb939 Binary files /dev/null and b/pos_product_create_edit/static/description/assets/icons/restaurant-black.png differ diff --git a/pos_product_create_edit/static/description/assets/icons/service-black.png b/pos_product_create_edit/static/description/assets/icons/service-black.png new file mode 100644 index 000000000..301ab51cb Binary files /dev/null and b/pos_product_create_edit/static/description/assets/icons/service-black.png differ diff --git a/pos_product_create_edit/static/description/assets/icons/trading-black.png b/pos_product_create_edit/static/description/assets/icons/trading-black.png new file mode 100644 index 000000000..9398ba2f1 Binary files /dev/null and b/pos_product_create_edit/static/description/assets/icons/trading-black.png differ diff --git a/pos_product_create_edit/static/description/assets/icons/training.png b/pos_product_create_edit/static/description/assets/icons/training.png new file mode 100644 index 000000000..884ca024d Binary files /dev/null and b/pos_product_create_edit/static/description/assets/icons/training.png differ diff --git a/pos_product_create_edit/static/description/assets/icons/update.png b/pos_product_create_edit/static/description/assets/icons/update.png new file mode 100644 index 000000000..ecbc5a01a Binary files /dev/null and b/pos_product_create_edit/static/description/assets/icons/update.png differ diff --git a/pos_product_create_edit/static/description/assets/icons/user.png b/pos_product_create_edit/static/description/assets/icons/user.png new file mode 100644 index 000000000..6ffb23d9f Binary files /dev/null and b/pos_product_create_edit/static/description/assets/icons/user.png differ diff --git a/pos_product_create_edit/static/description/assets/icons/wrench.png b/pos_product_create_edit/static/description/assets/icons/wrench.png new file mode 100644 index 000000000..6c04dea0f Binary files /dev/null and b/pos_product_create_edit/static/description/assets/icons/wrench.png differ diff --git a/pos_product_create_edit/static/description/assets/misc/Cybrosys R.png b/pos_product_create_edit/static/description/assets/misc/Cybrosys R.png new file mode 100644 index 000000000..da4058087 Binary files /dev/null and b/pos_product_create_edit/static/description/assets/misc/Cybrosys R.png differ diff --git a/pos_product_create_edit/static/description/assets/misc/categories.png b/pos_product_create_edit/static/description/assets/misc/categories.png new file mode 100644 index 000000000..bedf1e0b1 Binary files /dev/null and b/pos_product_create_edit/static/description/assets/misc/categories.png differ diff --git a/pos_product_create_edit/static/description/assets/misc/check-box.png b/pos_product_create_edit/static/description/assets/misc/check-box.png new file mode 100644 index 000000000..42caf24b9 Binary files /dev/null and b/pos_product_create_edit/static/description/assets/misc/check-box.png differ diff --git a/pos_product_create_edit/static/description/assets/misc/compass.png b/pos_product_create_edit/static/description/assets/misc/compass.png new file mode 100644 index 000000000..d5fed8faa Binary files /dev/null and b/pos_product_create_edit/static/description/assets/misc/compass.png differ diff --git a/pos_product_create_edit/static/description/assets/misc/corporate.png b/pos_product_create_edit/static/description/assets/misc/corporate.png new file mode 100644 index 000000000..2eb13edbf Binary files /dev/null and b/pos_product_create_edit/static/description/assets/misc/corporate.png differ diff --git a/pos_product_create_edit/static/description/assets/misc/customer-support.png b/pos_product_create_edit/static/description/assets/misc/customer-support.png new file mode 100644 index 000000000..79efc72ed Binary files /dev/null and b/pos_product_create_edit/static/description/assets/misc/customer-support.png differ diff --git a/pos_product_create_edit/static/description/assets/misc/cybrosys-logo.png b/pos_product_create_edit/static/description/assets/misc/cybrosys-logo.png new file mode 100644 index 000000000..cc3cc0ccf Binary files /dev/null and b/pos_product_create_edit/static/description/assets/misc/cybrosys-logo.png differ diff --git a/pos_product_create_edit/static/description/assets/misc/email.svg b/pos_product_create_edit/static/description/assets/misc/email.svg new file mode 100644 index 000000000..15291cdc3 --- /dev/null +++ b/pos_product_create_edit/static/description/assets/misc/email.svg @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/pos_product_create_edit/static/description/assets/misc/features.png b/pos_product_create_edit/static/description/assets/misc/features.png new file mode 100644 index 000000000..b41769f77 Binary files /dev/null and b/pos_product_create_edit/static/description/assets/misc/features.png differ diff --git a/pos_product_create_edit/static/description/assets/misc/logo.png b/pos_product_create_edit/static/description/assets/misc/logo.png new file mode 100644 index 000000000..478462d3e Binary files /dev/null and b/pos_product_create_edit/static/description/assets/misc/logo.png differ diff --git a/pos_product_create_edit/static/description/assets/misc/phone.svg b/pos_product_create_edit/static/description/assets/misc/phone.svg new file mode 100644 index 000000000..b7bd7f251 --- /dev/null +++ b/pos_product_create_edit/static/description/assets/misc/phone.svg @@ -0,0 +1,3 @@ + + + diff --git a/pos_product_create_edit/static/description/assets/misc/pictures.png b/pos_product_create_edit/static/description/assets/misc/pictures.png new file mode 100644 index 000000000..56d255fe9 Binary files /dev/null and b/pos_product_create_edit/static/description/assets/misc/pictures.png differ diff --git a/pos_product_create_edit/static/description/assets/misc/pie-chart.png b/pos_product_create_edit/static/description/assets/misc/pie-chart.png new file mode 100644 index 000000000..426e05244 Binary files /dev/null and b/pos_product_create_edit/static/description/assets/misc/pie-chart.png differ diff --git a/pos_product_create_edit/static/description/assets/misc/right-arrow.png b/pos_product_create_edit/static/description/assets/misc/right-arrow.png new file mode 100644 index 000000000..730984a06 Binary files /dev/null and b/pos_product_create_edit/static/description/assets/misc/right-arrow.png differ diff --git a/pos_product_create_edit/static/description/assets/misc/star (1) 2.svg b/pos_product_create_edit/static/description/assets/misc/star (1) 2.svg new file mode 100644 index 000000000..5ae9f507a --- /dev/null +++ b/pos_product_create_edit/static/description/assets/misc/star (1) 2.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/pos_product_create_edit/static/description/assets/misc/star.png b/pos_product_create_edit/static/description/assets/misc/star.png new file mode 100644 index 000000000..2eb9ab29f Binary files /dev/null and b/pos_product_create_edit/static/description/assets/misc/star.png differ diff --git a/pos_product_create_edit/static/description/assets/misc/support (1) 1.svg b/pos_product_create_edit/static/description/assets/misc/support (1) 1.svg new file mode 100644 index 000000000..7d37a8f30 --- /dev/null +++ b/pos_product_create_edit/static/description/assets/misc/support (1) 1.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/pos_product_create_edit/static/description/assets/misc/support-email.svg b/pos_product_create_edit/static/description/assets/misc/support-email.svg new file mode 100644 index 000000000..eb70370d6 --- /dev/null +++ b/pos_product_create_edit/static/description/assets/misc/support-email.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/pos_product_create_edit/static/description/assets/misc/support.png b/pos_product_create_edit/static/description/assets/misc/support.png new file mode 100644 index 000000000..4f18b8b82 Binary files /dev/null and b/pos_product_create_edit/static/description/assets/misc/support.png differ diff --git a/pos_product_create_edit/static/description/assets/misc/tick-mark.svg b/pos_product_create_edit/static/description/assets/misc/tick-mark.svg new file mode 100644 index 000000000..2dbb40187 --- /dev/null +++ b/pos_product_create_edit/static/description/assets/misc/tick-mark.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/pos_product_create_edit/static/description/assets/misc/whatsapp 1.svg b/pos_product_create_edit/static/description/assets/misc/whatsapp 1.svg new file mode 100644 index 000000000..0bfaf8fc6 --- /dev/null +++ b/pos_product_create_edit/static/description/assets/misc/whatsapp 1.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/pos_product_create_edit/static/description/assets/misc/whatsapp.png b/pos_product_create_edit/static/description/assets/misc/whatsapp.png new file mode 100644 index 000000000..d513a5356 Binary files /dev/null and b/pos_product_create_edit/static/description/assets/misc/whatsapp.png differ diff --git a/pos_product_create_edit/static/description/assets/misc/whatsapp.svg b/pos_product_create_edit/static/description/assets/misc/whatsapp.svg new file mode 100644 index 000000000..b618aea1d --- /dev/null +++ b/pos_product_create_edit/static/description/assets/misc/whatsapp.svg @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/pos_product_create_edit/static/description/assets/modules/1.jpg b/pos_product_create_edit/static/description/assets/modules/1.jpg new file mode 100644 index 000000000..67c7f7062 Binary files /dev/null and b/pos_product_create_edit/static/description/assets/modules/1.jpg differ diff --git a/pos_product_create_edit/static/description/assets/modules/2.jpg b/pos_product_create_edit/static/description/assets/modules/2.jpg new file mode 100644 index 000000000..87c2bb2ba Binary files /dev/null and b/pos_product_create_edit/static/description/assets/modules/2.jpg differ diff --git a/pos_product_create_edit/static/description/assets/modules/3.png b/pos_product_create_edit/static/description/assets/modules/3.png new file mode 100644 index 000000000..a5299d338 Binary files /dev/null and b/pos_product_create_edit/static/description/assets/modules/3.png differ diff --git a/pos_product_create_edit/static/description/assets/modules/4.png b/pos_product_create_edit/static/description/assets/modules/4.png new file mode 100644 index 000000000..a0ac2d840 Binary files /dev/null and b/pos_product_create_edit/static/description/assets/modules/4.png differ diff --git a/pos_product_create_edit/static/description/assets/modules/5.jpg b/pos_product_create_edit/static/description/assets/modules/5.jpg new file mode 100644 index 000000000..6a102f103 Binary files /dev/null and b/pos_product_create_edit/static/description/assets/modules/5.jpg differ diff --git a/pos_product_create_edit/static/description/assets/modules/6.jpg b/pos_product_create_edit/static/description/assets/modules/6.jpg new file mode 100644 index 000000000..eaf13fef5 Binary files /dev/null and b/pos_product_create_edit/static/description/assets/modules/6.jpg differ diff --git a/pos_product_create_edit/static/description/assets/screenshots/hero.gif b/pos_product_create_edit/static/description/assets/screenshots/hero.gif new file mode 100644 index 000000000..6a2143064 Binary files /dev/null and b/pos_product_create_edit/static/description/assets/screenshots/hero.gif differ diff --git a/pos_product_create_edit/static/description/assets/screenshots/ss1.png b/pos_product_create_edit/static/description/assets/screenshots/ss1.png new file mode 100644 index 000000000..d9a3dfe0e Binary files /dev/null and b/pos_product_create_edit/static/description/assets/screenshots/ss1.png differ diff --git a/pos_product_create_edit/static/description/assets/screenshots/ss2.png b/pos_product_create_edit/static/description/assets/screenshots/ss2.png new file mode 100644 index 000000000..5e5b7b15b Binary files /dev/null and b/pos_product_create_edit/static/description/assets/screenshots/ss2.png differ diff --git a/pos_product_create_edit/static/description/assets/screenshots/ss3.png b/pos_product_create_edit/static/description/assets/screenshots/ss3.png new file mode 100644 index 000000000..82f6a8cc2 Binary files /dev/null and b/pos_product_create_edit/static/description/assets/screenshots/ss3.png differ diff --git a/pos_product_create_edit/static/description/assets/screenshots/ss5.png b/pos_product_create_edit/static/description/assets/screenshots/ss5.png new file mode 100644 index 000000000..0def8093c Binary files /dev/null and b/pos_product_create_edit/static/description/assets/screenshots/ss5.png differ diff --git a/pos_product_create_edit/static/description/assets/screenshots/ss6.png b/pos_product_create_edit/static/description/assets/screenshots/ss6.png new file mode 100644 index 000000000..297d25db6 Binary files /dev/null and b/pos_product_create_edit/static/description/assets/screenshots/ss6.png differ diff --git a/pos_product_create_edit/static/description/assets/screenshots/ss7.png b/pos_product_create_edit/static/description/assets/screenshots/ss7.png new file mode 100644 index 000000000..ee5fcd8b2 Binary files /dev/null and b/pos_product_create_edit/static/description/assets/screenshots/ss7.png differ diff --git a/pos_product_create_edit/static/description/banner.jpg b/pos_product_create_edit/static/description/banner.jpg new file mode 100644 index 000000000..86ceb125f Binary files /dev/null and b/pos_product_create_edit/static/description/banner.jpg differ diff --git a/pos_product_create_edit/static/description/icon.png b/pos_product_create_edit/static/description/icon.png new file mode 100644 index 000000000..3523e9379 Binary files /dev/null and b/pos_product_create_edit/static/description/icon.png differ diff --git a/pos_product_create_edit/static/description/index.html b/pos_product_create_edit/static/description/index.html new file mode 100644 index 000000000..b53420192 --- /dev/null +++ b/pos_product_create_edit/static/description/index.html @@ -0,0 +1,761 @@ + + + + + + Odoo App 3 Index + + + + + + + + +
+
+
+
+
+ +
+
+
+ Community +
+
+ Enterprise +
+
+
+
+
+
+

+ POS Product Create Edit

+

+ You Can Directly Edit or Create A New Product From Point Of + Sale. +

+
+ +
+
+
+
+
+

+ Key Highlights +

+
+
+
+
+
+ +
+
+

+ Odoo 17 Community & Enterprise Edition + Support.

+

Product Create + & Edit From Pos in Odoo 17 Community Enterprise + Edition + Support. +

+
+
+
+
+
+
+ +
+
+

+ Direct Creation Option

+

Create new + products directly from point of sale. +

+
+
+
+
+
+
+ +
+
+

+ Direct Edit Option

+

Edit products + directly from point of sale.

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

+ New Product Button in POS

+
+ In the POS Interface, there will be a new button "Products", to display a list of all products available. +
+
+
+
+
+
+
+ +
+
+

+ Product List page

+
+ List out all products with Create,Discard and Edit buttons.
+
+
+
+
+
+
+ +
+
+

+ Product Create Popup

+
+ When the Create Button Is Clicked, it will + Open a new Popup Window for creating a new product
+
+
+
+
+
+
+ +
+
+

+ Confirm the Product

+
+ After filling the fields click on the + Confirm button
+
+
+
+
+
+
+ +
+
+

+ New Product on POS

+
+ Now, you can see the created Product in the + pos
+
+
+
+
+
+
+ +
+
+

+ Edit The Product

+
+ Click on edit button to update the details + of the product
+
+
+
+
+
+
+
    +
  • + You can directly + create new product from point of sale. +
  • +
  • + You can directly + Edit new product from point of sale. +
  • +
+
+
+
+
+
+
Version + 17.0.1.0.0|Released on:18 Jan 2024 +
+

+ Product Create & Edit From 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_product_create_edit/static/src/css/ProductList.css b/pos_product_create_edit/static/src/css/ProductList.css new file mode 100644 index 000000000..100a6bd48 --- /dev/null +++ b/pos_product_create_edit/static/src/css/ProductList.css @@ -0,0 +1,41 @@ +button.edit_product{ + border-radius:9px; + width :38px; +} +i.fa.fa-pencil{ + font-size:15px; +} +img.product_img { + max-width:40px; +} +label.field_label{ + padding:3%; +} +.field_div{ + margin-bottom:10px; +} +select.form-control{ + text-align: left; + display: inline-block; + overflow: hidden; + background: white; + min-height: 44px; + font-family: "Lato"; + font-size: 20px; + color: #444; + padding: 10px; + border-radius: 3px; + border: none; + box-shadow: 0px 0px 0px 1px gainsboro inset; + box-sizing: border-box; + width: 100%; +} +i.fa.fa-plus.create_btn{ + margin-right:5px; +} +.partner-list-contents td{ + +vertical-align: middle !important; +} +.product-img img{ +height:63px !important;} \ No newline at end of file diff --git a/pos_product_create_edit/static/src/js/ProductCreatePopup.js b/pos_product_create_edit/static/src/js/ProductCreatePopup.js new file mode 100644 index 000000000..6148b9e97 --- /dev/null +++ b/pos_product_create_edit/static/src/js/ProductCreatePopup.js @@ -0,0 +1,107 @@ +/**@odoo-module **/ + +import { AbstractAwaitablePopup } from "@point_of_sale/app/popup/abstract_awaitable_popup"; +import { registry } from "@web/core/registry"; +import { ErrorPopup } from "@point_of_sale/app/errors/popups/error_popup"; +import { _t } from "@web/core/l10n/translation"; +import { usePos } from "@point_of_sale/app/store/pos_hook"; +import { useService } from "@web/core/utils/hooks"; +import { useState } from "@odoo/owl"; +import { getDataURLFromFile } from "@web/core/utils/urls"; + + +export class CreateProductPopup extends AbstractAwaitablePopup { + + static defaultProps = { + title: "", + body: "", + product: "" + }; + + setup() { + super.setup(); + this.popup = useService("popup"); + this.pos = usePos(); + const product = this.props.product; + this.changes = useState({ + name: product.display_name || "", + image_1920: product.image_1920 || "", + standard_price: product.standard_price || "", + id: product.id || "", + lst_price: product.lst_price || "", + pos_categ_ids: product.pos_categ_ids || "", + default_code: product.default_code || "", + available_in_pos: true, + }); + } + + async uploadImage(event) { + const file = event.target.files[0]; + if (!file.type.match(/image.*/)) { + await this.popup.add(ErrorPopup, { + title: _t("Unsupported File Format"), + body: _t("Only web-compatible Image formats such as .png or .jpeg are supported."), + }); + } else { + const imageUrl = await getDataURLFromFile(file); + const loadedImage = await this._loadImage(imageUrl); + if (loadedImage) { + const resizedImage = await this._resizeImage(loadedImage, 800, 600); + this.changes.image_1920 = resizedImage.toDataURL(); + } + } + } + _resizeImage(img, maxwidth, maxheight) { + var canvas = document.createElement("canvas"); + var ctx = canvas.getContext("2d"); + var ratio = 1; + + if (img.width > maxwidth) { + ratio = maxwidth / img.width; + } + if (img.height * ratio > maxheight) { + ratio = maxheight / img.height; + } + var width = Math.floor(img.width * ratio); + var height = Math.floor(img.height * ratio); + canvas.width = width; + canvas.height = height; + ctx.drawImage(img, 0, 0, width, height); + return canvas; + } + get productImageUrl() { + // We prioritize image_1920 in the `changes` field because we want + // to show the uploaded image without fetching new data from the server. + const product = this.props.product; + if (this.changes.image_1920) { + + return this.changes.image_1920; + } else if (product.id) { + return `/web/image?model=product.product&id=${product.id}&field=image_1920&unique=${product.write_date}`; + } else { + return false; + } + } + _loadImage(url) { + return new Promise((resolve) => { + const img = new Image(); + img.addEventListener("load", () => resolve(img)); + img.addEventListener("error", () => { + this.popup.add(ErrorPopup, { + title: _t("Loading Image Error"), + body: _t("Encountered error when loading image. Please try again."), + }); + resolve(false); + }); + img.src = url; + }); + } + getPayload() { + const processedChanges = {}; + for (const [key, value] of Object.entries(this.changes)) { + processedChanges[key] = value; + } + return processedChanges; + } +} +CreateProductPopup.template = "CreateProductPopup"; diff --git a/pos_product_create_edit/static/src/js/ProductLine.js b/pos_product_create_edit/static/src/js/ProductLine.js new file mode 100644 index 000000000..8b4daf834 --- /dev/null +++ b/pos_product_create_edit/static/src/js/ProductLine.js @@ -0,0 +1,43 @@ +/**@odoo-module **/ +import { Component , useState } from "@odoo/owl"; +import { registry } from "@web/core/registry"; +import { usePos } from "@point_of_sale/app/store/pos_hook"; +import { useService } from "@web/core/utils/hooks"; +import { CreateProductPopup } from "@pos_product_create_edit/js/ProductCreatePopup"; +import { onWillStart} from "@odoo/owl"; + +export class ProductLine extends Component { +static template = "pos_product_create_edit.ProductLine"; + setup() { + super.setup(); + this.pos = usePos(); + this.popup = useService("popup") + this.orm = useService("orm") + this.state = useState({ + product: this.props.product + }); + onWillStart(async () => { + await this.imageUrl(); + }); + } + + imageUrl() { + const product = this.props.product; + this.state.product.imageUrl=`/web/image?model=product.product&field=image_128&id=${product.id}&unique=${product.write_date}`; + } + async editCurrentProduct() { + const { confirmed, payload } = await this.popup.add(CreateProductPopup, { + product: this.props.product, + }); + + if (confirmed) { + var b= await this.orm.call("product.product", "create_from_ui", [payload]); + let pos_product = await this.orm.call("pos.session", "get_pos_ui_product_product_by_params", [odoo.pos_session_id, {domain: [['id', '=', b]]}]); + this.state.product = pos_product[0]; + this.props.product = pos_product[0]; + this.imageUrl() + + } + +} +} diff --git a/pos_product_create_edit/static/src/js/pos_product_screen.js b/pos_product_create_edit/static/src/js/pos_product_screen.js new file mode 100644 index 000000000..d08e8d88f --- /dev/null +++ b/pos_product_create_edit/static/src/js/pos_product_screen.js @@ -0,0 +1,34 @@ +/**@odoo-module **/ + +import { Component,useRef } from "@odoo/owl"; +import { usePos } from "@point_of_sale/app/store/pos_hook"; +import { ProductScreen } from "@point_of_sale/app/screens/product_screen/product_screen"; + +export class SetProductListButton extends Component { +static template = "SetProductListButton"; + + setup() { + super.setup(); + this.pos = usePos(); + } + get productsList() { + let list = []; + list = this.pos.db.get_product_by_category( + this.pos.selectedCategoryId + ); + return list.sort(function (a, b) { + return a.display_name.localeCompare(b.display_name); + }); + } + onClick_ProductListScreen() { + let list = this.productsList; + const screen = "ProductListScreen"; + this.pos.showScreen("ProductListScreen"); + } +} +ProductScreen.addControlButton({ + component: SetProductListButton, + condition: function () { + return true; + }, +}); diff --git a/pos_product_create_edit/static/src/js/productScreen.js b/pos_product_create_edit/static/src/js/productScreen.js new file mode 100644 index 000000000..4957cf005 --- /dev/null +++ b/pos_product_create_edit/static/src/js/productScreen.js @@ -0,0 +1,92 @@ +/**@odoo-module **/ +import { ControlButtonsMixin } from "@point_of_sale/app/utils/control_buttons_mixin"; +import { registry } from "@web/core/registry"; +import { Component, useState , onWillStart} from "@odoo/owl"; +import { onWillUnmount, useRef, onMounted } from "@odoo/owl"; +import { usePos } from "@point_of_sale/app/store/pos_hook"; +import { ProductLine } from "@pos_product_create_edit/js/ProductLine"; +import { useService } from "@web/core/utils/hooks"; +import { CreateProductPopup } from "@pos_product_create_edit/js/ProductCreatePopup"; + + +class ProductListScreen extends Component { +static template = "pos_product_create_edit.ProductListScreen"; +static components = { ProductLine }; + + setup() { + super.setup(); + this.pos = usePos(); + this.popup = useService("popup"); + this.orm = useService("orm"); + this.searchWordInputRef = useRef("search-word-input-product"); + this.state = useState({ + search: null, + products:[] + }); + onWillStart(async () => { + this.state.products = await this.get_products(); + }); + } + + async createProduct() { + const { confirmed, payload } = await this.popup.add(CreateProductPopup, { + product: this.props.product, + }); + + if (confirmed) { + var b= await this.orm.call("product.product", "create_from_ui", [payload]); + let pos_product = await this.orm.call("pos.session", "get_pos_ui_product_product_by_params", [odoo.pos_session_id, {domain: [['id', '=', b]]}]); + this.state.products = [pos_product[0], ...this.state.products] + } + } + async get_products() { + let list; + if (this.state.search && this.state.search.trim() !== "") { + list = this.pos.db.search_product_in_category( + 0, + this.state.search.trim() + ); + } else { + list = this.pos.db.get_product_by_category(0); + } + if (!list || list.length === 0) { + list = this.pos.db.get_product_by_category(0); + } + var abc=list.sort(function (a, b) { + return a.display_name.localeCompare(b.display_name); + }); + return abc +} + async updateProductList(event) { + this.state.search = event.target.value; + if (event.code === "Enter") { + this._onPressEnterKey(); + } else { + var result = await this.get_products(); + this.state.products = result; + this.render(true); + } + } + async _onPressEnterKey() { + if (!this.state.search) return; + if (!this.pos.isEveryProductLoaded) { + const result = await this.get_products(); + this.state.products = await this.get_products(); + this.env.services.notification.add(_t('%s Product(s) found for "%s".', { thread_name: thread.name }), + { type: "success" }) + if (!result.length) this._clearSearch(); + } + } + async _clearSearch() { + this.searchWordInputRef.el.value = ""; + this.state.search = ""; + var result = await this.get_products(); + this.state.products = result; + this.render(true); + } + + back() { + this.pos.showScreen('ProductScreen'); + } +} +registry.category("pos_screens").add("ProductListScreen", ProductListScreen); diff --git a/pos_product_create_edit/static/src/xml/ProductCreatePopup.xml b/pos_product_create_edit/static/src/xml/ProductCreatePopup.xml new file mode 100644 index 000000000..e97a8c58c --- /dev/null +++ b/pos_product_create_edit/static/src/xml/ProductCreatePopup.xml @@ -0,0 +1,88 @@ + + + + + + + \ No newline at end of file diff --git a/pos_product_create_edit/static/src/xml/ProductLine.xml b/pos_product_create_edit/static/src/xml/ProductLine.xml new file mode 100644 index 000000000..4cf5a7841 --- /dev/null +++ b/pos_product_create_edit/static/src/xml/ProductLine.xml @@ -0,0 +1,44 @@ + + + + + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+