Skip to content

Commit

Permalink
chore: patch to update From Voucher details
Browse files Browse the repository at this point in the history
  • Loading branch information
s-aga-r committed Oct 23, 2023
1 parent 24788dd commit 6942ab1
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions erpnext/patches.txt
Original file line number Diff line number Diff line change
Expand Up @@ -340,5 +340,6 @@ erpnext.patches.v14_0.update_invoicing_period_in_subscription
execute:frappe.delete_doc("Page", "welcome-to-erpnext")
erpnext.patches.v15_0.delete_payment_gateway_doctypes
erpnext.patches.v14_0.create_accounting_dimensions_in_sales_order_item
erpnext.patches.v15_0.update_sre_from_voucher_details
# below migration patch should always run last
erpnext.patches.v14_0.migrate_gl_to_payment_ledger
15 changes: 15 additions & 0 deletions erpnext/patches/v15_0/update_sre_from_voucher_details.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import frappe
from frappe.query_builder.functions import IfNull


def execute():
sre = frappe.qb.DocType("Stock Reservation Entry")
(
frappe.qb.update(sre)
.set(sre.from_voucher_type, "Pick List")
.set(sre.from_voucher_no, sre.against_pick_list)
.set(sre.from_voucher_detail_no, sre.against_pick_list_item)
.where(
(IfNull(sre.against_pick_list, "") != "") & (IfNull(sre.against_pick_list_item, "") != "")
)
).run()

0 comments on commit 6942ab1

Please sign in to comment.