-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: auto reserve stock for Sales Order on purchase (backport #37603) (
#37648) * chore: make `Reserve Stock` checkbox visible in SO (cherry picked from commit 36a996d) * refactor: rename field `Auto Reserve Stock for Sales Order` (cherry picked from commit 2b4fa98) * feat: add fields to hold SO and SO Item ref in PR Item (cherry picked from commit 188175b) * feat: reserve stock for SO on PR submission (cherry picked from commit 64497c9) # Conflicts: # erpnext/stock/doctype/purchase_receipt/purchase_receipt.py * feat: add field `From Voucher Type` in SRE (cherry picked from commit 5ae9c2f) * refactor: rename field `against_pick_list_item` (cherry picked from commit 78fe567) * refactor: rename field `against_pick_list` (cherry picked from commit 961d2d9) * fix: incorrect serial and batch get reserved (cherry picked from commit 4539502) * fix: partial reservation against SBB (cherry picked from commit 4f363f5) * fix: ignore qty msg if From Voucher is set (cherry picked from commit a432290) * test: add test case for auto-reservation from PR (cherry picked from commit adf313a) * chore: add SRE link in PR Connections (cherry picked from commit 24788dd) * chore: patch to update `From Voucher` details (cherry picked from commit 6942ab1) * chore: `conflicts` * fix(patch): `update_sre_from_voucher_details` --------- Co-authored-by: s-aga-r <sagarsharma.s312@gmail.com>
- Loading branch information
1 parent
3155790
commit da5bf50
Showing
19 changed files
with
403 additions
and
167 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
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() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.