mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-04 12:49:10 +00:00
Merge pull request #51899 from rohitwaghchaure/fixed-github-51401
feat: option to import serial / batches using csv for outward entry
This commit is contained in:
@@ -163,7 +163,7 @@ erpnext.SerialBatchPackageSelector = class SerialNoBatchBundleUpdate {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (this.item?.type_of_transaction === "Outward") {
|
if (this.item?.type_of_transaction === "Outward") {
|
||||||
fields = [...this.get_filter_fields(), ...fields];
|
fields = [...this.get_filter_fields(), ...fields, ...this.get_attach_field()];
|
||||||
} else {
|
} else {
|
||||||
fields = [...fields, ...this.get_attach_field()];
|
fields = [...fields, ...this.get_attach_field()];
|
||||||
}
|
}
|
||||||
@@ -195,7 +195,7 @@ erpnext.SerialBatchPackageSelector = class SerialNoBatchBundleUpdate {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let fields = [];
|
let fields = [];
|
||||||
if (this.item.has_serial_no) {
|
if (this.item.has_serial_no && this.item?.type_of_transaction !== "Outward") {
|
||||||
fields.push({
|
fields.push({
|
||||||
fieldtype: "Check",
|
fieldtype: "Check",
|
||||||
label: __("Enter Manually"),
|
label: __("Enter Manually"),
|
||||||
@@ -217,7 +217,8 @@ erpnext.SerialBatchPackageSelector = class SerialNoBatchBundleUpdate {
|
|||||||
label: __("Import Using CSV file"),
|
label: __("Import Using CSV file"),
|
||||||
fieldname: "import_using_csv_file",
|
fieldname: "import_using_csv_file",
|
||||||
depends_on: "eval:doc.enter_manually !== 1",
|
depends_on: "eval:doc.enter_manually !== 1",
|
||||||
default: !this.item.has_serial_no ? 1 : 0,
|
default: !this.item.has_serial_no || this.item?.type_of_transaction === "Outward" ? 1 : 0,
|
||||||
|
hidden: this.item?.type_of_transaction === "Outward",
|
||||||
change() {
|
change() {
|
||||||
if (me.dialog.get_value("import_using_csv_file")) {
|
if (me.dialog.get_value("import_using_csv_file")) {
|
||||||
me.dialog.set_value("enter_manually", 0);
|
me.dialog.set_value("enter_manually", 0);
|
||||||
@@ -246,7 +247,7 @@ erpnext.SerialBatchPackageSelector = class SerialNoBatchBundleUpdate {
|
|||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
if (this.item?.has_serial_no) {
|
if (this.item?.has_serial_no && this.item?.type_of_transaction !== "Outward") {
|
||||||
fields = [
|
fields = [
|
||||||
...fields,
|
...fields,
|
||||||
{
|
{
|
||||||
@@ -267,7 +268,7 @@ erpnext.SerialBatchPackageSelector = class SerialNoBatchBundleUpdate {
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.item?.has_serial_no) {
|
if (this.item?.has_serial_no && this.item?.type_of_transaction !== "Outward") {
|
||||||
fields = [
|
fields = [
|
||||||
...fields,
|
...fields,
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -633,6 +633,9 @@ class SerialNoValuation(DeprecatedSerialNoValuation):
|
|||||||
self.old_serial_nos = []
|
self.old_serial_nos = []
|
||||||
|
|
||||||
serial_nos = self.get_serial_nos()
|
serial_nos = self.get_serial_nos()
|
||||||
|
if not serial_nos:
|
||||||
|
return
|
||||||
|
|
||||||
result = self.get_serial_no_wise_incoming_rate(serial_nos)
|
result = self.get_serial_no_wise_incoming_rate(serial_nos)
|
||||||
for serial_no in serial_nos:
|
for serial_no in serial_nos:
|
||||||
incoming_rate = result.get(serial_no)
|
incoming_rate = result.get(serial_no)
|
||||||
|
|||||||
Reference in New Issue
Block a user