mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-03 04:09:11 +00:00
feat: enable automatic type annotations (#38452)
This commit is contained in:
@@ -7,4 +7,22 @@ from frappe.model.document import Document
|
||||
|
||||
|
||||
class NonConformance(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
|
||||
|
||||
corrective_action: DF.TextEditor | None
|
||||
details: DF.TextEditor | None
|
||||
full_name: DF.Data | None
|
||||
preventive_action: DF.TextEditor | None
|
||||
procedure: DF.Link
|
||||
process_owner: DF.Data | None
|
||||
status: DF.Literal["Open", "Resolved", "Cancelled"]
|
||||
subject: DF.Data
|
||||
# end: auto-generated types
|
||||
|
||||
pass
|
||||
|
||||
@@ -6,5 +6,27 @@ from frappe.model.document import Document
|
||||
|
||||
|
||||
class QualityAction(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.quality_management.doctype.quality_action_resolution.quality_action_resolution import (
|
||||
QualityActionResolution,
|
||||
)
|
||||
|
||||
corrective_preventive: DF.Literal["Corrective", "Preventive"]
|
||||
date: DF.Date | None
|
||||
feedback: DF.Link | None
|
||||
goal: DF.Link | None
|
||||
procedure: DF.Link | None
|
||||
resolutions: DF.Table[QualityActionResolution]
|
||||
review: DF.Link | None
|
||||
status: DF.Literal["Open", "Completed"]
|
||||
# end: auto-generated types
|
||||
|
||||
def validate(self):
|
||||
self.status = "Open" if any([d.status == "Open" for d in self.resolutions]) else "Completed"
|
||||
|
||||
@@ -7,4 +7,22 @@ from frappe.model.document import Document
|
||||
|
||||
|
||||
class QualityActionResolution(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
|
||||
|
||||
completion_by: DF.Date | None
|
||||
parent: DF.Data
|
||||
parentfield: DF.Data
|
||||
parenttype: DF.Data
|
||||
problem: DF.LongText | None
|
||||
resolution: DF.TextEditor | None
|
||||
responsible: DF.Link | None
|
||||
status: DF.Literal["Open", "Completed"]
|
||||
# end: auto-generated types
|
||||
|
||||
pass
|
||||
|
||||
@@ -7,6 +7,24 @@ from frappe.model.document import Document
|
||||
|
||||
|
||||
class QualityFeedback(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.quality_management.doctype.quality_feedback_parameter.quality_feedback_parameter import (
|
||||
QualityFeedbackParameter,
|
||||
)
|
||||
|
||||
document_name: DF.DynamicLink
|
||||
document_type: DF.Literal["User", "Customer"]
|
||||
parameters: DF.Table[QualityFeedbackParameter]
|
||||
template: DF.Link
|
||||
# end: auto-generated types
|
||||
|
||||
@frappe.whitelist()
|
||||
def set_parameters(self):
|
||||
if self.template and not getattr(self, "parameters", []):
|
||||
|
||||
@@ -7,4 +7,20 @@ from frappe.model.document import Document
|
||||
|
||||
|
||||
class QualityFeedbackParameter(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
|
||||
|
||||
feedback: DF.TextEditor | None
|
||||
parameter: DF.Data | None
|
||||
parent: DF.Data
|
||||
parentfield: DF.Data
|
||||
parenttype: DF.Data
|
||||
rating: DF.Literal["", "1", "2", "3", "4", "5"]
|
||||
# end: auto-generated types
|
||||
|
||||
pass
|
||||
|
||||
@@ -7,4 +7,20 @@ from frappe.model.document import Document
|
||||
|
||||
|
||||
class QualityFeedbackTemplate(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.quality_management.doctype.quality_feedback_template_parameter.quality_feedback_template_parameter import (
|
||||
QualityFeedbackTemplateParameter,
|
||||
)
|
||||
|
||||
parameters: DF.Table[QualityFeedbackTemplateParameter]
|
||||
template: DF.Data
|
||||
# end: auto-generated types
|
||||
|
||||
pass
|
||||
|
||||
@@ -7,4 +7,18 @@ from frappe.model.document import Document
|
||||
|
||||
|
||||
class QualityFeedbackTemplateParameter(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
|
||||
|
||||
parameter: DF.Data | None
|
||||
parent: DF.Data
|
||||
parentfield: DF.Data
|
||||
parenttype: DF.Data
|
||||
# end: auto-generated types
|
||||
|
||||
pass
|
||||
|
||||
@@ -6,5 +6,56 @@ from frappe.model.document import Document
|
||||
|
||||
|
||||
class QualityGoal(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.quality_management.doctype.quality_goal_objective.quality_goal_objective import (
|
||||
QualityGoalObjective,
|
||||
)
|
||||
|
||||
date: DF.Literal[
|
||||
"1",
|
||||
"2",
|
||||
"3",
|
||||
"4",
|
||||
"5",
|
||||
"6",
|
||||
"7",
|
||||
"8",
|
||||
"9",
|
||||
"10",
|
||||
"11",
|
||||
"12",
|
||||
"13",
|
||||
"14",
|
||||
"15",
|
||||
"16",
|
||||
"17",
|
||||
"18",
|
||||
"19",
|
||||
"20",
|
||||
"21",
|
||||
"22",
|
||||
"23",
|
||||
"24",
|
||||
"25",
|
||||
"26",
|
||||
"27",
|
||||
"28",
|
||||
"29",
|
||||
"30",
|
||||
]
|
||||
frequency: DF.Literal["None", "Daily", "Weekly", "Monthly", "Quarterly"]
|
||||
goal: DF.Data
|
||||
objectives: DF.Table[QualityGoalObjective]
|
||||
procedure: DF.Link | None
|
||||
weekday: DF.Literal["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]
|
||||
# end: auto-generated types
|
||||
|
||||
def validate(self):
|
||||
pass
|
||||
|
||||
@@ -7,4 +7,20 @@ from frappe.model.document import Document
|
||||
|
||||
|
||||
class QualityGoalObjective(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
|
||||
|
||||
objective: DF.Text
|
||||
parent: DF.Data
|
||||
parentfield: DF.Data
|
||||
parenttype: DF.Data
|
||||
target: DF.Data | None
|
||||
uom: DF.Link | None
|
||||
# end: auto-generated types
|
||||
|
||||
pass
|
||||
|
||||
@@ -6,4 +6,24 @@ from frappe.model.document import Document
|
||||
|
||||
|
||||
class QualityMeeting(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.quality_management.doctype.quality_meeting_agenda.quality_meeting_agenda import (
|
||||
QualityMeetingAgenda,
|
||||
)
|
||||
from erpnext.quality_management.doctype.quality_meeting_minutes.quality_meeting_minutes import (
|
||||
QualityMeetingMinutes,
|
||||
)
|
||||
|
||||
agenda: DF.Table[QualityMeetingAgenda]
|
||||
minutes: DF.Table[QualityMeetingMinutes]
|
||||
status: DF.Literal["Open", "Closed"]
|
||||
# end: auto-generated types
|
||||
|
||||
pass
|
||||
|
||||
@@ -7,4 +7,18 @@ from frappe.model.document import Document
|
||||
|
||||
|
||||
class QualityMeetingAgenda(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
|
||||
|
||||
agenda: DF.TextEditor | None
|
||||
parent: DF.Data
|
||||
parentfield: DF.Data
|
||||
parenttype: DF.Data
|
||||
# end: auto-generated types
|
||||
|
||||
pass
|
||||
|
||||
@@ -7,4 +7,20 @@ from frappe.model.document import Document
|
||||
|
||||
|
||||
class QualityMeetingMinutes(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
|
||||
|
||||
document_name: DF.DynamicLink | None
|
||||
document_type: DF.Literal["Quality Review", "Quality Action", "Quality Feedback"]
|
||||
minute: DF.TextEditor | None
|
||||
parent: DF.Data
|
||||
parentfield: DF.Data
|
||||
parenttype: DF.Data
|
||||
# end: auto-generated types
|
||||
|
||||
pass
|
||||
|
||||
@@ -8,6 +8,29 @@ from frappe.utils.nestedset import NestedSet
|
||||
|
||||
|
||||
class QualityProcedure(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.quality_management.doctype.quality_procedure_process.quality_procedure_process import (
|
||||
QualityProcedureProcess,
|
||||
)
|
||||
|
||||
is_group: DF.Check
|
||||
lft: DF.Int
|
||||
old_parent: DF.Data | None
|
||||
parent_quality_procedure: DF.Link | None
|
||||
process_owner: DF.Link | None
|
||||
process_owner_full_name: DF.Data | None
|
||||
processes: DF.Table[QualityProcedureProcess]
|
||||
quality_procedure_name: DF.Data
|
||||
rgt: DF.Int
|
||||
# end: auto-generated types
|
||||
|
||||
nsm_parent_field = "parent_quality_procedure"
|
||||
|
||||
def before_save(self):
|
||||
|
||||
@@ -7,4 +7,19 @@ from frappe.model.document import Document
|
||||
|
||||
|
||||
class QualityProcedureProcess(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
|
||||
procedure: DF.Link | None
|
||||
process_description: DF.TextEditor | None
|
||||
# end: auto-generated types
|
||||
|
||||
pass
|
||||
|
||||
@@ -7,6 +7,26 @@ from frappe.model.document import Document
|
||||
|
||||
|
||||
class QualityReview(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.quality_management.doctype.quality_review_objective.quality_review_objective import (
|
||||
QualityReviewObjective,
|
||||
)
|
||||
|
||||
additional_information: DF.Text | None
|
||||
date: DF.Date | None
|
||||
goal: DF.Link
|
||||
procedure: DF.Link | None
|
||||
reviews: DF.Table[QualityReviewObjective]
|
||||
status: DF.Literal["Open", "Passed", "Failed"]
|
||||
# end: auto-generated types
|
||||
|
||||
def validate(self):
|
||||
# fetch targets from goal
|
||||
if not self.reviews:
|
||||
|
||||
@@ -7,4 +7,22 @@ from frappe.model.document import Document
|
||||
|
||||
|
||||
class QualityReviewObjective(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
|
||||
|
||||
objective: DF.Text | None
|
||||
parent: DF.Data
|
||||
parentfield: DF.Data
|
||||
parenttype: DF.Data
|
||||
review: DF.TextEditor | None
|
||||
status: DF.Literal["Open", "Passed", "Failed"]
|
||||
target: DF.Data | None
|
||||
uom: DF.Link | None
|
||||
# end: auto-generated types
|
||||
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user