def test_auto_material_request(self): webnotes.conn.sql("""delete from `tabMaterial Request Item`""") webnotes.conn.sql("""delete from `tabMaterial Request`""") self._clear_stock_account_balance() webnotes.conn.set_value("Stock Settings", None, "auto_indent", True) st1 = webnotes.bean(copy=test_records[0]) st1.insert() st1.submit() st2 = webnotes.bean(copy=test_records[1]) st2.insert() st2.submit() from stock.utils import reorder_item reorder_item() mr_name = webnotes.conn.sql( """select parent from `tabMaterial Request Item` where item_code='_Test Item'""" ) self.assertTrue(mr_name) webnotes.conn.set_default("company", self.old_default_company)
def test_auto_material_request(self): webnotes.conn.sql("""delete from `tabMaterial Request Item`""") webnotes.conn.sql("""delete from `tabMaterial Request`""") self._clear_stock_account_balance() webnotes.conn.set_value("Stock Settings", None, "auto_indent", True) st1 = webnotes.bean(copy=test_records[0]) st1.insert() st1.submit() st2 = webnotes.bean(copy=test_records[1]) st2.insert() st2.submit() from stock.utils import reorder_item reorder_item() mr_name = webnotes.conn.sql( """select parent from `tabMaterial Request Item` where item_code='_Test Item'""") self.assertTrue(mr_name) webnotes.conn.set_default("company", self.old_default_company)