mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-22 06:29:20 +00:00
new rename doc function
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
import webnotes
|
import webnotes
|
||||||
import conf
|
import conf
|
||||||
from webnotes.model import rename, delete_doc
|
import webnotes.model
|
||||||
from webnotes.model.code import get_obj
|
from webnotes.model.code import get_obj
|
||||||
from wnf import replace_code
|
from wnf import replace_code
|
||||||
from termcolor import colored
|
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')
|
print colored('Renaming... ' + d + ' --> '+ ren_data[d], 'yellow')
|
||||||
#rename
|
#rename
|
||||||
try:
|
try:
|
||||||
rename(data_type, d, ren_data[d], is_doctype)
|
webnotes.model.rename(data_type, d, ren_data[d], is_doctype)
|
||||||
except Exception, e:
|
except Exception, e:
|
||||||
print e
|
if e.args[0]!=1050:
|
||||||
pass
|
raise e
|
||||||
|
else:
|
||||||
|
print e
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
def update_dt_in_records(rendt):
|
def update_dt_in_records(rendt):
|
||||||
|
|||||||
@@ -227,16 +227,16 @@ patch_list = [
|
|||||||
'patch_file': 'so_rv_mapper_fix',
|
'patch_file': 'so_rv_mapper_fix',
|
||||||
'description': 'SO-RV duplicate mapper entry removal'
|
'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_module': 'patches.mar_2012',
|
||||||
'patch_file': 'clean_property_setter',
|
'patch_file': 'clean_property_setter',
|
||||||
'description': 'Patch related to property setter cleanup'
|
'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_module': 'patches.april_2012',
|
||||||
'patch_file': 'naming_series_patch',
|
'patch_file': 'naming_series_patch',
|
||||||
|
|||||||
Reference in New Issue
Block a user