mirror of
https://github.com/frappe/erpnext.git
synced 2026-04-12 19:35:09 +00:00
test: Validate the actual quantity when creating a material request from the sales order
This commit is contained in:
@@ -9,6 +9,8 @@ import frappe.permissions
|
||||
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
|
||||
@@ -119,6 +121,10 @@ class TestSalesOrder(AccountsTestMixin, IntegrationTestCase):
|
||||
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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user