mirror of
https://github.com/frappe/erpnext.git
synced 2026-09-20 03:47:11 +00:00
fix(stock): honour pick serial / batch based on in the batch selector (#58176)
This commit is contained in:
committed by
GitHub
parent
1519770cb0
commit
fb7c2caf29
@@ -8,6 +8,16 @@ erpnext.SerialBatchPackageSelector = class SerialNoBatchBundleUpdate {
|
|||||||
? this.item.rejected_serial_and_batch_bundle
|
? this.item.rejected_serial_and_batch_bundle
|
||||||
: this.item.serial_and_batch_bundle;
|
: this.item.serial_and_batch_bundle;
|
||||||
|
|
||||||
|
this.init();
|
||||||
|
}
|
||||||
|
|
||||||
|
async init() {
|
||||||
|
try {
|
||||||
|
this.based_on = await erpnext.stock.get_pick_serial_batch_based_on();
|
||||||
|
} catch (e) {
|
||||||
|
this.based_on = "FIFO";
|
||||||
|
}
|
||||||
|
|
||||||
this.make();
|
this.make();
|
||||||
this.render_data();
|
this.render_data();
|
||||||
}
|
}
|
||||||
@@ -391,7 +401,7 @@ erpnext.SerialBatchPackageSelector = class SerialNoBatchBundleUpdate {
|
|||||||
{
|
{
|
||||||
fieldtype: "Select",
|
fieldtype: "Select",
|
||||||
options: ["FIFO", "LIFO", "Expiry"],
|
options: ["FIFO", "LIFO", "Expiry"],
|
||||||
default: "FIFO",
|
default: this.based_on,
|
||||||
fieldname: "based_on",
|
fieldname: "based_on",
|
||||||
label: __("Fetch Based On"),
|
label: __("Fetch Based On"),
|
||||||
onchange: () => this.get_auto_data(),
|
onchange: () => this.get_auto_data(),
|
||||||
@@ -537,7 +547,7 @@ erpnext.SerialBatchPackageSelector = class SerialNoBatchBundleUpdate {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!based_on) {
|
if (!based_on) {
|
||||||
based_on = "FIFO";
|
based_on = this.based_on;
|
||||||
}
|
}
|
||||||
|
|
||||||
let warehouse = this.item.warehouse || this.item.s_warehouse;
|
let warehouse = this.item.warehouse || this.item.s_warehouse;
|
||||||
|
|||||||
Reference in New Issue
Block a user