[purchase] [validation] validate warehouse belongs to company if set

This commit is contained in:
Rushabh Mehta
2013-05-02 11:34:37 +05:30
parent e97b07e43f
commit ecb36f2cb0
4 changed files with 26 additions and 2 deletions

View File

@@ -27,6 +27,12 @@ class TestPurchaseOrder(unittest.TestCase):
po.insert()
self.assertEquals(len(po.doclist.get({"parentfield": "po_raw_material_details"})), 2)
def test_warehouse_company_validation(self):
from controllers.buying_controller import WrongWarehouseCompany
po = webnotes.bean(copy=test_records[0])
po.doc.company = "_Test Company 1"
self.assertRaises(WrongWarehouseCompany, po.insert)
test_dependencies = ["BOM"]