Fixes in Make Demo
This commit is contained in:
parent
d9ba544e09
commit
fc13b87fd5
@ -320,12 +320,9 @@ class DocType(SellingController):
|
|||||||
item = webnotes.conn.sql("select name,is_asset_item,is_sales_item from `tabItem` where name = '%s' and (ifnull(end_of_life,'')='' or end_of_life = '0000-00-00' or end_of_life > now())"% d.item_code)
|
item = webnotes.conn.sql("select name,is_asset_item,is_sales_item from `tabItem` where name = '%s' and (ifnull(end_of_life,'')='' or end_of_life = '0000-00-00' or end_of_life > now())"% d.item_code)
|
||||||
acc = webnotes.conn.sql("select account_type from `tabAccount` where name = '%s' and docstatus != 2" % d.income_account)
|
acc = webnotes.conn.sql("select account_type from `tabAccount` where name = '%s' and docstatus != 2" % d.income_account)
|
||||||
if not acc:
|
if not acc:
|
||||||
msgprint("Account: "+d.income_account+" does not exist in the system")
|
msgprint("Account: "+d.income_account+" does not exist in the system", raise_exception=True)
|
||||||
raise Exception
|
|
||||||
elif item and item[0][1] == 'Yes' and not acc[0][0] == 'Fixed Asset Account':
|
elif item and item[0][1] == 'Yes' and not acc[0][0] == 'Fixed Asset Account':
|
||||||
msgprint("Please select income head with account type 'Fixed Asset Account' as Item %s is an asset item" % d.item_code)
|
msgprint("Please select income head with account type 'Fixed Asset Account' as Item %s is an asset item" % d.item_code, raise_exception=True)
|
||||||
raise Exception
|
|
||||||
|
|
||||||
|
|
||||||
def validate_with_previous_doc(self):
|
def validate_with_previous_doc(self):
|
||||||
super(DocType, self).validate_with_previous_doc(self.tname, {
|
super(DocType, self).validate_with_previous_doc(self.tname, {
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
{
|
{
|
||||||
"creation": "2013-05-13 16:10:02",
|
"creation": "2013-05-13 16:10:02",
|
||||||
"docstatus": 0,
|
"docstatus": 0,
|
||||||
"modified": "2013-05-13 16:21:07",
|
"modified": "2014-01-24 18:19:11",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"owner": "Administrator"
|
"owner": "Administrator"
|
||||||
},
|
},
|
||||||
@ -11,7 +11,7 @@
|
|||||||
"doctype": "Report",
|
"doctype": "Report",
|
||||||
"is_standard": "Yes",
|
"is_standard": "Yes",
|
||||||
"name": "__common__",
|
"name": "__common__",
|
||||||
"query": "select \n mr.name as \"Material Request:Link/Material Request:120\",\n\tmr.transaction_date as \"Date:Date:100\",\n\tmr_item.item_code as \"Item Code:Link/Item:120\",\n\tmr_item.qty as \"Qty:Float:100\",\n\tmr_item.ordered_qty as \"Ordered Qty:Float:100\", \n\t(mr_item.qty - ifnull(mr_item.ordered_qty, 0)) as \"Qty to Order:Float:100\",\n\tmr_item.item_name as \"Item Name::150\",\n\tmr_item.description as \"Description::200\"\nfrom\n\t`tabMaterial Request` mr, `tabMaterial Request Item` mr_item\nwhere\n\tmr_item.parent = mr.name\n\tand mr.material_request_type = \"Purchase\"\n\tand mr.docstatus = 1\n\tand mr.status != \"Stopped\"\n\tand ifnull(mr_item.ordered_qty, 0) < ifnull(mr_item.qty, 0)\norder by mr.transaction_date asc",
|
"query": "select \n mr.name as \"Material Request:Link/Material Request:120\",\n\tmr.transaction_date as \"Date:Date:100\",\n\tmr_item.item_code as \"Item Code:Link/Item:120\",\n\tsum(ifnull(mr_item.qty, 0)) as \"Qty:Float:100\",\n\tsum(ifnull(mr_item.ordered_qty, 0)) as \"Ordered Qty:Float:100\", \n\t(sum(mr_item.qty) - sum(ifnull(mr_item.ordered_qty, 0))) as \"Qty to Order:Float:100\",\n\tmr_item.item_name as \"Item Name::150\",\n\tmr_item.description as \"Description::200\"\nfrom\n\t`tabMaterial Request` mr, `tabMaterial Request Item` mr_item\nwhere\n\tmr_item.parent = mr.name\n\tand mr.material_request_type = \"Purchase\"\n\tand mr.docstatus = 1\n\tand mr.status != \"Stopped\"\ngroup by mr.name, mr_item.item_code\nhaving\n\tsum(ifnull(mr_item.ordered_qty, 0)) < sum(ifnull(mr_item.qty, 0))\norder by mr.transaction_date asc",
|
||||||
"ref_doctype": "Purchase Order",
|
"ref_doctype": "Purchase Order",
|
||||||
"report_name": "Requested Items To Be Ordered",
|
"report_name": "Requested Items To Be Ordered",
|
||||||
"report_type": "Query Report"
|
"report_type": "Query Report"
|
||||||
|
@ -21,3 +21,4 @@ Start entering data below this line,,,,
|
|||||||
,,2009,01-01-2009,31-12-2009,No
|
,,2009,01-01-2009,31-12-2009,No
|
||||||
,,2010,01-01-2010,31-12-2010,No
|
,,2010,01-01-2010,31-12-2010,No
|
||||||
,,2011,01-01-2011,31-12-2011,No
|
,,2011,01-01-2011,31-12-2011,No
|
||||||
|
,,2012,01-01-2012,31-12-2012,No
|
Can't render this file because it has a wrong number of fields in line 16.
|
@ -19,7 +19,7 @@ company_abbr = "WP"
|
|||||||
country = "United States"
|
country = "United States"
|
||||||
currency = "USD"
|
currency = "USD"
|
||||||
time_zone = "America/New_York"
|
time_zone = "America/New_York"
|
||||||
start_date = '2013-01-01'
|
start_date = '2014-01-01'
|
||||||
bank_name = "Citibank"
|
bank_name = "Citibank"
|
||||||
runs_for = None
|
runs_for = None
|
||||||
prob = {
|
prob = {
|
||||||
@ -105,6 +105,10 @@ def run_accounts(current_date):
|
|||||||
for so in list(set([r[0] for r in query_report.run(report)["result"] if r[0]!="Total"]))[:how_many("Sales Invoice")]:
|
for so in list(set([r[0] for r in query_report.run(report)["result"] if r[0]!="Total"]))[:how_many("Sales Invoice")]:
|
||||||
si = webnotes.bean(make_sales_invoice(so))
|
si = webnotes.bean(make_sales_invoice(so))
|
||||||
si.doc.posting_date = current_date
|
si.doc.posting_date = current_date
|
||||||
|
for d in si.doclist.get({"parentfield": "entries"}):
|
||||||
|
if not d.income_account:
|
||||||
|
d.income_account = "Sales - {}".format(company_abbr)
|
||||||
|
|
||||||
si.insert()
|
si.insert()
|
||||||
si.submit()
|
si.submit()
|
||||||
webnotes.conn.commit()
|
webnotes.conn.commit()
|
||||||
@ -170,6 +174,9 @@ def run_stock(current_date):
|
|||||||
dn = webnotes.bean(make_delivery_note(so))
|
dn = webnotes.bean(make_delivery_note(so))
|
||||||
dn.doc.posting_date = current_date
|
dn.doc.posting_date = current_date
|
||||||
dn.doc.fiscal_year = current_date.year
|
dn.doc.fiscal_year = current_date.year
|
||||||
|
for d in dn.doclist.get({"parentfield": "delivery_note_details"}):
|
||||||
|
d.expense_account = "Cost of Goods Sold - {}".format(company_abbr)
|
||||||
|
|
||||||
dn.insert()
|
dn.insert()
|
||||||
try:
|
try:
|
||||||
dn.submit()
|
dn.submit()
|
||||||
@ -236,7 +243,7 @@ def run_manufacturing(current_date):
|
|||||||
ppt = webnotes.bean("Production Planning Tool", "Production Planning Tool")
|
ppt = webnotes.bean("Production Planning Tool", "Production Planning Tool")
|
||||||
ppt.doc.company = company
|
ppt.doc.company = company
|
||||||
ppt.doc.use_multi_level_bom = 1
|
ppt.doc.use_multi_level_bom = 1
|
||||||
ppt.doc.purchase_request_for_warehouse = "Stores - WP"
|
ppt.doc.purchase_request_for_warehouse = "Stores - {}".format(company_abbr)
|
||||||
ppt.run_method("get_open_sales_orders")
|
ppt.run_method("get_open_sales_orders")
|
||||||
ppt.run_method("get_items_from_so")
|
ppt.run_method("get_items_from_so")
|
||||||
ppt.run_method("raise_production_order")
|
ppt.run_method("raise_production_order")
|
||||||
@ -380,8 +387,8 @@ def complete_setup():
|
|||||||
setup_account({
|
setup_account({
|
||||||
"first_name": "Test",
|
"first_name": "Test",
|
||||||
"last_name": "User",
|
"last_name": "User",
|
||||||
"fy_start_date": "2013-01-01",
|
"fy_start_date": "2014-01-01",
|
||||||
"fy_end_date": "2013-12-31",
|
"fy_end_date": "2014-12-31",
|
||||||
"industry": "Manufacturing",
|
"industry": "Manufacturing",
|
||||||
"company_name": company,
|
"company_name": company,
|
||||||
"company_abbr": company_abbr,
|
"company_abbr": company_abbr,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user