Browse Source

Oct 8 [UPDT] Updated 'multi_barcodes_pos'

pull/347/head
AjmalCybro 7 months ago
parent
commit
32740510d9
  1. 2
      multi_barcodes_pos/__manifest__.py
  2. 7
      multi_barcodes_pos/doc/RELEASE_NOTES.md
  3. 2
      multi_barcodes_pos/static/description/index.html
  4. 2
      multi_barcodes_pos/static/src/js/ProductWidget.js
  5. 48
      multi_barcodes_pos/static/src/js/pos_scan.js

2
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

7
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

2
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);">
<div class="d-flex mb-3"
style="font-size: 0.8rem; font-weight: 500;"><span>Version
17.0.1.0.0</span><span
17.0.1.0.2</span><span
class="px-2">|</span><span
style="color: #714B67;font-weight: 600;">Released on:08th Feb 2024</span>
</div>

2
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)){

48
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);
}
});
}
});
}
});
Loading…
Cancel
Save