[minor] demo and item
diff --git a/stock/doctype/item/item.py b/stock/doctype/item/item.py
index 121226a..a4985e9 100644
--- a/stock/doctype/item/item.py
+++ b/stock/doctype/item/item.py
@@ -207,6 +207,7 @@
return sle and 'exists' or 'not exists'
def validate_name_with_item_group(self):
+ # causes problem with tree build
if webnotes.conn.exists("Item Group", self.doc.name):
webnotes.msgprint("An item group exists with same name (%s), \
please change the item name or rename the item group" %
diff --git a/utilities/demo/make_demo.py b/utilities/demo/make_demo.py
index 67e163f..b98fd7a 100644
--- a/utilities/demo/make_demo.py
+++ b/utilities/demo/make_demo.py
@@ -153,7 +153,7 @@
for po in list(set([r[0] for r in query_report.run(report)["result"] if r[0]!="Total"]))[:how_many("Purchase Receipt")]:
pr = webnotes.bean(make_purchase_receipt(po))
pr.doc.posting_date = current_date
- pr.doc.fiscal_year = "2013"
+ pr.doc.fiscal_year = current_date.year
pr.insert()
try:
pr.submit()
@@ -169,7 +169,7 @@
for so in list(set([r[0] for r in query_report.run(report)["result"] if r[0]!="Total"]))[:how_many("Delivery Note")]:
dn = webnotes.bean(make_delivery_note(so))
dn.doc.posting_date = current_date
- dn.doc.fiscal_year = "2013"
+ dn.doc.fiscal_year = current_date.year
dn.insert()
try:
dn.submit()
@@ -192,7 +192,7 @@
mr = webnotes.new_bean("Material Request")
mr.doc.material_request_type = "Purchase"
mr.doc.transaction_date = current_date
- mr.doc.fiscal_year = "2013"
+ mr.doc.fiscal_year = current_date.year
mr.doclist.append({
"doctype": "Material Request Item",
"parentfield": "indent_details",
@@ -211,7 +211,7 @@
if row[0] != "Total":
sq = webnotes.bean(make_supplier_quotation(row[0]))
sq.doc.transaction_date = current_date
- sq.doc.fiscal_year = "2013"
+ sq.doc.fiscal_year = current_date.year
sq.insert()
sq.submit()
webnotes.conn.commit()
@@ -224,7 +224,7 @@
if row[0] != "Total":
po = webnotes.bean(make_purchase_order(row[0]))
po.doc.transaction_date = current_date
- po.doc.fiscal_year = "2013"
+ po.doc.fiscal_year = current_date.year
po.insert()
po.submit()
webnotes.conn.commit()
@@ -283,7 +283,7 @@
try:
st = webnotes.bean(make_stock_entry(pro_id, purpose))
st.doc.posting_date = current_date
- st.doc.fiscal_year = "2013"
+ st.doc.fiscal_year = current_date.year
for d in st.doclist.get({"parentfield": "mtn_details"}):
d.expense_account = "Stock Adjustment - " + company_abbr
d.cost_center = "Main - " + company_abbr
@@ -303,7 +303,7 @@
"customer": get_random("Customer"),
"order_type": "Sales",
"transaction_date": current_date,
- "fiscal_year": "2013"
+ "fiscal_year": current_date.year
}])
add_random_children(b, {