feat: enable automatic type annotations (#38452)

This commit is contained in:
Ankush Menat
2023-11-30 13:53:48 +05:30
committed by GitHub
parent 1da9087cc4
commit 63313eef6f
485 changed files with 12920 additions and 0 deletions

View File

@@ -12,6 +12,23 @@ class DuplicationError(frappe.ValidationError):
class ActivityCost(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
activity_type: DF.Link
billing_rate: DF.Currency
costing_rate: DF.Currency
department: DF.Link | None
employee: DF.Link | None
employee_name: DF.Data | None
title: DF.Data | None
# end: auto-generated types
def validate(self):
self.set_title()
self.check_unique()

View File

@@ -6,4 +6,18 @@ from frappe.model.document import Document
class ActivityType(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
activity_type: DF.Data
billing_rate: DF.Currency
costing_rate: DF.Currency
disabled: DF.Check
# end: auto-generated types
pass

View File

@@ -6,4 +6,18 @@ from frappe.model.document import Document
class DependentTask(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
parent: DF.Data
parentfield: DF.Data
parenttype: DF.Data
task: DF.Link | None
# end: auto-generated types
pass

View File

@@ -9,6 +9,22 @@ from frappe.utils import get_link_to_form
class ProjectTemplate(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.projects.doctype.project_template_task.project_template_task import (
ProjectTemplateTask,
)
project_type: DF.Link | None
tasks: DF.Table[ProjectTemplateTask]
# end: auto-generated types
def validate(self):
self.validate_dependencies()

View File

@@ -7,4 +7,19 @@ from frappe.model.document import Document
class ProjectTemplateTask(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
parent: DF.Data
parentfield: DF.Data
parenttype: DF.Data
subject: DF.ReadOnly | None
task: DF.Link
# end: auto-generated types
pass

View File

@@ -8,6 +8,18 @@ from frappe.model.document import Document
class ProjectType(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
description: DF.Text | None
project_type: DF.Data
# end: auto-generated types
def on_trash(self):
if self.name == "External":
frappe.throw(_("You cannot delete Project Type 'External'"))

View File

@@ -7,6 +7,25 @@ from frappe.model.document import Document
class ProjectUpdate(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.projects.doctype.project_user.project_user import ProjectUser
amended_from: DF.Link | None
date: DF.Date | None
naming_series: DF.Data | None
project: DF.Link
sent: DF.Check
time: DF.Time | None
users: DF.Table[ProjectUser]
# end: auto-generated types
pass

View File

@@ -6,4 +6,24 @@ from frappe.model.document import Document
class ProjectUser(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
email: DF.ReadOnly | None
full_name: DF.ReadOnly | None
image: DF.ReadOnly | None
parent: DF.Data
parentfield: DF.Data
parenttype: DF.Data
project_status: DF.Text | None
user: DF.Link
view_attachments: DF.Check
welcome_email_sent: DF.Check
# end: auto-generated types
pass

View File

@@ -6,4 +6,17 @@ from frappe.model.document import Document
class ProjectsSettings(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
ignore_employee_time_overlap: DF.Check
ignore_user_time_overlap: DF.Check
ignore_workstation_time_overlap: DF.Check
# end: auto-generated types
pass

View File

@@ -18,6 +18,56 @@ class CircularReferenceError(frappe.ValidationError):
class Task(NestedSet):
# 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.projects.doctype.task_depends_on.task_depends_on import TaskDependsOn
act_end_date: DF.Date | None
act_start_date: DF.Date | None
actual_time: DF.Float
closing_date: DF.Date | None
color: DF.Color | None
company: DF.Link | None
completed_by: DF.Link | None
completed_on: DF.Date | None
department: DF.Link | None
depends_on: DF.Table[TaskDependsOn]
depends_on_tasks: DF.Code | None
description: DF.TextEditor | None
duration: DF.Int
exp_end_date: DF.Date | None
exp_start_date: DF.Date | None
expected_time: DF.Float
is_group: DF.Check
is_milestone: DF.Check
is_template: DF.Check
issue: DF.Link | None
lft: DF.Int
old_parent: DF.Data | None
parent_task: DF.Link | None
priority: DF.Literal["Low", "Medium", "High", "Urgent"]
progress: DF.Percent
project: DF.Link | None
review_date: DF.Date | None
rgt: DF.Int
start: DF.Int
status: DF.Literal[
"Open", "Working", "Pending Review", "Overdue", "Template", "Completed", "Cancelled"
]
subject: DF.Data
task_weight: DF.Float
template_task: DF.Data | None
total_billing_amount: DF.Currency
total_costing_amount: DF.Currency
type: DF.Link | None
# end: auto-generated types
nsm_parent_field = "parent_task"
def get_customer_details(self):

View File

@@ -6,4 +6,20 @@ from frappe.model.document import Document
class TaskDependsOn(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
parent: DF.Data
parentfield: DF.Data
parenttype: DF.Data
project: DF.Text | None
subject: DF.Text | None
task: DF.Link | None
# end: auto-generated types
pass

View File

@@ -7,4 +7,16 @@ from frappe.model.document import Document
class TaskType(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
description: DF.SmallText | None
weight: DF.Float
# end: auto-generated types
pass

View File

@@ -6,4 +6,38 @@ from frappe.model.document import Document
class TimesheetDetail(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
activity_type: DF.Link | None
base_billing_amount: DF.Currency
base_billing_rate: DF.Currency
base_costing_amount: DF.Currency
base_costing_rate: DF.Currency
billing_amount: DF.Currency
billing_hours: DF.Float
billing_rate: DF.Currency
completed: DF.Check
costing_amount: DF.Currency
costing_rate: DF.Currency
description: DF.SmallText | None
expected_hours: DF.Float
from_time: DF.Datetime | None
hours: DF.Float
is_billable: DF.Check
parent: DF.Data
parentfield: DF.Data
parenttype: DF.Data
project: DF.Link | None
project_name: DF.Data | None
sales_invoice: DF.Link | None
task: DF.Link | None
to_time: DF.Datetime | None
# end: auto-generated types
pass