fix: set batch created from bundle to batch field in stock transaction (#39966)

* fix: set batch created from bundle to batch field in stock transaction

* fix: validation for serial and batch no
This commit is contained in:
rohitwaghchaure
2024-02-20 23:45:07 +05:30
committed by GitHub
parent 8e7d47b3a7
commit 4b24fcd221
16 changed files with 213 additions and 58 deletions

View File

@@ -71,6 +71,10 @@ erpnext.SerialBatchPackageSelector = class SerialNoBatchBundleUpdate {
let warehouse = this.item?.type_of_transaction === "Outward" ?
(this.item.warehouse || this.item.s_warehouse) : "";
if (this.frm.doc.doctype === 'Stock Entry') {
warehouse = this.item.s_warehouse || this.item.t_warehouse;
}
if (!warehouse && this.frm.doc.doctype === 'Stock Reconciliation') {
warehouse = this.get_warehouse();
}
@@ -367,19 +371,11 @@ erpnext.SerialBatchPackageSelector = class SerialNoBatchBundleUpdate {
label: __('Batch No'),
in_list_view: 1,
get_query: () => {
if (this.item.type_of_transaction !== "Outward") {
return {
filters: {
'item': this.item.item_code,
}
}
} else {
return {
query : "erpnext.controllers.queries.get_batch_no",
filters: {
'item_code': this.item.item_code,
'warehouse': this.get_warehouse()
}
return {
query : "erpnext.controllers.queries.get_batch_no",
filters: {
'item_code': this.item.item_code,
'warehouse': this.item.s_warehouse || this.item.t_warehouse,
}
}
},