Merge pull request #32250 from s-aga-r/fix/stock-entry/supplied-item-reference

fix: make `po_detail` or `sco_rm_detail` mandatory for SE Send to Subcontractor
This commit is contained in:
Sagar Sharma 2022-09-18 14:54:08 +05:30 committed by GitHub
commit b944849bd4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -919,6 +919,16 @@ class StockEntry(StockController):
)
if order_rm_detail:
se_item.db_set(self.subcontract_data.rm_detail_field, order_rm_detail)
else:
if not se_item.allow_alternative_item:
frappe.throw(
_("Row {0}# Item {1} not found in 'Raw Materials Supplied' table in {2} {3}").format(
se_item.idx,
se_item.item_code,
self.subcontract_data.order_doctype,
self.get(self.subcontract_data.order_field),
)
)
elif backflush_raw_materials_based_on == "Material Transferred for Subcontract":
for row in self.items:
if not row.subcontracted_item: