Skip to content

Commit

Permalink
fix: possible deadlock while deleting dummy prices (frappe#177)
Browse files Browse the repository at this point in the history
  • Loading branch information
ankush committed Mar 20, 2022
1 parent 47d731f commit c22dd49
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion ecommerce_integrations/utils/price_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,8 @@ def get_dummy_price_list() -> str:
def discard_item_prices(doc, method=None):
"""Discard any item prices added in dummy price list"""
if doc.price_list == DUMMY_PRICE_LIST:
frappe.db.delete("Item Price", {"price_list": DUMMY_PRICE_LIST, "selling": 1})
frappe.enqueue(method=_delete_all_dummy_prices, queue="short", enqueue_after_commit=True)


def _delete_all_dummy_prices():
frappe.db.delete("Item Price", {"price_list": DUMMY_PRICE_LIST, "selling": 1})

0 comments on commit c22dd49

Please sign in to comment.