* chore: make `Reserve Stock` checkbox visible in SO (cherry picked from commit 36a996d70499a8bc4cf9c28853c2b5606d73f81d) * refactor: rename field `Auto Reserve Stock for Sales Order` (cherry picked from commit 2b4fa98941817966b8a936e4076be84406ad035a) * feat: add fields to hold SO and SO Item ref in PR Item (cherry picked from commit 188175be84b5eaa0be73face69f4f2b58b80dd64) * feat: reserve stock for SO on PR submission (cherry picked from commit 64497c922892d19ca378b5da75cf6b528f5e52d9) # Conflicts: # erpnext/stock/doctype/purchase_receipt/purchase_receipt.py * feat: add field `From Voucher Type` in SRE (cherry picked from commit 5ae9c2f62b741d64da4ce74b3b251339711e8256) * refactor: rename field `against_pick_list_item` (cherry picked from commit 78fe56741931ad2c253bf9acca2896c2411f4ac6) * refactor: rename field `against_pick_list` (cherry picked from commit 961d2d9926a1a9c0396c3292d431d3bad6865e62) * fix: incorrect serial and batch get reserved (cherry picked from commit 45395027d3b5c51ac3ccdbebb1f0d23d5ffd2ec1) * fix: partial reservation against SBB (cherry picked from commit 4f363f5bf3da286999966f10d0cca22264f42199) * fix: ignore qty msg if From Voucher is set (cherry picked from commit a432290a828478265a8a463d05aea818c2b75914) * test: add test case for auto-reservation from PR (cherry picked from commit adf313a6d3308f957b4876574e455ca750b22106) * chore: add SRE link in PR Connections (cherry picked from commit 24788ddcc085fb825d2b14145a82ced02842f512) * chore: patch to update `From Voucher` details (cherry picked from commit 6942ab10125cfaf07c526df53a7c88bffcc5b9da) * chore: `conflicts` * fix(patch): `update_sre_from_voucher_details` --------- Co-authored-by: s-aga-r <sagarsharma.s312@gmail.com>
19 lines
592 B
Python
19 lines
592 B
Python
import frappe
|
|
from frappe.query_builder.functions import IfNull
|
|
|
|
|
|
def execute():
|
|
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()
|