fix: validate accepted and rejected qty in SCR Item
This commit is contained in:
parent
a0e2a93f3f
commit
f028bd6e69
@ -57,6 +57,7 @@ class SubcontractingReceipt(SubcontractingController):
|
||||
|
||||
def before_validate(self):
|
||||
super(SubcontractingReceipt, self).before_validate()
|
||||
self.validate_items_qty()
|
||||
self.set_items_bom()
|
||||
self.set_items_cost_center()
|
||||
self.set_items_expense_account()
|
||||
@ -194,6 +195,13 @@ class SubcontractingReceipt(SubcontractingController):
|
||||
).format(item.idx)
|
||||
)
|
||||
|
||||
def validate_items_qty(self):
|
||||
for item in self.items:
|
||||
if not (item.qty or item.rejected_qty):
|
||||
frappe.throw(
|
||||
_(f"Row {item.idx}: Accepted Qty and Rejected Qty can't be zero at the same time.")
|
||||
)
|
||||
|
||||
def set_items_bom(self):
|
||||
if self.is_return:
|
||||
for item in self.items:
|
||||
|
Loading…
x
Reference in New Issue
Block a user