mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-30 18:34:48 +00:00
fix: incorrect type hint
This commit is contained in:
@@ -3139,7 +3139,7 @@ def get_default_taxes_and_charges(
|
|||||||
|
|
||||||
|
|
||||||
@frappe.whitelist()
|
@frappe.whitelist()
|
||||||
def get_taxes_and_charges(master_doctype: str, master_name: str):
|
def get_taxes_and_charges(master_doctype: str, master_name: str | None = None):
|
||||||
if not master_name:
|
if not master_name:
|
||||||
return
|
return
|
||||||
from frappe.model import child_table_fields, default_fields
|
from frappe.model import child_table_fields, default_fields
|
||||||
@@ -3564,6 +3564,7 @@ def get_payment_terms(
|
|||||||
|
|
||||||
schedule = []
|
schedule = []
|
||||||
for d in terms_doc.get("terms"):
|
for d in terms_doc.get("terms"):
|
||||||
|
d = frappe._dict(d.as_dict())
|
||||||
term_details = get_payment_term_details(d, posting_date, grand_total, base_grand_total, bill_date)
|
term_details = get_payment_term_details(d, posting_date, grand_total, base_grand_total, bill_date)
|
||||||
schedule.append(term_details)
|
schedule.append(term_details)
|
||||||
|
|
||||||
@@ -3612,7 +3613,7 @@ def get_payment_term_details(
|
|||||||
term_details.due_date = get_due_date(term, posting_date)
|
term_details.due_date = get_due_date(term, posting_date)
|
||||||
term_details.discount_date = get_discount_date(term, posting_date)
|
term_details.discount_date = get_discount_date(term, posting_date)
|
||||||
|
|
||||||
if getdate(term_details.due_date) < getdate(posting_date):
|
if posting_date and getdate(term_details.due_date) < getdate(posting_date):
|
||||||
term_details.due_date = posting_date
|
term_details.due_date = posting_date
|
||||||
|
|
||||||
return term_details
|
return term_details
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ def employee_query(
|
|||||||
searchfield: str,
|
searchfield: str,
|
||||||
start: int,
|
start: int,
|
||||||
page_len: int,
|
page_len: int,
|
||||||
filters: dict,
|
filters: dict | str | None = None,
|
||||||
reference_doctype: str | None = None,
|
reference_doctype: str | None = None,
|
||||||
ignore_user_permissions: bool = False,
|
ignore_user_permissions: bool = False,
|
||||||
):
|
):
|
||||||
@@ -91,7 +91,9 @@ def has_ignored_field(reference_doctype, doctype):
|
|||||||
# searches for leads which are not converted
|
# searches for leads which are not converted
|
||||||
@frappe.whitelist()
|
@frappe.whitelist()
|
||||||
@frappe.validate_and_sanitize_search_inputs
|
@frappe.validate_and_sanitize_search_inputs
|
||||||
def lead_query(doctype: str, txt: str, searchfield: str, start: int, page_len: int, filters: dict):
|
def lead_query(
|
||||||
|
doctype: str, txt: str, searchfield: str, start: int, page_len: int, filters: dict | None = None
|
||||||
|
):
|
||||||
doctype = "Lead"
|
doctype = "Lead"
|
||||||
fields = get_fields(doctype, ["name", "lead_name", "company_name"])
|
fields = get_fields(doctype, ["name", "lead_name", "company_name"])
|
||||||
|
|
||||||
@@ -175,7 +177,13 @@ def tax_account_query(doctype: str, txt: str, searchfield: str, start: int, page
|
|||||||
@frappe.whitelist()
|
@frappe.whitelist()
|
||||||
@frappe.validate_and_sanitize_search_inputs
|
@frappe.validate_and_sanitize_search_inputs
|
||||||
def item_query(
|
def item_query(
|
||||||
doctype: str, txt: str, searchfield: str, start: int, page_len: int, filters: dict, as_dict: bool = False
|
doctype: str,
|
||||||
|
txt: str,
|
||||||
|
searchfield: str,
|
||||||
|
start: int,
|
||||||
|
page_len: int,
|
||||||
|
filters: dict | str | None = None,
|
||||||
|
as_dict: bool = False,
|
||||||
):
|
):
|
||||||
doctype = "Item"
|
doctype = "Item"
|
||||||
conditions = []
|
conditions = []
|
||||||
@@ -282,7 +290,9 @@ def item_query(
|
|||||||
|
|
||||||
@frappe.whitelist()
|
@frappe.whitelist()
|
||||||
@frappe.validate_and_sanitize_search_inputs
|
@frappe.validate_and_sanitize_search_inputs
|
||||||
def bom(doctype: str, txt: str, searchfield: str, start: int, page_len: int, filters: dict):
|
def bom(
|
||||||
|
doctype: str, txt: str, searchfield: str, start: int, page_len: int, filters: dict | str | None = None
|
||||||
|
):
|
||||||
doctype = "BOM"
|
doctype = "BOM"
|
||||||
conditions = []
|
conditions = []
|
||||||
fields = get_fields(doctype, ["name", "item"])
|
fields = get_fields(doctype, ["name", "item"])
|
||||||
@@ -314,7 +324,9 @@ def bom(doctype: str, txt: str, searchfield: str, start: int, page_len: int, fil
|
|||||||
|
|
||||||
@frappe.whitelist()
|
@frappe.whitelist()
|
||||||
@frappe.validate_and_sanitize_search_inputs
|
@frappe.validate_and_sanitize_search_inputs
|
||||||
def get_project_name(doctype: str, txt: str, searchfield: str, start: int, page_len: int, filters: dict):
|
def get_project_name(
|
||||||
|
doctype: str, txt: str, searchfield: str, start: int, page_len: int, filters: dict | None = None
|
||||||
|
):
|
||||||
proj = qb.DocType("Project")
|
proj = qb.DocType("Project")
|
||||||
qb_filter_and_conditions = []
|
qb_filter_and_conditions = []
|
||||||
qb_filter_or_conditions = []
|
qb_filter_or_conditions = []
|
||||||
@@ -563,7 +575,9 @@ def get_batches_from_serial_and_batch_bundle(searchfields, txt, filters, start=0
|
|||||||
|
|
||||||
@frappe.whitelist()
|
@frappe.whitelist()
|
||||||
@frappe.validate_and_sanitize_search_inputs
|
@frappe.validate_and_sanitize_search_inputs
|
||||||
def get_account_list(doctype: str, txt: str, searchfield: str, start: int, page_len: int, filters: dict):
|
def get_account_list(
|
||||||
|
doctype: str, txt: str, searchfield: str, start: int, page_len: int, filters: dict | list
|
||||||
|
):
|
||||||
doctype = "Account"
|
doctype = "Account"
|
||||||
filter_list = []
|
filter_list = []
|
||||||
|
|
||||||
@@ -740,7 +754,7 @@ def get_expense_account(doctype: str, txt: str, searchfield: str, start: int, pa
|
|||||||
|
|
||||||
@frappe.whitelist()
|
@frappe.whitelist()
|
||||||
@frappe.validate_and_sanitize_search_inputs
|
@frappe.validate_and_sanitize_search_inputs
|
||||||
def warehouse_query(doctype: str, txt: str, searchfield: str, start: int, page_len: int, filters: dict):
|
def warehouse_query(doctype: str, txt: str, searchfield: str, start: int, page_len: int, filters: list):
|
||||||
# Should be used when item code is passed in filters.
|
# Should be used when item code is passed in filters.
|
||||||
doctype = "Warehouse"
|
doctype = "Warehouse"
|
||||||
conditions, bin_conditions = [], []
|
conditions, bin_conditions = [], []
|
||||||
|
|||||||
@@ -2087,7 +2087,7 @@ def check_item_quality_inspection(doctype: str, items: str | list[dict]):
|
|||||||
|
|
||||||
|
|
||||||
@frappe.whitelist()
|
@frappe.whitelist()
|
||||||
def make_quality_inspections(doctype: str, docname: str, items: str | list[dict], inspection_type: str):
|
def make_quality_inspections(doctype: str, docname: str, items: str | list, inspection_type: str):
|
||||||
if isinstance(items, str):
|
if isinstance(items, str):
|
||||||
items = json.loads(items)
|
items = json.loads(items)
|
||||||
|
|
||||||
|
|||||||
@@ -1369,7 +1369,7 @@ def get_pending_subcontracted_quantity(doctype, name):
|
|||||||
@frappe.whitelist()
|
@frappe.whitelist()
|
||||||
def make_rm_stock_entry(
|
def make_rm_stock_entry(
|
||||||
subcontract_order: str,
|
subcontract_order: str,
|
||||||
rm_items: str | list[dict],
|
rm_items: str | list | None = None,
|
||||||
order_doctype: str = "Subcontracting Order",
|
order_doctype: str = "Subcontracting Order",
|
||||||
target_doc: dict | None = None,
|
target_doc: dict | None = None,
|
||||||
):
|
):
|
||||||
@@ -1559,7 +1559,7 @@ def make_return_stock_entry_for_subcontract(
|
|||||||
|
|
||||||
@frappe.whitelist()
|
@frappe.whitelist()
|
||||||
def get_materials_from_supplier(
|
def get_materials_from_supplier(
|
||||||
subcontract_order: str, rm_details: str | list[dict], order_doctype: str = "Subcontracting Order"
|
subcontract_order: str, rm_details: str | list, order_doctype: str = "Subcontracting Order"
|
||||||
):
|
):
|
||||||
if isinstance(rm_details, str):
|
if isinstance(rm_details, str):
|
||||||
rm_details = json.loads(rm_details)
|
rm_details = json.loads(rm_details)
|
||||||
|
|||||||
Reference in New Issue
Block a user