[fix] [minor] erpnext demo

This commit is contained in:
Anand Doshi 2013-08-26 17:33:50 +05:30
parent 3c92b21876
commit c753d31ba7
3 changed files with 8 additions and 10 deletions

View File

@ -261,13 +261,11 @@ class DocType(BuyingController):
if d.purchase_order:
submitted = sql("select name from `tabPurchase Order` where docstatus = 1 and name = '%s'" % d.purchase_order)
if not submitted:
msgprint("Purchase Order : "+ cstr(d.purchase_order) +" is not submitted")
raise Exception , "Validation Error."
webnotes.throw("Purchase Order : "+ cstr(d.purchase_order) +" is not submitted")
if d.purchase_receipt:
submitted = sql("select name from `tabPurchase Receipt` where docstatus = 1 and name = '%s'" % d.purchase_receipt)
if not submitted:
msgprint("Purchase Receipt : "+ cstr(d.purchase_receipt) +" is not submitted")
raise Exception , "Validation Error."
webnotes.throw("Purchase Receipt : "+ cstr(d.purchase_receipt) +" is not submitted")
def update_against_document_in_jv(self):

View File

@ -266,11 +266,11 @@ def make_stock_entry_from_pro(pro_id, purpose, current_date):
from stock.stock_ledger import NegativeStockError
from stock.doctype.stock_entry.stock_entry import IncorrectValuationRateError, DuplicateEntryForProductionOrderError
st = webnotes.bean(make_stock_entry(pro_id, purpose))
st.doc.posting_date = current_date
st.doc.fiscal_year = "2013"
st.doc.expense_adjustment_account = "Stock in Hand - WP"
try:
st = webnotes.bean(make_stock_entry(pro_id, purpose))
st.doc.posting_date = current_date
st.doc.fiscal_year = "2013"
st.doc.expense_adjustment_account = "Stock in Hand - WP"
st.insert()
webnotes.conn.commit()
st.submit()
@ -278,7 +278,7 @@ def make_stock_entry_from_pro(pro_id, purpose, current_date):
except NegativeStockError: pass
except IncorrectValuationRateError: pass
except DuplicateEntryForProductionOrderError: pass
def make_quotation(current_date):
b = webnotes.bean([{
"creation": current_date,

View File

@ -73,7 +73,7 @@ def make_demo_on_login_script():
s.doc.script = dfile.read()
if __name__=="__main__":
webnotes.connect()
# webnotes.connect()
webnotes.mute_emails = 1
make_demo_app()
make_demo_user()