Don't allow to set negative quantity if transaction is not return entry (#13255)

This commit is contained in:
rohitwaghchaure 2018-03-12 11:20:30 +05:30 committed by Nabin Hait
parent 69d9f51dbb
commit 12aa4265ff

View File

@ -156,6 +156,9 @@ class StatusUpdater(Document):
# get unique transactions to update
for d in self.get_all_children():
if hasattr(d, 'qty') and d.qty < 0 and not self.get('is_return'):
frappe.throw(_("For an item {0}, quantity must be positive number").format(d.item_code))
if d.doctype == args['source_dt'] and d.get(args["join_field"]):
args['name'] = d.get(args['join_field'])