mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-20 05:29:18 +00:00
Merge branch 'master' of github.com:webnotes/erpnext into wsgi
Conflicts: stock/doctype/stock_entry/test_stock_entry.py
This commit is contained in:
@@ -40,6 +40,7 @@ class TestStockEntry(unittest.TestCase):
|
|||||||
webnotes.conn.set_default("company", self.old_default_company)
|
webnotes.conn.set_default("company", self.old_default_company)
|
||||||
|
|
||||||
def test_warehouse_company_validation(self):
|
def test_warehouse_company_validation(self):
|
||||||
|
set_perpetual_inventory(0)
|
||||||
self._clear_stock_account_balance()
|
self._clear_stock_account_balance()
|
||||||
webnotes.bean("Profile", "test2@example.com").get_controller()\
|
webnotes.bean("Profile", "test2@example.com").get_controller()\
|
||||||
.add_roles("Sales User", "Sales Manager", "Material User", "Material Manager")
|
.add_roles("Sales User", "Sales Manager", "Material User", "Material Manager")
|
||||||
@@ -54,6 +55,7 @@ class TestStockEntry(unittest.TestCase):
|
|||||||
webnotes.session.user = "Administrator"
|
webnotes.session.user = "Administrator"
|
||||||
|
|
||||||
def test_warehouse_user(self):
|
def test_warehouse_user(self):
|
||||||
|
set_perpetual_inventory(0)
|
||||||
from stock.utils import UserNotAllowedForWarehouse
|
from stock.utils import UserNotAllowedForWarehouse
|
||||||
|
|
||||||
webnotes.bean("Profile", "test@example.com").get_controller()\
|
webnotes.bean("Profile", "test@example.com").get_controller()\
|
||||||
@@ -68,6 +70,7 @@ class TestStockEntry(unittest.TestCase):
|
|||||||
st1.insert()
|
st1.insert()
|
||||||
self.assertRaises(UserNotAllowedForWarehouse, st1.submit)
|
self.assertRaises(UserNotAllowedForWarehouse, st1.submit)
|
||||||
|
|
||||||
|
webnotes.session.user = "test2@example.com"
|
||||||
st1 = webnotes.bean(copy=test_records[0])
|
st1 = webnotes.bean(copy=test_records[0])
|
||||||
st1.doc.company = "_Test Company 1"
|
st1.doc.company = "_Test Company 1"
|
||||||
st1.doclist[1].t_warehouse="_Test Warehouse 2 - _TC1"
|
st1.doclist[1].t_warehouse="_Test Warehouse 2 - _TC1"
|
||||||
|
|||||||
Reference in New Issue
Block a user