Skip to content

Commit

Permalink
Don't allow to set negative quantity if transaction is not return ent…
Browse files Browse the repository at this point in the history
…ry (#13255)
  • Loading branch information
rohitwaghchaure authored and nabinhait committed Mar 12, 2018
1 parent 69d9f51 commit 12aa426
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions erpnext/controllers/status_updater.py
Expand Up @@ -156,6 +156,9 @@ def validate_qty(self):

# 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'])

Expand Down

0 comments on commit 12aa426

Please sign in to comment.