[fixes] errors caught on flake8 (#10126)

This commit is contained in:
Rushabh Mehta 2017-07-28 11:39:01 +05:30 committed by GitHub
parent 2653825d25
commit d50da78f28
6 changed files with 127 additions and 139 deletions

View File

@ -158,7 +158,6 @@ def get_balance_on(account=None, date=None, party_type=None, party=None, company
return flt(bal)
def get_count_on(account, fieldname, date):
cond = []
if date:
cond.append("posting_date <= '%s'" % frappe.db.escape(cstr(date)))
@ -195,11 +194,6 @@ def get_count_on(account, fieldname, date):
select name from `tabAccount` ac where ac.name = gle.account
and ac.lft >= %s and ac.rgt <= %s
)""" % (acc.lft, acc.rgt))
# If group and currency same as company,
# always return balance based on debit and credit in company currency
if acc.account_currency == frappe.db.get_value("Company", acc.company, "default_currency"):
in_account_currency = False
else:
cond.append("""gle.account = "%s" """ % (frappe.db.escape(account, percent=False), ))
@ -534,7 +528,7 @@ def get_stock_and_account_difference(account_list=None, posting_date=None):
account_balance = get_balance_on(account_data.get('account'), posting_date, in_account_currency=False)
stock_value = get_stock_value_on(warehouse, posting_date)
if abs(flt(stock_value) - flt(account_balance)) > 0.005:
difference.setdefault(account, flt(stock_value) - flt(account_balance))
difference.setdefault(account_data.get('account'), flt(stock_value) - flt(account_balance))
return difference
@ -695,9 +689,6 @@ def get_children():
return acc
def create_payment_gateway_account(gateway):
create_payment_gateway_account(gateway)
def create_payment_gateway_account(gateway):
from erpnext.setup.setup_wizard.setup_wizard import create_bank_account

View File

@ -367,9 +367,6 @@ def run_production_planning_tool(**args):
return ppt
def create_production_orders(ppt):
raise_production_orders(ppt)
def create_material_requests(ppt):
ppt.raise_material_requests()

View File

@ -6,5 +6,5 @@ import frappe
def execute():
return
country = get_country_info(country="Turkey")
add_country_and_currency("Turkey", country)
# country = get_country_info(country="Turkey")
# add_country_and_currency("Turkey", country)

View File

@ -3,9 +3,9 @@ import frappe
def execute():
return
frappe.reload_doc('website', 'doctype', 'style_settings')
style_settings = frappe.get_doc("Style Settings", "Style Settings")
if not style_settings.apply_style:
style_settings.update(default_properties)
style_settings.apply_style = 1
style_settings.save()
# frappe.reload_doc('website', 'doctype', 'style_settings')
# style_settings = frappe.get_doc("Style Settings", "Style Settings")
# if not style_settings.apply_style:
# style_settings.update(default_properties)
# style_settings.apply_style = 1
# style_settings.save()

View File

@ -2,19 +2,19 @@ import frappe
def execute():
return
for party_type in ('Customer', 'Supplier'):
frappe.reload_doctype(party_type)
# set all as default status
frappe.db.sql('update `tab{0}` set status=%s'.format(party_type), default_status[party_type])
for doctype in status_depends_on[party_type]:
filters = get_filters_for(doctype)
parties = frappe.get_all(doctype, fields="{0} as party".format(party_type.lower()),
filters=filters, limit_page_length=1)
parties = filter(None, [p.party for p in parties])
if parties:
frappe.db.sql('update `tab{0}` set status="Open" where name in ({1})'.format(party_type,
', '.join(len(parties) * ['%s'])), parties)
# for party_type in ('Customer', 'Supplier'):
# frappe.reload_doctype(party_type)
#
# # set all as default status
# frappe.db.sql('update `tab{0}` set status=%s'.format(party_type), default_status[party_type])
#
# for doctype in status_depends_on[party_type]:
# filters = get_filters_for(doctype)
# parties = frappe.get_all(doctype, fields="{0} as party".format(party_type.lower()),
# filters=filters, limit_page_length=1)
#
# parties = filter(None, [p.party for p in parties])
#
# if parties:
# frappe.db.sql('update `tab{0}` set status="Open" where name in ({1})'.format(party_type,
# ', '.join(len(parties) * ['%s'])), parties)

View File

@ -51,4 +51,4 @@ def check_and_update_auto_email_report(report):
frappe.delete_doc("Auto Email Report", auto_email_report)
elif report in ["Customer Addresses And Contacts", "Supplier Addresses And Contacts"]:
frapppe.db.set_value("Auto Email Report", auto_email_report, "report", report)
frappe.db.set_value("Auto Email Report", auto_email_report, "report", report)