mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-20 21:49:18 +00:00
feat: enable automatic type annotations (#38452)
This commit is contained in:
@@ -10,6 +10,16 @@ from erpnext.utilities.transaction_base import TransactionBase
|
||||
|
||||
|
||||
class AuthorizationControl(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
|
||||
|
||||
# end: auto-generated types
|
||||
|
||||
def get_appr_user_role(self, det, doctype_name, total, based_on, condition, master_name, company):
|
||||
amt_list, appr_users, appr_roles = [], [], []
|
||||
users, roles = "", ""
|
||||
|
||||
@@ -9,6 +9,45 @@ from frappe.utils import cstr, flt
|
||||
|
||||
|
||||
class AuthorizationRule(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
|
||||
|
||||
approving_role: DF.Link | None
|
||||
approving_user: DF.Link | None
|
||||
based_on: DF.Literal[
|
||||
"",
|
||||
"Grand Total",
|
||||
"Average Discount",
|
||||
"Customerwise Discount",
|
||||
"Itemwise Discount",
|
||||
"Item Group wise Discount",
|
||||
"Not Applicable",
|
||||
]
|
||||
company: DF.Link | None
|
||||
customer_or_item: DF.Literal["Customer", "Item", "Item Group"]
|
||||
master_name: DF.DynamicLink | None
|
||||
system_role: DF.Link | None
|
||||
system_user: DF.Link | None
|
||||
to_designation: DF.Link | None
|
||||
to_emp: DF.Link | None
|
||||
transaction: DF.Literal[
|
||||
"",
|
||||
"Sales Order",
|
||||
"Purchase Order",
|
||||
"Quotation",
|
||||
"Delivery Note",
|
||||
"Sales Invoice",
|
||||
"Purchase Invoice",
|
||||
"Purchase Receipt",
|
||||
]
|
||||
value: DF.Float
|
||||
# end: auto-generated types
|
||||
|
||||
def check_duplicate_entry(self):
|
||||
exists = frappe.db.sql(
|
||||
"""select name, docstatus from `tabAuthorization Rule`
|
||||
|
||||
@@ -6,4 +6,15 @@ from frappe.model.document import Document
|
||||
|
||||
|
||||
class Branch(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
|
||||
|
||||
branch: DF.Data
|
||||
# end: auto-generated types
|
||||
|
||||
pass
|
||||
|
||||
@@ -9,6 +9,22 @@ from frappe.model.document import Document
|
||||
|
||||
|
||||
class Brand(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.stock.doctype.item_default.item_default import ItemDefault
|
||||
|
||||
brand: DF.Data
|
||||
brand_defaults: DF.Table[ItemDefault]
|
||||
description: DF.Text | None
|
||||
image: DF.AttachImage | None
|
||||
# end: auto-generated types
|
||||
|
||||
pass
|
||||
|
||||
|
||||
|
||||
@@ -19,6 +19,90 @@ from erpnext.setup.setup_wizard.operations.taxes_setup import setup_taxes_and_ch
|
||||
|
||||
|
||||
class Company(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
|
||||
|
||||
abbr: DF.Data
|
||||
accumulated_depreciation_account: DF.Link | None
|
||||
allow_account_creation_against_child_company: DF.Check
|
||||
asset_received_but_not_billed: DF.Link | None
|
||||
auto_err_frequency: DF.Literal["Daily", "Weekly"]
|
||||
auto_exchange_rate_revaluation: DF.Check
|
||||
book_advance_payments_in_separate_party_account: DF.Check
|
||||
capital_work_in_progress_account: DF.Link | None
|
||||
chart_of_accounts: DF.Literal
|
||||
company_description: DF.TextEditor | None
|
||||
company_logo: DF.AttachImage | None
|
||||
company_name: DF.Data
|
||||
cost_center: DF.Link | None
|
||||
country: DF.Link
|
||||
create_chart_of_accounts_based_on: DF.Literal["", "Standard Template", "Existing Company"]
|
||||
credit_limit: DF.Currency
|
||||
date_of_commencement: DF.Date | None
|
||||
date_of_establishment: DF.Date | None
|
||||
date_of_incorporation: DF.Date | None
|
||||
default_advance_paid_account: DF.Link | None
|
||||
default_advance_received_account: DF.Link | None
|
||||
default_bank_account: DF.Link | None
|
||||
default_buying_terms: DF.Link | None
|
||||
default_cash_account: DF.Link | None
|
||||
default_currency: DF.Link
|
||||
default_deferred_expense_account: DF.Link | None
|
||||
default_deferred_revenue_account: DF.Link | None
|
||||
default_discount_account: DF.Link | None
|
||||
default_expense_account: DF.Link | None
|
||||
default_finance_book: DF.Link | None
|
||||
default_holiday_list: DF.Link | None
|
||||
default_in_transit_warehouse: DF.Link | None
|
||||
default_income_account: DF.Link | None
|
||||
default_inventory_account: DF.Link | None
|
||||
default_letter_head: DF.Link | None
|
||||
default_payable_account: DF.Link | None
|
||||
default_provisional_account: DF.Link | None
|
||||
default_receivable_account: DF.Link | None
|
||||
default_selling_terms: DF.Link | None
|
||||
default_warehouse_for_sales_return: DF.Link | None
|
||||
depreciation_cost_center: DF.Link | None
|
||||
depreciation_expense_account: DF.Link | None
|
||||
disposal_account: DF.Link | None
|
||||
domain: DF.Data | None
|
||||
email: DF.Data | None
|
||||
enable_perpetual_inventory: DF.Check
|
||||
enable_provisional_accounting_for_non_stock_items: DF.Check
|
||||
exception_budget_approver_role: DF.Link | None
|
||||
exchange_gain_loss_account: DF.Link | None
|
||||
existing_company: DF.Link | None
|
||||
fax: DF.Data | None
|
||||
is_group: DF.Check
|
||||
lft: DF.Int
|
||||
monthly_sales_target: DF.Currency
|
||||
old_parent: DF.Data | None
|
||||
parent_company: DF.Link | None
|
||||
payment_terms: DF.Link | None
|
||||
phone_no: DF.Data | None
|
||||
registration_details: DF.Code | None
|
||||
rgt: DF.Int
|
||||
round_off_account: DF.Link | None
|
||||
round_off_cost_center: DF.Link | None
|
||||
sales_monthly_history: DF.SmallText | None
|
||||
series_for_depreciation_entry: DF.Data | None
|
||||
stock_adjustment_account: DF.Link | None
|
||||
stock_received_but_not_billed: DF.Link | None
|
||||
submit_err_jv: DF.Check
|
||||
tax_id: DF.Data | None
|
||||
total_monthly_sales: DF.Currency
|
||||
transactions_annual_history: DF.Code | None
|
||||
unrealized_exchange_gain_loss_account: DF.Link | None
|
||||
unrealized_profit_loss_account: DF.Link | None
|
||||
website: DF.Data | None
|
||||
write_off_account: DF.Link | None
|
||||
# end: auto-generated types
|
||||
|
||||
nsm_parent_field = "parent_company"
|
||||
|
||||
def onload(self):
|
||||
|
||||
@@ -10,6 +10,22 @@ from frappe.utils import cint, formatdate, get_datetime_str, nowdate
|
||||
|
||||
|
||||
class CurrencyExchange(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
|
||||
|
||||
date: DF.Date
|
||||
exchange_rate: DF.Float
|
||||
for_buying: DF.Check
|
||||
for_selling: DF.Check
|
||||
from_currency: DF.Link
|
||||
to_currency: DF.Link
|
||||
# end: auto-generated types
|
||||
|
||||
def autoname(self):
|
||||
purpose = ""
|
||||
if not self.date:
|
||||
|
||||
@@ -8,6 +8,31 @@ from frappe.utils.nestedset import NestedSet, get_root_of
|
||||
|
||||
|
||||
class CustomerGroup(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.accounts.doctype.party_account.party_account import PartyAccount
|
||||
from erpnext.selling.doctype.customer_credit_limit.customer_credit_limit import (
|
||||
CustomerCreditLimit,
|
||||
)
|
||||
|
||||
accounts: DF.Table[PartyAccount]
|
||||
credit_limits: DF.Table[CustomerCreditLimit]
|
||||
customer_group_name: DF.Data
|
||||
default_price_list: DF.Link | None
|
||||
is_group: DF.Check
|
||||
lft: DF.Int
|
||||
old_parent: DF.Link | None
|
||||
parent_customer_group: DF.Link | None
|
||||
payment_terms: DF.Link | None
|
||||
rgt: DF.Int
|
||||
# end: auto-generated types
|
||||
|
||||
nsm_parent_field = "parent_customer_group"
|
||||
|
||||
def validate(self):
|
||||
|
||||
@@ -9,6 +9,24 @@ from erpnext.utilities.transaction_base import delete_events
|
||||
|
||||
|
||||
class Department(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
|
||||
|
||||
company: DF.Link
|
||||
department_name: DF.Data
|
||||
disabled: DF.Check
|
||||
is_group: DF.Check
|
||||
lft: DF.Int
|
||||
old_parent: DF.Data | None
|
||||
parent_department: DF.Link | None
|
||||
rgt: DF.Int
|
||||
# end: auto-generated types
|
||||
|
||||
nsm_parent_field = "parent_department"
|
||||
|
||||
def autoname(self):
|
||||
|
||||
@@ -6,4 +6,16 @@ from frappe.model.document import Document
|
||||
|
||||
|
||||
class Designation(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.Text | None
|
||||
designation_name: DF.Data
|
||||
# end: auto-generated types
|
||||
|
||||
pass
|
||||
|
||||
@@ -6,4 +6,29 @@ from frappe.model.document import Document
|
||||
|
||||
|
||||
class Driver(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.setup.doctype.driving_license_category.driving_license_category import (
|
||||
DrivingLicenseCategory,
|
||||
)
|
||||
|
||||
address: DF.Link | None
|
||||
cell_number: DF.Data | None
|
||||
driving_license_category: DF.Table[DrivingLicenseCategory]
|
||||
employee: DF.Link | None
|
||||
expiry_date: DF.Date | None
|
||||
full_name: DF.Data
|
||||
issuing_date: DF.Date | None
|
||||
license_number: DF.Data | None
|
||||
naming_series: DF.Literal["HR-DRI-.YYYY.-"]
|
||||
status: DF.Literal["Active", "Suspended", "Left"]
|
||||
transporter: DF.Link | None
|
||||
# end: auto-generated types
|
||||
|
||||
pass
|
||||
|
||||
@@ -6,4 +6,20 @@ from frappe.model.document import Document
|
||||
|
||||
|
||||
class DrivingLicenseCategory(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.Data | None
|
||||
expiry_date: DF.Date | None
|
||||
issuing_date: DF.Date | None
|
||||
parent: DF.Data
|
||||
parentfield: DF.Data
|
||||
parenttype: DF.Data
|
||||
# end: auto-generated types
|
||||
|
||||
pass
|
||||
|
||||
@@ -30,6 +30,50 @@ from frappe.model.document import Document
|
||||
|
||||
|
||||
class EmailDigest(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.setup.doctype.email_digest_recipient.email_digest_recipient import (
|
||||
EmailDigestRecipient,
|
||||
)
|
||||
|
||||
add_quote: DF.Check
|
||||
bank_balance: DF.Check
|
||||
calendar_events: DF.Check
|
||||
company: DF.Link
|
||||
credit_balance: DF.Check
|
||||
enabled: DF.Check
|
||||
expense_year_to_date: DF.Check
|
||||
expenses_booked: DF.Check
|
||||
frequency: DF.Literal["Daily", "Weekly", "Monthly"]
|
||||
income: DF.Check
|
||||
income_year_to_date: DF.Check
|
||||
invoiced_amount: DF.Check
|
||||
issue: DF.Check
|
||||
new_quotations: DF.Check
|
||||
next_send: DF.Data | None
|
||||
notifications: DF.Check
|
||||
payables: DF.Check
|
||||
pending_quotations: DF.Check
|
||||
project: DF.Check
|
||||
purchase_invoice: DF.Check
|
||||
purchase_order: DF.Check
|
||||
purchase_orders_items_overdue: DF.Check
|
||||
purchase_orders_to_bill: DF.Check
|
||||
purchase_orders_to_receive: DF.Check
|
||||
recipients: DF.TableMultiSelect[EmailDigestRecipient]
|
||||
sales_invoice: DF.Check
|
||||
sales_order: DF.Check
|
||||
sales_orders_to_bill: DF.Check
|
||||
sales_orders_to_deliver: DF.Check
|
||||
todo_list: DF.Check
|
||||
# end: auto-generated types
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(EmailDigest, self).__init__(*args, **kwargs)
|
||||
|
||||
|
||||
@@ -7,4 +7,18 @@ from frappe.model.document import Document
|
||||
|
||||
|
||||
class EmailDigestRecipient(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
|
||||
recipient: DF.Link
|
||||
# end: auto-generated types
|
||||
|
||||
pass
|
||||
|
||||
@@ -6,4 +6,23 @@ from frappe.model.document import Document
|
||||
|
||||
|
||||
class EmployeeEducation(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
|
||||
|
||||
class_per: DF.Data | None
|
||||
level: DF.Literal["Graduate", "Post Graduate", "Under Graduate"]
|
||||
maj_opt_subj: DF.Text | None
|
||||
parent: DF.Data
|
||||
parentfield: DF.Data
|
||||
parenttype: DF.Data
|
||||
qualification: DF.Data | None
|
||||
school_univ: DF.SmallText | None
|
||||
year_of_passing: DF.Int
|
||||
# end: auto-generated types
|
||||
|
||||
pass
|
||||
|
||||
@@ -6,4 +6,23 @@ from frappe.model.document import Document
|
||||
|
||||
|
||||
class EmployeeExternalWorkHistory(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
|
||||
|
||||
address: DF.SmallText | None
|
||||
company_name: DF.Data | None
|
||||
contact: DF.Data | None
|
||||
designation: DF.Data | None
|
||||
parent: DF.Data
|
||||
parentfield: DF.Data
|
||||
parenttype: DF.Data
|
||||
salary: DF.Currency
|
||||
total_experience: DF.Data | None
|
||||
# end: auto-generated types
|
||||
|
||||
pass
|
||||
|
||||
@@ -6,4 +6,18 @@ from frappe.model.document import Document
|
||||
|
||||
|
||||
class EmployeeGroup(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.setup.doctype.employee_group_table.employee_group_table import EmployeeGroupTable
|
||||
|
||||
employee_group_name: DF.Data
|
||||
employee_list: DF.Table[EmployeeGroupTable]
|
||||
# end: auto-generated types
|
||||
|
||||
pass
|
||||
|
||||
@@ -6,4 +6,20 @@ from frappe.model.document import Document
|
||||
|
||||
|
||||
class EmployeeGroupTable(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: DF.Link | None
|
||||
employee_name: DF.Data | None
|
||||
parent: DF.Data
|
||||
parentfield: DF.Data
|
||||
parenttype: DF.Data
|
||||
user_id: DF.Data | None
|
||||
# end: auto-generated types
|
||||
|
||||
pass
|
||||
|
||||
@@ -6,4 +6,22 @@ from frappe.model.document import Document
|
||||
|
||||
|
||||
class EmployeeInternalWorkHistory(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
|
||||
|
||||
branch: DF.Link | None
|
||||
department: DF.Link | None
|
||||
designation: DF.Link | None
|
||||
from_date: DF.Date | None
|
||||
parent: DF.Data
|
||||
parentfield: DF.Data
|
||||
parenttype: DF.Data
|
||||
to_date: DF.Date | None
|
||||
# end: auto-generated types
|
||||
|
||||
pass
|
||||
|
||||
@@ -23,6 +23,24 @@ from frappe.model.document import Document
|
||||
|
||||
|
||||
class GlobalDefaults(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
|
||||
|
||||
country: DF.Link | None
|
||||
default_company: DF.Link | None
|
||||
default_currency: DF.Link
|
||||
default_distance_unit: DF.Link | None
|
||||
demo_company: DF.Link | None
|
||||
disable_in_words: DF.Check
|
||||
disable_rounded_total: DF.Check
|
||||
hide_currency_symbol: DF.Literal["", "No", "Yes"]
|
||||
# end: auto-generated types
|
||||
|
||||
def on_update(self):
|
||||
"""update defaults"""
|
||||
for key in keydict:
|
||||
|
||||
@@ -6,4 +6,20 @@ from frappe.model.document import Document
|
||||
|
||||
|
||||
class Holiday(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
|
||||
holiday_date: DF.Date
|
||||
parent: DF.Data
|
||||
parentfield: DF.Data
|
||||
parenttype: DF.Data
|
||||
weekly_off: DF.Check
|
||||
# end: auto-generated types
|
||||
|
||||
pass
|
||||
|
||||
@@ -16,6 +16,29 @@ class OverlapError(frappe.ValidationError):
|
||||
|
||||
|
||||
class HolidayList(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.setup.doctype.holiday.holiday import Holiday
|
||||
|
||||
color: DF.Color | None
|
||||
country: DF.Autocomplete | None
|
||||
from_date: DF.Date
|
||||
holiday_list_name: DF.Data
|
||||
holidays: DF.Table[Holiday]
|
||||
subdivision: DF.Autocomplete | None
|
||||
to_date: DF.Date
|
||||
total_holidays: DF.Int
|
||||
weekly_off: DF.Literal[
|
||||
"", "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"
|
||||
]
|
||||
# end: auto-generated types
|
||||
|
||||
def validate(self):
|
||||
self.validate_days()
|
||||
self.total_holidays = len(self.holidays)
|
||||
|
||||
@@ -6,6 +6,19 @@ from frappe.model.document import Document
|
||||
|
||||
|
||||
class Incoterm(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
|
||||
|
||||
code: DF.Data
|
||||
description: DF.LongText | None
|
||||
title: DF.Data
|
||||
# end: auto-generated types
|
||||
|
||||
pass
|
||||
|
||||
|
||||
|
||||
@@ -9,6 +9,28 @@ from frappe.utils.nestedset import NestedSet
|
||||
|
||||
|
||||
class ItemGroup(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.stock.doctype.item_default.item_default import ItemDefault
|
||||
from erpnext.stock.doctype.item_tax.item_tax import ItemTax
|
||||
|
||||
image: DF.AttachImage | None
|
||||
is_group: DF.Check
|
||||
item_group_defaults: DF.Table[ItemDefault]
|
||||
item_group_name: DF.Data
|
||||
lft: DF.Int
|
||||
old_parent: DF.Link | None
|
||||
parent_item_group: DF.Link | None
|
||||
rgt: DF.Int
|
||||
taxes: DF.Table[ItemTax]
|
||||
# end: auto-generated types
|
||||
|
||||
def validate(self):
|
||||
if not self.parent_item_group and not frappe.flags.in_test:
|
||||
if frappe.db.exists("Item Group", _("All Item Groups")):
|
||||
|
||||
@@ -7,6 +7,18 @@ from frappe.model.document import Document
|
||||
|
||||
|
||||
class PartyType(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
|
||||
|
||||
account_type: DF.Literal["Payable", "Receivable"]
|
||||
party_type: DF.Link
|
||||
# end: auto-generated types
|
||||
|
||||
pass
|
||||
|
||||
|
||||
|
||||
@@ -6,4 +6,16 @@ from frappe.model.document import Document
|
||||
|
||||
|
||||
class PrintHeading(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
|
||||
print_heading: DF.Data
|
||||
# end: auto-generated types
|
||||
|
||||
pass
|
||||
|
||||
@@ -6,4 +6,15 @@ from frappe.model.document import Document
|
||||
|
||||
|
||||
class QuotationLostReason(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
|
||||
|
||||
order_lost_reason: DF.Data
|
||||
# end: auto-generated types
|
||||
|
||||
pass
|
||||
|
||||
@@ -7,4 +7,18 @@ from frappe.model.document import Document
|
||||
|
||||
|
||||
class QuotationLostReasonDetail(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
|
||||
|
||||
lost_reason: DF.Link | None
|
||||
parent: DF.Data
|
||||
parentfield: DF.Data
|
||||
parenttype: DF.Data
|
||||
# end: auto-generated types
|
||||
|
||||
pass
|
||||
|
||||
@@ -9,6 +9,30 @@ from frappe.website.website_generator import WebsiteGenerator
|
||||
|
||||
|
||||
class SalesPartner(WebsiteGenerator):
|
||||
# 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.setup.doctype.target_detail.target_detail import TargetDetail
|
||||
|
||||
commission_rate: DF.Float
|
||||
description: DF.TextEditor | None
|
||||
introduction: DF.Text | None
|
||||
logo: DF.Attach | None
|
||||
partner_name: DF.Data
|
||||
partner_type: DF.Link | None
|
||||
partner_website: DF.Data | None
|
||||
referral_code: DF.Data | None
|
||||
route: DF.Data | None
|
||||
show_in_website: DF.Check
|
||||
targets: DF.Table[TargetDetail]
|
||||
territory: DF.Link
|
||||
# end: auto-generated types
|
||||
|
||||
website = frappe._dict(
|
||||
page_title_field="partner_name",
|
||||
condition_field="show_in_website",
|
||||
|
||||
@@ -16,6 +16,29 @@ from erpnext import get_default_currency
|
||||
|
||||
|
||||
class SalesPerson(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.setup.doctype.target_detail.target_detail import TargetDetail
|
||||
|
||||
commission_rate: DF.Data | None
|
||||
department: DF.Link | None
|
||||
employee: DF.Link | None
|
||||
enabled: DF.Check
|
||||
is_group: DF.Check
|
||||
lft: DF.Int
|
||||
old_parent: DF.Data | None
|
||||
parent_sales_person: DF.Link | None
|
||||
rgt: DF.Int
|
||||
sales_person_name: DF.Data
|
||||
targets: DF.Table[TargetDetail]
|
||||
# end: auto-generated types
|
||||
|
||||
nsm_parent_field = "parent_sales_person"
|
||||
|
||||
def validate(self):
|
||||
|
||||
@@ -7,6 +7,26 @@ from frappe.utils.nestedset import NestedSet, get_root_of
|
||||
|
||||
|
||||
class SupplierGroup(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.accounts.doctype.party_account.party_account import PartyAccount
|
||||
|
||||
accounts: DF.Table[PartyAccount]
|
||||
is_group: DF.Check
|
||||
lft: DF.Int
|
||||
old_parent: DF.Link | None
|
||||
parent_supplier_group: DF.Link | None
|
||||
payment_terms: DF.Link | None
|
||||
rgt: DF.Int
|
||||
supplier_group_name: DF.Data
|
||||
# end: auto-generated types
|
||||
|
||||
nsm_parent_field = "parent_supplier_group"
|
||||
|
||||
def validate(self):
|
||||
|
||||
@@ -6,4 +6,22 @@ from frappe.model.document import Document
|
||||
|
||||
|
||||
class TargetDetail(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
|
||||
|
||||
distribution_id: DF.Link
|
||||
fiscal_year: DF.Link
|
||||
item_group: DF.Link | None
|
||||
parent: DF.Data
|
||||
parentfield: DF.Data
|
||||
parenttype: DF.Data
|
||||
target_amount: DF.Float
|
||||
target_qty: DF.Float
|
||||
# end: auto-generated types
|
||||
|
||||
pass
|
||||
|
||||
@@ -12,6 +12,21 @@ from frappe.utils.jinja import validate_template
|
||||
|
||||
|
||||
class TermsandConditions(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
|
||||
|
||||
buying: DF.Check
|
||||
disabled: DF.Check
|
||||
selling: DF.Check
|
||||
terms: DF.TextEditor | None
|
||||
title: DF.Data
|
||||
# end: auto-generated types
|
||||
|
||||
def validate(self):
|
||||
if self.terms:
|
||||
validate_template(self.terms)
|
||||
|
||||
@@ -9,6 +9,26 @@ from frappe.utils.nestedset import NestedSet, get_root_of
|
||||
|
||||
|
||||
class Territory(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.setup.doctype.target_detail.target_detail import TargetDetail
|
||||
|
||||
is_group: DF.Check
|
||||
lft: DF.Int
|
||||
old_parent: DF.Link | None
|
||||
parent_territory: DF.Link | None
|
||||
rgt: DF.Int
|
||||
targets: DF.Table[TargetDetail]
|
||||
territory_manager: DF.Link | None
|
||||
territory_name: DF.Data
|
||||
# end: auto-generated types
|
||||
|
||||
nsm_parent_field = "parent_territory"
|
||||
|
||||
def validate(self):
|
||||
|
||||
@@ -10,6 +10,25 @@ from frappe.utils import cint, create_batch
|
||||
|
||||
|
||||
class TransactionDeletionRecord(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.setup.doctype.transaction_deletion_record_item.transaction_deletion_record_item import (
|
||||
TransactionDeletionRecordItem,
|
||||
)
|
||||
|
||||
amended_from: DF.Link | None
|
||||
company: DF.Link
|
||||
doctypes: DF.Table[TransactionDeletionRecordItem]
|
||||
doctypes_to_be_ignored: DF.Table[TransactionDeletionRecordItem]
|
||||
status: DF.Literal["Draft", "Completed"]
|
||||
# end: auto-generated types
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(TransactionDeletionRecord, self).__init__(*args, **kwargs)
|
||||
self.batch_size = 5000
|
||||
|
||||
@@ -7,4 +7,19 @@ from frappe.model.document import Document
|
||||
|
||||
|
||||
class TransactionDeletionRecordItem(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
|
||||
|
||||
doctype_name: DF.Link
|
||||
no_of_docs: DF.Data | None
|
||||
parent: DF.Data
|
||||
parentfield: DF.Data
|
||||
parenttype: DF.Data
|
||||
# end: auto-generated types
|
||||
|
||||
pass
|
||||
|
||||
@@ -6,4 +6,17 @@ from frappe.model.document import Document
|
||||
|
||||
|
||||
class UOM(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
|
||||
|
||||
enabled: DF.Check
|
||||
must_be_whole_number: DF.Check
|
||||
uom_name: DF.Data
|
||||
# end: auto-generated types
|
||||
|
||||
pass
|
||||
|
||||
@@ -6,4 +6,18 @@ from frappe.model.document import Document
|
||||
|
||||
|
||||
class UOMConversionFactor(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
|
||||
|
||||
category: DF.Link
|
||||
from_uom: DF.Link
|
||||
to_uom: DF.Link
|
||||
value: DF.Float
|
||||
# end: auto-generated types
|
||||
|
||||
pass
|
||||
|
||||
@@ -9,6 +9,36 @@ from frappe.utils import getdate
|
||||
|
||||
|
||||
class Vehicle(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
|
||||
|
||||
acquisition_date: DF.Date | None
|
||||
amended_from: DF.Link | None
|
||||
carbon_check_date: DF.Date | None
|
||||
chassis_no: DF.Data | None
|
||||
color: DF.Data | None
|
||||
doors: DF.Int
|
||||
employee: DF.Link | None
|
||||
end_date: DF.Date | None
|
||||
fuel_type: DF.Literal["Petrol", "Diesel", "Natural Gas", "Electric"]
|
||||
insurance_company: DF.Data | None
|
||||
last_odometer: DF.Int
|
||||
license_plate: DF.Data
|
||||
location: DF.Data | None
|
||||
make: DF.Data
|
||||
model: DF.Data
|
||||
policy_no: DF.Data | None
|
||||
start_date: DF.Date | None
|
||||
uom: DF.Link
|
||||
vehicle_value: DF.Currency
|
||||
wheels: DF.Int
|
||||
# end: auto-generated types
|
||||
|
||||
def validate(self):
|
||||
if getdate(self.start_date) > getdate(self.end_date):
|
||||
frappe.throw(_("Insurance Start date should be less than Insurance End date"))
|
||||
|
||||
@@ -8,4 +8,18 @@ from frappe.model.document import Document
|
||||
|
||||
|
||||
class WebsiteItemGroup(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
|
||||
|
||||
item_group: DF.Link
|
||||
parent: DF.Data
|
||||
parentfield: DF.Data
|
||||
parenttype: DF.Data
|
||||
# end: auto-generated types
|
||||
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user