new rename doc function

This commit is contained in:
Anand Doshi 2012-05-29 15:47:27 +05:30
parent 002191f166
commit 9c011f405d
2 changed files with 12 additions and 9 deletions

View File

@ -1,6 +1,6 @@
import webnotes
import conf
from webnotes.model import rename, delete_doc
import webnotes.model
from webnotes.model.code import get_obj
from wnf import replace_code
from termcolor import colored
@ -150,10 +150,13 @@ def rename_in_db(ren_data, data_type, is_doctype):
print colored('Renaming... ' + d + ' --> '+ ren_data[d], 'yellow')
#rename
try:
rename(data_type, d, ren_data[d], is_doctype)
webnotes.model.rename(data_type, d, ren_data[d], is_doctype)
except Exception, e:
print e
pass
if e.args[0]!=1050:
raise e
else:
print e
pass
def update_dt_in_records(rendt):

View File

@ -227,16 +227,16 @@ patch_list = [
'patch_file': 'so_rv_mapper_fix',
'description': 'SO-RV duplicate mapper entry removal'
},
{
'patch_module': 'patches.jan_mar_2012',
'patch_file': 'sync_ref_db',
'description': 'Deletes non required doctypes'
},
{
'patch_module': 'patches.mar_2012',
'patch_file': 'clean_property_setter',
'description': 'Patch related to property setter cleanup'
},
{
'patch_module': 'patches.jan_mar_2012',
'patch_file': 'sync_ref_db',
'description': 'Deletes non required doctypes'
},
{
'patch_module': 'patches.april_2012',
'patch_file': 'naming_series_patch',