diff --git a/product_multi_uom_pos/README.rst b/product_multi_uom_pos/README.rst new file mode 100644 index 000000000..8af9e1474 --- /dev/null +++ b/product_multi_uom_pos/README.rst @@ -0,0 +1,47 @@ +.. 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 Multiple UOM +======================== +*This app allows you to change UoM in POS.* + +Installation +============ + - www.odoo.com/documentation/16.0/setup/install.html + - Install our custom addon + +License +------- +GNU AFFERO GENERAL PUBLIC LICENSE v3.0 (AGPL-3) +(https://www.gnu.org/licenses/agpl-3.0-standalone.html) + +Company +------- +* `Cybrosys Techno Solutions `__ + +Credits +------- +* Developer:(V16) Arwa V V, Contact: odoo@cybrosys.com + +Contacts +-------- +* Mail Contact : odoo@cybrosys.com +* Website: https://cybrosys.com + +Bug Tracker +----------- +Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. + +Maintainer +========== +.. image:: https://cybrosys.com/images/logo.png + :target: https://cybrosys.com + +This module is maintained by Cybrosys Technologies. + +For support and more information, please visit https://www.cybrosys.com + +Further information +=================== +HTML Description: ``__ diff --git a/product_multi_uom_pos/__init__.py b/product_multi_uom_pos/__init__.py new file mode 100644 index 000000000..d0935ec22 --- /dev/null +++ b/product_multi_uom_pos/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Arwa V V (Contact : 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/product_multi_uom_pos/__manifest__.py b/product_multi_uom_pos/__manifest__.py new file mode 100644 index 000000000..5bc1ac5c9 --- /dev/null +++ b/product_multi_uom_pos/__manifest__.py @@ -0,0 +1,56 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Arwa V V (Contact : 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 Multiple UOM", + 'version': '16.0.1.0.0', + 'category': 'Point of Sale', + 'summary': """A module to manage multiple UoM in POS""", + 'description': """This app allows you to change UoM of product in POS.""", + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': "https://www.cybrosys.com", + 'depends': ['base', 'point_of_sale'], + 'data': + [ + 'security/ir.model.access.csv', + 'views/res_config_settings_views.xml', + 'views/product_template_views.xml', + 'views/pos_order_views.xml', + ], + 'assets': { + 'point_of_sale.assets': [ + 'product_multi_uom_pos/static/src/js/Orderline.js', + 'product_multi_uom_pos/static/src/xml/Orderline.xml', + 'product_multi_uom_pos/static/src/xml/OrderReceipt.xml', + 'product_multi_uom_pos/static/src/js/load_pos_multi_uom.js', + 'product_multi_uom_pos/static/src/js/models.js', + ], + }, + 'images': [ + 'static/description/banner.png', + ], + 'license': 'AGPL-3', + 'installable': True, + 'auto_install': False, + 'application': False, +} diff --git a/product_multi_uom_pos/doc/RELEASE_NOTES.md b/product_multi_uom_pos/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..e56942037 --- /dev/null +++ b/product_multi_uom_pos/doc/RELEASE_NOTES.md @@ -0,0 +1,6 @@ +## Module + +#### 18.10.2023 +#### Version 16.0.1.0.0 +#### ADD +- Initial commit for POS Product Multiple UOM diff --git a/product_multi_uom_pos/models/__init__.py b/product_multi_uom_pos/models/__init__.py new file mode 100644 index 000000000..3ec6537aa --- /dev/null +++ b/product_multi_uom_pos/models/__init__.py @@ -0,0 +1,28 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Arwa V V (Contact : 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 pos_session +from . import product_template +from . import pos_order_line +from . import stock_picking +from . import pos_config +from . import res_config_settings +from . import pos_multi_uom diff --git a/product_multi_uom_pos/models/pos_config.py b/product_multi_uom_pos/models/pos_config.py new file mode 100644 index 000000000..4e267f36e --- /dev/null +++ b/product_multi_uom_pos/models/pos_config.py @@ -0,0 +1,31 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Arwa V V (Contact : 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 fields, models + + +class PosConfig(models.Model): + """Inherits 'pos.config' and adds new field""" + _inherit = "pos.config" + + pos_multi_uom = fields.Boolean(string="Multi UoM", + help="Enable the option change UoM of" + " products in POS") diff --git a/product_multi_uom_pos/models/pos_multi_uom.py b/product_multi_uom_pos/models/pos_multi_uom.py new file mode 100644 index 000000000..31a3721fe --- /dev/null +++ b/product_multi_uom_pos/models/pos_multi_uom.py @@ -0,0 +1,47 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Arwa V V (Contact : 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 fields, models + + +class PosMultiUom(models.Model): + """ + Model for managing Point of Sale (POS) Multi Unit of Measure (UoM). + + This model represents the association between a product template and its + multiple unit of measure options for the Point of Sale module. + """ + _name = 'pos.multi.uom' + _description = 'POS Multi UoM' + + product_template_id = fields.Many2one('product.template', + string='Product Template', + help='Inverse field of one2many' + 'field POS Multiple UoM in' + 'product.template') + category_id = fields.Many2one( + related='product_template_id.uom_id.category_id', + string='UoM Category', help='Category of unit of measure') + uom_id = fields.Many2one('uom.uom', string='Unit Of Measure', + domain="[('category_id', '=', category_id)]", + help="Choose a UoM") + price = fields.Float(string='Sale Price', help="Set a price for selected " + "UoM") diff --git a/product_multi_uom_pos/models/pos_order_line.py b/product_multi_uom_pos/models/pos_order_line.py new file mode 100644 index 000000000..8aade3e7d --- /dev/null +++ b/product_multi_uom_pos/models/pos_order_line.py @@ -0,0 +1,41 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Arwa V V (Contact : 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, fields, models + + +class PosOrderLine(models.Model): + """Inherits model 'pos.order.line' and updates UoM""" + _inherit = 'pos.order.line' + + product_uom_id = fields.Many2one('uom.uom', string='Product UoM', + related='uom_id', + help='Unit of measure of product') + uom_id = fields.Many2one('uom.uom', string='Product UoM', + help='Unit of measure of product added in POS ' + 'order line') + + @api.model + def create(self, values): + """Updates UoM in POS order lines""" + if values.get('product_uom_id'): + values['uom_id'] = values['product_uom_id'] + return super(PosOrderLine, self).create(values) diff --git a/product_multi_uom_pos/models/pos_session.py b/product_multi_uom_pos/models/pos_session.py new file mode 100644 index 000000000..21d84f54a --- /dev/null +++ b/product_multi_uom_pos/models/pos_session.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Arwa V V (Contact : 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 models + + +class PosSession(models.Model): + """Inherits model 'pos.session' and loads fields and models""" + _inherit = 'pos.session' + + def _loader_params_product_product(self): + """Loading field 'pos_multi_uom_ids' to POS""" + result = super()._loader_params_product_product() + result['search_params']['fields'].append('pos_multi_uom_ids') + return result + + def _pos_ui_models_to_load(self): + """Loading model 'pos.multi.uom' to POS""" + result = super()._pos_ui_models_to_load() + result.append('pos.multi.uom') + return result + + def _loader_params_pos_multi_uom(self): + """Loading fields of model 'pos.multi.uom' to POS""" + return { + 'search_params': { + 'fields': ['uom_id', 'price', 'product_template_id']} + } + + def _get_pos_ui_pos_multi_uom(self, params): + """Loading new model to POS""" + return self.env['pos.multi.uom'].search_read(**params['search_params']) diff --git a/product_multi_uom_pos/models/product_template.py b/product_multi_uom_pos/models/product_template.py new file mode 100644 index 000000000..5bb4e4aa8 --- /dev/null +++ b/product_multi_uom_pos/models/product_template.py @@ -0,0 +1,48 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Arwa V V (Contact : 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 fields, models + + +class ProductTemplate(models.Model): + """Inherits model 'product.template' and adds field to set multiple units + of measure""" + _inherit = 'product.template' + + multi_uom = fields.Boolean(compute='_compute_multi_uom', string='Multi UoM', + help='A boolean field to show the one2many field' + 'POS Multiple UoM if the Multi UoM option' + ' is enabled in Configuration settings') + pos_multi_uom_ids = fields.One2many('pos.multi.uom', 'product_template_id', + string="POS Multiple UoM", + help='These UoM can be selected from ' + 'PoS') + + def _compute_multi_uom(self): + """ + Updates the 'multi_uom' field based on the configuration parameter + 'product_multi_uom_pos.pos_multi_uom'. + """ + status = self.env['ir.config_parameter'].sudo().get_param( + 'product_multi_uom_pos.pos_multi_uom') + self.write({ + 'multi_uom': status + }) diff --git a/product_multi_uom_pos/models/res_config_settings.py b/product_multi_uom_pos/models/res_config_settings.py new file mode 100644 index 000000000..9b3340c6e --- /dev/null +++ b/product_multi_uom_pos/models/res_config_settings.py @@ -0,0 +1,35 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Arwa V V (Contact : 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 fields, models + + +class ResConfigSettings(models.TransientModel): + """Inherits 'res.config.settings' and adds new field """ + _inherit = 'res.config.settings' + + pos_multi_uom = fields.Boolean(string="Multi UoM", + related="pos_config_id.pos_multi_uom", + readonly=False, + config_parameter="product_multi_uom_pos." + "pos_multi_uom", + help='UoM of products can be changed in ' + 'POS if enabled') diff --git a/product_multi_uom_pos/models/stock_picking.py b/product_multi_uom_pos/models/stock_picking.py new file mode 100644 index 000000000..90e05c6d3 --- /dev/null +++ b/product_multi_uom_pos/models/stock_picking.py @@ -0,0 +1,59 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Arwa V V (Contact : 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 models + + +class StockPicking(models.Model): + """Inherits model 'stock.picking' and updates unit of measure in move + lines""" + _inherit = 'stock.picking' + + def _prepare_stock_move_vals(self, first_line, order_lines): + """Updates unit of measure in move lines""" + for line in order_lines: + self._cr.execute( + """select * from pos_order_line where id = %s""" % (line.id)) + uom_id = self._cr.dictfetchall()[0]['uom_id'] + return { + 'name': first_line.name, + 'product_uom': uom_id, + 'picking_id': self.id, + 'picking_type_id': self.picking_type_id.id, + 'product_id': first_line.product_id.id, + 'product_uom_qty': abs(sum(order_lines.mapped('qty'))), + 'state': 'draft', + 'location_id': self.location_id.id, + 'location_dest_id': self.location_dest_id.id, + 'company_id': self.company_id.id, + } + + def _create_move_from_pos_order_lines(self, lines): + """Creates individual stock move lines for each sale order line""" + self.ensure_one() + move_vals = [] + for line in lines: + order_lines = self.env['pos.order.line'].concat(line) + move_vals.append( + self._prepare_stock_move_vals(order_lines[0], order_lines)) + moves = self.env['stock.move'].create(move_vals) + confirmed_moves = moves._action_confirm() + confirmed_moves._add_mls_related_to_order(lines, are_qties_done=True) diff --git a/product_multi_uom_pos/security/ir.model.access.csv b/product_multi_uom_pos/security/ir.model.access.csv new file mode 100644 index 000000000..459fbb366 --- /dev/null +++ b/product_multi_uom_pos/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_pos_multi_uom,access.pos.multi.uom,model_pos_multi_uom,base.group_user,1,1,1,1 diff --git a/product_multi_uom_pos/static/description/assets/icons/cogs.png b/product_multi_uom_pos/static/description/assets/icons/cogs.png new file mode 100644 index 000000000..95d0bad62 Binary files /dev/null and b/product_multi_uom_pos/static/description/assets/icons/cogs.png differ diff --git a/product_multi_uom_pos/static/description/assets/icons/consultation.png b/product_multi_uom_pos/static/description/assets/icons/consultation.png new file mode 100644 index 000000000..8319d4baa Binary files /dev/null and b/product_multi_uom_pos/static/description/assets/icons/consultation.png differ diff --git a/product_multi_uom_pos/static/description/assets/icons/ecom-black.png b/product_multi_uom_pos/static/description/assets/icons/ecom-black.png new file mode 100644 index 000000000..a9385ff13 Binary files /dev/null and b/product_multi_uom_pos/static/description/assets/icons/ecom-black.png differ diff --git a/product_multi_uom_pos/static/description/assets/icons/education-black.png b/product_multi_uom_pos/static/description/assets/icons/education-black.png new file mode 100644 index 000000000..3eb09b27b Binary files /dev/null and b/product_multi_uom_pos/static/description/assets/icons/education-black.png differ diff --git a/product_multi_uom_pos/static/description/assets/icons/hotel-black.png b/product_multi_uom_pos/static/description/assets/icons/hotel-black.png new file mode 100644 index 000000000..130f613be Binary files /dev/null and b/product_multi_uom_pos/static/description/assets/icons/hotel-black.png differ diff --git a/product_multi_uom_pos/static/description/assets/icons/license.png b/product_multi_uom_pos/static/description/assets/icons/license.png new file mode 100644 index 000000000..a5869797e Binary files /dev/null and b/product_multi_uom_pos/static/description/assets/icons/license.png differ diff --git a/product_multi_uom_pos/static/description/assets/icons/lifebuoy.png b/product_multi_uom_pos/static/description/assets/icons/lifebuoy.png new file mode 100644 index 000000000..658d56ccc Binary files /dev/null and b/product_multi_uom_pos/static/description/assets/icons/lifebuoy.png differ diff --git a/product_multi_uom_pos/static/description/assets/icons/manufacturing-black.png b/product_multi_uom_pos/static/description/assets/icons/manufacturing-black.png new file mode 100644 index 000000000..697eb0e9f Binary files /dev/null and b/product_multi_uom_pos/static/description/assets/icons/manufacturing-black.png differ diff --git a/product_multi_uom_pos/static/description/assets/icons/pos-black.png b/product_multi_uom_pos/static/description/assets/icons/pos-black.png new file mode 100644 index 000000000..97c0f90c1 Binary files /dev/null and b/product_multi_uom_pos/static/description/assets/icons/pos-black.png differ diff --git a/product_multi_uom_pos/static/description/assets/icons/puzzle.png b/product_multi_uom_pos/static/description/assets/icons/puzzle.png new file mode 100644 index 000000000..65cf854e7 Binary files /dev/null and b/product_multi_uom_pos/static/description/assets/icons/puzzle.png differ diff --git a/product_multi_uom_pos/static/description/assets/icons/restaurant-black.png b/product_multi_uom_pos/static/description/assets/icons/restaurant-black.png new file mode 100644 index 000000000..4a35eb939 Binary files /dev/null and b/product_multi_uom_pos/static/description/assets/icons/restaurant-black.png differ diff --git a/product_multi_uom_pos/static/description/assets/icons/service-black.png b/product_multi_uom_pos/static/description/assets/icons/service-black.png new file mode 100644 index 000000000..301ab51cb Binary files /dev/null and b/product_multi_uom_pos/static/description/assets/icons/service-black.png differ diff --git a/product_multi_uom_pos/static/description/assets/icons/trading-black.png b/product_multi_uom_pos/static/description/assets/icons/trading-black.png new file mode 100644 index 000000000..9398ba2f1 Binary files /dev/null and b/product_multi_uom_pos/static/description/assets/icons/trading-black.png differ diff --git a/product_multi_uom_pos/static/description/assets/icons/training.png b/product_multi_uom_pos/static/description/assets/icons/training.png new file mode 100644 index 000000000..884ca024d Binary files /dev/null and b/product_multi_uom_pos/static/description/assets/icons/training.png differ diff --git a/product_multi_uom_pos/static/description/assets/icons/update.png b/product_multi_uom_pos/static/description/assets/icons/update.png new file mode 100644 index 000000000..ecbc5a01a Binary files /dev/null and b/product_multi_uom_pos/static/description/assets/icons/update.png differ diff --git a/product_multi_uom_pos/static/description/assets/icons/user.png b/product_multi_uom_pos/static/description/assets/icons/user.png new file mode 100644 index 000000000..6ffb23d9f Binary files /dev/null and b/product_multi_uom_pos/static/description/assets/icons/user.png differ diff --git a/product_multi_uom_pos/static/description/assets/icons/wrench.png b/product_multi_uom_pos/static/description/assets/icons/wrench.png new file mode 100644 index 000000000..6c04dea0f Binary files /dev/null and b/product_multi_uom_pos/static/description/assets/icons/wrench.png differ diff --git a/product_multi_uom_pos/static/description/assets/misc/categories.png b/product_multi_uom_pos/static/description/assets/misc/categories.png new file mode 100644 index 000000000..bedf1e0b1 Binary files /dev/null and b/product_multi_uom_pos/static/description/assets/misc/categories.png differ diff --git a/product_multi_uom_pos/static/description/assets/misc/check-box.png b/product_multi_uom_pos/static/description/assets/misc/check-box.png new file mode 100644 index 000000000..42caf24b9 Binary files /dev/null and b/product_multi_uom_pos/static/description/assets/misc/check-box.png differ diff --git a/product_multi_uom_pos/static/description/assets/misc/compass.png b/product_multi_uom_pos/static/description/assets/misc/compass.png new file mode 100644 index 000000000..d5fed8faa Binary files /dev/null and b/product_multi_uom_pos/static/description/assets/misc/compass.png differ diff --git a/product_multi_uom_pos/static/description/assets/misc/corporate.png b/product_multi_uom_pos/static/description/assets/misc/corporate.png new file mode 100644 index 000000000..2eb13edbf Binary files /dev/null and b/product_multi_uom_pos/static/description/assets/misc/corporate.png differ diff --git a/product_multi_uom_pos/static/description/assets/misc/customer-support.png b/product_multi_uom_pos/static/description/assets/misc/customer-support.png new file mode 100644 index 000000000..79efc72ed Binary files /dev/null and b/product_multi_uom_pos/static/description/assets/misc/customer-support.png differ diff --git a/product_multi_uom_pos/static/description/assets/misc/cybrosys-logo.png b/product_multi_uom_pos/static/description/assets/misc/cybrosys-logo.png new file mode 100644 index 000000000..cc3cc0ccf Binary files /dev/null and b/product_multi_uom_pos/static/description/assets/misc/cybrosys-logo.png differ diff --git a/product_multi_uom_pos/static/description/assets/misc/features.png b/product_multi_uom_pos/static/description/assets/misc/features.png new file mode 100644 index 000000000..b41769f77 Binary files /dev/null and b/product_multi_uom_pos/static/description/assets/misc/features.png differ diff --git a/product_multi_uom_pos/static/description/assets/misc/logo.png b/product_multi_uom_pos/static/description/assets/misc/logo.png new file mode 100644 index 000000000..478462d3e Binary files /dev/null and b/product_multi_uom_pos/static/description/assets/misc/logo.png differ diff --git a/product_multi_uom_pos/static/description/assets/misc/pictures.png b/product_multi_uom_pos/static/description/assets/misc/pictures.png new file mode 100644 index 000000000..56d255fe9 Binary files /dev/null and b/product_multi_uom_pos/static/description/assets/misc/pictures.png differ diff --git a/product_multi_uom_pos/static/description/assets/misc/pie-chart.png b/product_multi_uom_pos/static/description/assets/misc/pie-chart.png new file mode 100644 index 000000000..426e05244 Binary files /dev/null and b/product_multi_uom_pos/static/description/assets/misc/pie-chart.png differ diff --git a/product_multi_uom_pos/static/description/assets/misc/right-arrow.png b/product_multi_uom_pos/static/description/assets/misc/right-arrow.png new file mode 100644 index 000000000..730984a06 Binary files /dev/null and b/product_multi_uom_pos/static/description/assets/misc/right-arrow.png differ diff --git a/product_multi_uom_pos/static/description/assets/misc/star.png b/product_multi_uom_pos/static/description/assets/misc/star.png new file mode 100644 index 000000000..2eb9ab29f Binary files /dev/null and b/product_multi_uom_pos/static/description/assets/misc/star.png differ diff --git a/product_multi_uom_pos/static/description/assets/misc/support.png b/product_multi_uom_pos/static/description/assets/misc/support.png new file mode 100644 index 000000000..4f18b8b82 Binary files /dev/null and b/product_multi_uom_pos/static/description/assets/misc/support.png differ diff --git a/product_multi_uom_pos/static/description/assets/misc/whatsapp.png b/product_multi_uom_pos/static/description/assets/misc/whatsapp.png new file mode 100644 index 000000000..d513a5356 Binary files /dev/null and b/product_multi_uom_pos/static/description/assets/misc/whatsapp.png differ diff --git a/product_multi_uom_pos/static/description/assets/modules/multi_barcodes_pos.png b/product_multi_uom_pos/static/description/assets/modules/multi_barcodes_pos.png new file mode 100644 index 000000000..05c8b4a69 Binary files /dev/null and b/product_multi_uom_pos/static/description/assets/modules/multi_barcodes_pos.png differ diff --git a/product_multi_uom_pos/static/description/assets/modules/pos_category_wise_receipt.png b/product_multi_uom_pos/static/description/assets/modules/pos_category_wise_receipt.png new file mode 100644 index 000000000..ea9ab12fb Binary files /dev/null and b/product_multi_uom_pos/static/description/assets/modules/pos_category_wise_receipt.png differ diff --git a/product_multi_uom_pos/static/description/assets/modules/pos_numpad_show_hide.png b/product_multi_uom_pos/static/description/assets/modules/pos_numpad_show_hide.png new file mode 100644 index 000000000..ae32f480b Binary files /dev/null and b/product_multi_uom_pos/static/description/assets/modules/pos_numpad_show_hide.png differ diff --git a/product_multi_uom_pos/static/description/assets/modules/pos_order_line_image.png b/product_multi_uom_pos/static/description/assets/modules/pos_order_line_image.png new file mode 100644 index 000000000..38ea1f663 Binary files /dev/null and b/product_multi_uom_pos/static/description/assets/modules/pos_order_line_image.png differ diff --git a/product_multi_uom_pos/static/description/assets/modules/pos_product_creation.png b/product_multi_uom_pos/static/description/assets/modules/pos_product_creation.png new file mode 100644 index 000000000..fd1f87699 Binary files /dev/null and b/product_multi_uom_pos/static/description/assets/modules/pos_product_creation.png differ diff --git a/product_multi_uom_pos/static/description/assets/modules/pos_sync_orders.png b/product_multi_uom_pos/static/description/assets/modules/pos_sync_orders.png new file mode 100644 index 000000000..f5c24146b Binary files /dev/null and b/product_multi_uom_pos/static/description/assets/modules/pos_sync_orders.png differ diff --git a/product_multi_uom_pos/static/description/assets/screenshots/Screenshot1.png b/product_multi_uom_pos/static/description/assets/screenshots/Screenshot1.png new file mode 100644 index 000000000..f23976904 Binary files /dev/null and b/product_multi_uom_pos/static/description/assets/screenshots/Screenshot1.png differ diff --git a/product_multi_uom_pos/static/description/assets/screenshots/Screenshot2.png b/product_multi_uom_pos/static/description/assets/screenshots/Screenshot2.png new file mode 100644 index 000000000..ba8638822 Binary files /dev/null and b/product_multi_uom_pos/static/description/assets/screenshots/Screenshot2.png differ diff --git a/product_multi_uom_pos/static/description/assets/screenshots/Screenshot3.png b/product_multi_uom_pos/static/description/assets/screenshots/Screenshot3.png new file mode 100644 index 000000000..85b8a27d8 Binary files /dev/null and b/product_multi_uom_pos/static/description/assets/screenshots/Screenshot3.png differ diff --git a/product_multi_uom_pos/static/description/assets/screenshots/Screenshot4.png b/product_multi_uom_pos/static/description/assets/screenshots/Screenshot4.png new file mode 100644 index 000000000..d0eac9fe5 Binary files /dev/null and b/product_multi_uom_pos/static/description/assets/screenshots/Screenshot4.png differ diff --git a/product_multi_uom_pos/static/description/assets/screenshots/Screenshot5.png b/product_multi_uom_pos/static/description/assets/screenshots/Screenshot5.png new file mode 100644 index 000000000..2532991f2 Binary files /dev/null and b/product_multi_uom_pos/static/description/assets/screenshots/Screenshot5.png differ diff --git a/product_multi_uom_pos/static/description/assets/screenshots/Screenshot6.png b/product_multi_uom_pos/static/description/assets/screenshots/Screenshot6.png new file mode 100644 index 000000000..a2203fdc4 Binary files /dev/null and b/product_multi_uom_pos/static/description/assets/screenshots/Screenshot6.png differ diff --git a/product_multi_uom_pos/static/description/assets/screenshots/Screenshot7.png b/product_multi_uom_pos/static/description/assets/screenshots/Screenshot7.png new file mode 100644 index 000000000..97df1bcf9 Binary files /dev/null and b/product_multi_uom_pos/static/description/assets/screenshots/Screenshot7.png differ diff --git a/product_multi_uom_pos/static/description/assets/screenshots/Screenshot8.png b/product_multi_uom_pos/static/description/assets/screenshots/Screenshot8.png new file mode 100644 index 000000000..fb4ee760c Binary files /dev/null and b/product_multi_uom_pos/static/description/assets/screenshots/Screenshot8.png differ diff --git a/product_multi_uom_pos/static/description/assets/screenshots/Screenshot9.png b/product_multi_uom_pos/static/description/assets/screenshots/Screenshot9.png new file mode 100644 index 000000000..76e95e4b0 Binary files /dev/null and b/product_multi_uom_pos/static/description/assets/screenshots/Screenshot9.png differ diff --git a/product_multi_uom_pos/static/description/assets/screenshots/hero.gif b/product_multi_uom_pos/static/description/assets/screenshots/hero.gif new file mode 100644 index 000000000..54525322f Binary files /dev/null and b/product_multi_uom_pos/static/description/assets/screenshots/hero.gif differ diff --git a/product_multi_uom_pos/static/description/banner.png b/product_multi_uom_pos/static/description/banner.png new file mode 100644 index 000000000..05ed3ee8c Binary files /dev/null and b/product_multi_uom_pos/static/description/banner.png differ diff --git a/product_multi_uom_pos/static/description/icon.png b/product_multi_uom_pos/static/description/icon.png new file mode 100644 index 000000000..2c324184a Binary files /dev/null and b/product_multi_uom_pos/static/description/icon.png differ diff --git a/product_multi_uom_pos/static/description/index.html b/product_multi_uom_pos/static/description/index.html new file mode 100644 index 000000000..779793fe1 --- /dev/null +++ b/product_multi_uom_pos/static/description/index.html @@ -0,0 +1,698 @@ +
+ +
+ +
+
+ Community +
+
+ Enterprise +
+
+ Odoo.sh +
+ +
+
+ +
+
+
+ +

+ POS Product Multiple UOM

+

+ A Module For Managing Multiple UoM in POS

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

+ Explore This + Module

+
+ + + + +
+
+ +
+

+ Overview +

+
+
+
+ Using this app, you can change unit of measure of product in POS order. +
+
+ + + +
+
+ +
+

+ Features +

+
+
+
+
+ + Change UoM of products in POS +
+
+
+
+ + Available in Odoo 16.0 Enterprise and + Community. +
+ +
+
+ + + +
+
+ +
+

+ Screenshots +

+
+
+
+ +
+

+ 'Multiple Unit of Measure' Option in POS Configuration Setting +

+

+ Enable the option 'Multiple Unit of Measure'

+ +
+ +
+

+ Form View of Product +

+

+ If 'Multiple Unit of Measure' option is enabled, you can add + multiple units of measures and its price under 'Sales' tab of + Products as shown.

+ +

+ +
+ +
+

+ Selection Box to Change UoM +

+

+ You can change UoM from selection box..

+ +
+ +
+

+ UoM and price in Orderline +

+

+ Changed UoM and price in orderline

+ +
+ +
+

+ UoM In POS Receipt +

+

+ UoM will be updated in the Receipt

+ +
+
+

+ UoM In POS Order +

+

+ UoM will be updated in the POS Order

+ +
+
+

+ UoM In Stock Picking +

+

+ UoM will be updated in the Picking

+ +
+
+

+ Reset button in Orderline +

+

+ You can reset the changed UoM to default UoM by clicking this + button.

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

+ 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

+
+
+
+
+
+
+
+ +
+
+
+ diff --git a/product_multi_uom_pos/static/src/js/Orderline.js b/product_multi_uom_pos/static/src/js/Orderline.js new file mode 100644 index 000000000..b03f5f421 --- /dev/null +++ b/product_multi_uom_pos/static/src/js/Orderline.js @@ -0,0 +1,48 @@ +odoo.define('product_multi_uom_pos.multi_uom_pos', function(require) { + 'use strict'; + var OrderLine = require('point_of_sale.Orderline'); + const Registries = require('point_of_sale.Registries'); + const { useListener } = require("@web/core/utils/hooks"); + const OrderLineExtend = (OrderLine) => class extends OrderLine { + setup(){ + super.setup(); + useListener('click', '#select_uom', this.onClickUom); + useListener('click', '#reset_uom', this.resetUom); + } + + // Retrieve the available unit of measure options based on the product's multi_uom_ids + getUom() { + const filteredData = this.props.line.pos.pos_multi_uom.filter(obj => this.props.line.product.pos_multi_uom_ids.includes(obj.id)); + return filteredData + } + + // Handle click event on the unit of measure options + onClickUom(ev) { + var splitTargetValue = ev.target.value.split(',') + var price = splitTargetValue[0] + var uomId = splitTargetValue[1] + var uomName = splitTargetValue[2] + // Set the selected unit of measure on the order line + this.props.line.set_uom({0:uomId,1:uomName}) + + // Set the price_manually_set flag to indicate that the price was manually set + this.props.line.price_manually_set = true; + + // Set the unit price of selected UoM on the order line + this.props.line.set_unit_price(price); + } + + // Reset the unit of measure to the default uom_id of the product + resetUom(ev) { + var lineId = this.props.line.id + console.log(this) + this.el.querySelector('#change_uom').disabled = false; + this.el.querySelector('#select_uom').value = 'change_uom'; + this.el.querySelector('#change_uom').disabled = true; + this.props.line.set_uom({0:this.props.line.product.uom_id[0],1:this.props.line.product.uom_id[1]}) + this.props.line.set_unit_price(this.props.line.product.lst_price); + } + }; + Registries.Component.extend(OrderLine, OrderLineExtend); + return OrderLine; +}); diff --git a/product_multi_uom_pos/static/src/js/load_pos_multi_uom.js b/product_multi_uom_pos/static/src/js/load_pos_multi_uom.js new file mode 100644 index 000000000..f0f8d1df3 --- /dev/null +++ b/product_multi_uom_pos/static/src/js/load_pos_multi_uom.js @@ -0,0 +1,16 @@ +odoo.define('product_multi_uom_pos.pos_multi_uom_load', function (require) { +"use strict"; + // Import the required modules + var {PosGlobalState} = require('point_of_sale.models'); + const Registries = require('point_of_sale.Registries'); + // Extend the PosGlobalState class + const NewPosGlobalState = (PosGlobalState) => class NewPosGlobalState extends PosGlobalState { + async _processData(loadedData){ + await super._processData(...arguments); + // Assign the loaded 'pos.multi.uom' data to the pos_multi_uom property + this.pos_multi_uom = loadedData['pos.multi.uom']; + } + } + // Extend the PosGlobalState model using the NewPosGlobalState class + Registries.Model.extend(PosGlobalState,NewPosGlobalState) + }); diff --git a/product_multi_uom_pos/static/src/js/models.js b/product_multi_uom_pos/static/src/js/models.js new file mode 100644 index 000000000..d81f7c43e --- /dev/null +++ b/product_multi_uom_pos/static/src/js/models.js @@ -0,0 +1,47 @@ +/** @odoo-module **/ + +// Import the required modules +import Registries from 'point_of_sale.Registries'; +import {Orderline} from 'point_of_sale.models'; + +// Extend the Orderline class +const ProductUom = (Orderline) => class ProductUom extends Orderline { + export_as_JSON(){ + var json = super.export_as_JSON.call(this); + // Check if the product_uom_id is undefined.If yes, set product_uom_id to the default uom_id of the product + if (this.product_uom_id == undefined){ + this.product_uom_id = this.product.uom_id; + } + // Set the product_uom_id in the JSON object + json.product_uom_id = this.product_uom_id[0]; + return json; + } + init_from_JSON(json){ + super.init_from_JSON(...arguments); + // Set the product_uom_id from the JSON data + this.product_uom_id = { + 0 : this.pos.units_by_id[json.product_uom_id].id, + 1 : this.pos.units_by_id[json.product_uom_id].name, + }; + } + // Add a custom set_uom method + set_uom(uom_id){ + this.product_uom_id = uom_id; + } + + // Override the get_unit method to get selected UoM from POS + get_unit() { + if (this.product_uom_id){ + var unit_id = this.product_uom_id[0]; + if(!unit_id){ + return undefined; + } + if(!this.pos){ + return undefined; + } + return this.pos.units_by_id[unit_id]; + } + return this.product.get_unit(); + } +} +Registries.Model.extend(Orderline, ProductUom); diff --git a/product_multi_uom_pos/static/src/xml/OrderReceipt.xml b/product_multi_uom_pos/static/src/xml/OrderReceipt.xml new file mode 100644 index 000000000..936c7e9a6 --- /dev/null +++ b/product_multi_uom_pos/static/src/xml/OrderReceipt.xml @@ -0,0 +1,61 @@ + + + + + + +
+ + +
+ + -> + +
+
+ +
+ + + + + + +
+
+ +
+ Discount: % +
+
+
+ + + x + + + + +
+ +
+ +
+
+ +
+
    + +
  • + SN +
  • +
    +
+
+
+ + + + diff --git a/product_multi_uom_pos/static/src/xml/Orderline.xml b/product_multi_uom_pos/static/src/xml/Orderline.xml new file mode 100644 index 000000000..6fbf3710a --- /dev/null +++ b/product_multi_uom_pos/static/src/xml/Orderline.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + + diff --git a/product_multi_uom_pos/views/pos_order_views.xml b/product_multi_uom_pos/views/pos_order_views.xml new file mode 100644 index 000000000..0ee0a63c1 --- /dev/null +++ b/product_multi_uom_pos/views/pos_order_views.xml @@ -0,0 +1,14 @@ + + + + + pos.order.view.form.inherit.product.multi.uom.pos + + pos.order + + + + + + + diff --git a/product_multi_uom_pos/views/product_template_views.xml b/product_multi_uom_pos/views/product_template_views.xml new file mode 100644 index 000000000..24b0fd15a --- /dev/null +++ b/product_multi_uom_pos/views/product_template_views.xml @@ -0,0 +1,21 @@ + + + + + product.template.view.form.inherit.product.multi.uom.pos + + product.template + + + + + + + + + + + + + + diff --git a/product_multi_uom_pos/views/res_config_settings_views.xml b/product_multi_uom_pos/views/res_config_settings_views.xml new file mode 100644 index 000000000..c0f66e76b --- /dev/null +++ b/product_multi_uom_pos/views/res_config_settings_views.xml @@ -0,0 +1,28 @@ + + + + + res.config.settings.view.form.inherit.product.multi.uom.pos + res.config.settings + + + +
+
+
+ +
+
+
+
+
+
+
+
+