mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-15 19:19:17 +00:00
fix: Linters
This commit is contained in:
@@ -19,6 +19,8 @@ class Quotation(SellingController):
|
|||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
from erpnext.accounts.doctype.payment_schedule.payment_schedule import PaymentSchedule
|
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.pricing_rule_detail.pricing_rule_detail import PricingRuleDetail
|
||||||
from erpnext.accounts.doctype.sales_taxes_and_charges.sales_taxes_and_charges import (
|
from erpnext.accounts.doctype.sales_taxes_and_charges.sales_taxes_and_charges import (
|
||||||
@@ -30,7 +32,6 @@ class Quotation(SellingController):
|
|||||||
QuotationLostReasonDetail,
|
QuotationLostReasonDetail,
|
||||||
)
|
)
|
||||||
from erpnext.stock.doctype.packed_item.packed_item import PackedItem
|
from erpnext.stock.doctype.packed_item.packed_item import PackedItem
|
||||||
from frappe.types import DF
|
|
||||||
|
|
||||||
additional_discount_percentage: DF.Float
|
additional_discount_percentage: DF.Float
|
||||||
address_display: DF.TextEditor | None
|
address_display: DF.TextEditor | None
|
||||||
|
|||||||
@@ -57,13 +57,16 @@ class SalesOrder(SellingController):
|
|||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
from erpnext.accounts.doctype.payment_schedule.payment_schedule import PaymentSchedule
|
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.pricing_rule_detail.pricing_rule_detail import PricingRuleDetail
|
||||||
from erpnext.accounts.doctype.sales_taxes_and_charges.sales_taxes_and_charges import SalesTaxesandCharges
|
from erpnext.accounts.doctype.sales_taxes_and_charges.sales_taxes_and_charges import (
|
||||||
|
SalesTaxesandCharges,
|
||||||
|
)
|
||||||
from erpnext.selling.doctype.sales_order_item.sales_order_item import SalesOrderItem
|
from erpnext.selling.doctype.sales_order_item.sales_order_item import SalesOrderItem
|
||||||
from erpnext.selling.doctype.sales_team.sales_team import SalesTeam
|
from erpnext.selling.doctype.sales_team.sales_team import SalesTeam
|
||||||
from erpnext.stock.doctype.packed_item.packed_item import PackedItem
|
from erpnext.stock.doctype.packed_item.packed_item import PackedItem
|
||||||
from frappe.types import DF
|
|
||||||
|
|
||||||
additional_discount_percentage: DF.Float
|
additional_discount_percentage: DF.Float
|
||||||
address_display: DF.TextEditor | None
|
address_display: DF.TextEditor | None
|
||||||
@@ -101,7 +104,9 @@ class SalesOrder(SellingController):
|
|||||||
customer_group: DF.Link | None
|
customer_group: DF.Link | None
|
||||||
customer_name: DF.Data | None
|
customer_name: DF.Data | None
|
||||||
delivery_date: DF.Date | None
|
delivery_date: DF.Date | None
|
||||||
delivery_status: DF.Literal["Not Delivered", "Fully Delivered", "Partly Delivered", "Closed", "Not Applicable"]
|
delivery_status: DF.Literal[
|
||||||
|
"Not Delivered", "Fully Delivered", "Partly Delivered", "Closed", "Not Applicable"
|
||||||
|
]
|
||||||
disable_rounded_total: DF.Check
|
disable_rounded_total: DF.Check
|
||||||
discount_amount: DF.Currency
|
discount_amount: DF.Currency
|
||||||
dispatch_address: DF.TextEditor | None
|
dispatch_address: DF.TextEditor | None
|
||||||
@@ -152,7 +157,18 @@ class SalesOrder(SellingController):
|
|||||||
shipping_address_name: DF.Link | None
|
shipping_address_name: DF.Link | None
|
||||||
shipping_rule: DF.Link | None
|
shipping_rule: DF.Link | None
|
||||||
skip_delivery_note: DF.Check
|
skip_delivery_note: DF.Check
|
||||||
status: DF.Literal["", "Draft", "On Hold", "To Pay", "To Deliver and Bill", "To Bill", "To Deliver", "Completed", "Cancelled", "Closed"]
|
status: DF.Literal[
|
||||||
|
"",
|
||||||
|
"Draft",
|
||||||
|
"On Hold",
|
||||||
|
"To Pay",
|
||||||
|
"To Deliver and Bill",
|
||||||
|
"To Bill",
|
||||||
|
"To Deliver",
|
||||||
|
"Completed",
|
||||||
|
"Cancelled",
|
||||||
|
"Closed",
|
||||||
|
]
|
||||||
tax_category: DF.Link | None
|
tax_category: DF.Link | None
|
||||||
tax_id: DF.Data | None
|
tax_id: DF.Data | None
|
||||||
taxes: DF.Table[SalesTaxesandCharges]
|
taxes: DF.Table[SalesTaxesandCharges]
|
||||||
@@ -1143,9 +1159,7 @@ def make_sales_invoice(source_name, target_doc=None, ignore_permissions=False):
|
|||||||
target.cost_center = cost_center
|
target.cost_center = cost_center
|
||||||
|
|
||||||
# has_unit_price_items = 0 is accepted as the qty uncertain for some items
|
# has_unit_price_items = 0 is accepted as the qty uncertain for some items
|
||||||
has_unit_price_items = frappe.db.get_value(
|
has_unit_price_items = frappe.db.get_value("Sales Order", source_name, "has_unit_price_items")
|
||||||
"Sales Order", source_name, "has_unit_price_items"
|
|
||||||
)
|
|
||||||
doclist = get_mapped_doc(
|
doclist = get_mapped_doc(
|
||||||
"Sales Order",
|
"Sales Order",
|
||||||
source_name,
|
source_name,
|
||||||
@@ -1167,12 +1181,9 @@ def make_sales_invoice(source_name, target_doc=None, ignore_permissions=False):
|
|||||||
},
|
},
|
||||||
"postprocess": update_item,
|
"postprocess": update_item,
|
||||||
"condition": lambda doc: (
|
"condition": lambda doc: (
|
||||||
doc.qty
|
doc.qty and (doc.base_amount == 0 or abs(doc.billed_amt) < abs(doc.amount))
|
||||||
and (
|
)
|
||||||
doc.base_amount == 0
|
or has_unit_price_items,
|
||||||
or abs(doc.billed_amt) < abs(doc.amount)
|
|
||||||
)
|
|
||||||
) or has_unit_price_items,
|
|
||||||
},
|
},
|
||||||
"Sales Taxes and Charges": {
|
"Sales Taxes and Charges": {
|
||||||
"doctype": "Sales Taxes and Charges",
|
"doctype": "Sales Taxes and Charges",
|
||||||
|
|||||||
Reference in New Issue
Block a user