Browse Source

Replace asset path with file path

master
venkataakhil 1 year ago
parent
commit
4faa3c1f65
  1. 14
      smart_service/apis/master_api.py

14
smart_service/apis/master_api.py

@ -378,7 +378,13 @@ def change_file_dir():
pass
def asset_to_files_path():
frappe.db.sql('''
update tabProcedure_Details set file =concat('/files/',SUBSTRING_INDEX(file,'/',-1)) where content_type = 'File' and file like '%Asset/%';
''')
frappe.db.commit()
try:
count = frappe.db.sql('''
select count(*) from tabProcedure_Details where content_type = 'File' and file like '%Asset/%';''')
frappe.db.sql('''
update tabProcedure_Details set file =concat('/files/',SUBSTRING_INDEX(file,'/',-1)) where content_type = 'File' and file like '%Asset/%';
''')
frappe.db.commit()
return count
except:
return False
Loading…
Cancel
Save