mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-07 23:31:20 +00:00
[purchase] [validation] validate warehouse belongs to company if set
This commit is contained in:
@@ -263,6 +263,12 @@ class TestMaterialRequest(unittest.TestCase):
|
||||
se = webnotes.bean(copy=se_doclist)
|
||||
self.assertRaises(webnotes.MappingMismatchError, se.insert)
|
||||
|
||||
def test_warehouse_company_validation(self):
|
||||
from controllers.buying_controller import WrongWarehouseCompany
|
||||
mr = webnotes.bean(copy=test_records[0])
|
||||
mr.doc.company = "_Test Company 1"
|
||||
self.assertRaises(WrongWarehouseCompany, mr.insert)
|
||||
|
||||
test_records = [
|
||||
[
|
||||
{
|
||||
|
||||
@@ -2,7 +2,8 @@ test_records = [
|
||||
[{
|
||||
"doctype": "Warehouse",
|
||||
"warehouse_name": "_Test Warehouse",
|
||||
"warehouse_type": "_Test Warehouse Type"
|
||||
"warehouse_type": "_Test Warehouse Type",
|
||||
"company": "_Test Company"
|
||||
}],
|
||||
[{
|
||||
"doctype": "Warehouse",
|
||||
|
||||
Reference in New Issue
Block a user