Skip to content

Commit

Permalink
fix(patch): update_sre_from_voucher_details (frappe#37649)
Browse files Browse the repository at this point in the history
  • Loading branch information
s-aga-r committed Oct 25, 2023
1 parent f8645c4 commit 3948de6
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions erpnext/patches/v15_0/update_sre_from_voucher_details.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,16 @@


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()
columns = frappe.db.get_table_columns("Stock Reservation Entry")

if set(["against_pick_list", "against_pick_list_item"]).issubset(set(columns)):
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 3948de6

Please sign in to comment.