mirror of
https://github.com/frappe/erpnext.git
synced 2026-04-13 11:55:11 +00:00
fix(stock): pass company to avoid document naming rule issue in QI
When a Document Naming Rule is configured in QI with a condition based on the company, the system was not passing the company value properly. As a result, the naming rule condition was skipped and the document name was generated using the default series. This fix ensures that the company is passed correctly so that the configured Document Naming Rule is evaluated and applied as expected.
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user