diff --git a/multi_barcodes_pos/__manifest__.py b/multi_barcodes_pos/__manifest__.py index 5eaf59842..855d2ceb5 100755 --- a/multi_barcodes_pos/__manifest__.py +++ b/multi_barcodes_pos/__manifest__.py @@ -21,7 +21,7 @@ ############################################################################# { 'name': 'POS Product Multi Barcode', - 'version': '17.0.1.0.0', + 'version': '17.0.1.0.2', 'category': 'Point of Sale', 'summary': """Allows to create multiple barcode for a single product""", 'description': """This module allows you to set multiple barcodes for a diff --git a/multi_barcodes_pos/doc/RELEASE_NOTES.md b/multi_barcodes_pos/doc/RELEASE_NOTES.md index 71179e0f3..362e60432 100755 --- a/multi_barcodes_pos/doc/RELEASE_NOTES.md +++ b/multi_barcodes_pos/doc/RELEASE_NOTES.md @@ -6,6 +6,11 @@ - Initial commit for POS Product Multi Barcode #### 23.09.2024 -#### Version 17.0.1.0.01 +#### Version 17.0.1.0.1 ##### BUG FIX - Changed the js files for scanning barcodes from multi barcode table. + +#### 01.10.2024 +#### Version 17.0.1.0.2 +##### BUG FIX +- Added an alert and fix issue of multiple barcode \ No newline at end of file diff --git a/multi_barcodes_pos/static/description/index.html b/multi_barcodes_pos/static/description/index.html index aaf1e44d3..3b5087873 100755 --- a/multi_barcodes_pos/static/description/index.html +++ b/multi_barcodes_pos/static/description/index.html @@ -219,7 +219,7 @@ style="font-weight: 500;background-color: #fff; border-radius: 4px; padding: 1rem; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);">
Version - 17.0.1.0.0|Released on:08th Feb 2024
diff --git a/multi_barcodes_pos/static/src/js/ProductWidget.js b/multi_barcodes_pos/static/src/js/ProductWidget.js index 4fbfd08cd..307bda8ef 100755 --- a/multi_barcodes_pos/static/src/js/ProductWidget.js +++ b/multi_barcodes_pos/static/src/js/ProductWidget.js @@ -1,5 +1,4 @@ /** @odoo-module */ - import { patch } from "@web/core/utils/patch"; import { PosDB } from "@point_of_sale/app/store/db"; import { unaccent } from "@web/core/utils/strings"; @@ -28,7 +27,6 @@ patch(PosDB.prototype, { } else if(this.product_by_lot_id){ if(this.product_by_lot_id[old_query]){ - console.log(this.product_by_lot_id[old_query]) const product = this.get_product_by_id(this.product_by_lot_id[old_query]); if (!this.shouldAddProduct(product, results)) continue; if(!results.includes(product)){ diff --git a/multi_barcodes_pos/static/src/js/pos_scan.js b/multi_barcodes_pos/static/src/js/pos_scan.js index ea375a2b4..176176b21 100755 --- a/multi_barcodes_pos/static/src/js/pos_scan.js +++ b/multi_barcodes_pos/static/src/js/pos_scan.js @@ -1,31 +1,39 @@ /** @odoo-module */ - import { patch } from "@web/core/utils/patch"; import { PosDB } from "@point_of_sale/app/store/db"; import { unaccent } from "@web/core/utils/strings"; import { jsonrpc } from "@web/core/network/rpc_service"; import { DebugWidget } from "@point_of_sale/app/debug/debug_widget"; import { useService } from "@web/core/utils/hooks"; - +import { Dialog } from "@web/core/dialog/dialog"; +import { AlertDialog } from "@web/core/confirmation_dialog/confirmation_dialog"; +import { _t } from "@web/core/l10n/translation"; patch(DebugWidget.prototype, { - setup() { - super.setup() - this.orm = useService("orm"); - }, - async barcodeScan() { - if (!this.barcodeReader) { - return; + setup() { + super.setup() + this.orm = useService("orm"); + this.dialog = useService("dialog"); + }, + async barcodeScan() { + if (!this.barcodeReader) { + return; + } + await this.orm.call('multi.barcode.products','get_barcode_val',[this.state.barcodeInput]).then(async (data) => { + if (data[1]){ + this.currentOrder = this.pos.get_order(); + var product = this.pos.db.get_product_by_id(parseInt(data[1])) + if(product){ + this.currentOrder.add_product(product); + } + else{ + this.dialog.add(AlertDialog, { + body: _t("Product is not loaded in the POS"), + }); + } + } else{ + await this.barcodeReader.scan(this.state.barcodeInput); } - await this.orm.call('multi.barcode.products','get_barcode_val',[this.state.barcodeInput]).then(async (data) => { - if (data[1]){ - this.currentOrder = this.pos.get_order(); - var product = this.pos.db.get_product_by_id(parseInt(data[1])) - this.currentOrder.add_product(product); - } - else{ - await this.barcodeReader.scan(this.state.barcodeInput); - } - }); - } + }); + } }); \ No newline at end of file