mirror of
https://github.com/frappe/erpnext.git
synced 2026-02-17 03:33:43 +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
|
old_limit = frappe.db.MAX_WRITES_PER_TRANSACTION
|
||||||
frappe.db.MAX_WRITES_PER_TRANSACTION *= 4
|
frappe.db.MAX_WRITES_PER_TRANSACTION *= 4
|
||||||
for doc in docs:
|
try:
|
||||||
frappe.db.set_value("Material Request", doc, "buying_price_list", default_buying_price_list)
|
for doc in docs:
|
||||||
frappe.db.MAX_WRITES_PER_TRANSACTION = old_limit
|
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