style: format code with black

This commit is contained in:
Ankush Menat
2022-03-28 18:52:46 +05:30
parent 21e00da3d6
commit 494bd9ef78
1395 changed files with 91704 additions and 62532 deletions

View File

@@ -7,12 +7,13 @@ import frappe
def execute():
frappe.reload_doc('accounts', 'doctype', 'subscription')
frappe.reload_doc('accounts', 'doctype', 'subscription_invoice')
frappe.reload_doc('accounts', 'doctype', 'subscription_plan')
frappe.reload_doc("accounts", "doctype", "subscription")
frappe.reload_doc("accounts", "doctype", "subscription_invoice")
frappe.reload_doc("accounts", "doctype", "subscription_plan")
if frappe.db.has_column('Subscription', 'customer'):
frappe.db.sql("""
if frappe.db.has_column("Subscription", "customer"):
frappe.db.sql(
"""
UPDATE `tabSubscription`
SET
start_date = start,
@@ -20,22 +21,28 @@ def execute():
party = customer,
sales_tax_template = tax_template
WHERE IFNULL(party,'') = ''
""")
"""
)
frappe.db.sql("""
frappe.db.sql(
"""
UPDATE `tabSubscription Invoice`
SET document_type = 'Sales Invoice'
WHERE IFNULL(document_type, '') = ''
""")
"""
)
price_determination_map = {
'Fixed rate': 'Fixed Rate',
'Based on price list': 'Based On Price List'
"Fixed rate": "Fixed Rate",
"Based on price list": "Based On Price List",
}
for key, value in price_determination_map.items():
frappe.db.sql("""
frappe.db.sql(
"""
UPDATE `tabSubscription Plan`
SET price_determination = %s
WHERE price_determination = %s
""", (value, key))
""",
(value, key),
)