diff --git a/erpnext/controllers/stock_controller.py b/erpnext/controllers/stock_controller.py index ea356f2a21e..1f515d562a5 100644 --- a/erpnext/controllers/stock_controller.py +++ b/erpnext/controllers/stock_controller.py @@ -2087,7 +2087,9 @@ def check_item_quality_inspection(doctype: str, items: str | list[dict]): @frappe.whitelist() -def make_quality_inspections(doctype: str, docname: str, items: str | list, inspection_type: str): +def make_quality_inspections( + company: str, doctype: str, docname: str, items: str | list, inspection_type: str +): if isinstance(items, str): items = json.loads(items) @@ -2106,6 +2108,7 @@ def make_quality_inspections(doctype: str, docname: str, items: str | list, insp quality_inspection = frappe.get_doc( { + "company": company, "doctype": "Quality Inspection", "inspection_type": inspection_type, "inspected_by": frappe.session.user, diff --git a/erpnext/public/js/controllers/transaction.js b/erpnext/public/js/controllers/transaction.js index d76c721166d..b3fa69c77e7 100644 --- a/erpnext/public/js/controllers/transaction.js +++ b/erpnext/public/js/controllers/transaction.js @@ -2961,6 +2961,7 @@ erpnext.TransactionController = class TransactionController extends erpnext.taxe frappe.call({ method: "erpnext.controllers.stock_controller.make_quality_inspections", args: { + company: me.frm.doc.company, doctype: me.frm.doc.doctype, docname: me.frm.doc.name, items: selected_data,