mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-23 15:09:20 +00:00
@@ -303,20 +303,13 @@ class DeliveryNote(SellingController):
|
|||||||
)
|
)
|
||||||
|
|
||||||
def validate_packed_qty(self):
|
def validate_packed_qty(self):
|
||||||
"""
|
"""Validate that if packed qty exists, it should be equal to qty"""
|
||||||
Validate that if packed qty exists, it should be equal to qty
|
|
||||||
"""
|
for item in self.items + self.packed_items:
|
||||||
if not any(flt(d.get("packed_qty")) for d in self.get("items")):
|
if item.packed_qty and item.packed_qty != item.qty:
|
||||||
return
|
frappe.throw(
|
||||||
has_error = False
|
_("Row {0}: Packed Qty must be equal to {1} Qty.").format(item.idx, frappe.bold(item.doctype))
|
||||||
for d in self.get("items"):
|
|
||||||
if flt(d.get("qty")) != flt(d.get("packed_qty")):
|
|
||||||
frappe.msgprint(
|
|
||||||
_("Packed quantity must equal quantity for Item {0} in row {1}").format(d.item_code, d.idx)
|
|
||||||
)
|
)
|
||||||
has_error = True
|
|
||||||
if has_error:
|
|
||||||
raise frappe.ValidationError
|
|
||||||
|
|
||||||
def update_pick_list_status(self):
|
def update_pick_list_status(self):
|
||||||
from erpnext.stock.doctype.pick_list.pick_list import update_pick_list_status
|
from erpnext.stock.doctype.pick_list.pick_list import update_pick_list_status
|
||||||
|
|||||||
Reference in New Issue
Block a user