mirror of
https://github.com/frappe/erpnext.git
synced 2026-02-13 09:43:49 +00:00
fix: correct uom reflecting in sales order when fetching from barcode
This commit is contained in:
@@ -555,10 +555,11 @@ erpnext.TransactionController = class TransactionController extends erpnext.taxe
|
|||||||
|
|
||||||
var item = frappe.get_doc(cdt, cdn);
|
var item = frappe.get_doc(cdt, cdn);
|
||||||
var update_stock = 0, show_batch_dialog = 0;
|
var update_stock = 0, show_batch_dialog = 0;
|
||||||
|
|
||||||
item.weight_per_unit = 0;
|
item.weight_per_unit = 0;
|
||||||
item.weight_uom = '';
|
item.weight_uom = '';
|
||||||
item.uom = null // make UOM blank to update the existing UOM when item changes
|
if(!item.barcode){
|
||||||
|
item.uom = null // make UOM blank to update the existing UOM when item changes
|
||||||
|
}
|
||||||
item.conversion_factor = 0;
|
item.conversion_factor = 0;
|
||||||
|
|
||||||
if(['Sales Invoice', 'Purchase Invoice'].includes(this.frm.doc.doctype)) {
|
if(['Sales Invoice', 'Purchase Invoice'].includes(this.frm.doc.doctype)) {
|
||||||
@@ -574,6 +575,7 @@ erpnext.TransactionController = class TransactionController extends erpnext.taxe
|
|||||||
show_batch_dialog = 0;
|
show_batch_dialog = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
item.barcode = null;
|
item.barcode = null;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -404,6 +404,8 @@ erpnext.utils.BarcodeScanner = class BarcodeScanner {
|
|||||||
async set_barcode(row, barcode) {
|
async set_barcode(row, barcode) {
|
||||||
if (barcode && frappe.meta.has_field(row.doctype, this.barcode_field)) {
|
if (barcode && frappe.meta.has_field(row.doctype, this.barcode_field)) {
|
||||||
await frappe.model.set_value(row.doctype, row.name, this.barcode_field, barcode);
|
await frappe.model.set_value(row.doctype, row.name, this.barcode_field, barcode);
|
||||||
|
} else {
|
||||||
|
row.barcode = barcode;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user