mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-04 04:39:11 +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:
@@ -9,6 +9,38 @@ from frappe.model.document import Document
|
||||
|
||||
|
||||
class BuyingSettings(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
|
||||
|
||||
allow_multiple_items: DF.Check
|
||||
auto_create_purchase_receipt: DF.Check
|
||||
auto_create_subcontracting_order: DF.Check
|
||||
backflush_raw_materials_of_subcontract_based_on: DF.Literal[
|
||||
"BOM", "Material Transferred for Subcontract"
|
||||
]
|
||||
bill_for_rejected_quantity_in_purchase_invoice: DF.Check
|
||||
blanket_order_allowance: DF.Float
|
||||
buying_price_list: DF.Link | None
|
||||
disable_last_purchase_rate: DF.Check
|
||||
maintain_same_rate: DF.Check
|
||||
maintain_same_rate_action: DF.Literal["Stop", "Warn"]
|
||||
over_transfer_allowance: DF.Float
|
||||
po_required: DF.Literal["No", "Yes"]
|
||||
pr_required: DF.Literal["No", "Yes"]
|
||||
project_update_frequency: DF.Literal["Each Transaction", "Manual"]
|
||||
role_to_override_stop_action: DF.Link | None
|
||||
set_landed_cost_based_on_purchase_invoice_rate: DF.Check
|
||||
show_pay_button: DF.Check
|
||||
supp_master_name: DF.Literal["Supplier Name", "Naming Series", "Auto Name"]
|
||||
supplier_group: DF.Link | None
|
||||
use_transaction_date_exchange_rate: DF.Check
|
||||
# end: auto-generated types
|
||||
|
||||
def validate(self):
|
||||
for key in ["supplier_group", "supp_master_name", "maintain_same_rate", "buying_price_list"]:
|
||||
frappe.db.set_default(key, self.get(key, ""))
|
||||
|
||||
@@ -36,6 +36,137 @@ form_grid_templates = {"items": "templates/form_grid/item_grid.html"}
|
||||
|
||||
|
||||
class PurchaseOrder(BuyingController):
|
||||
# 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.accounts.doctype.payment_schedule.payment_schedule import PaymentSchedule
|
||||
from erpnext.accounts.doctype.pricing_rule_detail.pricing_rule_detail import PricingRuleDetail
|
||||
from erpnext.accounts.doctype.purchase_taxes_and_charges.purchase_taxes_and_charges import (
|
||||
PurchaseTaxesandCharges,
|
||||
)
|
||||
from erpnext.buying.doctype.purchase_order_item.purchase_order_item import PurchaseOrderItem
|
||||
from erpnext.buying.doctype.purchase_order_item_supplied.purchase_order_item_supplied import (
|
||||
PurchaseOrderItemSupplied,
|
||||
)
|
||||
|
||||
additional_discount_percentage: DF.Float
|
||||
address_display: DF.SmallText | None
|
||||
advance_paid: DF.Currency
|
||||
amended_from: DF.Link | None
|
||||
apply_discount_on: DF.Literal["", "Grand Total", "Net Total"]
|
||||
apply_tds: DF.Check
|
||||
auto_repeat: DF.Link | None
|
||||
base_discount_amount: DF.Currency
|
||||
base_grand_total: DF.Currency
|
||||
base_in_words: DF.Data | None
|
||||
base_net_total: DF.Currency
|
||||
base_rounded_total: DF.Currency
|
||||
base_rounding_adjustment: DF.Currency
|
||||
base_tax_withholding_net_total: DF.Currency
|
||||
base_taxes_and_charges_added: DF.Currency
|
||||
base_taxes_and_charges_deducted: DF.Currency
|
||||
base_total: DF.Currency
|
||||
base_total_taxes_and_charges: DF.Currency
|
||||
billing_address: DF.Link | None
|
||||
billing_address_display: DF.SmallText | None
|
||||
buying_price_list: DF.Link | None
|
||||
company: DF.Link
|
||||
contact_display: DF.SmallText | None
|
||||
contact_email: DF.SmallText | None
|
||||
contact_mobile: DF.SmallText | None
|
||||
contact_person: DF.Link | None
|
||||
conversion_rate: DF.Float
|
||||
cost_center: DF.Link | None
|
||||
currency: DF.Link
|
||||
customer: DF.Link | None
|
||||
customer_contact_display: DF.SmallText | None
|
||||
customer_contact_email: DF.Code | None
|
||||
customer_contact_mobile: DF.SmallText | None
|
||||
customer_contact_person: DF.Link | None
|
||||
customer_name: DF.Data | None
|
||||
disable_rounded_total: DF.Check
|
||||
discount_amount: DF.Currency
|
||||
from_date: DF.Date | None
|
||||
grand_total: DF.Currency
|
||||
group_same_items: DF.Check
|
||||
ignore_pricing_rule: DF.Check
|
||||
in_words: DF.Data | None
|
||||
incoterm: DF.Link | None
|
||||
inter_company_order_reference: DF.Link | None
|
||||
is_internal_supplier: DF.Check
|
||||
is_old_subcontracting_flow: DF.Check
|
||||
is_subcontracted: DF.Check
|
||||
items: DF.Table[PurchaseOrderItem]
|
||||
language: DF.Data | None
|
||||
letter_head: DF.Link | None
|
||||
named_place: DF.Data | None
|
||||
naming_series: DF.Literal["PUR-ORD-.YYYY.-"]
|
||||
net_total: DF.Currency
|
||||
order_confirmation_date: DF.Date | None
|
||||
order_confirmation_no: DF.Data | None
|
||||
other_charges_calculation: DF.LongText | None
|
||||
party_account_currency: DF.Link | None
|
||||
payment_schedule: DF.Table[PaymentSchedule]
|
||||
payment_terms_template: DF.Link | None
|
||||
per_billed: DF.Percent
|
||||
per_received: DF.Percent
|
||||
plc_conversion_rate: DF.Float
|
||||
price_list_currency: DF.Link | None
|
||||
pricing_rules: DF.Table[PricingRuleDetail]
|
||||
project: DF.Link | None
|
||||
ref_sq: DF.Link | None
|
||||
represents_company: DF.Link | None
|
||||
rounded_total: DF.Currency
|
||||
rounding_adjustment: DF.Currency
|
||||
scan_barcode: DF.Data | None
|
||||
schedule_date: DF.Date | None
|
||||
select_print_heading: DF.Link | None
|
||||
set_from_warehouse: DF.Link | None
|
||||
set_reserve_warehouse: DF.Link | None
|
||||
set_warehouse: DF.Link | None
|
||||
shipping_address: DF.Link | None
|
||||
shipping_address_display: DF.SmallText | None
|
||||
shipping_rule: DF.Link | None
|
||||
status: DF.Literal[
|
||||
"",
|
||||
"Draft",
|
||||
"On Hold",
|
||||
"To Receive and Bill",
|
||||
"To Bill",
|
||||
"To Receive",
|
||||
"Completed",
|
||||
"Cancelled",
|
||||
"Closed",
|
||||
"Delivered",
|
||||
]
|
||||
supplied_items: DF.Table[PurchaseOrderItemSupplied]
|
||||
supplier: DF.Link
|
||||
supplier_address: DF.Link | None
|
||||
supplier_name: DF.Data | None
|
||||
supplier_warehouse: DF.Link | None
|
||||
tax_category: DF.Link | None
|
||||
tax_withholding_category: DF.Link | None
|
||||
tax_withholding_net_total: DF.Currency
|
||||
taxes: DF.Table[PurchaseTaxesandCharges]
|
||||
taxes_and_charges: DF.Link | None
|
||||
taxes_and_charges_added: DF.Currency
|
||||
taxes_and_charges_deducted: DF.Currency
|
||||
tc_name: DF.Link | None
|
||||
terms: DF.TextEditor | None
|
||||
title: DF.Data
|
||||
to_date: DF.Date | None
|
||||
total: DF.Currency
|
||||
total_net_weight: DF.Float
|
||||
total_qty: DF.Float
|
||||
total_taxes_and_charges: DF.Currency
|
||||
transaction_date: DF.Date
|
||||
# end: auto-generated types
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(PurchaseOrder, self).__init__(*args, **kwargs)
|
||||
self.status_updater = [
|
||||
|
||||
@@ -7,6 +7,93 @@ from frappe.model.document import Document
|
||||
|
||||
|
||||
class PurchaseOrderItem(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
|
||||
against_blanket_order: DF.Check
|
||||
amount: DF.Currency
|
||||
apply_tds: DF.Check
|
||||
base_amount: DF.Currency
|
||||
base_net_amount: DF.Currency
|
||||
base_net_rate: DF.Currency
|
||||
base_price_list_rate: DF.Currency
|
||||
base_rate: DF.Currency
|
||||
base_rate_with_margin: DF.Currency
|
||||
billed_amt: DF.Currency
|
||||
blanket_order: DF.Link | None
|
||||
blanket_order_rate: DF.Currency
|
||||
bom: DF.Link | None
|
||||
brand: DF.Link | None
|
||||
company_total_stock: DF.Float
|
||||
conversion_factor: DF.Float
|
||||
cost_center: DF.Link | None
|
||||
delivered_by_supplier: DF.Check
|
||||
description: DF.TextEditor | None
|
||||
discount_amount: DF.Currency
|
||||
discount_percentage: DF.Percent
|
||||
expected_delivery_date: DF.Date | None
|
||||
expense_account: DF.Link | None
|
||||
fg_item: DF.Link | None
|
||||
fg_item_qty: DF.Float
|
||||
from_warehouse: DF.Link | None
|
||||
image: DF.Attach | None
|
||||
include_exploded_items: DF.Check
|
||||
is_fixed_asset: DF.Check
|
||||
is_free_item: DF.Check
|
||||
item_code: DF.Link
|
||||
item_group: DF.Link | None
|
||||
item_name: DF.Data
|
||||
item_tax_rate: DF.Code | None
|
||||
item_tax_template: DF.Link | None
|
||||
last_purchase_rate: DF.Currency
|
||||
manufacturer: DF.Link | None
|
||||
manufacturer_part_no: DF.Data | None
|
||||
margin_rate_or_amount: DF.Float
|
||||
margin_type: DF.Literal["", "Percentage", "Amount"]
|
||||
material_request: DF.Link | None
|
||||
material_request_item: DF.Data | None
|
||||
net_amount: DF.Currency
|
||||
net_rate: DF.Currency
|
||||
page_break: DF.Check
|
||||
parent: DF.Data
|
||||
parentfield: DF.Data
|
||||
parenttype: DF.Data
|
||||
price_list_rate: DF.Currency
|
||||
pricing_rules: DF.SmallText | None
|
||||
product_bundle: DF.Link | None
|
||||
production_plan: DF.Link | None
|
||||
production_plan_item: DF.Data | None
|
||||
production_plan_sub_assembly_item: DF.Data | None
|
||||
project: DF.Link | None
|
||||
qty: DF.Float
|
||||
rate: DF.Currency
|
||||
rate_with_margin: DF.Currency
|
||||
received_qty: DF.Float
|
||||
returned_qty: DF.Float
|
||||
sales_order: DF.Link | None
|
||||
sales_order_item: DF.Data | None
|
||||
sales_order_packed_item: DF.Data | None
|
||||
schedule_date: DF.Date
|
||||
stock_qty: DF.Float
|
||||
stock_uom: DF.Link
|
||||
stock_uom_rate: DF.Currency
|
||||
supplier_part_no: DF.Data | None
|
||||
supplier_quotation: DF.Link | None
|
||||
supplier_quotation_item: DF.Link | None
|
||||
total_weight: DF.Float
|
||||
uom: DF.Link
|
||||
warehouse: DF.Link | None
|
||||
weight_per_unit: DF.Float
|
||||
weight_uom: DF.Link | None
|
||||
wip_composite_asset: DF.Link | None
|
||||
# end: auto-generated types
|
||||
|
||||
pass
|
||||
|
||||
|
||||
|
||||
@@ -6,4 +6,31 @@ from frappe.model.document import Document
|
||||
|
||||
|
||||
class PurchaseOrderItemSupplied(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
|
||||
|
||||
@@ -6,4 +6,33 @@ from frappe.model.document import Document
|
||||
|
||||
|
||||
class PurchaseReceiptItemSupplied(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
|
||||
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
|
||||
purchase_order: DF.Link | None
|
||||
rate: DF.Currency
|
||||
reference_name: DF.Data | None
|
||||
required_qty: DF.Float
|
||||
rm_item_code: DF.Link | None
|
||||
serial_no: DF.Text | None
|
||||
stock_uom: DF.Link | None
|
||||
# end: auto-generated types
|
||||
|
||||
pass
|
||||
|
||||
@@ -23,6 +23,45 @@ STANDARD_USERS = ("Guest", "Administrator")
|
||||
|
||||
|
||||
class RequestforQuotation(BuyingController):
|
||||
# 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.buying.doctype.request_for_quotation_item.request_for_quotation_item import (
|
||||
RequestforQuotationItem,
|
||||
)
|
||||
from erpnext.buying.doctype.request_for_quotation_supplier.request_for_quotation_supplier import (
|
||||
RequestforQuotationSupplier,
|
||||
)
|
||||
|
||||
amended_from: DF.Link | None
|
||||
billing_address: DF.Link | None
|
||||
billing_address_display: DF.SmallText | None
|
||||
company: DF.Link
|
||||
email_template: DF.Link | None
|
||||
incoterm: DF.Link | None
|
||||
items: DF.Table[RequestforQuotationItem]
|
||||
letter_head: DF.Link | None
|
||||
message_for_supplier: DF.TextEditor
|
||||
named_place: DF.Data | None
|
||||
naming_series: DF.Literal["PUR-RFQ-.YYYY.-"]
|
||||
opportunity: DF.Link | None
|
||||
schedule_date: DF.Date | None
|
||||
select_print_heading: DF.Link | None
|
||||
send_attached_files: DF.Check
|
||||
send_document_print: DF.Check
|
||||
status: DF.Literal["", "Draft", "Submitted", "Cancelled"]
|
||||
suppliers: DF.Table[RequestforQuotationSupplier]
|
||||
tc_name: DF.Link | None
|
||||
terms: DF.TextEditor | None
|
||||
transaction_date: DF.Date
|
||||
vendor: DF.Link | None
|
||||
# end: auto-generated types
|
||||
|
||||
def validate(self):
|
||||
self.validate_duplicate_supplier()
|
||||
self.validate_supplier_list()
|
||||
|
||||
@@ -6,4 +6,35 @@ from frappe.model.document import Document
|
||||
|
||||
|
||||
class RequestforQuotationItem(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
|
||||
|
||||
brand: DF.Link | None
|
||||
conversion_factor: DF.Float
|
||||
description: DF.TextEditor | None
|
||||
image: DF.Attach | None
|
||||
item_code: DF.Link
|
||||
item_group: DF.Link | None
|
||||
item_name: DF.Data | None
|
||||
material_request: DF.Link | None
|
||||
material_request_item: DF.Data | None
|
||||
page_break: DF.Check
|
||||
parent: DF.Data
|
||||
parentfield: DF.Data
|
||||
parenttype: DF.Data
|
||||
project_name: DF.Link | None
|
||||
qty: DF.Float
|
||||
schedule_date: DF.Date
|
||||
stock_qty: DF.Float
|
||||
stock_uom: DF.Link
|
||||
supplier_part_no: DF.Data | None
|
||||
uom: DF.Link
|
||||
warehouse: DF.Link | None
|
||||
# end: auto-generated types
|
||||
|
||||
pass
|
||||
|
||||
@@ -6,4 +6,24 @@ from frappe.model.document import Document
|
||||
|
||||
|
||||
class RequestforQuotationSupplier(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
|
||||
|
||||
contact: DF.Link | None
|
||||
email_id: DF.Data | None
|
||||
email_sent: DF.Check
|
||||
parent: DF.Data
|
||||
parentfield: DF.Data
|
||||
parenttype: DF.Data
|
||||
quote_status: DF.Literal["Pending", "Received"]
|
||||
send_email: DF.Check
|
||||
supplier: DF.Link
|
||||
supplier_name: DF.ReadOnly | None
|
||||
# end: auto-generated types
|
||||
|
||||
pass
|
||||
|
||||
@@ -21,6 +21,60 @@ from erpnext.utilities.transaction_base import TransactionBase
|
||||
|
||||
|
||||
class Supplier(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.accounts.doctype.allowed_to_transact_with.allowed_to_transact_with import (
|
||||
AllowedToTransactWith,
|
||||
)
|
||||
from erpnext.accounts.doctype.party_account.party_account import PartyAccount
|
||||
from erpnext.utilities.doctype.portal_user.portal_user import PortalUser
|
||||
|
||||
accounts: DF.Table[PartyAccount]
|
||||
allow_purchase_invoice_creation_without_purchase_order: DF.Check
|
||||
allow_purchase_invoice_creation_without_purchase_receipt: DF.Check
|
||||
companies: DF.Table[AllowedToTransactWith]
|
||||
country: DF.Link | None
|
||||
default_bank_account: DF.Link | None
|
||||
default_currency: DF.Link | None
|
||||
default_price_list: DF.Link | None
|
||||
disabled: DF.Check
|
||||
email_id: DF.ReadOnly | None
|
||||
hold_type: DF.Literal["", "All", "Invoices", "Payments"]
|
||||
image: DF.AttachImage | None
|
||||
is_frozen: DF.Check
|
||||
is_internal_supplier: DF.Check
|
||||
is_transporter: DF.Check
|
||||
language: DF.Link | None
|
||||
mobile_no: DF.ReadOnly | None
|
||||
naming_series: DF.Literal["SUP-.YYYY.-"]
|
||||
on_hold: DF.Check
|
||||
payment_terms: DF.Link | None
|
||||
portal_users: DF.Table[PortalUser]
|
||||
prevent_pos: DF.Check
|
||||
prevent_rfqs: DF.Check
|
||||
primary_address: DF.Text | None
|
||||
release_date: DF.Date | None
|
||||
represents_company: DF.Link | None
|
||||
supplier_details: DF.Text | None
|
||||
supplier_group: DF.Link | None
|
||||
supplier_name: DF.Data
|
||||
supplier_primary_address: DF.Link | None
|
||||
supplier_primary_contact: DF.Link | None
|
||||
supplier_type: DF.Literal["Company", "Individual", "Proprietorship", "Partnership"]
|
||||
tax_category: DF.Link | None
|
||||
tax_id: DF.Data | None
|
||||
tax_withholding_category: DF.Link | None
|
||||
warn_pos: DF.Check
|
||||
warn_rfqs: DF.Check
|
||||
website: DF.Data | None
|
||||
# end: auto-generated types
|
||||
|
||||
def onload(self):
|
||||
"""Load address and contacts in `__onload`"""
|
||||
load_address_and_contact(self)
|
||||
|
||||
@@ -14,6 +14,95 @@ form_grid_templates = {"items": "templates/form_grid/item_grid.html"}
|
||||
|
||||
|
||||
class SupplierQuotation(BuyingController):
|
||||
# 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.accounts.doctype.pricing_rule_detail.pricing_rule_detail import PricingRuleDetail
|
||||
from erpnext.accounts.doctype.purchase_taxes_and_charges.purchase_taxes_and_charges import (
|
||||
PurchaseTaxesandCharges,
|
||||
)
|
||||
from erpnext.buying.doctype.supplier_quotation_item.supplier_quotation_item import (
|
||||
SupplierQuotationItem,
|
||||
)
|
||||
|
||||
additional_discount_percentage: DF.Float
|
||||
address_display: DF.SmallText | None
|
||||
amended_from: DF.Link | None
|
||||
apply_discount_on: DF.Literal["", "Grand Total", "Net Total"]
|
||||
auto_repeat: DF.Link | None
|
||||
base_discount_amount: DF.Currency
|
||||
base_grand_total: DF.Currency
|
||||
base_in_words: DF.Data | None
|
||||
base_net_total: DF.Currency
|
||||
base_rounded_total: DF.Currency
|
||||
base_rounding_adjustment: DF.Currency
|
||||
base_taxes_and_charges_added: DF.Currency
|
||||
base_taxes_and_charges_deducted: DF.Currency
|
||||
base_total: DF.Currency
|
||||
base_total_taxes_and_charges: DF.Currency
|
||||
billing_address: DF.Link | None
|
||||
billing_address_display: DF.SmallText | None
|
||||
buying_price_list: DF.Link | None
|
||||
company: DF.Link
|
||||
contact_display: DF.SmallText | None
|
||||
contact_email: DF.Data | None
|
||||
contact_mobile: DF.SmallText | None
|
||||
contact_person: DF.Link | None
|
||||
conversion_rate: DF.Float
|
||||
cost_center: DF.Link | None
|
||||
currency: DF.Link
|
||||
disable_rounded_total: DF.Check
|
||||
discount_amount: DF.Currency
|
||||
grand_total: DF.Currency
|
||||
group_same_items: DF.Check
|
||||
ignore_pricing_rule: DF.Check
|
||||
in_words: DF.Data | None
|
||||
incoterm: DF.Link | None
|
||||
is_subcontracted: DF.Check
|
||||
items: DF.Table[SupplierQuotationItem]
|
||||
language: DF.Data | None
|
||||
letter_head: DF.Link | None
|
||||
named_place: DF.Data | None
|
||||
naming_series: DF.Literal["PUR-SQTN-.YYYY.-"]
|
||||
net_total: DF.Currency
|
||||
opportunity: DF.Link | None
|
||||
other_charges_calculation: DF.LongText | None
|
||||
plc_conversion_rate: DF.Float
|
||||
price_list_currency: DF.Link | None
|
||||
pricing_rules: DF.Table[PricingRuleDetail]
|
||||
project: DF.Link | None
|
||||
quotation_number: DF.Data | None
|
||||
rounded_total: DF.Currency
|
||||
rounding_adjustment: DF.Currency
|
||||
select_print_heading: DF.Link | None
|
||||
shipping_address: DF.Link | None
|
||||
shipping_address_display: DF.SmallText | None
|
||||
shipping_rule: DF.Link | None
|
||||
status: DF.Literal["", "Draft", "Submitted", "Stopped", "Cancelled", "Expired"]
|
||||
supplier: DF.Link
|
||||
supplier_address: DF.Link | None
|
||||
supplier_name: DF.Data | None
|
||||
tax_category: DF.Link | None
|
||||
taxes: DF.Table[PurchaseTaxesandCharges]
|
||||
taxes_and_charges: DF.Link | None
|
||||
taxes_and_charges_added: DF.Currency
|
||||
taxes_and_charges_deducted: DF.Currency
|
||||
tc_name: DF.Link | None
|
||||
terms: DF.TextEditor | None
|
||||
title: DF.Data | None
|
||||
total: DF.Currency
|
||||
total_net_weight: DF.Float
|
||||
total_qty: DF.Float
|
||||
total_taxes_and_charges: DF.Currency
|
||||
transaction_date: DF.Date
|
||||
valid_till: DF.Date | None
|
||||
# end: auto-generated types
|
||||
|
||||
def validate(self):
|
||||
super(SupplierQuotation, self).validate()
|
||||
|
||||
|
||||
@@ -6,4 +6,62 @@ from frappe.model.document import Document
|
||||
|
||||
|
||||
class SupplierQuotationItem(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
|
||||
base_amount: DF.Currency
|
||||
base_net_amount: DF.Currency
|
||||
base_net_rate: DF.Currency
|
||||
base_price_list_rate: DF.Currency
|
||||
base_rate: DF.Currency
|
||||
brand: DF.Link | None
|
||||
conversion_factor: DF.Float
|
||||
cost_center: DF.Link | None
|
||||
description: DF.TextEditor | None
|
||||
discount_amount: DF.Currency
|
||||
discount_percentage: DF.Percent
|
||||
expected_delivery_date: DF.Date | None
|
||||
image: DF.Attach | None
|
||||
is_free_item: DF.Check
|
||||
item_code: DF.Link
|
||||
item_group: DF.Link | None
|
||||
item_name: DF.Data | None
|
||||
item_tax_rate: DF.Code | None
|
||||
item_tax_template: DF.Link | None
|
||||
lead_time_days: DF.Int
|
||||
manufacturer: DF.Link | None
|
||||
manufacturer_part_no: DF.Data | None
|
||||
material_request: DF.Link | None
|
||||
material_request_item: DF.Data | None
|
||||
net_amount: DF.Currency
|
||||
net_rate: DF.Currency
|
||||
page_break: DF.Check
|
||||
parent: DF.Data
|
||||
parentfield: DF.Data
|
||||
parenttype: DF.Data
|
||||
prevdoc_doctype: DF.Data | None
|
||||
price_list_rate: DF.Currency
|
||||
pricing_rules: DF.SmallText | None
|
||||
project: DF.Link | None
|
||||
qty: DF.Float
|
||||
rate: DF.Currency
|
||||
request_for_quotation: DF.Link | None
|
||||
request_for_quotation_item: DF.Data | None
|
||||
sales_order: DF.Link | None
|
||||
stock_qty: DF.Float
|
||||
stock_uom: DF.Link
|
||||
supplier_part_no: DF.Data | None
|
||||
total_weight: DF.Float
|
||||
uom: DF.Link
|
||||
warehouse: DF.Link | None
|
||||
weight_per_unit: DF.Float
|
||||
weight_uom: DF.Link | None
|
||||
# end: auto-generated types
|
||||
|
||||
pass
|
||||
|
||||
@@ -16,6 +16,38 @@ from erpnext.buying.doctype.supplier_scorecard_period.supplier_scorecard_period
|
||||
|
||||
|
||||
class SupplierScorecard(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.buying.doctype.supplier_scorecard_scoring_criteria.supplier_scorecard_scoring_criteria import (
|
||||
SupplierScorecardScoringCriteria,
|
||||
)
|
||||
from erpnext.buying.doctype.supplier_scorecard_scoring_standing.supplier_scorecard_scoring_standing import (
|
||||
SupplierScorecardScoringStanding,
|
||||
)
|
||||
|
||||
criteria: DF.Table[SupplierScorecardScoringCriteria]
|
||||
employee: DF.Link | None
|
||||
indicator_color: DF.Data | None
|
||||
notify_employee: DF.Check
|
||||
notify_supplier: DF.Check
|
||||
period: DF.Literal["Per Week", "Per Month", "Per Year"]
|
||||
prevent_pos: DF.Check
|
||||
prevent_rfqs: DF.Check
|
||||
standings: DF.Table[SupplierScorecardScoringStanding]
|
||||
status: DF.Data | None
|
||||
supplier: DF.Link | None
|
||||
supplier_score: DF.Data | None
|
||||
warn_pos: DF.Check
|
||||
warn_rfqs: DF.Check
|
||||
weighting_function: DF.SmallText
|
||||
# end: auto-generated types
|
||||
|
||||
def validate(self):
|
||||
self.validate_standings()
|
||||
self.validate_criteria_weights()
|
||||
|
||||
@@ -14,6 +14,20 @@ class InvalidFormulaVariable(frappe.ValidationError):
|
||||
|
||||
|
||||
class SupplierScorecardCriteria(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
|
||||
|
||||
criteria_name: DF.Data
|
||||
formula: DF.SmallText
|
||||
max_score: DF.Float
|
||||
weight: DF.Percent
|
||||
# end: auto-generated types
|
||||
|
||||
def validate(self):
|
||||
self.validate_variables()
|
||||
self.validate_formula()
|
||||
|
||||
@@ -14,6 +14,32 @@ from erpnext.buying.doctype.supplier_scorecard_criteria.supplier_scorecard_crite
|
||||
|
||||
|
||||
class SupplierScorecardPeriod(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.buying.doctype.supplier_scorecard_scoring_criteria.supplier_scorecard_scoring_criteria import (
|
||||
SupplierScorecardScoringCriteria,
|
||||
)
|
||||
from erpnext.buying.doctype.supplier_scorecard_scoring_variable.supplier_scorecard_scoring_variable import (
|
||||
SupplierScorecardScoringVariable,
|
||||
)
|
||||
|
||||
amended_from: DF.Link | None
|
||||
criteria: DF.Table[SupplierScorecardScoringCriteria]
|
||||
end_date: DF.Date
|
||||
naming_series: DF.Literal["PU-SSP-.YYYY.-"]
|
||||
scorecard: DF.Link
|
||||
start_date: DF.Date
|
||||
supplier: DF.Link
|
||||
total_score: DF.Percent
|
||||
variables: DF.Table[SupplierScorecardScoringVariable]
|
||||
# end: auto-generated types
|
||||
|
||||
def validate(self):
|
||||
self.validate_criteria_weights()
|
||||
self.calculate_variables()
|
||||
|
||||
@@ -6,4 +6,22 @@ from frappe.model.document import Document
|
||||
|
||||
|
||||
class SupplierScorecardScoringCriteria(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
|
||||
|
||||
criteria_name: DF.Link
|
||||
formula: DF.SmallText | None
|
||||
max_score: DF.Float
|
||||
parent: DF.Data
|
||||
parentfield: DF.Data
|
||||
parenttype: DF.Data
|
||||
score: DF.Percent
|
||||
weight: DF.Percent
|
||||
# end: auto-generated types
|
||||
|
||||
pass
|
||||
|
||||
@@ -6,4 +6,28 @@ from frappe.model.document import Document
|
||||
|
||||
|
||||
class SupplierScorecardScoringStanding(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
|
||||
|
||||
employee_link: DF.Link | None
|
||||
max_grade: DF.Percent
|
||||
min_grade: DF.Percent
|
||||
notify_employee: DF.Check
|
||||
notify_supplier: DF.Check
|
||||
parent: DF.Data
|
||||
parentfield: DF.Data
|
||||
parenttype: DF.Data
|
||||
prevent_pos: DF.Check
|
||||
prevent_rfqs: DF.Check
|
||||
standing_color: DF.Literal["Blue", "Purple", "Green", "Yellow", "Orange", "Red"]
|
||||
standing_name: DF.Link | None
|
||||
warn_pos: DF.Check
|
||||
warn_rfqs: DF.Check
|
||||
# end: auto-generated types
|
||||
|
||||
pass
|
||||
|
||||
@@ -6,4 +6,22 @@ from frappe.model.document import Document
|
||||
|
||||
|
||||
class SupplierScorecardScoringVariable(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
|
||||
param_name: DF.Data | None
|
||||
parent: DF.Data
|
||||
parentfield: DF.Data
|
||||
parenttype: DF.Data
|
||||
path: DF.Data | None
|
||||
value: DF.Float
|
||||
variable_label: DF.Link
|
||||
# end: auto-generated types
|
||||
|
||||
pass
|
||||
|
||||
@@ -7,6 +7,27 @@ from frappe.model.document import Document
|
||||
|
||||
|
||||
class SupplierScorecardStanding(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
|
||||
|
||||
employee_link: DF.Link | None
|
||||
max_grade: DF.Percent
|
||||
min_grade: DF.Percent
|
||||
notify_employee: DF.Check
|
||||
notify_supplier: DF.Check
|
||||
prevent_pos: DF.Check
|
||||
prevent_rfqs: DF.Check
|
||||
standing_color: DF.Literal["Blue", "Purple", "Green", "Yellow", "Orange", "Red"]
|
||||
standing_name: DF.Data | None
|
||||
warn_pos: DF.Check
|
||||
warn_rfqs: DF.Check
|
||||
# end: auto-generated types
|
||||
|
||||
pass
|
||||
|
||||
|
||||
|
||||
@@ -16,6 +16,21 @@ class VariablePathNotFound(frappe.ValidationError):
|
||||
|
||||
|
||||
class SupplierScorecardVariable(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
|
||||
is_custom: DF.Check
|
||||
param_name: DF.Data
|
||||
path: DF.Data
|
||||
variable_label: DF.Data
|
||||
# end: auto-generated types
|
||||
|
||||
def validate(self):
|
||||
self.validate_path_exists()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user