minor patch fixes

This commit is contained in:
Nabin Hait 2016-09-26 18:00:00 +05:30
parent 7faa4b5fdf
commit ad3e213b41

View File

@ -29,10 +29,11 @@ def execute():
make_warehouse_nestedset(company) make_warehouse_nestedset(company)
else: else:
sle_against_companies = frappe.db.sql_list("""select distinct company from `tabStock Ledger Entry`""") sle_against_companies = frappe.db.sql_list("""select distinct company from `tabStock Ledger Entry`""")
company = frappe.defaults.get_defaults().company
if len(sle_against_companies) == 1: if len(sle_against_companies) == 1:
set_company_to_warehouse(company) company = frappe.db.get_value("Company", sle_against_companies[0],
fieldname=["name", "abbr"], as_dict=1)
set_company_to_warehouse(company.name)
make_warehouse_nestedset(company) make_warehouse_nestedset(company)
elif len(sle_against_companies) > 1: elif len(sle_against_companies) > 1: