mirror of
https://github.com/frappe/erpnext.git
synced 2026-02-15 10:43:31 +00:00
fix: Add try-finally for setting buying price list
(cherry picked from commit35a8d02866) (cherry picked from commite21baec246)
This commit is contained in:
@@ -11,6 +11,8 @@ def execute():
|
||||
)
|
||||
old_limit = frappe.db.MAX_WRITES_PER_TRANSACTION
|
||||
frappe.db.MAX_WRITES_PER_TRANSACTION *= 4
|
||||
for doc in docs:
|
||||
frappe.db.set_value("Material Request", doc, "buying_price_list", default_buying_price_list)
|
||||
frappe.db.MAX_WRITES_PER_TRANSACTION = old_limit
|
||||
try:
|
||||
for doc in docs:
|
||||
frappe.db.set_value("Material Request", doc, "buying_price_list", default_buying_price_list)
|
||||
finally:
|
||||
frappe.db.MAX_WRITES_PER_TRANSACTION = old_limit
|
||||
|
||||
Reference in New Issue
Block a user