Skip to content

Commit

Permalink
fix: remove file from the disk after the completion of reposting
Browse files Browse the repository at this point in the history
(cherry picked from commit fb330d1)
  • Loading branch information
rohitwaghchaure authored and mergify[bot] committed Feb 6, 2024
1 parent faf79f4 commit b582e9c
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,7 @@ def repost(doc):
repost_gl_entries(doc)

doc.set_status("Completed")
remove_attached_file(doc.name)

except Exception as e:
if frappe.flags.in_test:
Expand Down Expand Up @@ -314,6 +315,13 @@ def repost(doc):
frappe.db.commit()


def remove_attached_file(docname):
if file_name := frappe.db.get_value(
"File", {"attached_to_name": docname, "attached_to_doctype": "Repost Item Valuation"}, "name"
):
frappe.delete_doc("File", file_name)


def repost_sl_entries(doc):
if doc.based_on == "Transaction":
repost_future_sle(
Expand Down

0 comments on commit b582e9c

Please sign in to comment.