Skip to content

Commit

Permalink
Merge pull request #39180 from frappe/mergify/bp/version-14-hotfix/pr…
Browse files Browse the repository at this point in the history
…-39159

refactor: prevent permission error by always processing bulk transaction in background (backport #39159)
  • Loading branch information
ruthra-kumar authored Jan 8, 2024
2 parents 2866f7c + f236a2c commit f6b10f3
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions erpnext/utilities/bulk_transaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,15 @@ def transaction_processing(data, from_doctype, to_doctype):

length_of_data = len(deserialized_data)

if length_of_data > 10:
frappe.msgprint(
_("Started a background job to create {1} {0}").format(to_doctype, length_of_data)
)
frappe.enqueue(
job,
deserialized_data=deserialized_data,
from_doctype=from_doctype,
to_doctype=to_doctype,
)
else:
job(deserialized_data, from_doctype, to_doctype)
frappe.msgprint(
_("Started a background job to create {1} {0}").format(to_doctype, length_of_data)
)
frappe.enqueue(
job,
deserialized_data=deserialized_data,
from_doctype=from_doctype,
to_doctype=to_doctype,
)


@frappe.whitelist()
Expand Down

0 comments on commit f6b10f3

Please sign in to comment.