fix: update status of quotation in patch (backport #54577) (#54579)

fix: update status of quotation in patch (#54577)

(cherry picked from commit 2088a01c19)

Co-authored-by: Mihir Kandoi <kandoimihir@gmail.com>
This commit is contained in:
mergify[bot]
2026-04-28 15:13:16 +05:30
committed by GitHub
parent 49ab25dda8
commit 1a8dc7e332
2 changed files with 16 additions and 6 deletions

View File

@@ -10,7 +10,18 @@ def execute():
)
if data:
frappe.db.auto_commit_on_many_writes = 1
frappe.db.bulk_update(
"Quotation Item", {d.quotation_item: {"ordered_qty": d.ordered_qty} for d in data}
)
frappe.db.auto_commit_on_many_writes = 0
try:
frappe.db.bulk_update(
"Quotation Item", {d.quotation_item: {"ordered_qty": d.ordered_qty} for d in data}
)
quotations = frappe.get_all(
"Quotation Item",
filters={"name": ["in", [d.quotation_item for d in data]]},
pluck="parent",
distinct=True,
)
for quotation in quotations:
doc = frappe.get_doc("Quotation", quotation)
doc.set_status(update=True, update_modified=False)
finally:
frappe.db.auto_commit_on_many_writes = 0

View File

@@ -123,6 +123,7 @@ erpnext.selling.QuotationController = class QuotationController extends erpnext.
frappe.datetime.get_diff(doc.valid_till, frappe.datetime.get_today()) >= 0)
) {
this.frm.add_custom_button(__("Sales Order"), () => this.make_sales_order(), __("Create"));
cur_frm.page.set_inner_btn_group_as_primary(__("Create"));
this.frm.add_custom_button(__("Update Items"), () => {
erpnext.utils.update_child_items({
frm: this.frm,
@@ -137,8 +138,6 @@ erpnext.selling.QuotationController = class QuotationController extends erpnext.
this.frm.trigger("set_as_lost_dialog");
});
}
cur_frm.page.set_inner_btn_group_as_primary(__("Create"));
}
if (this.frm.doc.docstatus === 0 && frappe.model.can_read("Opportunity")) {