Merge branch 'master' of github.com:webnotes/erpnext

This commit is contained in:
Nabin Hait 2011-07-27 12:39:33 +05:30
commit e33831252d
2 changed files with 126 additions and 59 deletions

View File

@ -5,7 +5,7 @@
{ {
'creation': '2010-09-25 10:50:34', 'creation': '2010-09-25 10:50:34',
'docstatus': 0, 'docstatus': 0,
'modified': '2011-07-26 18:14:48', 'modified': '2011-07-27 11:43:40',
'modified_by': 'Administrator', 'modified_by': 'Administrator',
'owner': 'Administrator' 'owner': 'Administrator'
}, },
@ -364,6 +364,60 @@
'idx': 33 'idx': 33
}, },
# Module Def Item
{
'display_name': 'Lease Monthly Future Installment Inflows',
'doc_name': 'Lease Monthly Future Installment Inflows',
'doc_type': 'Reports',
'doctype': 'Module Def Item',
'idx': 34
},
# Module Def Item
{
'display_name': 'Lease Overdue Age Wise',
'doc_name': 'Lease Overdue Age Wise',
'doc_type': 'Reports',
'doctype': 'Module Def Item',
'idx': 35
},
# Module Def Item
{
'display_name': 'Lease Overdue List',
'doc_name': 'Lease Overdue List',
'doc_type': 'Reports',
'doctype': 'Module Def Item',
'idx': 36
},
# Module Def Item
{
'display_name': 'Lease Receipts Client Wise',
'doc_name': 'Lease Receipts Client Wise',
'doc_type': 'Reports',
'doctype': 'Module Def Item',
'idx': 37
},
# Module Def Item
{
'display_name': 'Lease Receipt Summary Year to Date',
'doc_name': 'Lease Receipt Summary Year to Date',
'doc_type': 'Reports',
'doctype': 'Module Def Item',
'idx': 38
},
# Module Def Item
{
'display_name': 'Lease Yearly Future Installment Inflows',
'doc_name': 'Lease Yearly Future Installment Inflows',
'doc_type': 'Reports',
'doctype': 'Module Def Item',
'idx': 39
},
# Module Def Role # Module Def Role
{ {
'doctype': 'Module Def Role', 'doctype': 'Module Def Role',

View File

@ -1,7 +1,7 @@
# REMEMBER to update this # REMEMBER to update this
# ======================== # ========================
last_patch = 329 last_patch = 330
#------------------------------------------- #-------------------------------------------
@ -46,7 +46,7 @@ def execute(patch_no):
for d in path_list: for d in path_list:
doclist = eval(open(d,'r').read()) doclist = eval(open(d,'r').read())
webnotes.conn.sql("update `tab%s` set module = '%s' where name = '%s'" % (doclist[0]['doctype'], doclist[0]['module'], doclist[0]['name'])) webnotes.conn.sql("update `tab%s` set module = '%s' where name = '%s'" % (doclist[0]['doctype'], doclist[0]['module'], doclist[0]['name']))
elif patch_no==38: elif patch_no==38:
import webnotes import webnotes
webnotes.conn.set_global("system_message", "System Updates: Hello! You would have noticed some changes on the Home Page. As a part of our commitment to make the system more friendly and social, we have re-designed the feed so that now you will only see feed that is relevant to you (either you have created something or you have been mentioned in the document).<br><br>On the individual listings, you can add tags and also color them!<br><br>You will also get time-to-time updates from our side here. Do keep sending your feedback at support@erpnext.com.") webnotes.conn.set_global("system_message", "System Updates: Hello! You would have noticed some changes on the Home Page. As a part of our commitment to make the system more friendly and social, we have re-designed the feed so that now you will only see feed that is relevant to you (either you have created something or you have been mentioned in the document).<br><br>On the individual listings, you can add tags and also color them!<br><br>You will also get time-to-time updates from our side here. Do keep sending your feedback at support@erpnext.com.")
@ -56,7 +56,7 @@ def execute(patch_no):
pass pass
elif patch_no == 40: elif patch_no == 40:
import_from_files(record_list=[['material_management','doctype','item']]) import_from_files(record_list=[['material_management','doctype','item']])
elif patch_no == 42: elif patch_no == 42:
acc = sql("select name, lft, rgt from tabAccount where account_name in ('Incomes', 'Expenses')") acc = sql("select name, lft, rgt from tabAccount where account_name in ('Incomes', 'Expenses')")
@ -65,7 +65,7 @@ def execute(patch_no):
elif patch_no == 43: elif patch_no == 43:
import webnotes.model import webnotes.model
webnotes.model.delete_doc('Page', 'Module Manager') webnotes.model.delete_doc('Page', 'Module Manager')
# cleanup of Service, Customer Support, Utilities Modules # cleanup of Service, Customer Support, Utilities Modules
# ------------------------------------------------------- # -------------------------------------------------------
elif patch_no == 44: elif patch_no == 44:
@ -86,7 +86,7 @@ def execute(patch_no):
# remove utilities # remove utilities
webnotes.conn.sql('delete from `tabModule Def` where name in ("Customer Support", "Utilities")') webnotes.conn.sql('delete from `tabModule Def` where name in ("Customer Support", "Utilities")')
elif patch_no == 45: elif patch_no == 45:
webnotes.conn.sql('delete from tabDocField where options="Ticket Response Detail"') webnotes.conn.sql('delete from tabDocField where options="Ticket Response Detail"')
@ -125,7 +125,7 @@ def execute(patch_no):
elif patch_no == 56: elif patch_no == 56:
sql("delete from `tabModule Def Item` where parent = 'CRM' and doc_type = 'Reports' and doc_name = 'Delivery Note' and display_name = 'Territory, Item Group wise GP'") sql("delete from `tabModule Def Item` where parent = 'CRM' and doc_type = 'Reports' and doc_name = 'Delivery Note' and display_name = 'Territory, Item Group wise GP'")
elif patch_no == 57: elif patch_no == 57:
import_from_files(record_list=[['crm','doctype','sales_order_detail']]) import_from_files(record_list=[['crm','doctype','sales_order_detail']])
elif patch_no == 58: elif patch_no == 58:
# module def patches # module def patches
@ -133,24 +133,24 @@ def execute(patch_no):
sql("delete from `tabModule Def Item` where doc_type in ('Separator', 'Setup Forms', 'More Reports')") sql("delete from `tabModule Def Item` where doc_type in ('Separator', 'Setup Forms', 'More Reports')")
sql("delete from `tabModule Def Item` where doc_name = 'Project Activity'") sql("delete from `tabModule Def Item` where doc_name = 'Project Activity'")
sql("update `tabModule Def` set module_label = 'People', disabled='No', is_hidden='No' where name = 'My Company'") sql("update `tabModule Def` set module_label = 'People', disabled='No', is_hidden='No' where name = 'My Company'")
# insert new module items # insert new module items
from webnotes.model.doc import make_autoname from webnotes.model.doc import make_autoname
if not sql("select name from `tabModule Def Item` where parent='Projects' and doc_name='Ticket'"): if not sql("select name from `tabModule Def Item` where parent='Projects' and doc_name='Ticket'"):
sql("""insert into `tabModule Def Item` sql("""insert into `tabModule Def Item`
(name, parent, parenttype, parentfield, docstatus, doc_type, doc_name, display_name, idx) values (name, parent, parenttype, parentfield, docstatus, doc_type, doc_name, display_name, idx) values
(%s, 'Projects', 'Module Def', 'items', 0, 'Forms', 'Ticket', 'Task', 1)""", make_autoname('MDI.#####')) (%s, 'Projects', 'Module Def', 'items', 0, 'Forms', 'Ticket', 'Task', 1)""", make_autoname('MDI.#####'))
if not sql("select name from `tabModule Def Item` where parent='Projects' and doc_name='Timesheet'"): if not sql("select name from `tabModule Def Item` where parent='Projects' and doc_name='Timesheet'"):
sql("""insert into `tabModule Def Item` sql("""insert into `tabModule Def Item`
(name, parent, parenttype, parentfield, docstatus, doc_type, doc_name, display_name, idx) values (name, parent, parenttype, parentfield, docstatus, doc_type, doc_name, display_name, idx) values
(%s, 'Projects', 'Module Def', 'items', 0, 'Forms', 'Timesheet', 'Timesheet', 2)""", make_autoname('MDI.#####')) (%s, 'Projects', 'Module Def', 'items', 0, 'Forms', 'Timesheet', 'Timesheet', 2)""", make_autoname('MDI.#####'))
if not sql("select name from `tabModule Def Item` where parent='Projects' and doc_name='Projects'"): if not sql("select name from `tabModule Def Item` where parent='Projects' and doc_name='Projects'"):
sql("""insert into `tabModule Def Item` sql("""insert into `tabModule Def Item`
(name, parent, parenttype, parentfield, docstatus, doc_type, doc_name, display_name, idx) values (name, parent, parenttype, parentfield, docstatus, doc_type, doc_name, display_name, idx) values
(%s, 'Projects', 'Module Def', 'items', 0, 'Pages', 'Projects', 'Gantt Chart', 1)""", make_autoname('MDI.#####')) (%s, 'Projects', 'Module Def', 'items', 0, 'Pages', 'Projects', 'Gantt Chart', 1)""", make_autoname('MDI.#####'))
elif patch_no == 59: elif patch_no == 59:
webnotes.conn.set_value('Control Panel',None,'mail_footer','') webnotes.conn.set_value('Control Panel',None,'mail_footer','')
webnotes.conn.set_global('global_mail_footer','<div style="margin-top:8px; padding: 8px; font-size: 11px; text-align:right; border-top: 1px solid #AAA">Sent via <a href="https://www.erpnext.com">ERPNext</a></div>') webnotes.conn.set_global('global_mail_footer','<div style="margin-top:8px; padding: 8px; font-size: 11px; text-align:right; border-top: 1px solid #AAA">Sent via <a href="https://www.erpnext.com">ERPNext</a></div>')
@ -160,16 +160,16 @@ def execute(patch_no):
sql("delete from `tabTDS Category Account` where company not in (select name from tabCompany)") sql("delete from `tabTDS Category Account` where company not in (select name from tabCompany)")
elif patch_no == 62: elif patch_no == 62:
# Import Supplier Quotation # Import Supplier Quotation
import_from_files(record_list=[['srm','doctype','supplier_quotation']]) import_from_files(record_list=[['srm','doctype','supplier_quotation']])
# Adding Status Filter # Adding Status Filter
sql("update tabDocType set search_fields = concat('status,',search_fields) where name IN ('Delivery Note','Leave Transaction')") sql("update tabDocType set search_fields = concat('status,',search_fields) where name IN ('Delivery Note','Leave Transaction')")
# Import Other Charges # Import Other Charges
import_from_files(record_list=[['setup','doctype','other_charges']]) import_from_files(record_list=[['setup','doctype','other_charges']])
elif patch_no == 63: elif patch_no == 63:
sql("update `tabDocField` set permlevel = 1 where fieldname in ('return_date', 'return_details') and parent = 'Sales and Purchase Return Wizard'") sql("update `tabDocField` set permlevel = 1 where fieldname in ('return_date', 'return_details') and parent = 'Sales and Purchase Return Wizard'")
import_from_files(record_list = [['accounts', 'doctype', 'rv_detail'], ['material_management', 'doctype', 'sales_and_purchase_return_wizard'], ['material_management', 'doctype', 'stock_entry']]) import_from_files(record_list = [['accounts', 'doctype', 'rv_detail'], ['material_management', 'doctype', 'sales_and_purchase_return_wizard'], ['material_management', 'doctype', 'stock_entry']])
elif patch_no == 64: elif patch_no == 64:
sql("update tabDocField set `hidden` = 1, `print_hide` = 1, `report_hide` = 1 where options in ('RFQ','Supplier Quotation')") sql("update tabDocField set `hidden` = 1, `print_hide` = 1, `report_hide` = 1 where options in ('RFQ','Supplier Quotation')")
@ -183,7 +183,7 @@ def execute(patch_no):
import webnotes import webnotes
webnotes.conn.set_global("system_message", """<h3>UI Updates</h3>Based on user feedback, we have made a couple of changes in the UI:<ul><li>Sidebar menus are now collapsable</li><li>Forms are now scrollable (we removed the confusing tabs)</li><li>Feed is a lot more descriptive</li></ul>Do send us your feedback!""") webnotes.conn.set_global("system_message", """<h3>UI Updates</h3>Based on user feedback, we have made a couple of changes in the UI:<ul><li>Sidebar menus are now collapsable</li><li>Forms are now scrollable (we removed the confusing tabs)</li><li>Feed is a lot more descriptive</li></ul>Do send us your feedback!""")
webnotes.conn.set_global("system_message_id", "4") webnotes.conn.set_global("system_message_id", "4")
sql("update `tabModule Def Item` set doc_type = 'Setup Forms' where doc_name in ('TDS Payment', 'TDS Return Acknowledgement', 'Form 16A', 'Period Closing Voucher', 'IT Checklist')") sql("update `tabModule Def Item` set doc_type = 'Setup Forms' where doc_name in ('TDS Payment', 'TDS Return Acknowledgement', 'Form 16A', 'Period Closing Voucher', 'IT Checklist')")
from webnotes.session_cache import clear_cache from webnotes.session_cache import clear_cache
clear_cache(webnotes.session['user']) clear_cache(webnotes.session['user'])
@ -212,7 +212,7 @@ def execute(patch_no):
for d in fld_map: for d in fld_map:
emp_obj.doc.fields[d] = prof_obj.doc.fields[d] emp_obj.doc.fields[d] = prof_obj.doc.fields[d]
emp_obj.doc.current_accommodation_type = prof_obj.doc.present_accommodation_type emp_obj.doc.current_accommodation_type = prof_obj.doc.present_accommodation_type
# address # address
per_addr = cstr(e[2]) + '\n' + cstr(e[3]) + '\n' + cstr(e[4]) + '\n' + cstr(e[5]) + ', ' + cstr(e[6]) + '\n' + 'PIN - ' + cstr(e[7]) + '\n' + 'Ph. No' + cstr(e[8]) per_addr = cstr(e[2]) + '\n' + cstr(e[3]) + '\n' + cstr(e[4]) + '\n' + cstr(e[5]) + ', ' + cstr(e[6]) + '\n' + 'PIN - ' + cstr(e[7]) + '\n' + 'Ph. No' + cstr(e[8])
cur_addr = cstr(e[9]) + '\n' + cstr(e[10]) + '\n' + cstr(e[11]) + '\n' + cstr(e[12]) + ', ' + cstr(e[13]) + '\n' + 'PIN - ' + cstr(e[14]) + '\n' + 'Ph. No' + cstr(e[15]) cur_addr = cstr(e[9]) + '\n' + cstr(e[10]) + '\n' + cstr(e[11]) + '\n' + cstr(e[12]) + ', ' + cstr(e[13]) + '\n' + 'PIN - ' + cstr(e[14]) + '\n' + 'Ph. No' + cstr(e[15])
@ -244,7 +244,7 @@ def execute(patch_no):
elif patch_no == 70: elif patch_no == 70:
# update search criteria module -> System # update search criteria module -> System
sql("update tabDocType set module='System' where name='Search Criteria'") sql("update tabDocType set module='System' where name='Search Criteria'")
# Cleanups to Contact # Cleanups to Contact
sql("update tabDocField set fieldtype='Data' where options='Designation' and parent='Contact'") sql("update tabDocField set fieldtype='Data' where options='Designation' and parent='Contact'")
sql("update tabDocField set fieldtype='Data' where options='Department' and parent='Contact'") sql("update tabDocField set fieldtype='Data' where options='Department' and parent='Contact'")
@ -254,10 +254,10 @@ def execute(patch_no):
from webnotes.modules.import_module import import_from_files from webnotes.modules.import_module import import_from_files
import_from_files(record_list=[['tools','doctype','contact']]) import_from_files(record_list=[['tools','doctype','contact']])
# remove last_contact_date from Lead # remove last_contact_date from Lead
sql("delete from tabDocField where fieldname='last_contact_date' and parent='Lead'") sql("delete from tabDocField where fieldname='last_contact_date' and parent='Lead'")
elif patch_no == 71: elif patch_no == 71:
# Make Stock Qty and Conversion Factor field editable. Also no need to mention Conversion factor in table can do it directly # Make Stock Qty and Conversion Factor field editable. Also no need to mention Conversion factor in table can do it directly
sql("update `tabDocField` set `permlevel` = 0, `width` = '100px', `trigger` = 'Client' where parent IN ('PO Detail','Purchase Receipt Detail') and fieldname in ('stock_qty','conversion_factor')") sql("update `tabDocField` set `permlevel` = 0, `width` = '100px', `trigger` = 'Client' where parent IN ('PO Detail','Purchase Receipt Detail') and fieldname in ('stock_qty','conversion_factor')")
@ -266,18 +266,18 @@ def execute(patch_no):
elif patch_no == 72: elif patch_no == 72:
# Core Patch # Core Patch
# ---------- # ----------
from webnotes.modules.import_module import import_from_files from webnotes.modules.import_module import import_from_files
# import module def # import module def
import_from_files(record_list = [['core', 'Module Def', 'Core']]) import_from_files(record_list = [['core', 'Module Def', 'Core']])
elif patch_no == 73: elif patch_no == 73:
# set module in DocTypes # set module in DocTypes
sql("update tabDocType set module='Core' where name in ('DocType', 'DocField', 'DocPerm', 'Role', 'UserRole', 'Profile', 'Print Format', 'DocFormat', 'Control Panel', 'Event', 'Event Role', 'Event User', 'DefaultValue', 'Default Home Page', 'File', 'File Group', 'File Data', 'Letter Head', 'Module Def', 'Module Def Item', 'Module Def Role', 'Page', 'Page Role', 'Search Criteria', 'DocType Label', 'DocType Mapper', 'Field Mapper Detail', 'Table Mapper Detail')") sql("update tabDocType set module='Core' where name in ('DocType', 'DocField', 'DocPerm', 'Role', 'UserRole', 'Profile', 'Print Format', 'DocFormat', 'Control Panel', 'Event', 'Event Role', 'Event User', 'DefaultValue', 'Default Home Page', 'File', 'File Group', 'File Data', 'Letter Head', 'Module Def', 'Module Def Item', 'Module Def Role', 'Page', 'Page Role', 'Search Criteria', 'DocType Label', 'DocType Mapper', 'Field Mapper Detail', 'Table Mapper Detail')")
# set module in Page # set module in Page
sql("update tabPage set module='Core' where name='Login Page'") sql("update tabPage set module='Core' where name='Login Page'")
# move file browser to Tools # move file browser to Tools
sql("update tabPage set module='Tools' where name='File Browser'") sql("update tabPage set module='Tools' where name='File Browser'")
sql("update tabDocType set module='Tools' where name='File Browser Control'") sql("update tabDocType set module='Tools' where name='File Browser Control'")
@ -351,7 +351,7 @@ def execute(patch_no):
p.add_permission('Salary Slip', 'Employee', 1, read = 1, match = 'owner') p.add_permission('Salary Slip', 'Employee', 1, read = 1, match = 'owner')
elif patch_no == 79: elif patch_no == 79:
# Import Modules # Import Modules
import_from_files(record_list=[['payroll','doctype','leave_application'],['payroll','doctype','leave_allocation'],['payroll','doctype','leave_control_panel'],['payroll','doctype','holiday_list'],['payroll','doctype','holiday_list_detail'],['payroll','Module Def','Payroll']]) import_from_files(record_list=[['payroll','doctype','leave_application'],['payroll','doctype','leave_allocation'],['payroll','doctype','leave_control_panel'],['payroll','doctype','holiday_list'],['payroll','doctype','holiday_list_detail'],['payroll','Module Def','Payroll']])
elif patch_no == 80: elif patch_no == 80:
# Holiday List # Holiday List
@ -405,7 +405,7 @@ def execute(patch_no):
elif patch_no == 81: elif patch_no == 81:
# Import Modules # Import Modules
import_from_files(record_list=[['payroll','Module Def','Payroll']]) import_from_files(record_list=[['payroll','Module Def','Payroll']])
elif patch_no == 82: elif patch_no == 82:
sql("update tabDocType set search_fields = 'employee,leave_type,total_leaves_allocated,fiscal_year' where name = 'Leave Allocation'") sql("update tabDocType set search_fields = 'employee,leave_type,total_leaves_allocated,fiscal_year' where name = 'Leave Allocation'")
@ -432,13 +432,13 @@ def execute(patch_no):
sql("update tabDocPerm set `match` = '' where parent = 'Leave Application' and role = 'HR User'") sql("update tabDocPerm set `match` = '' where parent = 'Leave Application' and role = 'HR User'")
elif patch_no == 86: elif patch_no == 86:
# Import Modules # Import Modules
import_from_files(record_list=[['payroll','doctype','leave_type']]) import_from_files(record_list=[['payroll','doctype','leave_type']])
elif patch_no == 87: elif patch_no == 87:
sql("update `tabLeave Type` set is_lwp = 1 where name = 'Leave Without Pay'") sql("update `tabLeave Type` set is_lwp = 1 where name = 'Leave Without Pay'")
elif patch_no == 88: elif patch_no == 88:
# Import Modules # Import Modules
import_from_files(record_list=[['payroll','doctype','leave_allocation']]) import_from_files(record_list=[['payroll','doctype','leave_allocation']])
elif patch_no == 89: elif patch_no == 89:
sql("delete from `tabModule Def Item` where doc_type = 'Setup Forms' and doc_name in ('Payroll Rule', 'IT Checklist', 'Employee Profile') and parent = 'Payroll'") sql("delete from `tabModule Def Item` where doc_type = 'Setup Forms' and doc_name in ('Payroll Rule', 'IT Checklist', 'Employee Profile') and parent = 'Payroll'")
@ -457,10 +457,10 @@ def execute(patch_no):
sql("update `tabTable Mapper Detail` set validation_logic = 'qty > ifnull(billed_qty,0) and docstatus = 1' where parent = 'Sales Order-Receivable Voucher' and from_table = 'Sales Order Detail'") sql("update `tabTable Mapper Detail` set validation_logic = 'qty > ifnull(billed_qty,0) and docstatus = 1' where parent = 'Sales Order-Receivable Voucher' and from_table = 'Sales Order Detail'")
sql("update `tabField Mapper Detail` set from_field = 'customer' where to_field = 'customer' and parent = 'Sales Order-Receivable Voucher'") sql("update `tabField Mapper Detail` set from_field = 'customer' where to_field = 'customer' and parent = 'Sales Order-Receivable Voucher'")
elif patch_no == 94: elif patch_no == 94:
import_from_files(record_list=[['crm','doctype','sms_center']]) import_from_files(record_list=[['crm','doctype','sms_center']])
elif patch_no == 95: elif patch_no == 95:
import_from_files(record_list=[['mapper','DocType Mapper','Sales Order-Receivable Voucher'], ['mapper','DocType Mapper','Delivery Note-Receivable Voucher']]) import_from_files(record_list=[['mapper','DocType Mapper','Sales Order-Receivable Voucher'], ['mapper','DocType Mapper','Delivery Note-Receivable Voucher']])
elif patch_no == 96: elif patch_no == 96:
sql("delete from `tabModule Def Item` where doc_type = 'Reports' and display_name = 'Cenvat Credit - Input or Capital Goods' and parent = 'Accounts'") sql("delete from `tabModule Def Item` where doc_type = 'Reports' and display_name = 'Cenvat Credit - Input or Capital Goods' and parent = 'Accounts'")
@ -490,7 +490,7 @@ def execute(patch_no):
elif patch_no == 103: elif patch_no == 103:
sql("update tabDocField set fieldname = '' where fieldtype = 'HTML'") sql("update tabDocField set fieldname = '' where fieldtype = 'HTML'")
elif patch_no == 104: elif patch_no == 104:
import_from_files(record_list=[['payroll','search_criteria','stdsrch_00001'],['payroll','search_criteria','stdsrch_00002'],['payroll','search_criteria','stdsrch_00003'],['payroll','Module Def','Payroll'],['payroll','doctype','leave_application'],['payroll','doctype','leave_allocation']]) import_from_files(record_list=[['payroll','search_criteria','stdsrch_00001'],['payroll','search_criteria','stdsrch_00002'],['payroll','search_criteria','stdsrch_00003'],['payroll','Module Def','Payroll'],['payroll','doctype','leave_application'],['payroll','doctype','leave_allocation']])
elif patch_no == 105: elif patch_no == 105:
# Employee Leave Balance # Employee Leave Balance
@ -535,7 +535,7 @@ def execute(patch_no):
# patch for timesheet cleanup # patch for timesheet cleanup
from webnotes.model import delete_doc from webnotes.model import delete_doc
delete_doc('DocType', 'Timesheet Detail') delete_doc('DocType', 'Timesheet Detail')
from webnotes.modules.import_module import import_from_files from webnotes.modules.import_module import import_from_files
import_from_files(record_list = [['Projects', 'DocType', 'Timesheet'], ['Projects', 'DocType', 'Timesheet Detail'], ['Projects', 'DocType', 'Activity Type']]) import_from_files(record_list = [['Projects', 'DocType', 'Timesheet'], ['Projects', 'DocType', 'Timesheet Detail'], ['Projects', 'DocType', 'Activity Type']])
@ -543,7 +543,7 @@ def execute(patch_no):
# again! # again!
from webnotes.model import delete_doc from webnotes.model import delete_doc
delete_doc('DocType', 'Timesheet Detail') delete_doc('DocType', 'Timesheet Detail')
from webnotes.modules.import_module import import_from_files from webnotes.modules.import_module import import_from_files
import_from_files(record_list = [['Projects', 'DocType', 'Timesheet Detail']]) import_from_files(record_list = [['Projects', 'DocType', 'Timesheet Detail']])
elif patch_no == 117: elif patch_no == 117:
@ -646,13 +646,13 @@ def execute(patch_no):
elif patch_no == 142: elif patch_no == 142:
# fixes to letter head and personalize # fixes to letter head and personalize
from webnotes.model import delete_doc from webnotes.model import delete_doc
delete_doc('DocType', 'Batch Settings') delete_doc('DocType', 'Batch Settings')
delete_doc('DocType', 'Batch Settings Detail') delete_doc('DocType', 'Batch Settings Detail')
delete_doc('DocType', 'Social Badge') delete_doc('DocType', 'Social Badge')
delete_doc('Page', 'Personalize Page') delete_doc('Page', 'Personalize Page')
delete_doc('DocType', 'Personalize Page Control') delete_doc('DocType', 'Personalize Page Control')
import_from_files(record_list=[['core','doctype','letter_head'], ['setup','doctype','personalize']]) import_from_files(record_list=[['core','doctype','letter_head'], ['setup','doctype','personalize']])
elif patch_no == 144: elif patch_no == 144:
webnotes.conn.sql("update tabDocField set fieldtype='Code' where parent='Letter Head' and fieldname='content'") webnotes.conn.sql("update tabDocField set fieldtype='Code' where parent='Letter Head' and fieldname='content'")
@ -917,7 +917,7 @@ def execute(patch_no):
reload_doc('knowledge_base', 'page', 'questions') reload_doc('knowledge_base', 'page', 'questions')
reload_doc('knowledge_base', 'Module Def', 'Knowledge Base') reload_doc('knowledge_base', 'Module Def', 'Knowledge Base')
sql("update `tabModule Def` set disabled='No' where name='Knowledge Base'") sql("update `tabModule Def` set disabled='No' where name='Knowledge Base'")
elif patch_no == 229: elif patch_no == 229:
reload_doc('knowledge_base', 'page', 'question_view') reload_doc('knowledge_base', 'page', 'question_view')
elif patch_no == 230: elif patch_no == 230:
reload_doc('srm', 'doctype', 'indent') reload_doc('srm', 'doctype', 'indent')
@ -933,7 +933,7 @@ def execute(patch_no):
elif patch_no == 234: elif patch_no == 234:
sql("update `tabTable Mapper Detail` set validation_logic = 'docstatus=1' where parent = 'Sales Order-Indent' and from_table = 'Sales Order Detail'") sql("update `tabTable Mapper Detail` set validation_logic = 'docstatus=1' where parent = 'Sales Order-Indent' and from_table = 'Sales Order Detail'")
elif patch_no == 235: elif patch_no == 235:
for sc in sql("""select name from `tabSearch Criteria` where ifnull(name,'') for sc in sql("""select name from `tabSearch Criteria` where ifnull(name,'')
like 'srch%' or ifnull(name,'') like '%stdsrch'"""): like 'srch%' or ifnull(name,'') like '%stdsrch'"""):
try: try:
get_obj('Search Criteria', sc[0]).rename() get_obj('Search Criteria', sc[0]).rename()
@ -951,7 +951,7 @@ def execute(patch_no):
elif patch_no == 239: elif patch_no == 239:
reload_doc('core', 'doctype', 'docfield') reload_doc('core', 'doctype', 'docfield')
reload_doc('core', 'doctype', 'doctype') reload_doc('core', 'doctype', 'doctype')
from patches.feed_patch import set_subjects_and_tagfields from patches.feed_patch import set_subjects_and_tagfields
set_subjects_and_tagfields() set_subjects_and_tagfields()
elif patch_no == 240: elif patch_no == 240:
@ -1026,7 +1026,7 @@ def execute(patch_no):
sql("update `tabItem` set description_html = replace(description_html, 'http://46.4.50.84/v170-test/', '')") sql("update `tabItem` set description_html = replace(description_html, 'http://46.4.50.84/v170-test/', '')")
elif patch_no == 257: elif patch_no == 257:
from patches.customer_address import run_old_data_sync_patch from patches.customer_address import run_old_data_sync_patch
run_old_data_sync_patch() run_old_data_sync_patch()
elif patch_no == 258: elif patch_no == 258:
sql("update tabDocField set `default`=NULL where fieldname = 'naming_series'") sql("update tabDocField set `default`=NULL where fieldname = 'naming_series'")
elif patch_no == 259: elif patch_no == 259:
@ -1050,7 +1050,7 @@ def execute(patch_no):
elif patch_no == 263: elif patch_no == 263:
ol = ['','Open','To Reply','Waiting for Customer','Hold','Closed'] ol = ['','Open','To Reply','Waiting for Customer','Hold','Closed']
sql("update tabDocField set options=%s where parent=%s and fieldname=%s", ('\n'.join(ol), 'Support Ticket', 'status')) sql("update tabDocField set options=%s where parent=%s and fieldname=%s", ('\n'.join(ol), 'Support Ticket', 'status'))
elif patch_no == 264: elif patch_no == 264:
sql("delete from tabDocField where parent = 'Customer Issue' and (fieldname = 'issue_in' or fieldname = 'issue_category')") sql("delete from tabDocField where parent = 'Customer Issue' and (fieldname = 'issue_in' or fieldname = 'issue_category')")
sql("update tabDocField set options=NULL where parent='Support Ticket' and label = 'Send'") sql("update tabDocField set options=NULL where parent='Support Ticket' and label = 'Send'")
elif patch_no == 266: elif patch_no == 266:
@ -1077,12 +1077,12 @@ def execute(patch_no):
reload_doc('crm','doctype','sales_order') reload_doc('crm','doctype','sales_order')
reload_doc('material_management','doctype','delivery_note') reload_doc('material_management','doctype','delivery_note')
sql("delete from tabDocField where fieldname='per_amt_billed' and parent in ('Sales Order', 'Delivery Note')") sql("delete from tabDocField where fieldname='per_amt_billed' and parent in ('Sales Order', 'Delivery Note')")
sql("""update `tabSales Order` set delivery_status = if(ifnull(per_delivered,0) < 0.001, 'Not Delivered', sql("""update `tabSales Order` set delivery_status = if(ifnull(per_delivered,0) < 0.001, 'Not Delivered',
if(per_delivered >= 99.99, 'Fully Delivered', 'Partly Delivered'))""") if(per_delivered >= 99.99, 'Fully Delivered', 'Partly Delivered'))""")
sql("""update `tabSales Order` set billing_status = if(ifnull(per_billed,0) < 0.001, 'Not Billed', sql("""update `tabSales Order` set billing_status = if(ifnull(per_billed,0) < 0.001, 'Not Billed',
if(per_billed >= 99.99, 'Fully Billed', 'Partly Billed'))""") if(per_billed >= 99.99, 'Fully Billed', 'Partly Billed'))""")
sql("""update `tabDelivery Note` set billing_status = if(ifnull(per_billed,0) < 0.001, 'Not Billed', sql("""update `tabDelivery Note` set billing_status = if(ifnull(per_billed,0) < 0.001, 'Not Billed',
if(per_billed >= 99.99, 'Fully Billed', 'Partly Billed'))""") if(per_billed >= 99.99, 'Fully Billed', 'Partly Billed'))""")
elif patch_no == 272: elif patch_no == 272:
from webnotes.model import delete_doc from webnotes.model import delete_doc
@ -1116,7 +1116,7 @@ def execute(patch_no):
rec = sql("select voucher_type, voucher_no, ifnull(is_cancelled, 'No') from `tab%s` where modified >= '2011-06-15 01:00:00' group by voucher_no" % t) rec = sql("select voucher_type, voucher_no, ifnull(is_cancelled, 'No') from `tab%s` where modified >= '2011-06-15 01:00:00' group by voucher_no" % t)
for d in rec: for d in rec:
sql("update `tab%s` set docstatus = %s where name = '%s'" % (d[0], d[2]=='No' and 1 or 2, d[1])) sql("update `tab%s` set docstatus = %s where name = '%s'" % (d[0], d[2]=='No' and 1 or 2, d[1]))
other_dt = ['Enquiry', 'Quotation', 'Sales Order', 'Indent', 'Purchase Order', 'Production Order', 'Customer Issue', 'Installation Note'] other_dt = ['Enquiry', 'Quotation', 'Sales Order', 'Indent', 'Purchase Order', 'Production Order', 'Customer Issue', 'Installation Note']
for dt in other_dt: for dt in other_dt:
rec = sql("select name, status from `tab%s` where modified >= '2011-06-15 01:00:00'" % dt) rec = sql("select name, status from `tab%s` where modified >= '2011-06-15 01:00:00'" % dt)
@ -1151,9 +1151,9 @@ def execute(patch_no):
reload_doc('accounts', 'doctype', 'payable_voucher') reload_doc('accounts', 'doctype', 'payable_voucher')
elif patch_no == 289: elif patch_no == 289:
sql("update `tabDocType` set subject = 'From %(supplier_name)s worth %(grand_total)s due on %(due_date)s | %(outstanding_amount)s outstanding' where name = 'Payable Voucher'") sql("update `tabDocType` set subject = 'From %(supplier_name)s worth %(grand_total)s due on %(due_date)s | %(outstanding_amount)s outstanding' where name = 'Payable Voucher'")
sql("update `tabDocType` set search_fields = 'status,transaction_date,customer,lead,order_type' where name = 'Quotation'") sql("update `tabDocType` set search_fields = 'status,transaction_date,customer,lead,order_type' where name = 'Quotation'")
elif patch_no == 290: elif patch_no == 290:
count = sql("""SELECT * FROM `tabModule Def` count = sql("""SELECT * FROM `tabModule Def`
WHERE `module_name` LIKE 'Home'""") WHERE `module_name` LIKE 'Home'""")
if not count: if not count:
md = Document('Module Def') md = Document('Module Def')
@ -1236,14 +1236,14 @@ def execute(patch_no):
rec = sql("select voucher_type, voucher_no, ifnull(is_cancelled, 'No') from `tab%s` where modified >= '2011-07-06 10:00:00' group by voucher_no" % t) rec = sql("select voucher_type, voucher_no, ifnull(is_cancelled, 'No') from `tab%s` where modified >= '2011-07-06 10:00:00' group by voucher_no" % t)
for d in rec: for d in rec:
sql("update `tab%s` set docstatus = %s where name = '%s'" % (d[0], d[2]=='No' and 1 or 2, d[1])) sql("update `tab%s` set docstatus = %s where name = '%s'" % (d[0], d[2]=='No' and 1 or 2, d[1]))
other_dt = ['Enquiry', 'Quotation', 'Sales Order', 'Indent', 'Purchase Order', 'Production Order', 'Customer Issue', 'Installation Note'] other_dt = ['Enquiry', 'Quotation', 'Sales Order', 'Indent', 'Purchase Order', 'Production Order', 'Customer Issue', 'Installation Note']
for dt in other_dt: for dt in other_dt:
rec = sql("select name, status from `tab%s` where modified >= '2011-07-06 10:00:00'" % dt) rec = sql("select name, status from `tab%s` where modified >= '2011-07-06 10:00:00'" % dt)
for r in rec: for r in rec:
sql("update `tab%s` set docstatus = %s where name = '%s'" % (dt, (r[1] in ['Submitted', 'Closed'] and 1 or r[1]=='Cancelled' and 2 or 0), r[0])) sql("update `tab%s` set docstatus = %s where name = '%s'" % (dt, (r[1] in ['Submitted', 'Closed'] and 1 or r[1]=='Cancelled' and 2 or 0), r[0]))
dt_list = ['Delivery Note', 'Purchase Receipt'] dt_list = ['Delivery Note', 'Purchase Receipt']
for dt in dt_list: for dt in dt_list:
sql("update `tab%s` set status = 'Submitted' where docstatus = 1 and modified >='2011-07-06 10:00:00'" % dt) sql("update `tab%s` set status = 'Submitted' where docstatus = 1 and modified >='2011-07-06 10:00:00'" % dt)
@ -1254,7 +1254,7 @@ def execute(patch_no):
tbl = sql("select options from `tabDocField` where fieldtype = 'Table' and parent = '%s'" % d) tbl = sql("select options from `tabDocField` where fieldtype = 'Table' and parent = '%s'" % d)
for t in tbl: for t in tbl:
sql("update `tab%s` t1, `tab%s` t2 set t1.docstatus = t2.docstatus where t1.parent = t2.name" % (t[0], d)) sql("update `tab%s` t1, `tab%s` t2 set t1.docstatus = t2.docstatus where t1.parent = t2.name" % (t[0], d))
elif patch_no == 314: elif patch_no == 314:
# delete double feed # delete double feed
sql("delete from tabFeed where subject like 'New %'") sql("delete from tabFeed where subject like 'New %'")
@ -1273,7 +1273,7 @@ def execute(patch_no):
elif patch_no == 316: elif patch_no == 316:
pass pass
elif patch_no == 317: elif patch_no == 317:
sql("update `tabPage` set name = 'profile-settings' where page_name = 'Profile Settings'") sql("update `tabPage` set name = 'profile-settings' where page_name = 'Profile Settings'")
elif patch_no == 318: elif patch_no == 318:
reload_doc('utilities', 'doctype', 'bulk_rename_tool') reload_doc('utilities', 'doctype', 'bulk_rename_tool')
elif patch_no == 319: elif patch_no == 319:
@ -1300,7 +1300,7 @@ def execute(patch_no):
elif patch_no == 327: elif patch_no == 327:
# patch for support email settings now moved to email settings # patch for support email settings now moved to email settings
reload_doc('setup','doctype','email_settings') reload_doc('setup','doctype','email_settings')
# map fields from support to email settings # map fields from support to email settings
field_map = { field_map = {
'support_email': 'email', 'support_email': 'email',
@ -1311,11 +1311,11 @@ def execute(patch_no):
'sync_support_mails': 'integrate_incoming', 'sync_support_mails': 'integrate_incoming',
'signature': 'support_signature' 'signature': 'support_signature'
} }
for key in field_map: for key in field_map:
webnotes.conn.set_value('Email Settings',None,key, \ webnotes.conn.set_value('Email Settings',None,key, \
webnotes.conn.get_value('Support Email Settings',None,field_map[key])) webnotes.conn.get_value('Support Email Settings',None,field_map[key]))
# delete support email settings # delete support email settings
from webnotes.model import delete_doc from webnotes.model import delete_doc
delete_doc('DocType', 'Support Email Settings') delete_doc('DocType', 'Support Email Settings')
@ -1328,3 +1328,16 @@ def execute(patch_no):
elif patch_no == 329: elif patch_no == 329:
reload_doc('utilities', 'doctype', 'rename_tool') reload_doc('utilities', 'doctype', 'rename_tool')
reload_doc('utilities', 'doctype', 'bulk_rename_tool') reload_doc('utilities', 'doctype', 'bulk_rename_tool')
elif patch_no == 330:
reload_doc('accounts', 'doctype', 'lease_agreement')
reload_doc('accounts', 'doctype', 'lease_installment')
reload_doc('accounts', 'search_criteria', 'lease_agreement_list')
reload_doc('accounts', 'search_criteria', 'lease_monthly_future_installment_inflows')
reload_doc('accounts', 'search_criteria', 'lease_overdue_age_wise')
reload_doc('accounts', 'search_criteria', 'lease_overdue_list')
reload_doc('accounts', 'search_criteria', 'lease_receipts_client_wise')
reload_doc('accounts', 'search_criteria', 'lease_receipt_summary_year_to_date')
reload_doc('accounts', 'search_criteria', 'lease_yearly_future_installment_inflows')
reload_doc('accounts', 'Module Def', 'Accounts')