fix: not able to submit subcontracting pr (old flow) (backport #39622) (#39625)

fix: not able to submit subcontracting pr (old flow) (#39622)

(cherry picked from commit 5cf47ae5f991218ed74efeb2cce7f00a54475e6b)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
This commit is contained in:
mergify[bot] 2024-01-29 21:22:21 +05:30 committed by GitHub
parent f71af209c0
commit 960443d268
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -260,18 +260,22 @@ class SubcontractingController(StockController):
return frappe.get_all(f"{doctype}", fields=fields, filters=filters)
def __get_consumed_items(self, doctype, receipt_items):
return frappe.get_all(
self.subcontract_data.receipt_supplied_items_field,
fields=[
fields = [
"serial_no",
"rm_item_code",
"reference_name",
"serial_and_batch_bundle",
"batch_no",
"consumed_qty",
"main_item_code",
"parent as voucher_no",
],
]
if self.subcontract_data.receipt_supplied_items_field != "Purchase Receipt Item Supplied":
fields.append("serial_and_batch_bundle")
return frappe.get_all(
self.subcontract_data.receipt_supplied_items_field,
fields=fields,
filters={"docstatus": 1, "reference_name": ("in", list(receipt_items)), "parenttype": doctype},
)