feat: Create subcontracted PO from Material Request (#44745)

* feat: Create subcontracted PO from Material Request

* fix: Made minor changes in logic to pass all test cases

* refactor: Made changes suggested by mentor and simplified logic

* test: Made changes to tests
This commit is contained in:
Mihir Kandoi
2024-12-23 13:11:44 +05:30
committed by GitHub
parent cf57cb73f0
commit b7699012b2
5 changed files with 119 additions and 13 deletions

View File

@@ -421,6 +421,13 @@ class StatusUpdater(Document):
if d.doctype != args["source_dt"]:
continue
if (
d.get("material_request")
and frappe.db.get_value("Material Request", d.material_request, "material_request_type")
== "Subcontracting"
):
args.update({"source_field": "fg_item_qty"})
self._update_modified(args, update_modified)
# updates qty in the child table