fix: add type hints to whitelisted functions (#53210)

This commit is contained in:
Shubh Doshi
2026-03-06 13:57:01 +05:30
committed by GitHub
parent d6abbce4ec
commit d2e039ad4e
6 changed files with 19 additions and 15 deletions

View File

@@ -216,13 +216,13 @@ def get_issue_list(doctype, txt, filters, limit_start, limit_page_length=20, ord
@frappe.whitelist()
def set_multiple_status(names, status):
def set_multiple_status(names: str, status: str):
for name in json.loads(names):
frappe.db.set_value("Issue", name, "status", status)
@frappe.whitelist()
def set_status(name, status):
def set_status(name: str, status: str):
frappe.db.set_value("Issue", name, "status", status)
@@ -261,12 +261,12 @@ def update_issue(contact, method):
@frappe.whitelist()
def make_task(source_name, target_doc=None):
def make_task(source_name: str, target_doc: str | Document | None = None):
return get_mapped_doc("Issue", source_name, {"Issue": {"doctype": "Task"}}, target_doc)
@frappe.whitelist()
def make_issue_from_communication(communication, ignore_communication_links=False):
def make_issue_from_communication(communication: str, ignore_communication_links: bool = False):
"""raise a issue from email"""
doc = frappe.get_doc("Communication", communication)

View File

@@ -4,6 +4,7 @@
import frappe
from frappe import _, session
from frappe.model.document import Document
from frappe.utils import now_datetime
from erpnext.utilities.transaction_base import TransactionBase
@@ -78,7 +79,7 @@ class WarrantyClaim(TransactionBase):
@frappe.whitelist()
def make_maintenance_visit(source_name, target_doc=None):
def make_maintenance_visit(source_name: str, target_doc: str | Document | None = None):
from frappe.model.mapper import get_mapped_doc, map_child_doc
def _update_links(source_doc, target_doc, source_parent):