diff --git a/multi_barcodes_pos/README.rst b/multi_barcodes_pos/README.rst new file mode 100644 index 000000000..d6edf239f --- /dev/null +++ b/multi_barcodes_pos/README.rst @@ -0,0 +1,18 @@ +POS Product Multi Barcode +========================= +Allows to create multiple barcode for a single product. + +Installation +============ + - www.odoo.com/documentation/15.0/setup/install.html + - Install our custom addon + +Configuration +============= +No additional configurations needed + +Credits +======= +Developer: Risha C.T @ cybrosys, odoo@cybrosys.com + Viswanth k V14 @ cybrosys, odoo@cybrosys.com + Viswanth k V15 @ cybrosys, odoo@cybrosys.com diff --git a/multi_barcodes_pos/__init__.py b/multi_barcodes_pos/__init__.py new file mode 100644 index 000000000..685772c26 --- /dev/null +++ b/multi_barcodes_pos/__init__.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +################################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2020-TODAY Cybrosys Technologies (). +# Author: Risha C.T () +# +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +################################################################################### + +from . import models \ No newline at end of file diff --git a/multi_barcodes_pos/__manifest__.py b/multi_barcodes_pos/__manifest__.py new file mode 100644 index 000000000..31524f65c --- /dev/null +++ b/multi_barcodes_pos/__manifest__.py @@ -0,0 +1,48 @@ +# -*- coding: utf-8 -*- +################################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2020-TODAY Cybrosys Technologies (). +# Author: Risha C.T () +# +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +################################################################################### + +{ + 'name': 'POS Product Multi Barcode', + 'summary': """Allows to create multiple barcode for a single product""", + 'description': """Allows to create multiple barcode for a single product""", + 'version': '15.0.1.0.0', + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': 'https://www.cybrosys.com/', + 'category': 'Point of Sale', + 'depends': ['product', 'point_of_sale'], + 'license': 'AGPL-3', + 'data': [ + 'security/ir.model.access.csv', + 'views/product_views.xml' + ], + 'assets': { + 'point_of_sale.assets': [ + 'multi_barcodes_pos/static/src/js/pos_scan.js' + ], + }, + 'images': ['static/description/banner.png'], + 'installable': True, + 'auto_install': False, +} diff --git a/multi_barcodes_pos/doc/RELEASE_NOTES.md b/multi_barcodes_pos/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..cd35a38ed --- /dev/null +++ b/multi_barcodes_pos/doc/RELEASE_NOTES.md @@ -0,0 +1,6 @@ +## Module + +#### 17.09.2022 +#### Version 15.0.1.0.0 +##### ADD +- Initial commit for POS Multi Barcode Scan \ No newline at end of file diff --git a/multi_barcodes_pos/models/__init__.py b/multi_barcodes_pos/models/__init__.py new file mode 100644 index 000000000..7b376b615 --- /dev/null +++ b/multi_barcodes_pos/models/__init__.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +################################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2020-TODAY Cybrosys Technologies (). +# Author: Risha C.T () +# +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +################################################################################### + +from . import product_product \ No newline at end of file diff --git a/multi_barcodes_pos/models/product_product.py b/multi_barcodes_pos/models/product_product.py new file mode 100644 index 000000000..a6f91d35f --- /dev/null +++ b/multi_barcodes_pos/models/product_product.py @@ -0,0 +1,90 @@ +# -*- coding: utf-8 -*- +################################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2020-TODAY Cybrosys Technologies (). +# Author: Risha C.T () +# +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +################################################################################### + +from odoo import models, fields, api +from odoo.osv import expression + + +class ProductProduct(models.Model): + _inherit = 'product.product' + + product_multi_barcodes = fields.One2many('multi.barcode.products', 'product_multi', string='Barcodes') + + @api.model + def create(self, vals): + res = super(ProductProduct, self).create(vals) + res.product_multi_barcodes.update({ + 'template_multi': res.product_tmpl_id.id + }) + return res + + def write(self, vals): + res = super(ProductProduct, self).write(vals) + self.product_multi_barcodes.update({ + 'template_multi': self.product_tmpl_id.id + }) + return res + + @api.model + def _name_search(self, name, args=None, operator='ilike', limit=100, name_get_uid=None): + args = args or [] + domain = [] + if name: + domain = ['|', '|', ('name', operator, name), ('default_code', operator, name), + '|', ('barcode', operator, name), ('product_multi_barcodes', operator, name)] + product_id = self._search(expression.AND([domain, args]), limit=limit, access_rights_uid=name_get_uid) + return self.browse(product_id).name_get() + + +class ProductTemplate(models.Model): + _inherit = 'product.template' + + template_multi_barcodes = fields.One2many('multi.barcode.products', 'template_multi', string='Barcodes') + + @api.model + def create(self, vals): + res = super(ProductTemplate, self).create(vals) + res.template_multi_barcodes.update({ + 'product_multi': res.product_variant_id.id + }) + return res + + def write(self, vals): + res = super(ProductTemplate, self).write(vals) + if self.template_multi_barcodes: + self.template_multi_barcodes.update({ + 'product_multi': self.product_variant_id.id + }) + return res + + +class ProductMultiBarcode(models.Model): + _name = 'multi.barcode.products' + + multi_barcode = fields.Char(string="Barcode", help="Provide alternate barcodes for this product") + product_multi = fields.Many2one('product.product') + template_multi = fields.Many2one('product.template') + + def get_barcode_val(self, product): + # returns barcode of record in self and product id + return self.multi_barcode, product diff --git a/multi_barcodes_pos/security/ir.model.access.csv b/multi_barcodes_pos/security/ir.model.access.csv new file mode 100644 index 000000000..0a3148a7e --- /dev/null +++ b/multi_barcodes_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 +multi_barcode_products_id,multi.barcode.products.user,model_multi_barcode_products,,1,1,1,1 \ No newline at end of file diff --git a/multi_barcodes_pos/static/description/assets/icons/check.png b/multi_barcodes_pos/static/description/assets/icons/check.png new file mode 100644 index 000000000..c8e85f51d Binary files /dev/null and b/multi_barcodes_pos/static/description/assets/icons/check.png differ diff --git a/multi_barcodes_pos/static/description/assets/icons/chevron.png b/multi_barcodes_pos/static/description/assets/icons/chevron.png new file mode 100644 index 000000000..2089293d6 Binary files /dev/null and b/multi_barcodes_pos/static/description/assets/icons/chevron.png differ diff --git a/multi_barcodes_pos/static/description/assets/icons/cogs.png b/multi_barcodes_pos/static/description/assets/icons/cogs.png new file mode 100644 index 000000000..95d0bad62 Binary files /dev/null and b/multi_barcodes_pos/static/description/assets/icons/cogs.png differ diff --git a/multi_barcodes_pos/static/description/assets/icons/consultation.png b/multi_barcodes_pos/static/description/assets/icons/consultation.png new file mode 100644 index 000000000..8319d4baa Binary files /dev/null and b/multi_barcodes_pos/static/description/assets/icons/consultation.png differ diff --git a/multi_barcodes_pos/static/description/assets/icons/ecom-black.png b/multi_barcodes_pos/static/description/assets/icons/ecom-black.png new file mode 100644 index 000000000..a9385ff13 Binary files /dev/null and b/multi_barcodes_pos/static/description/assets/icons/ecom-black.png differ diff --git a/multi_barcodes_pos/static/description/assets/icons/education-black.png b/multi_barcodes_pos/static/description/assets/icons/education-black.png new file mode 100644 index 000000000..3eb09b27b Binary files /dev/null and b/multi_barcodes_pos/static/description/assets/icons/education-black.png differ diff --git a/multi_barcodes_pos/static/description/assets/icons/hotel-black.png b/multi_barcodes_pos/static/description/assets/icons/hotel-black.png new file mode 100644 index 000000000..130f613be Binary files /dev/null and b/multi_barcodes_pos/static/description/assets/icons/hotel-black.png differ diff --git a/multi_barcodes_pos/static/description/assets/icons/license.png b/multi_barcodes_pos/static/description/assets/icons/license.png new file mode 100644 index 000000000..a5869797e Binary files /dev/null and b/multi_barcodes_pos/static/description/assets/icons/license.png differ diff --git a/multi_barcodes_pos/static/description/assets/icons/lifebuoy.png b/multi_barcodes_pos/static/description/assets/icons/lifebuoy.png new file mode 100644 index 000000000..658d56ccc Binary files /dev/null and b/multi_barcodes_pos/static/description/assets/icons/lifebuoy.png differ diff --git a/multi_barcodes_pos/static/description/assets/icons/logo.png b/multi_barcodes_pos/static/description/assets/icons/logo.png new file mode 100644 index 000000000..478462d3e Binary files /dev/null and b/multi_barcodes_pos/static/description/assets/icons/logo.png differ diff --git a/multi_barcodes_pos/static/description/assets/icons/manufacturing-black.png b/multi_barcodes_pos/static/description/assets/icons/manufacturing-black.png new file mode 100644 index 000000000..697eb0e9f Binary files /dev/null and b/multi_barcodes_pos/static/description/assets/icons/manufacturing-black.png differ diff --git a/multi_barcodes_pos/static/description/assets/icons/pos-black.png b/multi_barcodes_pos/static/description/assets/icons/pos-black.png new file mode 100644 index 000000000..97c0f90c1 Binary files /dev/null and b/multi_barcodes_pos/static/description/assets/icons/pos-black.png differ diff --git a/multi_barcodes_pos/static/description/assets/icons/puzzle.png b/multi_barcodes_pos/static/description/assets/icons/puzzle.png new file mode 100644 index 000000000..65cf854e7 Binary files /dev/null and b/multi_barcodes_pos/static/description/assets/icons/puzzle.png differ diff --git a/multi_barcodes_pos/static/description/assets/icons/restaurant-black.png b/multi_barcodes_pos/static/description/assets/icons/restaurant-black.png new file mode 100644 index 000000000..4a35eb939 Binary files /dev/null and b/multi_barcodes_pos/static/description/assets/icons/restaurant-black.png differ diff --git a/multi_barcodes_pos/static/description/assets/icons/service-black.png b/multi_barcodes_pos/static/description/assets/icons/service-black.png new file mode 100644 index 000000000..301ab51cb Binary files /dev/null and b/multi_barcodes_pos/static/description/assets/icons/service-black.png differ diff --git a/multi_barcodes_pos/static/description/assets/icons/trading-black.png b/multi_barcodes_pos/static/description/assets/icons/trading-black.png new file mode 100644 index 000000000..9398ba2f1 Binary files /dev/null and b/multi_barcodes_pos/static/description/assets/icons/trading-black.png differ diff --git a/multi_barcodes_pos/static/description/assets/icons/training.png b/multi_barcodes_pos/static/description/assets/icons/training.png new file mode 100644 index 000000000..884ca024d Binary files /dev/null and b/multi_barcodes_pos/static/description/assets/icons/training.png differ diff --git a/multi_barcodes_pos/static/description/assets/icons/update.png b/multi_barcodes_pos/static/description/assets/icons/update.png new file mode 100644 index 000000000..ecbc5a01a Binary files /dev/null and b/multi_barcodes_pos/static/description/assets/icons/update.png differ diff --git a/multi_barcodes_pos/static/description/assets/icons/user.png b/multi_barcodes_pos/static/description/assets/icons/user.png new file mode 100644 index 000000000..6ffb23d9f Binary files /dev/null and b/multi_barcodes_pos/static/description/assets/icons/user.png differ diff --git a/multi_barcodes_pos/static/description/assets/icons/wrench.png b/multi_barcodes_pos/static/description/assets/icons/wrench.png new file mode 100644 index 000000000..6c04dea0f Binary files /dev/null and b/multi_barcodes_pos/static/description/assets/icons/wrench.png differ diff --git a/multi_barcodes_pos/static/description/assets/modules/approval_image.png b/multi_barcodes_pos/static/description/assets/modules/approval_image.png new file mode 100644 index 000000000..84fe94e80 Binary files /dev/null and b/multi_barcodes_pos/static/description/assets/modules/approval_image.png differ diff --git a/multi_barcodes_pos/static/description/assets/modules/budget_image.png b/multi_barcodes_pos/static/description/assets/modules/budget_image.png new file mode 100644 index 000000000..fe6aa6fe4 Binary files /dev/null and b/multi_barcodes_pos/static/description/assets/modules/budget_image.png differ diff --git a/multi_barcodes_pos/static/description/assets/modules/export_image.png b/multi_barcodes_pos/static/description/assets/modules/export_image.png new file mode 100644 index 000000000..4e4ea0e51 Binary files /dev/null and b/multi_barcodes_pos/static/description/assets/modules/export_image.png differ diff --git a/multi_barcodes_pos/static/description/assets/modules/magento_image.png b/multi_barcodes_pos/static/description/assets/modules/magento_image.png new file mode 100644 index 000000000..39de0820f Binary files /dev/null and b/multi_barcodes_pos/static/description/assets/modules/magento_image.png differ diff --git a/multi_barcodes_pos/static/description/assets/modules/pos_image.png b/multi_barcodes_pos/static/description/assets/modules/pos_image.png new file mode 100644 index 000000000..c5932894b Binary files /dev/null and b/multi_barcodes_pos/static/description/assets/modules/pos_image.png differ diff --git a/multi_barcodes_pos/static/description/assets/modules/shopify_image.png b/multi_barcodes_pos/static/description/assets/modules/shopify_image.png new file mode 100644 index 000000000..c6d92c16d Binary files /dev/null and b/multi_barcodes_pos/static/description/assets/modules/shopify_image.png differ diff --git a/multi_barcodes_pos/static/description/assets/screenshots/1.png b/multi_barcodes_pos/static/description/assets/screenshots/1.png new file mode 100644 index 000000000..ebab3befc Binary files /dev/null and b/multi_barcodes_pos/static/description/assets/screenshots/1.png differ diff --git a/multi_barcodes_pos/static/description/assets/screenshots/2.png b/multi_barcodes_pos/static/description/assets/screenshots/2.png new file mode 100644 index 000000000..fe59b766f Binary files /dev/null and b/multi_barcodes_pos/static/description/assets/screenshots/2.png differ diff --git a/multi_barcodes_pos/static/description/assets/screenshots/3.png b/multi_barcodes_pos/static/description/assets/screenshots/3.png new file mode 100644 index 000000000..c889e42ea Binary files /dev/null and b/multi_barcodes_pos/static/description/assets/screenshots/3.png differ diff --git a/multi_barcodes_pos/static/description/assets/screenshots/hero.gif b/multi_barcodes_pos/static/description/assets/screenshots/hero.gif new file mode 100644 index 000000000..1aa11a46b Binary files /dev/null and b/multi_barcodes_pos/static/description/assets/screenshots/hero.gif differ diff --git a/multi_barcodes_pos/static/description/banner.png b/multi_barcodes_pos/static/description/banner.png new file mode 100644 index 000000000..5713b11f6 Binary files /dev/null and b/multi_barcodes_pos/static/description/banner.png differ diff --git a/multi_barcodes_pos/static/description/icon.png b/multi_barcodes_pos/static/description/icon.png new file mode 100644 index 000000000..07fd31b7a Binary files /dev/null and b/multi_barcodes_pos/static/description/icon.png differ diff --git a/multi_barcodes_pos/static/description/index.html b/multi_barcodes_pos/static/description/index.html new file mode 100644 index 000000000..6863f00df --- /dev/null +++ b/multi_barcodes_pos/static/description/index.html @@ -0,0 +1,583 @@ +
+
+
+
+ +
+
+
+ Community +
+
+ Enterprise +
+ +
+
+
+
+ +
+
+
+

+ POS Product Multi Barcode

+

+ Allow to scan multiple barcodes of a product in POS +

+ +
+
+ + + + +
+
+

+ Overview +

+
+ +
+

+ Odoo allows having a single barcode for products. + This module allows you to set multiple barcodes for a product and product variants and use these barcodes for scanning the product in pos.

+ +
+
+ + +
+
+

+ Features +

+
+ +
+
+ +
+
+

+ Set multiple barcodes for a single product

+
+
+
+
+ +
+
+

+ Scan using these barcodes in pos

+
+
+ +
+
+ +
+
+

+ Allows using default barcode option also

+
+
+ +
+ +
+
+

+ Screenshots +

+
+
+

+ Setting Multiple Barcodes

+

+ For setting multiple barcodes for products, go to Point of sale --> Products --> Product Variants and select Barcodes Tab. +

+ +
+ +
+

+ Barcode Scanner

+

+ Now set multiple barcodes and go to Dashboard and open a pos to scan barcode using barcode scanner. +

+ +
+ +
+

+ Ordeline

+

+ Scan the barcode using the barcode scanner and you can see the product gets added in ordeline. If there is only single product Variant, you can see the multiple barcodes set for product in Point of sale -- > Products --> Products +

+ +
+ + +
+ + +
+
+

Suggested Products

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

Our Services

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

Our Industries

+
+
+ +
+
+ +
+ Trading +
+

+ Easily procure + and + sell your products

+
+
+ +
+
+ +
+ POS +
+

+ Easy + configuration + and convivial experience

+
+
+ +
+
+ +
+ Education +
+

+ A platform for + educational management

+
+
+ +
+
+ +
+ Manufacturing +
+

+ Plan, track and + schedule your operations

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

+ Mobile + friendly, + awe-inspiring product pages

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

+ Keep track of + services and invoice

+
+
+ +
+
+ +
+ Restaurant +
+

+ Run your bar or + restaurant methodically

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

+ An + all-inclusive + hotel management application

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

Need Help?

+
+
+
+ + +
+ +
+ +
+ +
+ WhatsApp +
+
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+
+
+ + +
\ No newline at end of file diff --git a/multi_barcodes_pos/static/src/js/pos_scan.js b/multi_barcodes_pos/static/src/js/pos_scan.js new file mode 100644 index 000000000..d846943fd --- /dev/null +++ b/multi_barcodes_pos/static/src/js/pos_scan.js @@ -0,0 +1,61 @@ +odoo.define('multi_barcodes_pos.product', function (require) { + "use strict"; +var rpc = require('web.rpc'); +var models = require('point_of_sale.models'); +var DB = require('point_of_sale.DB'); +models.load_fields("product.product", ['product_multi_barcodes']); +DB.include({ + + init: function(options){ + this._super.apply(this, arguments); + + }, + add_products: function(products){ + var stored_categories = this.product_by_category_id; + if(!products instanceof Array){ + products = [products]; + } + for(var i = 0, len = products.length; i < len; i++){ + var product = products[i]; + var search_string = this._product_search_string(product); + var categ_id = product.pos_categ_id ? product.pos_categ_id[0] : this.root_category_id; + product.product_tmpl_id = product.product_tmpl_id[0]; + if(!stored_categories[categ_id]){ + stored_categories[categ_id] = []; + } + stored_categories[categ_id].push(product.id); + if(this.category_search_string[categ_id] === undefined){ + this.category_search_string[categ_id] = ''; + } + this.category_search_string[categ_id] += search_string; + var ancestors = this.get_category_ancestors_ids(categ_id) || []; + for(var j = 0, jlen = ancestors.length; j < jlen; j++){ + var ancestor = ancestors[j]; + if(! stored_categories[ancestor]){ + stored_categories[ancestor] = []; + } + stored_categories[ancestor].push(product.id); + if( this.category_search_string[ancestor] === undefined){ + this.category_search_string[ancestor] = ''; + } + this.category_search_string[ancestor] += search_string; + } + this.product_by_id[product.id] = product; + if(product.barcode){ + this.product_by_barcode[product.barcode] = product; + } + for(var t=0;t < product.product_multi_barcodes.length;t++){ + var self = this; + rpc.query({ + model: 'multi.barcode.products', + method: 'get_barcode_val', + args: [product.product_multi_barcodes[t], product.id], + }).then(function (barcode_val) { + + self.product_by_barcode[barcode_val[0]] = self.product_by_id[barcode_val[1]]; + }); + } + } + }, + }); +}); \ No newline at end of file diff --git a/multi_barcodes_pos/views/product_views.xml b/multi_barcodes_pos/views/product_views.xml new file mode 100644 index 000000000..06437c725 --- /dev/null +++ b/multi_barcodes_pos/views/product_views.xml @@ -0,0 +1,34 @@ + + + product.template.ean13 + product.template + + + + + + + + + + + + + + + product.product.view.form.inherit.supplier.ean13 + product.product + + + + + + + + + + + + + + \ No newline at end of file