feat: provision to add items in Stock Reservation dialog (backport #38558) (#38920)

* feat: provision to update items in Stock Reservation dialog

(cherry picked from commit 9471d8fff9)

* fix(ux): show row index and field label while selecting the Sales Order Item

(cherry picked from commit 00261094c8)

* feat: provision to add items in Stock Reservation dialog

(cherry picked from commit 8d5045ef4c)

---------

Co-authored-by: s-aga-r <sagarsharma.s312@gmail.com>
This commit is contained in:
mergify[bot]
2023-12-22 15:50:07 +05:30
committed by GitHub
parent a8f3f2343d
commit 8c2c90f77a
2 changed files with 101 additions and 5 deletions

View File

@@ -891,3 +891,31 @@ def get_payment_terms_for_references(doctype, txt, searchfield, start, page_len,
as_list=1,
)
return terms
@frappe.whitelist()
@frappe.validate_and_sanitize_search_inputs
def get_filtered_child_rows(doctype, txt, searchfield, start, page_len, filters) -> list:
table = frappe.qb.DocType(doctype)
query = (
frappe.qb.from_(table)
.select(
table.name,
Concat("#", table.idx, ", ", table.item_code),
)
.orderby(table.idx)
.offset(start)
.limit(page_len)
)
if filters:
for field, value in filters.items():
query = query.where(table[field] == value)
if txt:
txt += "%"
query = query.where(
((table.idx.like(txt.replace("#", ""))) | (table.item_code.like(txt))) | (table.name.like(txt))
)
return query.run(as_dict=False)