reset standard transaction series in cleanup_data

This commit is contained in:
Nabin Hait 2012-09-18 11:19:34 +05:30
parent 42208085a1
commit 82efcc780b

View File

@ -107,15 +107,22 @@ def delete_masters():
def reset_series(): def reset_all_series():
# Reset series # Reset master series
webnotes.conn.sql("""update tabSeries set current = 0 where name not in \ webnotes.conn.sql("""update tabSeries set current = 0 where name not in
('Ann/', 'BSD', 'DEF', 'DF', 'EV', 'Event Updates/', 'FileData-', \ ('Ann/', 'BSD', 'DEF', 'DF', 'EV', 'Event Updates/', 'FileData-',
'FL', 'FMD/', 'GLM Detail', 'Login Page/', 'MDI', 'MDR', 'MI', 'MIR', \ 'FL', 'FMD/', 'GLM Detail', 'Login Page/', 'MDI', 'MDR', 'MI', 'MIR',
'PERM', 'PR', 'SRCH/C/', 'TD', 'TIC/', 'TMD/', 'TW', 'UR', '_FEED', \ 'PERM', 'PR', 'SRCH/C/', 'TD', 'TIC/', 'TMD/', 'TW', 'UR', '_FEED',
'_SRCH', '_TRIGGER', '__NSO', 'CustomField', 'Letter') '_SRCH', '_TRIGGER', '__NSO', 'CustomField', 'Letter')
""") """)
print "Series updated" print "Series updated"
def reset_transaction_series():
webnotes.conn.sql("""update tabSeries set current = 0 where name in
('JV', 'INV', 'BILL', 'SO', 'DN', 'PO', 'LEAD', 'ENQUIRY', 'ENQ', 'CI',
'IN', 'PS', 'IDT', 'QAI', 'QTN', 'STE', 'SQTN', 'SUP', 'TDSP', 'SR',
'POS', 'LAP', 'LAL', 'EXP')""")
print "Series updated"
def delete_main_masters(): def delete_main_masters():
@ -184,12 +191,11 @@ def run():
# delete # delete
delete_transactions() delete_transactions()
if cleanup_type == '1': if cleanup_type == '1':
print '\n', '*' * 10 + 'NOTE' + '*' * 10, '\n' reset_transaction_series()
print "To reset series of the transactions go to Setup --> Numbering Series\n"
else: else:
delete_masters() delete_masters()
reset_series() reset_all_series()
delete_main_masters() delete_main_masters()
reset_global_defaults() reset_global_defaults()