Skip to content

Commit

Permalink
test: Validate the actual quantity when creating a material request f…
Browse files Browse the repository at this point in the history
…rom the sales order
  • Loading branch information
Bhavan23 committed Oct 8, 2024
1 parent 9302081 commit 17fdd42
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions erpnext/selling/doctype/sales_order/test_sales_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
from frappe.core.doctype.user_permission.test_user_permission import create_user
from frappe.tests import IntegrationTestCase
from frappe.utils import add_days, flt, getdate, nowdate, today
from erpnext.stock.get_item_details import get_bin_details


from erpnext.accounts.test.accounts_mixin import AccountsTestMixin
from erpnext.controllers.accounts_controller import InvalidQtyError, update_child_qty_rate
Expand Down Expand Up @@ -119,6 +121,10 @@ def test_make_material_request(self):
self.assertEqual(mr.material_request_type, "Purchase")
self.assertEqual(len(mr.get("items")), len(so.get("items")))

for item in mr.get("items"):
actual_qty = get_bin_details(item.item_code, item.warehouse, mr.company, True).get("actual_qty", 0)
self.assertEqual(flt(item.actual_qty), actual_qty)

def test_make_delivery_note(self):
so = make_sales_order(do_not_submit=True)

Expand Down

0 comments on commit 17fdd42

Please sign in to comment.