mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-19 13:09:17 +00:00
fix(validate): Qty is mandatory in delivery note
This commit is contained in:
committed by
Anurag Mishra
parent
7b2c445707
commit
6ddb15b3df
@@ -98,6 +98,7 @@ class DeliveryNote(SellingController):
|
|||||||
frappe.throw(_("Sales Order required for Item {0}").format(d.item_code))
|
frappe.throw(_("Sales Order required for Item {0}").format(d.item_code))
|
||||||
|
|
||||||
def validate(self):
|
def validate(self):
|
||||||
|
self.validate_qty()
|
||||||
self.validate_posting_time()
|
self.validate_posting_time()
|
||||||
super(DeliveryNote, self).validate()
|
super(DeliveryNote, self).validate()
|
||||||
self.set_status()
|
self.set_status()
|
||||||
@@ -121,9 +122,8 @@ class DeliveryNote(SellingController):
|
|||||||
if not self.installation_status: self.installation_status = 'Not Installed'
|
if not self.installation_status: self.installation_status = 'Not Installed'
|
||||||
|
|
||||||
def validate_qty(self):
|
def validate_qty(self):
|
||||||
data = frappe.get_all("Delivery Note Item", filters={"parent" : self.name}, fields=["qty"])
|
for item in self.items:
|
||||||
for quant in data:
|
if not item.qty:
|
||||||
if quant.qty == 0:
|
|
||||||
frappe.throw("Item quantity can not be zero")
|
frappe.throw("Item quantity can not be zero")
|
||||||
|
|
||||||
def validate_with_previous_doc(self):
|
def validate_with_previous_doc(self):
|
||||||
|
|||||||
Reference in New Issue
Block a user