[fix] Patch fixed for account_currency field rename

This commit is contained in:
Nabin Hait 2015-08-28 19:26:28 +05:30
parent 6e439a5e53
commit c68f68d6cc

View File

@ -13,8 +13,8 @@ def execute():
for company in frappe.get_all("Company", fields=["name", "default_currency", "default_receivable_account"]): for company in frappe.get_all("Company", fields=["name", "default_currency", "default_receivable_account"]):
# update currency in account and gl entry as per company currency # update currency in account and gl entry as per company currency
frappe.db.sql("""update `tabAccount` set currency = %s frappe.db.sql("""update `tabAccount` set account_currency = %s
where ifnull(currency, '') = '' and company=%s""", (company.default_currency, company.name)) where ifnull(account_currency, '') = '' and company=%s""", (company.default_currency, company.name))
# update newly introduced field's value in sales / purchase invoice # update newly introduced field's value in sales / purchase invoice
frappe.db.sql(""" frappe.db.sql("""
@ -45,7 +45,7 @@ def execute():
set set
debit_in_account_currency=debit, debit_in_account_currency=debit,
credit_in_account_currency=credit, credit_in_account_currency=credit,
currency=%s account_currency=%s
where where
jea.parent = je.name jea.parent = je.name
and je.company=%s and je.company=%s
@ -58,7 +58,7 @@ def execute():
set set
debit_in_account_currency=debit, debit_in_account_currency=debit,
credit_in_account_currency=credit, credit_in_account_currency=credit,
currency=%s account_currency=%s
where where
company=%s company=%s
""", (company.default_currency, company.name)) """, (company.default_currency, company.name))