mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-01 11:19:09 +00:00
feat: enable automatic type annotations (#38452)
This commit is contained in:
@@ -11,6 +11,40 @@ from erpnext.utilities.transaction_base import TransactionBase, delete_events
|
||||
|
||||
|
||||
class MaintenanceSchedule(TransactionBase):
|
||||
# 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.maintenance.doctype.maintenance_schedule_detail.maintenance_schedule_detail import (
|
||||
MaintenanceScheduleDetail,
|
||||
)
|
||||
from erpnext.maintenance.doctype.maintenance_schedule_item.maintenance_schedule_item import (
|
||||
MaintenanceScheduleItem,
|
||||
)
|
||||
|
||||
address_display: DF.SmallText | None
|
||||
amended_from: DF.Link | None
|
||||
company: DF.Link
|
||||
contact_display: DF.SmallText | None
|
||||
contact_email: DF.Data | None
|
||||
contact_mobile: DF.Data | None
|
||||
contact_person: DF.Link | None
|
||||
customer: DF.Link | None
|
||||
customer_address: DF.Link | None
|
||||
customer_group: DF.Link | None
|
||||
customer_name: DF.Data | None
|
||||
items: DF.Table[MaintenanceScheduleItem]
|
||||
naming_series: DF.Literal["MAT-MSH-.YYYY.-"]
|
||||
schedules: DF.Table[MaintenanceScheduleDetail]
|
||||
status: DF.Literal["", "Draft", "Submitted", "Cancelled"]
|
||||
territory: DF.Link | None
|
||||
transaction_date: DF.Date
|
||||
# end: auto-generated types
|
||||
|
||||
@frappe.whitelist()
|
||||
def generate_schedule(self):
|
||||
if self.docstatus != 0:
|
||||
|
||||
@@ -6,4 +6,25 @@ from frappe.model.document import Document
|
||||
|
||||
|
||||
class MaintenanceScheduleDetail(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
|
||||
|
||||
actual_date: DF.Date | None
|
||||
completion_status: DF.Literal["Pending", "Partially Completed", "Fully Completed"]
|
||||
item_code: DF.Link | None
|
||||
item_name: DF.Data | None
|
||||
item_reference: DF.Link | None
|
||||
parent: DF.Data
|
||||
parentfield: DF.Data
|
||||
parenttype: DF.Data
|
||||
sales_person: DF.Link | None
|
||||
scheduled_date: DF.Date
|
||||
serial_no: DF.SmallText | None
|
||||
# end: auto-generated types
|
||||
|
||||
pass
|
||||
|
||||
@@ -6,4 +6,28 @@ from frappe.model.document import Document
|
||||
|
||||
|
||||
class MaintenanceScheduleItem(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.TextEditor | None
|
||||
end_date: DF.Date
|
||||
item_code: DF.Link
|
||||
item_name: DF.Data | None
|
||||
no_of_visits: DF.Int
|
||||
parent: DF.Data
|
||||
parentfield: DF.Data
|
||||
parenttype: DF.Data
|
||||
periodicity: DF.Literal["", "Weekly", "Monthly", "Quarterly", "Half Yearly", "Yearly", "Random"]
|
||||
sales_order: DF.Link | None
|
||||
sales_person: DF.Link | None
|
||||
serial_and_batch_bundle: DF.Link | None
|
||||
serial_no: DF.SmallText | None
|
||||
start_date: DF.Date
|
||||
# end: auto-generated types
|
||||
|
||||
pass
|
||||
|
||||
@@ -10,6 +10,42 @@ from erpnext.utilities.transaction_base import TransactionBase
|
||||
|
||||
|
||||
class MaintenanceVisit(TransactionBase):
|
||||
# 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.maintenance.doctype.maintenance_visit_purpose.maintenance_visit_purpose import (
|
||||
MaintenanceVisitPurpose,
|
||||
)
|
||||
|
||||
address_display: DF.SmallText | None
|
||||
amended_from: DF.Link | None
|
||||
company: DF.Link
|
||||
completion_status: DF.Literal["", "Partially Completed", "Fully Completed"]
|
||||
contact_display: DF.SmallText | None
|
||||
contact_email: DF.Data | None
|
||||
contact_mobile: DF.Data | None
|
||||
contact_person: DF.Link | None
|
||||
customer: DF.Link
|
||||
customer_address: DF.Link | None
|
||||
customer_feedback: DF.SmallText | None
|
||||
customer_group: DF.Link | None
|
||||
customer_name: DF.Data | None
|
||||
maintenance_schedule: DF.Link | None
|
||||
maintenance_schedule_detail: DF.Link | None
|
||||
maintenance_type: DF.Literal["", "Scheduled", "Unscheduled", "Breakdown"]
|
||||
mntc_date: DF.Date
|
||||
mntc_time: DF.Time | None
|
||||
naming_series: DF.Literal["MAT-MVS-.YYYY.-"]
|
||||
purposes: DF.Table[MaintenanceVisitPurpose]
|
||||
status: DF.Literal["", "Draft", "Cancelled", "Submitted"]
|
||||
territory: DF.Link | None
|
||||
# end: auto-generated types
|
||||
|
||||
def validate_serial_no(self):
|
||||
for d in self.get("purposes"):
|
||||
if d.serial_no and not frappe.db.exists("Serial No", d.serial_no):
|
||||
|
||||
@@ -6,4 +6,25 @@ from frappe.model.document import Document
|
||||
|
||||
|
||||
class MaintenanceVisitPurpose(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.TextEditor
|
||||
item_code: DF.Link | None
|
||||
item_name: DF.Data | None
|
||||
parent: DF.Data
|
||||
parentfield: DF.Data
|
||||
parenttype: DF.Data
|
||||
prevdoc_docname: DF.DynamicLink | None
|
||||
prevdoc_doctype: DF.Link | None
|
||||
serial_no: DF.Link | None
|
||||
service_person: DF.Link
|
||||
work_done: DF.SmallText
|
||||
# end: auto-generated types
|
||||
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user