From 7fb08173b54b67a67aac03102a6327cc3c9b475b Mon Sep 17 00:00:00 2001 From: 18alantom <2.alan.tom@gmail.com> Date: Tue, 17 Aug 2021 16:03:04 +0530 Subject: [PATCH] fix: reword error messages, fix test values --- erpnext/manufacturing/doctype/bom/bom.py | 10 +++++----- .../doctype/work_order/test_work_order.py | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/erpnext/manufacturing/doctype/bom/bom.py b/erpnext/manufacturing/doctype/bom/bom.py index 8d9b10ddc1..8d105789d0 100644 --- a/erpnext/manufacturing/doctype/bom/bom.py +++ b/erpnext/manufacturing/doctype/bom/bom.py @@ -696,23 +696,23 @@ class BOM(WebsiteGenerator): for item in self.scrap_items: msg = "" if item.item_code == self.item and not item.is_process_loss: - msg = _('Scrap/Loss Item: {0} should have Is Process Loss checked') \ + msg = _('Scrap/Loss Item: {0} should have Is Process Loss checked as it is the same as the item to be manufactured or repacked.') \ .format(frappe.bold(item.item_code)) elif item.item_code != self.item and item.is_process_loss: - msg = _('Scrap/Loss Item: {0} should not have Is Process Loss checked') \ + msg = _('Scrap/Loss Item: {0} should not have Is Process Loss checked as it is different from the item to be manufactured or repacked') \ .format(frappe.bold(item.item_code)) must_be_whole_number = frappe.get_value("UOM", item.stock_uom, "must_be_whole_number") if item.is_process_loss and must_be_whole_number: - msg = _("Item: {0} with Stock UOM: {1} cannot be a Scrap/Loss Item") \ + msg = _("Item: {0} with Stock UOM: {1} cannot be a Scrap/Loss Item as {1} is a whole UOM.") \ .format(frappe.bold(item.item_code), frappe.bold(item.stock_uom)) if item.is_process_loss and (item.stock_qty >= self.quantity): - msg = _("Scrap/Loss Item: {0} should have Qty less than finished goods Quantity") \ + msg = _("Scrap/Loss Item: {0} should have Qty less than finished goods Quantity.") \ .format(frappe.bold(item.item_code)) if item.is_process_loss and (item.rate > 0): - msg = _("Scrap/Loss Item: {0} should have Rate set to 0 because Is Process Loss is checked") \ + msg = _("Scrap/Loss Item: {0} should have Rate set to 0 because Is Process Loss is checked.") \ .format(frappe.bold(item.item_code)) if msg: diff --git a/erpnext/manufacturing/doctype/work_order/test_work_order.py b/erpnext/manufacturing/doctype/work_order/test_work_order.py index d6a20df0c8..0569092f88 100644 --- a/erpnext/manufacturing/doctype/work_order/test_work_order.py +++ b/erpnext/manufacturing/doctype/work_order/test_work_order.py @@ -735,7 +735,7 @@ class TestWorkOrder(unittest.TestCase): # Testing stock entry values items = se.get("items") - self.assertEqual(len(items), 4, "There should be 3 items including process loss.") + self.assertEqual(len(items), 3, "There should be 3 items including process loss.") source_item, fg_item, pl_item = items @@ -746,7 +746,7 @@ class TestWorkOrder(unittest.TestCase): self.assertEqual(fg_item.qty, actual_fg_qty) # Testing Work Order values - self.assertEqual(frappe.db.get_value("Work Order", wo.name, "produced_qty"), actual_fg_qty) + self.assertEqual(frappe.db.get_value("Work Order", wo.name, "produced_qty"), qty) def get_scrap_item_details(bom_no): scrap_items = {}