* fix: `ZeroDivisionError: float division by zero` in SCR (cherry picked from commit434aa594d5) * chore: add row-index in error msgs (cherry picked from commit6878f40d1d) * chore: update error msgs for Subcontracted PO (cherry picked from commita0e2a93f3f) * fix: validate accepted and rejected qty in SCR Item (cherry picked from commitf028bd6e69) * chore: linter (cherry picked from commitb26e96cdf4) Co-authored-by: s-aga-r <sagarsharma.s312@gmail.com>
This commit is contained in:
@@ -74,24 +74,25 @@ class SubcontractingController(StockController):
|
||||
)
|
||||
|
||||
if not is_stock_item:
|
||||
msg = f"Item {item.item_name} must be a stock item."
|
||||
frappe.throw(_(msg))
|
||||
frappe.throw(_("Row {0}: Item {1} must be a stock item.").format(item.idx, item.item_name))
|
||||
|
||||
if not is_sub_contracted_item:
|
||||
msg = f"Item {item.item_name} must be a subcontracted item."
|
||||
frappe.throw(_(msg))
|
||||
frappe.throw(
|
||||
_("Row {0}: Item {1} must be a subcontracted item.").format(item.idx, item.item_name)
|
||||
)
|
||||
|
||||
if item.bom:
|
||||
bom = frappe.get_doc("BOM", item.bom)
|
||||
if not bom.is_active:
|
||||
msg = f"Please select an active BOM for Item {item.item_name}."
|
||||
frappe.throw(_(msg))
|
||||
frappe.throw(
|
||||
_("Row {0}: Please select an active BOM for Item {1}.").format(item.idx, item.item_name)
|
||||
)
|
||||
if bom.item != item.item_code:
|
||||
msg = f"Please select an valid BOM for Item {item.item_name}."
|
||||
frappe.throw(_(msg))
|
||||
frappe.throw(
|
||||
_("Row {0}: Please select an valid BOM for Item {1}.").format(item.idx, item.item_name)
|
||||
)
|
||||
else:
|
||||
msg = f"Please select a BOM for Item {item.item_name}."
|
||||
frappe.throw(_(msg))
|
||||
frappe.throw(_("Row {0}: Please select a BOM for Item {1}.").format(item.idx, item.item_name))
|
||||
|
||||
def __get_data_before_save(self):
|
||||
item_dict = {}
|
||||
|
||||
Reference in New Issue
Block a user