fix: allow to create Sales Order from expired Quotation (#32641)

(cherry picked from commit 4ad3002861)
This commit is contained in:
Raffael Meyer
2022-10-19 18:37:02 +02:00
committed by Mergify
parent 7601a016b8
commit ea032893d3

View File

@@ -83,11 +83,12 @@ erpnext.selling.QuotationController = erpnext.selling.SellingController.extend({
} }
} }
if(doc.docstatus == 1 && !(['Lost', 'Ordered']).includes(doc.status)) { if (doc.docstatus == 1 && !["Lost", "Ordered"].includes(doc.status)) {
if(!doc.valid_till || frappe.datetime.get_diff(doc.valid_till, frappe.datetime.get_today()) >= 0) { this.frm.add_custom_button(
cur_frm.add_custom_button(__('Sales Order'), __("Sales Order"),
cur_frm.cscript['Make Sales Order'], __('Create')); this.frm.cscript["Make Sales Order"],
} __("Create")
);
if(doc.status!=="Ordered") { if(doc.status!=="Ordered") {
this.frm.add_custom_button(__('Set as Lost'), () => { this.frm.add_custom_button(__('Set as Lost'), () => {