mirror of
https://github.com/frappe/erpnext.git
synced 2025-12-03 18:35:36 +00:00
Merge pull request #50072 from aerele/support-50647
fix: swap warehouse labels for return entry
This commit is contained in:
@@ -113,6 +113,7 @@ erpnext.sales_common = {
|
|||||||
);
|
);
|
||||||
|
|
||||||
this.toggle_editable_price_list_rate();
|
this.toggle_editable_price_list_rate();
|
||||||
|
this.change_warehouse_labels_for_return();
|
||||||
}
|
}
|
||||||
|
|
||||||
company() {
|
company() {
|
||||||
@@ -504,6 +505,33 @@ erpnext.sales_common = {
|
|||||||
this.frm.set_value("discount_amount", 0);
|
this.frm.set_value("discount_amount", 0);
|
||||||
this.frm.set_value("additional_discount_percentage", 0);
|
this.frm.set_value("additional_discount_percentage", 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
is_return() {
|
||||||
|
let reset = !this.frm.doc.is_return;
|
||||||
|
this.change_warehouse_labels_for_return(reset);
|
||||||
|
}
|
||||||
|
|
||||||
|
change_warehouse_labels_for_return(reset) {
|
||||||
|
// swap source and target warehouse labels for return
|
||||||
|
let source_warehouse_label = __("Source Warehouse");
|
||||||
|
let target_warehouse_label = __("Set Target Warehouse");
|
||||||
|
|
||||||
|
if (this.frm.doc.doctype == "Delivery Note") {
|
||||||
|
source_warehouse_label = __("Set Source Warehouse");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (reset) {
|
||||||
|
// reset to original labels
|
||||||
|
this.frm.set_df_property("set_warehouse", "label", source_warehouse_label);
|
||||||
|
this.frm.set_df_property("set_target_warehouse", "label", target_warehouse_label);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.frm.doc.is_return) {
|
||||||
|
this.frm.set_df_property("set_warehouse", "label", target_warehouse_label);
|
||||||
|
this.frm.set_df_property("set_target_warehouse", "label", source_warehouse_label);
|
||||||
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user