Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: enqueue_after_commit wherever it makes sense #35588

Merged
merged 1 commit into from
Jun 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,15 @@ def after_insert(self):
if frappe.flags.in_test:
make_dimension_in_accounting_doctypes(doc=self)
else:
frappe.enqueue(make_dimension_in_accounting_doctypes, doc=self, queue="long")
frappe.enqueue(
make_dimension_in_accounting_doctypes, doc=self, queue="long", enqueue_after_commit=True
)

def on_trash(self):
if frappe.flags.in_test:
delete_accounting_dimension(doc=self)
else:
frappe.enqueue(delete_accounting_dimension, doc=self, queue="long")
frappe.enqueue(delete_accounting_dimension, doc=self, queue="long", enqueue_after_commit=True)

def set_fieldname_and_label(self):
if not self.label:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ def on_cancel(self):
voucher_type="Period Closing Voucher",
voucher_no=self.name,
queue="long",
enqueue_after_commit=True,
)
frappe.msgprint(
_("The GL Entries will be cancelled in the background, it can take a few minutes."), alert=True
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,14 @@ def on_submit(self):
boms=boms,
timeout=40000,
now=frappe.flags.in_test,
enqueue_after_commit=True,
)
else:
frappe.enqueue(
method="erpnext.manufacturing.doctype.bom_update_log.bom_update_log.process_boms_cost_level_wise",
update_doc=self,
now=frappe.flags.in_test,
enqueue_after_commit=True,
)


Expand Down
1 change: 1 addition & 0 deletions erpnext/stock/doctype/item/item.py
Original file line number Diff line number Diff line change
Expand Up @@ -714,6 +714,7 @@ def update_variants(self):
template=self,
now=frappe.flags.in_test,
timeout=600,
enqueue_after_commit=True,
)

def validate_has_variants(self):
Expand Down
1 change: 1 addition & 0 deletions erpnext/stock/doctype/stock_settings/stock_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ def validate_clean_description_html(self):
frappe.enqueue(
"erpnext.stock.doctype.stock_settings.stock_settings.clean_all_descriptions",
now=frappe.flags.in_test,
enqueue_after_commit=True,
)

def validate_pending_reposts(self):
Expand Down