mirror of
https://github.com/frappe/erpnext.git
synced 2026-03-30 04:05:43 +00:00
refactor(utilities): type annotations for whitelisted methods
This commit is contained in:
@@ -7,7 +7,9 @@ from frappe.utils import get_link_to_form, today
|
||||
|
||||
|
||||
@frappe.whitelist()
|
||||
def transaction_processing(data, from_doctype, to_doctype, args=None):
|
||||
def transaction_processing(
|
||||
data: str | list, from_doctype: str, to_doctype: str, args: str | frappe._dict | None = None
|
||||
):
|
||||
frappe.has_permission(from_doctype, "read", throw=True)
|
||||
frappe.has_permission(to_doctype, "create", throw=True)
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ def get_doctypes():
|
||||
|
||||
|
||||
@frappe.whitelist()
|
||||
def upload(select_doctype=None, rows=None):
|
||||
def upload(select_doctype: str | None = None):
|
||||
from frappe.utils.csvutils import read_csv_content_from_attached_file
|
||||
|
||||
if not select_doctype:
|
||||
|
||||
@@ -105,7 +105,7 @@ def get_formatted_ids(video_list):
|
||||
|
||||
|
||||
@frappe.whitelist()
|
||||
def get_id_from_url(url):
|
||||
def get_id_from_url(url: str):
|
||||
"""
|
||||
Returns video id from url
|
||||
:param youtube url: String URL
|
||||
|
||||
@@ -292,7 +292,7 @@ class TransactionBase(StatusUpdater):
|
||||
)
|
||||
|
||||
@frappe.whitelist()
|
||||
def process_item_selection(self, item_idx):
|
||||
def process_item_selection(self, item_idx: int):
|
||||
# Server side 'item' doc. Update this to reflect in UI
|
||||
item_obj = self.get("items", {"idx": item_idx})[0]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user