From 46289fc544522e0414b58186fa85e37ba2134b38 Mon Sep 17 00:00:00 2001 From: AjmalCybro Date: Tue, 11 Apr 2023 10:06:38 +0530 Subject: [PATCH] Apr 11 : [FIX] Bug Fixed 'multi_barcodes_pos' --- multi_barcodes_pos/README.rst | 41 ++++++++++++++++---- multi_barcodes_pos/__manifest__.py | 2 +- multi_barcodes_pos/doc/RELEASE_NOTES.md | 7 +++- multi_barcodes_pos/models/__init__.py | 2 +- multi_barcodes_pos/models/product_product.py | 6 ++- multi_barcodes_pos/static/src/js/pos_scan.js | 4 -- multi_barcodes_pos/views/pos_template.xml | 9 ----- multi_barcodes_pos/views/product_views.xml | 1 + 8 files changed, 46 insertions(+), 26 deletions(-) delete mode 100644 multi_barcodes_pos/views/pos_template.xml diff --git a/multi_barcodes_pos/README.rst b/multi_barcodes_pos/README.rst index 5c9b8fd35..055316a3b 100644 --- a/multi_barcodes_pos/README.rst +++ b/multi_barcodes_pos/README.rst @@ -1,20 +1,45 @@ +.. image:: https://img.shields.io/badge/licence-LGPL--3-blue.svg + :target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html + :alt: License: LGPL-3 + POS Product Multi Barcode ========================= Allows to create multiple barcode for a single product. -Installation -============ - - www.odoo.com/documentation/16.0/setup/install.html - - Install our custom addon - Configuration ============= -No additional configurations needed +No configuration required + +Company +------- +* `Cybrosys Techno Solutions `__ Credits -======= +------- Developer: Risha C.T @ cybrosys, odoo@cybrosys.com Viswanth K V14 @ cybrosys, odoo@cybrosys.com Viswanth K V15 @ cybrosys, odoo@cybrosys.com - Viswanth K V16 @ cybrosys, odoo@cybrosys.com + Viswanth K v16 @ cybrosys, odoo@cybrosys.com + +Contacts +------- +* Mail Contact : odoo@cybrosys.com +* Website : https://cybrosys.com + +Bug Tracker +------- +Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. + +Maintainer +========== +.. image:: https://cybrosys.com/images/logo.png + :target: https://cybrosys.com + +This module is maintained by Cybrosys Technologies. + +For support and more information, please visit `Our Website `__ + +Further information +=================== +HTML Description: ``__ diff --git a/multi_barcodes_pos/__manifest__.py b/multi_barcodes_pos/__manifest__.py index 2648859c9..58e7e8f44 100644 --- a/multi_barcodes_pos/__manifest__.py +++ b/multi_barcodes_pos/__manifest__.py @@ -25,7 +25,7 @@ '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': '16.0.1.0.0', + 'version': '16.0.1.0.1', 'author': 'Cybrosys Techno Solutions', 'company': 'Cybrosys Techno Solutions', 'maintainer': 'Cybrosys Techno Solutions', diff --git a/multi_barcodes_pos/doc/RELEASE_NOTES.md b/multi_barcodes_pos/doc/RELEASE_NOTES.md index d62e9b2fb..682cb3787 100644 --- a/multi_barcodes_pos/doc/RELEASE_NOTES.md +++ b/multi_barcodes_pos/doc/RELEASE_NOTES.md @@ -3,4 +3,9 @@ #### 21.09.2022 #### Version 16.0.1.0.0 ##### ADD -- Initial commit for POS Multi Barcode Scan \ No newline at end of file +- Initial commit for POS Multi Barcode Scan + +#### 10.04.2023 +#### Version 16.0.1.0.1 +##### FIX +- Bug Fix: added validation for the field multi_barcode to avoid duplication of barcodes \ No newline at end of file diff --git a/multi_barcodes_pos/models/__init__.py b/multi_barcodes_pos/models/__init__.py index 7b376b615..b48415a62 100644 --- a/multi_barcodes_pos/models/__init__.py +++ b/multi_barcodes_pos/models/__init__.py @@ -21,4 +21,4 @@ # ################################################################################### -from . import product_product \ No newline at end of file +from . import product_product diff --git a/multi_barcodes_pos/models/product_product.py b/multi_barcodes_pos/models/product_product.py index 37bbe341f..11f00461c 100644 --- a/multi_barcodes_pos/models/product_product.py +++ b/multi_barcodes_pos/models/product_product.py @@ -23,7 +23,6 @@ from odoo import models, fields, api from odoo.osv import expression -from odoo.osv.expression import OR class ProductProduct(models.Model): @@ -88,14 +87,17 @@ class ProductTemplate(models.Model): class ProductMultiBarcode(models.Model): _name = 'multi.barcode.products' + _description = 'For creating multiple Barcodes for 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') + _sql_constraints = [('field_unique', 'unique(multi_barcode)', 'Existing barcode is not allowed !'), ] + def get_barcode_val(self, product): - # returns barcode of record in self and product id + """returns barcode of record in self and product id""" return self.multi_barcode, product diff --git a/multi_barcodes_pos/static/src/js/pos_scan.js b/multi_barcodes_pos/static/src/js/pos_scan.js index eaf133eaf..8c60cf5ea 100644 --- a/multi_barcodes_pos/static/src/js/pos_scan.js +++ b/multi_barcodes_pos/static/src/js/pos_scan.js @@ -66,10 +66,6 @@ DB.include({ }); } - - - - } }, }); diff --git a/multi_barcodes_pos/views/pos_template.xml b/multi_barcodes_pos/views/pos_template.xml deleted file mode 100644 index faeea36cb..000000000 --- a/multi_barcodes_pos/views/pos_template.xml +++ /dev/null @@ -1,9 +0,0 @@ - - -