Added patch to update account id value in description_html of item, which maps the image url to the description
This commit is contained in:
parent
b61abff9cd
commit
aabf1748a2
@ -1,7 +1,7 @@
|
|||||||
# REMEMBER to update this
|
# REMEMBER to update this
|
||||||
# ========================
|
# ========================
|
||||||
|
|
||||||
last_patch = 336
|
last_patch = 337
|
||||||
|
|
||||||
#-------------------------------------------
|
#-------------------------------------------
|
||||||
|
|
||||||
@ -1357,3 +1357,20 @@ def execute(patch_no):
|
|||||||
sql("update `tabDocField` set fieldtype = 'Link', options = %s where fieldname = 'old_parent' and parent = %s", (dt, dt))
|
sql("update `tabDocField` set fieldtype = 'Link', options = %s where fieldname = 'old_parent' and parent = %s", (dt, dt))
|
||||||
elif patch_no == 336:
|
elif patch_no == 336:
|
||||||
reload_doc('server_tools','page','billing')
|
reload_doc('server_tools','page','billing')
|
||||||
|
elif patch_no == 337:
|
||||||
|
item_list = webnotes.conn.sql("""SELECT name, description_html
|
||||||
|
FROM tabItem""")
|
||||||
|
if item_list:
|
||||||
|
for item, html in item_list:
|
||||||
|
if html and "getfile" in html and "acx" in html:
|
||||||
|
ac_id = webnotes.conn.sql("""SELECT value FROM `tabSingles` WHERE doctype='Control Panel' AND field='account_id'""")
|
||||||
|
sp_acx = html.split("acx=")
|
||||||
|
l_acx = len(sp_acx)
|
||||||
|
if l_acx > 1:
|
||||||
|
for i in range(l_acx-1):
|
||||||
|
sp_quot = sp_acx[i+1].split('"')
|
||||||
|
if len(sp_quot) > 1: sp_quot[0] = str(ac_id[0][0])
|
||||||
|
sp_acx[i+1] = '"'.join(sp_quot)
|
||||||
|
html = "acx=".join(sp_acx)
|
||||||
|
webnotes.conn.sql("""UPDATE tabItem SET description_html=%s WHERE name=%s""", (html, item))
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user