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

@@ -9,11 +9,11 @@ from erpnext.regional.italy.setup import make_custom_fields, setup_report
def execute():
company = frappe.get_all('Company', filters = {'country': 'Italy'})
company = frappe.get_all("Company", filters={"country": "Italy"})
if not company:
return
frappe.reload_doc('regional', 'report', 'electronic_invoice_register')
frappe.reload_doc("regional", "report", "electronic_invoice_register")
make_custom_fields()
setup_report()
@@ -25,15 +25,21 @@ def execute():
if condition:
condition = "state_code = (case state {0} end),".format(condition)
frappe.db.sql("""
frappe.db.sql(
"""
UPDATE tabAddress set {condition} country_code = UPPER(ifnull((select code
from `tabCountry` where name = `tabAddress`.country), ''))
where country_code is null and state_code is null
""".format(condition=condition))
""".format(
condition=condition
)
)
frappe.db.sql("""
frappe.db.sql(
"""
UPDATE `tabSales Invoice Item` si, `tabSales Order` so
set si.customer_po_no = so.po_no, si.customer_po_date = so.po_date
WHERE
si.sales_order = so.name and so.po_no is not null
""")
"""
)