2012-07-19 13:40:31 +05:30
|
|
|
from __future__ import unicode_literals
|
2012-05-28 13:26:17 +05:30
|
|
|
def execute():
|
|
|
|
"""
|
|
|
|
* Replace EURO with EUR
|
|
|
|
* Delete EURO from tabCurrency
|
|
|
|
"""
|
|
|
|
import webnotes
|
|
|
|
tables = webnotes.conn.sql("show tables")
|
|
|
|
for (tab,) in tables:
|
|
|
|
desc = webnotes.conn.sql("desc `%s`" % tab, as_dict=1)
|
|
|
|
for d in desc:
|
|
|
|
if "currency" in d.get('Field'):
|
|
|
|
field = d.get('Field')
|
|
|
|
webnotes.conn.sql("""\
|
|
|
|
update `%s` set `%s`='EUR'
|
|
|
|
where `%s`='EURO'""" % (tab, field, field))
|
2012-05-29 10:58:28 +05:30
|
|
|
webnotes.conn.sql("update `tabSingles` set value='EUR' where value='EURO'")
|
2012-05-28 13:26:17 +05:30
|
|
|
webnotes.conn.sql("delete from `tabCurrency` where name='EURO'")
|