mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-03 12:19:12 +00:00
feat: enable automatic type annotations (#38452)
This commit is contained in:
@@ -8,6 +8,25 @@ from frappe.utils import flt
|
||||
|
||||
|
||||
class SubcontractingBOM(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
|
||||
|
||||
conversion_factor: DF.Float
|
||||
finished_good: DF.Link
|
||||
finished_good_bom: DF.Link
|
||||
finished_good_qty: DF.Float
|
||||
finished_good_uom: DF.Link | None
|
||||
is_active: DF.Check
|
||||
service_item: DF.Link
|
||||
service_item_qty: DF.Float
|
||||
service_item_uom: DF.Link
|
||||
# end: auto-generated types
|
||||
|
||||
def validate(self):
|
||||
self.validate_finished_good()
|
||||
self.validate_service_item()
|
||||
|
||||
@@ -13,6 +13,73 @@ from erpnext.stock.utils import get_bin
|
||||
|
||||
|
||||
class SubcontractingOrder(SubcontractingController):
|
||||
# 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.stock.doctype.landed_cost_taxes_and_charges.landed_cost_taxes_and_charges import (
|
||||
LandedCostTaxesandCharges,
|
||||
)
|
||||
from erpnext.subcontracting.doctype.subcontracting_order_item.subcontracting_order_item import (
|
||||
SubcontractingOrderItem,
|
||||
)
|
||||
from erpnext.subcontracting.doctype.subcontracting_order_service_item.subcontracting_order_service_item import (
|
||||
SubcontractingOrderServiceItem,
|
||||
)
|
||||
from erpnext.subcontracting.doctype.subcontracting_order_supplied_item.subcontracting_order_supplied_item import (
|
||||
SubcontractingOrderSuppliedItem,
|
||||
)
|
||||
|
||||
additional_costs: DF.Table[LandedCostTaxesandCharges]
|
||||
address_display: DF.SmallText | None
|
||||
amended_from: DF.Link | None
|
||||
billing_address: DF.Link | None
|
||||
billing_address_display: DF.SmallText | None
|
||||
company: DF.Link
|
||||
contact_display: DF.SmallText | None
|
||||
contact_email: DF.SmallText | None
|
||||
contact_mobile: DF.SmallText | None
|
||||
contact_person: DF.Link | None
|
||||
cost_center: DF.Link | None
|
||||
distribute_additional_costs_based_on: DF.Literal["Qty", "Amount"]
|
||||
items: DF.Table[SubcontractingOrderItem]
|
||||
letter_head: DF.Link | None
|
||||
naming_series: DF.Literal["SC-ORD-.YYYY.-"]
|
||||
per_received: DF.Percent
|
||||
project: DF.Link | None
|
||||
purchase_order: DF.Link
|
||||
schedule_date: DF.Date | None
|
||||
select_print_heading: DF.Link | None
|
||||
service_items: DF.Table[SubcontractingOrderServiceItem]
|
||||
set_reserve_warehouse: DF.Link | None
|
||||
set_warehouse: DF.Link | None
|
||||
shipping_address: DF.Link | None
|
||||
shipping_address_display: DF.SmallText | None
|
||||
status: DF.Literal[
|
||||
"Draft",
|
||||
"Open",
|
||||
"Partially Received",
|
||||
"Completed",
|
||||
"Material Transferred",
|
||||
"Partial Material Transferred",
|
||||
"Cancelled",
|
||||
]
|
||||
supplied_items: DF.Table[SubcontractingOrderSuppliedItem]
|
||||
supplier: DF.Link
|
||||
supplier_address: DF.Link | None
|
||||
supplier_name: DF.Data
|
||||
supplier_warehouse: DF.Link
|
||||
title: DF.Data | None
|
||||
total: DF.Currency
|
||||
total_additional_costs: DF.Currency
|
||||
total_qty: DF.Float
|
||||
transaction_date: DF.Date
|
||||
# end: auto-generated types
|
||||
|
||||
def before_validate(self):
|
||||
super(SubcontractingOrder, self).before_validate()
|
||||
|
||||
|
||||
@@ -6,4 +6,43 @@ from frappe.model.document import Document
|
||||
|
||||
|
||||
class SubcontractingOrderItem(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
|
||||
|
||||
additional_cost_per_qty: DF.Currency
|
||||
amount: DF.Currency
|
||||
bom: DF.Link
|
||||
conversion_factor: DF.Float
|
||||
cost_center: DF.Link | None
|
||||
description: DF.TextEditor
|
||||
expected_delivery_date: DF.Date | None
|
||||
expense_account: DF.Link | None
|
||||
image: DF.Attach | None
|
||||
include_exploded_items: DF.Check
|
||||
item_code: DF.Link
|
||||
item_name: DF.Data
|
||||
manufacturer: DF.Link | None
|
||||
manufacturer_part_no: DF.Data | None
|
||||
page_break: DF.Check
|
||||
parent: DF.Data
|
||||
parentfield: DF.Data
|
||||
parenttype: DF.Data
|
||||
project: DF.Link | None
|
||||
purchase_order_item: DF.Data | None
|
||||
qty: DF.Float
|
||||
rate: DF.Currency
|
||||
received_qty: DF.Float
|
||||
returned_qty: DF.Float
|
||||
rm_cost_per_qty: DF.Currency
|
||||
schedule_date: DF.Date | None
|
||||
service_cost_per_qty: DF.Currency
|
||||
stock_uom: DF.Link
|
||||
warehouse: DF.Link
|
||||
# end: auto-generated types
|
||||
|
||||
pass
|
||||
|
||||
@@ -6,4 +6,25 @@ from frappe.model.document import Document
|
||||
|
||||
|
||||
class SubcontractingOrderServiceItem(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
|
||||
fg_item: DF.Link
|
||||
fg_item_qty: DF.Float
|
||||
item_code: DF.Link
|
||||
item_name: DF.Data
|
||||
parent: DF.Data
|
||||
parentfield: DF.Data
|
||||
parenttype: DF.Data
|
||||
purchase_order_item: DF.Data | None
|
||||
qty: DF.Float
|
||||
rate: DF.Currency
|
||||
# end: auto-generated types
|
||||
|
||||
pass
|
||||
|
||||
@@ -6,4 +6,31 @@ from frappe.model.document import Document
|
||||
|
||||
|
||||
class SubcontractingOrderSuppliedItem(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
|
||||
bom_detail_no: DF.Data | None
|
||||
consumed_qty: DF.Float
|
||||
conversion_factor: DF.Float
|
||||
main_item_code: DF.Link | None
|
||||
parent: DF.Data
|
||||
parentfield: DF.Data
|
||||
parenttype: DF.Data
|
||||
rate: DF.Currency
|
||||
reference_name: DF.Data | None
|
||||
required_qty: DF.Float
|
||||
reserve_warehouse: DF.Link | None
|
||||
returned_qty: DF.Float
|
||||
rm_item_code: DF.Link | None
|
||||
stock_uom: DF.Link | None
|
||||
supplied_qty: DF.Float
|
||||
total_supplied_qty: DF.Float
|
||||
# end: auto-generated types
|
||||
|
||||
pass
|
||||
|
||||
@@ -13,6 +13,76 @@ from erpnext.stock.stock_ledger import get_valuation_rate
|
||||
|
||||
|
||||
class SubcontractingReceipt(SubcontractingController):
|
||||
# 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.stock.doctype.landed_cost_taxes_and_charges.landed_cost_taxes_and_charges import (
|
||||
LandedCostTaxesandCharges,
|
||||
)
|
||||
from erpnext.subcontracting.doctype.subcontracting_receipt_item.subcontracting_receipt_item import (
|
||||
SubcontractingReceiptItem,
|
||||
)
|
||||
from erpnext.subcontracting.doctype.subcontracting_receipt_supplied_item.subcontracting_receipt_supplied_item import (
|
||||
SubcontractingReceiptSuppliedItem,
|
||||
)
|
||||
|
||||
additional_costs: DF.Table[LandedCostTaxesandCharges]
|
||||
address_display: DF.SmallText | None
|
||||
amended_from: DF.Link | None
|
||||
auto_repeat: DF.Link | None
|
||||
bill_date: DF.Date | None
|
||||
bill_no: DF.Data | None
|
||||
billing_address: DF.Link | None
|
||||
billing_address_display: DF.SmallText | None
|
||||
company: DF.Link
|
||||
contact_display: DF.SmallText | None
|
||||
contact_email: DF.SmallText | None
|
||||
contact_mobile: DF.SmallText | None
|
||||
contact_person: DF.Link | None
|
||||
cost_center: DF.Link | None
|
||||
distribute_additional_costs_based_on: DF.Literal["Qty", "Amount"]
|
||||
in_words: DF.Data | None
|
||||
instructions: DF.SmallText | None
|
||||
is_return: DF.Check
|
||||
items: DF.Table[SubcontractingReceiptItem]
|
||||
language: DF.Data | None
|
||||
letter_head: DF.Link | None
|
||||
lr_date: DF.Date | None
|
||||
lr_no: DF.Data | None
|
||||
naming_series: DF.Literal["MAT-SCR-.YYYY.-", "MAT-SCR-RET-.YYYY.-"]
|
||||
per_returned: DF.Percent
|
||||
posting_date: DF.Date
|
||||
posting_time: DF.Time
|
||||
project: DF.Link | None
|
||||
range: DF.Data | None
|
||||
rejected_warehouse: DF.Link | None
|
||||
remarks: DF.SmallText | None
|
||||
represents_company: DF.Link | None
|
||||
return_against: DF.Link | None
|
||||
select_print_heading: DF.Link | None
|
||||
set_posting_time: DF.Check
|
||||
set_warehouse: DF.Link | None
|
||||
shipping_address: DF.Link | None
|
||||
shipping_address_display: DF.SmallText | None
|
||||
status: DF.Literal["", "Draft", "Completed", "Return", "Return Issued", "Cancelled", "Closed"]
|
||||
supplied_items: DF.Table[SubcontractingReceiptSuppliedItem]
|
||||
supplier: DF.Link
|
||||
supplier_address: DF.Link | None
|
||||
supplier_delivery_note: DF.Data | None
|
||||
supplier_name: DF.Data | None
|
||||
supplier_warehouse: DF.Link | None
|
||||
title: DF.Data | None
|
||||
total: DF.Currency
|
||||
total_additional_costs: DF.Currency
|
||||
total_qty: DF.Float
|
||||
transporter_name: DF.Data | None
|
||||
# end: auto-generated types
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(SubcontractingReceipt, self).__init__(*args, **kwargs)
|
||||
self.status_updater = [
|
||||
|
||||
@@ -6,4 +6,59 @@ from frappe.model.document import Document
|
||||
|
||||
|
||||
class SubcontractingReceiptItem(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
|
||||
|
||||
additional_cost_per_qty: DF.Currency
|
||||
amount: DF.Currency
|
||||
batch_no: DF.Link | None
|
||||
bom: DF.Link | None
|
||||
brand: DF.Link | None
|
||||
conversion_factor: DF.Float
|
||||
cost_center: DF.Link | None
|
||||
description: DF.TextEditor | None
|
||||
expense_account: DF.Link | None
|
||||
image: DF.Attach | None
|
||||
include_exploded_items: DF.Check
|
||||
is_scrap_item: DF.Check
|
||||
item_code: DF.Link
|
||||
item_name: DF.Data | None
|
||||
manufacturer: DF.Link | None
|
||||
manufacturer_part_no: DF.Data | None
|
||||
page_break: DF.Check
|
||||
parent: DF.Data
|
||||
parentfield: DF.Data
|
||||
parenttype: DF.Data
|
||||
project: DF.Link | None
|
||||
purchase_order: DF.Link | None
|
||||
purchase_order_item: DF.Data | None
|
||||
qty: DF.Float
|
||||
quality_inspection: DF.Link | None
|
||||
rate: DF.Currency
|
||||
received_qty: DF.Float
|
||||
reference_name: DF.Data | None
|
||||
rejected_qty: DF.Float
|
||||
rejected_serial_and_batch_bundle: DF.Link | None
|
||||
rejected_serial_no: DF.SmallText | None
|
||||
rejected_warehouse: DF.Link | None
|
||||
returned_qty: DF.Float
|
||||
rm_cost_per_qty: DF.Currency
|
||||
rm_supp_cost: DF.Currency
|
||||
schedule_date: DF.Date | None
|
||||
scrap_cost_per_qty: DF.Float
|
||||
serial_and_batch_bundle: DF.Link | None
|
||||
serial_no: DF.SmallText | None
|
||||
service_cost_per_qty: DF.Currency
|
||||
stock_uom: DF.Link
|
||||
subcontracting_order: DF.Link | None
|
||||
subcontracting_order_item: DF.Data | None
|
||||
subcontracting_receipt_item: DF.Data | None
|
||||
warehouse: DF.Link | None
|
||||
# end: auto-generated types
|
||||
|
||||
pass
|
||||
|
||||
@@ -6,4 +6,35 @@ from frappe.model.document import Document
|
||||
|
||||
|
||||
class SubcontractingReceiptSuppliedItem(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
|
||||
available_qty_for_consumption: DF.Float
|
||||
batch_no: DF.Link | None
|
||||
bom_detail_no: DF.Data | None
|
||||
consumed_qty: DF.Float
|
||||
conversion_factor: DF.Float
|
||||
current_stock: DF.Float
|
||||
description: DF.TextEditor | None
|
||||
item_name: DF.Data | None
|
||||
main_item_code: DF.Link | None
|
||||
parent: DF.Data
|
||||
parentfield: DF.Data
|
||||
parenttype: DF.Data
|
||||
rate: DF.Currency
|
||||
reference_name: DF.Data | None
|
||||
required_qty: DF.Float
|
||||
rm_item_code: DF.Link | None
|
||||
serial_and_batch_bundle: DF.Link | None
|
||||
serial_no: DF.Text | None
|
||||
stock_uom: DF.Link | None
|
||||
subcontracting_order: DF.Link | None
|
||||
# end: auto-generated types
|
||||
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user