mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-02 03:39:11 +00:00
feat: enable automatic type annotations (#38452)
(cherry picked from commit 63313eef6f)
Co-authored-by: Ankush Menat <ankush@frappe.io>
This commit is contained in:
@@ -16,6 +16,34 @@ ONGOING_CALL_STATUSES = ["Ringing", "In Progress"]
|
||||
|
||||
|
||||
class CallLog(Document):
|
||||
# begin: auto-generated types
|
||||
# This code is auto-generated. Do not modify anything in this block.
|
||||
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from frappe.core.doctype.dynamic_link.dynamic_link import DynamicLink
|
||||
from frappe.types import DF
|
||||
|
||||
call_received_by: DF.Link | None
|
||||
customer: DF.Link | None
|
||||
duration: DF.Duration | None
|
||||
employee_user_id: DF.Link | None
|
||||
end_time: DF.Datetime | None
|
||||
id: DF.Data | None
|
||||
links: DF.Table[DynamicLink]
|
||||
medium: DF.Data | None
|
||||
recording_url: DF.Data | None
|
||||
start_time: DF.Datetime | None
|
||||
status: DF.Literal[
|
||||
"Ringing", "In Progress", "Completed", "Failed", "Busy", "No Answer", "Queued", "Canceled"
|
||||
]
|
||||
summary: DF.SmallText | None
|
||||
to: DF.Data | None
|
||||
type: DF.Literal["Incoming", "Outgoing"]
|
||||
type_of_call: DF.Link | None
|
||||
# end: auto-generated types
|
||||
|
||||
def validate(self):
|
||||
deduplicate_dynamic_links(self)
|
||||
|
||||
|
||||
@@ -7,4 +7,23 @@ from frappe.model.document import Document
|
||||
|
||||
|
||||
class IncomingCallHandlingSchedule(Document):
|
||||
# begin: auto-generated types
|
||||
# This code is auto-generated. Do not modify anything in this block.
|
||||
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from frappe.types import DF
|
||||
|
||||
agent_group: DF.Link
|
||||
day_of_week: DF.Literal[
|
||||
"Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"
|
||||
]
|
||||
from_time: DF.Time
|
||||
parent: DF.Data
|
||||
parentfield: DF.Data
|
||||
parenttype: DF.Data
|
||||
to_time: DF.Time
|
||||
# end: auto-generated types
|
||||
|
||||
pass
|
||||
|
||||
@@ -11,6 +11,25 @@ from frappe.model.document import Document
|
||||
|
||||
|
||||
class IncomingCallSettings(Document):
|
||||
# begin: auto-generated types
|
||||
# This code is auto-generated. Do not modify anything in this block.
|
||||
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from frappe.types import DF
|
||||
|
||||
from erpnext.telephony.doctype.incoming_call_handling_schedule.incoming_call_handling_schedule import (
|
||||
IncomingCallHandlingSchedule,
|
||||
)
|
||||
|
||||
agent_busy_message: DF.Data | None
|
||||
agent_unavailable_message: DF.Data | None
|
||||
call_handling_schedule: DF.Table[IncomingCallHandlingSchedule]
|
||||
call_routing: DF.Literal["Sequential", "Simultaneous"]
|
||||
greeting_message: DF.Data | None
|
||||
# end: auto-generated types
|
||||
|
||||
def validate(self):
|
||||
"""List of validations
|
||||
* Make sure that to time slot is ahead of from time slot in call schedule
|
||||
|
||||
@@ -6,4 +6,16 @@ from frappe.model.document import Document
|
||||
|
||||
|
||||
class TelephonyCallType(Document):
|
||||
# begin: auto-generated types
|
||||
# This code is auto-generated. Do not modify anything in this block.
|
||||
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from frappe.types import DF
|
||||
|
||||
amended_from: DF.Link | None
|
||||
call_type: DF.Data
|
||||
# end: auto-generated types
|
||||
|
||||
pass
|
||||
|
||||
@@ -7,4 +7,19 @@ from frappe.model.document import Document
|
||||
|
||||
|
||||
class VoiceCallSettings(Document):
|
||||
# begin: auto-generated types
|
||||
# This code is auto-generated. Do not modify anything in this block.
|
||||
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from frappe.types import DF
|
||||
|
||||
agent_busy_message: DF.Data | None
|
||||
agent_unavailable_message: DF.Data | None
|
||||
call_receiving_device: DF.Literal["Computer", "Phone"]
|
||||
greeting_message: DF.Data | None
|
||||
user: DF.Link
|
||||
# end: auto-generated types
|
||||
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user