fix: order_type validation restriction (#18096)
This commit is contained in:
parent
5c0ea2d7c9
commit
5557b16260
@ -148,13 +148,6 @@ class SellingController(StockController):
|
||||
if sales_team and total != 100.0:
|
||||
throw(_("Total allocated percentage for sales team should be 100"))
|
||||
|
||||
def validate_order_type(self):
|
||||
valid_types = ["Sales", "Maintenance", "Shopping Cart"]
|
||||
if not self.order_type:
|
||||
self.order_type = "Sales"
|
||||
elif self.order_type not in valid_types:
|
||||
throw(_("Order Type must be one of {0}").format(comma_or(valid_types)))
|
||||
|
||||
def validate_max_discount(self):
|
||||
for d in self.get("items"):
|
||||
if d.item_code:
|
||||
|
@ -26,7 +26,6 @@ class Quotation(SellingController):
|
||||
super(Quotation, self).validate()
|
||||
self.set_status()
|
||||
self.update_opportunity()
|
||||
self.validate_order_type()
|
||||
self.validate_uom_is_integer("stock_uom", "qty")
|
||||
self.validate_valid_till()
|
||||
self.set_customer_name()
|
||||
@ -40,9 +39,6 @@ class Quotation(SellingController):
|
||||
def has_sales_order(self):
|
||||
return frappe.db.get_value("Sales Order Item", {"prevdoc_docname": self.name, "docstatus": 1})
|
||||
|
||||
def validate_order_type(self):
|
||||
super(Quotation, self).validate_order_type()
|
||||
|
||||
def update_lead(self):
|
||||
if self.quotation_to == "Lead" and self.party_name:
|
||||
frappe.get_doc("Lead", self.party_name).set_status(update=True)
|
||||
|
@ -34,7 +34,6 @@ class SalesOrder(SellingController):
|
||||
|
||||
def validate(self):
|
||||
super(SalesOrder, self).validate()
|
||||
self.validate_order_type()
|
||||
self.validate_delivery_date()
|
||||
self.validate_proj_cust()
|
||||
self.validate_po()
|
||||
@ -100,9 +99,6 @@ class SalesOrder(SellingController):
|
||||
frappe.msgprint(_("Quotation {0} not of type {1}")
|
||||
.format(d.prevdoc_docname, self.order_type))
|
||||
|
||||
def validate_order_type(self):
|
||||
super(SalesOrder, self).validate_order_type()
|
||||
|
||||
def validate_delivery_date(self):
|
||||
if self.order_type == 'Sales' and not self.skip_delivery_note:
|
||||
delivery_date_list = [d.delivery_date for d in self.get("items") if d.delivery_date]
|
||||
|
Loading…
x
Reference in New Issue
Block a user