fix: update delivery date in line items (#53331)

This commit is contained in:
Mihir Kandoi
2026-03-12 20:37:52 +05:30
committed by GitHub
parent 62280c285f
commit 85c4cc3e1b
3 changed files with 23 additions and 8 deletions

View File

@@ -769,10 +769,6 @@ erpnext.buying.PurchaseOrderController = class PurchaseOrderController extends (
items_on_form_rendered() {
set_schedule_date(this.frm);
}
schedule_date() {
set_schedule_date(this.frm);
}
};
// for backward compatibility: combine new and previous states

View File

@@ -140,6 +140,7 @@ erpnext.buying = {
this.toggle_subcontracting_fields();
super.refresh();
this.prevent_past_schedule_dates(this.frm);
}
toggle_subcontracting_fields() {
@@ -183,6 +184,28 @@ erpnext.buying = {
erpnext.utils.set_letter_head(this.frm)
}
schedule_date(doc, cdt, cdn) {
if (doc.schedule_date && !cdt.endsWith(" Item")) {
doc.items.forEach((d) => {
frappe.model.set_value(d.doctype, d.name, "schedule_date", doc.schedule_date);
});
}
}
transaction_date() {
super.transaction_date();
this.frm.set_value("schedule_date", "");
this.prevent_past_schedule_dates(this.frm);
}
prevent_past_schedule_dates(frm) {
if (frm.doc.transaction_date && frm.fields_dict["schedule_date"]) {
frm.fields_dict["schedule_date"].datepicker?.update({
minDate: new Date(frm.doc.transaction_date),
});
}
}
supplier_address() {
erpnext.utils.get_address_display(this.frm);
erpnext.utils.set_taxes_from_address(this.frm, "supplier_address", "supplier_address", "supplier_address");

View File

@@ -642,10 +642,6 @@ erpnext.buying.MaterialRequestController = class MaterialRequestController exten
set_schedule_date(this.frm);
}
schedule_date() {
set_schedule_date(this.frm);
}
qty(doc, cdt, cdn) {
var row = frappe.get_doc(cdt, cdn);
row.amount = flt(row.qty) * flt(row.rate);