mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-05 13:24:47 +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:
@@ -40,6 +40,81 @@ from erpnext.controllers.accounts_controller import AccountsController
|
||||
|
||||
|
||||
class Asset(AccountsController):
|
||||
# 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.assets.doctype.asset_finance_book.asset_finance_book import AssetFinanceBook
|
||||
|
||||
amended_from: DF.Link | None
|
||||
asset_category: DF.Link | None
|
||||
asset_name: DF.Data
|
||||
asset_owner: DF.Literal["", "Company", "Supplier", "Customer"]
|
||||
asset_owner_company: DF.Link | None
|
||||
asset_quantity: DF.Int
|
||||
available_for_use_date: DF.Date
|
||||
booked_fixed_asset: DF.Check
|
||||
calculate_depreciation: DF.Check
|
||||
capitalized_in: DF.Link | None
|
||||
company: DF.Link
|
||||
comprehensive_insurance: DF.Data | None
|
||||
cost_center: DF.Link | None
|
||||
custodian: DF.Link | None
|
||||
customer: DF.Link | None
|
||||
default_finance_book: DF.Link | None
|
||||
department: DF.Link | None
|
||||
depr_entry_posting_status: DF.Literal["", "Successful", "Failed"]
|
||||
depreciation_method: DF.Literal["", "Straight Line", "Double Declining Balance", "Manual"]
|
||||
disposal_date: DF.Date | None
|
||||
finance_books: DF.Table[AssetFinanceBook]
|
||||
frequency_of_depreciation: DF.Int
|
||||
gross_purchase_amount: DF.Currency
|
||||
image: DF.AttachImage | None
|
||||
insurance_end_date: DF.Date | None
|
||||
insurance_start_date: DF.Date | None
|
||||
insured_value: DF.Data | None
|
||||
insurer: DF.Data | None
|
||||
is_composite_asset: DF.Check
|
||||
is_existing_asset: DF.Check
|
||||
is_fully_depreciated: DF.Check
|
||||
item_code: DF.Link
|
||||
item_name: DF.ReadOnly | None
|
||||
journal_entry_for_scrap: DF.Link | None
|
||||
location: DF.Link
|
||||
maintenance_required: DF.Check
|
||||
naming_series: DF.Literal["ACC-ASS-.YYYY.-"]
|
||||
next_depreciation_date: DF.Date | None
|
||||
number_of_depreciations_booked: DF.Int
|
||||
opening_accumulated_depreciation: DF.Currency
|
||||
policy_number: DF.Data | None
|
||||
purchase_date: DF.Date
|
||||
purchase_invoice: DF.Link | None
|
||||
purchase_receipt: DF.Link | None
|
||||
purchase_receipt_amount: DF.Currency
|
||||
split_from: DF.Link | None
|
||||
status: DF.Literal[
|
||||
"Draft",
|
||||
"Submitted",
|
||||
"Partially Depreciated",
|
||||
"Fully Depreciated",
|
||||
"Sold",
|
||||
"Scrapped",
|
||||
"In Maintenance",
|
||||
"Out of Order",
|
||||
"Issue",
|
||||
"Receipt",
|
||||
"Capitalized",
|
||||
"Decapitalized",
|
||||
]
|
||||
supplier: DF.Link | None
|
||||
total_number_of_depreciations: DF.Int
|
||||
value_after_depreciation: DF.Currency
|
||||
# end: auto-generated types
|
||||
|
||||
def validate(self):
|
||||
self.validate_asset_values()
|
||||
self.validate_asset_and_reference()
|
||||
|
||||
@@ -6,6 +6,20 @@ from frappe.model.document import Document
|
||||
|
||||
|
||||
class AssetActivity(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
|
||||
|
||||
asset: DF.Link
|
||||
date: DF.Datetime
|
||||
subject: DF.SmallText
|
||||
user: DF.Link
|
||||
# end: auto-generated types
|
||||
|
||||
pass
|
||||
|
||||
|
||||
|
||||
@@ -49,6 +49,61 @@ force_fields = [
|
||||
|
||||
|
||||
class AssetCapitalization(StockController):
|
||||
# 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.assets.doctype.asset_capitalization_asset_item.asset_capitalization_asset_item import (
|
||||
AssetCapitalizationAssetItem,
|
||||
)
|
||||
from erpnext.assets.doctype.asset_capitalization_service_item.asset_capitalization_service_item import (
|
||||
AssetCapitalizationServiceItem,
|
||||
)
|
||||
from erpnext.assets.doctype.asset_capitalization_stock_item.asset_capitalization_stock_item import (
|
||||
AssetCapitalizationStockItem,
|
||||
)
|
||||
|
||||
amended_from: DF.Link | None
|
||||
asset_items: DF.Table[AssetCapitalizationAssetItem]
|
||||
asset_items_total: DF.Currency
|
||||
capitalization_method: DF.Literal[
|
||||
"", "Create a new composite asset", "Choose a WIP composite asset"
|
||||
]
|
||||
company: DF.Link
|
||||
cost_center: DF.Link | None
|
||||
entry_type: DF.Literal["Capitalization", "Decapitalization"]
|
||||
finance_book: DF.Link | None
|
||||
naming_series: DF.Literal["ACC-ASC-.YYYY.-"]
|
||||
posting_date: DF.Date
|
||||
posting_time: DF.Time
|
||||
service_items: DF.Table[AssetCapitalizationServiceItem]
|
||||
service_items_total: DF.Currency
|
||||
set_posting_time: DF.Check
|
||||
stock_items: DF.Table[AssetCapitalizationStockItem]
|
||||
stock_items_total: DF.Currency
|
||||
target_asset: DF.Link | None
|
||||
target_asset_location: DF.Link | None
|
||||
target_asset_name: DF.Data | None
|
||||
target_batch_no: DF.Link | None
|
||||
target_fixed_asset_account: DF.Link | None
|
||||
target_has_batch_no: DF.Check
|
||||
target_has_serial_no: DF.Check
|
||||
target_incoming_rate: DF.Currency
|
||||
target_is_fixed_asset: DF.Check
|
||||
target_item_code: DF.Link | None
|
||||
target_item_name: DF.Data | None
|
||||
target_qty: DF.Float
|
||||
target_serial_no: DF.SmallText | None
|
||||
target_stock_uom: DF.Link | None
|
||||
target_warehouse: DF.Link | None
|
||||
title: DF.Data | None
|
||||
total_value: DF.Currency
|
||||
# end: auto-generated types
|
||||
|
||||
def validate(self):
|
||||
self.validate_posting_time()
|
||||
self.set_missing_values(for_validate=True)
|
||||
|
||||
@@ -6,4 +6,26 @@ from frappe.model.document import Document
|
||||
|
||||
|
||||
class AssetCapitalizationAssetItem(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
|
||||
|
||||
asset: DF.Link
|
||||
asset_name: DF.Data | None
|
||||
asset_value: DF.Currency
|
||||
cost_center: DF.Link | None
|
||||
current_asset_value: DF.Currency
|
||||
finance_book: DF.Link | None
|
||||
fixed_asset_account: DF.Link | None
|
||||
item_code: DF.Link
|
||||
item_name: DF.Data | None
|
||||
parent: DF.Data
|
||||
parentfield: DF.Data
|
||||
parenttype: DF.Data
|
||||
# end: auto-generated types
|
||||
|
||||
pass
|
||||
|
||||
@@ -6,4 +6,25 @@ from frappe.model.document import Document
|
||||
|
||||
|
||||
class AssetCapitalizationServiceItem(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
|
||||
|
||||
amount: DF.Currency
|
||||
cost_center: DF.Link | None
|
||||
expense_account: DF.Link
|
||||
item_code: DF.Link | None
|
||||
item_name: DF.Data | None
|
||||
parent: DF.Data
|
||||
parentfield: DF.Data
|
||||
parenttype: DF.Data
|
||||
qty: DF.Float
|
||||
rate: DF.Currency
|
||||
uom: DF.Link | None
|
||||
# end: auto-generated types
|
||||
|
||||
pass
|
||||
|
||||
@@ -6,4 +6,29 @@ from frappe.model.document import Document
|
||||
|
||||
|
||||
class AssetCapitalizationStockItem(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_qty: DF.Float
|
||||
amount: DF.Currency
|
||||
batch_no: DF.Link | None
|
||||
cost_center: DF.Link | None
|
||||
item_code: DF.Link
|
||||
item_name: DF.Data | None
|
||||
parent: DF.Data
|
||||
parentfield: DF.Data
|
||||
parenttype: DF.Data
|
||||
serial_and_batch_bundle: DF.Link | None
|
||||
serial_no: DF.SmallText | None
|
||||
stock_qty: DF.Float
|
||||
stock_uom: DF.Link
|
||||
valuation_rate: DF.Currency
|
||||
warehouse: DF.Link
|
||||
# end: auto-generated types
|
||||
|
||||
pass
|
||||
|
||||
@@ -9,6 +9,25 @@ from frappe.utils import cint, get_link_to_form
|
||||
|
||||
|
||||
class AssetCategory(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.assets.doctype.asset_category_account.asset_category_account import (
|
||||
AssetCategoryAccount,
|
||||
)
|
||||
from erpnext.assets.doctype.asset_finance_book.asset_finance_book import AssetFinanceBook
|
||||
|
||||
accounts: DF.Table[AssetCategoryAccount]
|
||||
asset_category_name: DF.Data
|
||||
enable_cwip_accounting: DF.Check
|
||||
finance_books: DF.Table[AssetFinanceBook]
|
||||
# end: auto-generated types
|
||||
|
||||
def validate(self):
|
||||
self.validate_finance_books()
|
||||
self.validate_account_types()
|
||||
|
||||
@@ -6,4 +6,22 @@ from frappe.model.document import Document
|
||||
|
||||
|
||||
class AssetCategoryAccount(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
|
||||
|
||||
accumulated_depreciation_account: DF.Link | None
|
||||
capital_work_in_progress_account: DF.Link | None
|
||||
company_name: DF.Link
|
||||
depreciation_expense_account: DF.Link | None
|
||||
fixed_asset_account: DF.Link
|
||||
parent: DF.Data
|
||||
parentfield: DF.Data
|
||||
parenttype: DF.Data
|
||||
# end: auto-generated types
|
||||
|
||||
pass
|
||||
|
||||
@@ -21,6 +21,40 @@ import erpnext
|
||||
|
||||
|
||||
class AssetDepreciationSchedule(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.assets.doctype.depreciation_schedule.depreciation_schedule import (
|
||||
DepreciationSchedule,
|
||||
)
|
||||
|
||||
amended_from: DF.Link | None
|
||||
asset: DF.Link
|
||||
daily_prorata_based: DF.Check
|
||||
depreciation_method: DF.Literal[
|
||||
"", "Straight Line", "Double Declining Balance", "Written Down Value", "Manual"
|
||||
]
|
||||
depreciation_schedule: DF.Table[DepreciationSchedule]
|
||||
expected_value_after_useful_life: DF.Currency
|
||||
finance_book: DF.Link | None
|
||||
finance_book_id: DF.Int
|
||||
frequency_of_depreciation: DF.Int
|
||||
gross_purchase_amount: DF.Currency
|
||||
naming_series: DF.Literal["ACC-ADS-.YYYY.-"]
|
||||
notes: DF.SmallText | None
|
||||
number_of_depreciations_booked: DF.Int
|
||||
opening_accumulated_depreciation: DF.Currency
|
||||
rate_of_depreciation: DF.Percent
|
||||
shift_based: DF.Check
|
||||
status: DF.Literal["Draft", "Active", "Cancelled"]
|
||||
total_number_of_depreciations: DF.Int
|
||||
# end: auto-generated types
|
||||
|
||||
def before_save(self):
|
||||
if not self.finance_book_id:
|
||||
self.prepare_draft_asset_depr_schedule_data_from_asset_name_and_fb_name(
|
||||
|
||||
@@ -6,4 +6,30 @@ from frappe.model.document import Document
|
||||
|
||||
|
||||
class AssetFinanceBook(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
|
||||
|
||||
daily_prorata_based: DF.Check
|
||||
depreciation_method: DF.Literal[
|
||||
"", "Straight Line", "Double Declining Balance", "Written Down Value", "Manual"
|
||||
]
|
||||
depreciation_start_date: DF.Date | None
|
||||
expected_value_after_useful_life: DF.Currency
|
||||
finance_book: DF.Link | None
|
||||
frequency_of_depreciation: DF.Int
|
||||
parent: DF.Data
|
||||
parentfield: DF.Data
|
||||
parenttype: DF.Data
|
||||
rate_of_depreciation: DF.Percent
|
||||
salvage_value_percentage: DF.Percent
|
||||
shift_based: DF.Check
|
||||
total_number_of_depreciations: DF.Int
|
||||
value_after_depreciation: DF.Currency
|
||||
# end: auto-generated types
|
||||
|
||||
pass
|
||||
|
||||
@@ -10,6 +10,29 @@ from frappe.utils import add_days, add_months, add_years, getdate, nowdate
|
||||
|
||||
|
||||
class AssetMaintenance(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.assets.doctype.asset_maintenance_task.asset_maintenance_task import (
|
||||
AssetMaintenanceTask,
|
||||
)
|
||||
|
||||
asset_category: DF.ReadOnly | None
|
||||
asset_maintenance_tasks: DF.Table[AssetMaintenanceTask]
|
||||
asset_name: DF.Link
|
||||
company: DF.Link
|
||||
item_code: DF.ReadOnly | None
|
||||
item_name: DF.ReadOnly | None
|
||||
maintenance_manager: DF.Data | None
|
||||
maintenance_manager_name: DF.ReadOnly | None
|
||||
maintenance_team: DF.Link
|
||||
# end: auto-generated types
|
||||
|
||||
def validate(self):
|
||||
for task in self.get("asset_maintenance_tasks"):
|
||||
if task.end_date and (getdate(task.start_date) >= getdate(task.end_date)):
|
||||
|
||||
@@ -11,6 +11,34 @@ from erpnext.assets.doctype.asset_maintenance.asset_maintenance import calculate
|
||||
|
||||
|
||||
class AssetMaintenanceLog(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
|
||||
|
||||
actions_performed: DF.TextEditor | None
|
||||
amended_from: DF.Link | None
|
||||
asset_maintenance: DF.Link | None
|
||||
asset_name: DF.ReadOnly | None
|
||||
assign_to_name: DF.ReadOnly | None
|
||||
certificate_attachement: DF.Attach | None
|
||||
completion_date: DF.Date | None
|
||||
description: DF.ReadOnly | None
|
||||
due_date: DF.Date | None
|
||||
has_certificate: DF.Check
|
||||
item_code: DF.ReadOnly | None
|
||||
item_name: DF.ReadOnly | None
|
||||
maintenance_status: DF.Literal["Planned", "Completed", "Cancelled", "Overdue"]
|
||||
maintenance_type: DF.ReadOnly | None
|
||||
naming_series: DF.Literal["ACC-AML-.YYYY.-"]
|
||||
periodicity: DF.Data | None
|
||||
task: DF.Link | None
|
||||
task_name: DF.Data | None
|
||||
# end: auto-generated types
|
||||
|
||||
def validate(self):
|
||||
if getdate(self.due_date) < getdate(nowdate()) and self.maintenance_status not in [
|
||||
"Completed",
|
||||
|
||||
@@ -6,4 +6,31 @@ from frappe.model.document import Document
|
||||
|
||||
|
||||
class AssetMaintenanceTask(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
|
||||
|
||||
assign_to: DF.Link | None
|
||||
assign_to_name: DF.ReadOnly | None
|
||||
certificate_required: DF.Check
|
||||
description: DF.TextEditor | None
|
||||
end_date: DF.Date | None
|
||||
last_completion_date: DF.Date | None
|
||||
maintenance_status: DF.Literal["Planned", "Overdue", "Cancelled"]
|
||||
maintenance_task: DF.Data
|
||||
maintenance_type: DF.Literal["Preventive Maintenance", "Calibration"]
|
||||
next_due_date: DF.Date | None
|
||||
parent: DF.Data
|
||||
parentfield: DF.Data
|
||||
parenttype: DF.Data
|
||||
periodicity: DF.Literal[
|
||||
"", "Daily", "Weekly", "Monthly", "Quarterly", "Half-yearly", "Yearly", "2 Yearly", "3 Yearly"
|
||||
]
|
||||
start_date: DF.Date
|
||||
# end: auto-generated types
|
||||
|
||||
pass
|
||||
|
||||
@@ -6,4 +6,23 @@ from frappe.model.document import Document
|
||||
|
||||
|
||||
class AssetMaintenanceTeam(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.assets.doctype.maintenance_team_member.maintenance_team_member import (
|
||||
MaintenanceTeamMember,
|
||||
)
|
||||
|
||||
company: DF.Link
|
||||
maintenance_manager: DF.Link | None
|
||||
maintenance_manager_name: DF.ReadOnly | None
|
||||
maintenance_team_members: DF.Table[MaintenanceTeamMember]
|
||||
maintenance_team_name: DF.Data
|
||||
# end: auto-generated types
|
||||
|
||||
pass
|
||||
|
||||
@@ -11,6 +11,25 @@ from erpnext.assets.doctype.asset_activity.asset_activity import add_asset_activ
|
||||
|
||||
|
||||
class AssetMovement(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.assets.doctype.asset_movement_item.asset_movement_item import AssetMovementItem
|
||||
|
||||
amended_from: DF.Link | None
|
||||
assets: DF.Table[AssetMovementItem]
|
||||
company: DF.Link
|
||||
purpose: DF.Literal["", "Issue", "Receipt", "Transfer"]
|
||||
reference_doctype: DF.Link | None
|
||||
reference_name: DF.DynamicLink | None
|
||||
transaction_date: DF.Datetime
|
||||
# end: auto-generated types
|
||||
|
||||
def validate(self):
|
||||
self.validate_asset()
|
||||
self.validate_location()
|
||||
|
||||
@@ -7,4 +7,24 @@ from frappe.model.document import Document
|
||||
|
||||
|
||||
class AssetMovementItem(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
|
||||
|
||||
asset: DF.Link
|
||||
asset_name: DF.Data | None
|
||||
company: DF.Link | None
|
||||
from_employee: DF.Link | None
|
||||
parent: DF.Data
|
||||
parentfield: DF.Data
|
||||
parenttype: DF.Data
|
||||
source_location: DF.Link | None
|
||||
target_location: DF.Link | None
|
||||
to_employee: DF.Link | None
|
||||
# end: auto-generated types
|
||||
|
||||
pass
|
||||
|
||||
@@ -17,6 +17,42 @@ from erpnext.controllers.accounts_controller import AccountsController
|
||||
|
||||
|
||||
class AssetRepair(AccountsController):
|
||||
# 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.assets.doctype.asset_repair_consumed_item.asset_repair_consumed_item import (
|
||||
AssetRepairConsumedItem,
|
||||
)
|
||||
|
||||
actions_performed: DF.LongText | None
|
||||
amended_from: DF.Link | None
|
||||
asset: DF.Link
|
||||
asset_name: DF.ReadOnly | None
|
||||
capitalize_repair_cost: DF.Check
|
||||
company: DF.Link | None
|
||||
completion_date: DF.Datetime | None
|
||||
cost_center: DF.Link | None
|
||||
description: DF.LongText | None
|
||||
downtime: DF.Data | None
|
||||
failure_date: DF.Datetime
|
||||
increase_in_asset_life: DF.Int
|
||||
naming_series: DF.Literal["ACC-ASR-.YYYY.-"]
|
||||
project: DF.Link | None
|
||||
purchase_invoice: DF.Link | None
|
||||
repair_cost: DF.Currency
|
||||
repair_status: DF.Literal["Pending", "Completed", "Cancelled"]
|
||||
stock_consumption: DF.Check
|
||||
stock_entry: DF.Link | None
|
||||
stock_items: DF.Table[AssetRepairConsumedItem]
|
||||
total_repair_cost: DF.Currency
|
||||
warehouse: DF.Link | None
|
||||
# end: auto-generated types
|
||||
|
||||
def validate(self):
|
||||
self.asset_doc = frappe.get_doc("Asset", self.asset)
|
||||
self.update_status()
|
||||
|
||||
@@ -6,4 +6,23 @@ from frappe.model.document import Document
|
||||
|
||||
|
||||
class AssetRepairConsumedItem(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
|
||||
|
||||
consumed_quantity: DF.Data | None
|
||||
item_code: DF.Link | None
|
||||
parent: DF.Data
|
||||
parentfield: DF.Data
|
||||
parenttype: DF.Data
|
||||
serial_and_batch_bundle: DF.Link | None
|
||||
serial_no: DF.SmallText | None
|
||||
total_value: DF.Currency
|
||||
valuation_rate: DF.Currency
|
||||
# end: auto-generated types
|
||||
|
||||
pass
|
||||
|
||||
@@ -22,6 +22,25 @@ from erpnext.assets.doctype.asset_depreciation_schedule.asset_depreciation_sched
|
||||
|
||||
|
||||
class AssetShiftAllocation(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.assets.doctype.depreciation_schedule.depreciation_schedule import (
|
||||
DepreciationSchedule,
|
||||
)
|
||||
|
||||
amended_from: DF.Link | None
|
||||
asset: DF.Link
|
||||
depreciation_schedule: DF.Table[DepreciationSchedule]
|
||||
finance_book: DF.Link | None
|
||||
naming_series: DF.Literal["ACC-ASA-.YYYY.-"]
|
||||
# end: auto-generated types
|
||||
|
||||
def after_insert(self):
|
||||
self.fetch_and_set_depr_schedule()
|
||||
|
||||
|
||||
@@ -7,6 +7,19 @@ from frappe.model.document import Document
|
||||
|
||||
|
||||
class AssetShiftFactor(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
|
||||
|
||||
default: DF.Check
|
||||
shift_factor: DF.Float
|
||||
shift_name: DF.Data
|
||||
# end: auto-generated types
|
||||
|
||||
def validate(self):
|
||||
self.validate_default()
|
||||
|
||||
|
||||
@@ -19,6 +19,27 @@ from erpnext.assets.doctype.asset_depreciation_schedule.asset_depreciation_sched
|
||||
|
||||
|
||||
class AssetValueAdjustment(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
|
||||
asset: DF.Link
|
||||
asset_category: DF.ReadOnly | None
|
||||
company: DF.Link | None
|
||||
cost_center: DF.Link | None
|
||||
current_asset_value: DF.Currency
|
||||
date: DF.Date
|
||||
difference_amount: DF.Currency
|
||||
finance_book: DF.Link | None
|
||||
journal_entry: DF.Link | None
|
||||
new_asset_value: DF.Currency
|
||||
# end: auto-generated types
|
||||
|
||||
def validate(self):
|
||||
self.validate_date()
|
||||
self.set_current_asset_value()
|
||||
|
||||
@@ -6,4 +6,22 @@ from frappe.model.document import Document
|
||||
|
||||
|
||||
class DepreciationSchedule(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
|
||||
|
||||
accumulated_depreciation_amount: DF.Currency
|
||||
depreciation_amount: DF.Currency
|
||||
journal_entry: DF.Link | None
|
||||
parent: DF.Data
|
||||
parentfield: DF.Data
|
||||
parenttype: DF.Data
|
||||
schedule_date: DF.Date
|
||||
shift: DF.Link | None
|
||||
# end: auto-generated types
|
||||
|
||||
pass
|
||||
|
||||
@@ -6,4 +6,18 @@ from frappe.model.document import Document
|
||||
|
||||
|
||||
class LinkedLocation(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
|
||||
|
||||
location: DF.Link
|
||||
parent: DF.Data
|
||||
parentfield: DF.Data
|
||||
parenttype: DF.Data
|
||||
# end: auto-generated types
|
||||
|
||||
pass
|
||||
|
||||
@@ -13,6 +13,27 @@ EARTH_RADIUS = 6378137
|
||||
|
||||
|
||||
class Location(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
|
||||
|
||||
area: DF.Float
|
||||
area_uom: DF.Link | None
|
||||
is_container: DF.Check
|
||||
is_group: DF.Check
|
||||
latitude: DF.Float
|
||||
lft: DF.Int
|
||||
location_name: DF.Data
|
||||
longitude: DF.Float
|
||||
old_parent: DF.Data | None
|
||||
parent_location: DF.Link | None
|
||||
rgt: DF.Int
|
||||
# end: auto-generated types
|
||||
|
||||
nsm_parent_field = "parent_location"
|
||||
|
||||
def validate(self):
|
||||
|
||||
@@ -6,4 +6,20 @@ from frappe.model.document import Document
|
||||
|
||||
|
||||
class MaintenanceTeamMember(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
|
||||
|
||||
full_name: DF.Data | None
|
||||
maintenance_role: DF.Link
|
||||
parent: DF.Data
|
||||
parentfield: DF.Data
|
||||
parenttype: DF.Data
|
||||
team_member: DF.Link
|
||||
# end: auto-generated types
|
||||
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user