mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-29 18:04:46 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user