mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-31 18:59:08 +00:00
removed amendment_date mandatory validation from purchase cucle
This commit is contained in:
@@ -165,15 +165,6 @@ class DocType(BuyingController):
|
|||||||
d.purchase_ref_rate = d.purchase_rate = d.import_ref_rate \
|
d.purchase_ref_rate = d.purchase_rate = d.import_ref_rate \
|
||||||
= d.import_rate = item_last_purchase_rate
|
= d.import_rate = item_last_purchase_rate
|
||||||
|
|
||||||
# validation
|
|
||||||
# -------------------------------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
# validate fields
|
|
||||||
def validate_mandatory(self, obj):
|
|
||||||
# check amendment date
|
|
||||||
if obj.doc.amended_from and not obj.doc.amendment_date:
|
|
||||||
msgprint("Please enter amendment date")
|
|
||||||
raise Exception
|
|
||||||
|
|
||||||
# validate for same items and validate is_stock_item , is_purchase_item also validate uom and conversion factor
|
# validate for same items and validate is_stock_item , is_purchase_item also validate uom and conversion factor
|
||||||
def validate_for_items(self, obj):
|
def validate_for_items(self, obj):
|
||||||
@@ -480,4 +471,4 @@ def get_uom_details(args=None):
|
|||||||
return {
|
return {
|
||||||
"conversion_factor": conversion_factor,
|
"conversion_factor": conversion_factor,
|
||||||
"qty": flt(args["stock_qty"]) / conversion_factor,
|
"qty": flt(args["stock_qty"]) / conversion_factor,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -52,8 +52,6 @@ class DocType(BuyingController):
|
|||||||
# Step 2:=> get Purchase Common Obj
|
# Step 2:=> get Purchase Common Obj
|
||||||
pc_obj = get_obj(dt='Purchase Common')
|
pc_obj = get_obj(dt='Purchase Common')
|
||||||
|
|
||||||
# Step 3:=> validate mandatory
|
|
||||||
pc_obj.validate_mandatory(self)
|
|
||||||
|
|
||||||
# Step 4:=> validate for items
|
# Step 4:=> validate for items
|
||||||
pc_obj.validate_for_items(self)
|
pc_obj.validate_for_items(self)
|
||||||
|
|||||||
@@ -126,8 +126,6 @@ class DocType(BuyingController):
|
|||||||
# Get Purchase Common Obj
|
# Get Purchase Common Obj
|
||||||
pc_obj = get_obj(dt='Purchase Common')
|
pc_obj = get_obj(dt='Purchase Common')
|
||||||
|
|
||||||
# Validate Mandatory
|
|
||||||
pc_obj.validate_mandatory(self)
|
|
||||||
|
|
||||||
# Validate for items
|
# Validate for items
|
||||||
pc_obj.validate_for_items(self)
|
pc_obj.validate_for_items(self)
|
||||||
@@ -196,4 +194,4 @@ class DocType(BuyingController):
|
|||||||
self.update_bin(is_submit = 0, is_stopped = (cstr(self.doc.status) == 'Stopped') and 1 or 0)
|
self.update_bin(is_submit = 0, is_stopped = (cstr(self.doc.status) == 'Stopped') and 1 or 0)
|
||||||
|
|
||||||
# Step 5:=> Set Status
|
# Step 5:=> Set Status
|
||||||
webnotes.conn.set(self.doc,'status','Cancelled')
|
webnotes.conn.set(self.doc,'status','Cancelled')
|
||||||
|
|||||||
@@ -75,7 +75,6 @@ class DocType(BuyingController):
|
|||||||
|
|
||||||
def validate_common(self):
|
def validate_common(self):
|
||||||
pc = get_obj('Purchase Common')
|
pc = get_obj('Purchase Common')
|
||||||
pc.validate_mandatory(self)
|
|
||||||
pc.validate_for_items(self)
|
pc.validate_for_items(self)
|
||||||
pc.get_prevdoc_date(self)
|
pc.get_prevdoc_date(self)
|
||||||
pc.validate_reference_value(self)
|
pc.validate_reference_value(self)
|
||||||
|
|||||||
@@ -130,7 +130,6 @@ class DocType(BuyingController):
|
|||||||
|
|
||||||
pc_obj = get_obj(dt='Purchase Common')
|
pc_obj = get_obj(dt='Purchase Common')
|
||||||
pc_obj.validate_for_items(self)
|
pc_obj.validate_for_items(self)
|
||||||
pc_obj.validate_mandatory(self)
|
|
||||||
pc_obj.get_prevdoc_date(self)
|
pc_obj.get_prevdoc_date(self)
|
||||||
pc_obj.validate_reference_value(self)
|
pc_obj.validate_reference_value(self)
|
||||||
self.check_for_stopped_status(pc_obj)
|
self.check_for_stopped_status(pc_obj)
|
||||||
|
|||||||
Reference in New Issue
Block a user