webnotes.conn.sql("update `tab%s` set module = '%s' where name = '%s'"%(doclist[0]['doctype'],doclist[0]['module'],doclist[0]['name']))
elifpatch_no==38:
importwebnotes
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.")
fordtinsql("select name from tabDocType where module in ('Customer Support')"):
delete_doc('DocType',dt[0])
fordtinsql("select name from `tabSearch Criteria` where module in ('Customer Support')"):
delete_doc('Search Criteria',dt[0])
fordtinsql("select name from tabPage where module in ('Customer Support')"):
delete_doc('Page',dt[0])
# move a couple
webnotes.conn.sql("update `tab%s` set module=%s where name=%s"%('DocType','%s','%s'),('Application Internal','Patch Util'))
webnotes.conn.sql("update `tab%s` set module=%s where name=%s"%('DocType','%s','%s'),('Application Internal','DocType Property Setter'))
# remove utilities
webnotes.conn.sql('delete from `tabModule Def` where name in ("Customer Support", "Utilities")')
elifpatch_no==45:
webnotes.conn.sql('delete from tabDocField where options="Ticket Response Detail"')
elifpatch_no==46:
importwebnotes
webnotes.conn.set_global("system_message","<b>SYSTEM DOWNTIME:</b> Hello! As part of our commitment to keep improving the service, we are planning a scheduled maintenance on our servers for 4 hrs on 16-Jan-2011(Sunday), from 10AM to 2PM. Do keep sending your feedback at support@erpnext.com.")
webnotes.conn.set_global("system_message_id","2")
elifpatch_no==47:
importwebnotes
webnotes.conn.set_global("system_message","")
webnotes.conn.set_global("system_message_id","3")
elifpatch_no==48:
webnotes.conn.sql("update tabDocField set options = 'Print Heading' where fieldname = 'select_print_heading'")
elifpatch_no==49:
webnotes.conn.sql("update tabDocType set autoname = '' where name = 'Search Criteria'")
elifpatch_no==50:
sql("update tabDocField set in_filter = 1 where fieldname in ('cost_center', 'income_account', 'Item Group') and parent = 'RV Detail'")
elifpatch_no==51:
sql("update tabDocField set options = 'link:Print Heading' where fieldtype = 'Select' and fieldname = 'select_print_heading' and parent = 'POS Setting'")
elifpatch_no==52:
sql("update tabDocField set print_hide = 1 where fieldname = 'letter_head'")
elifpatch_no==53:
sql("update tabDocType set search_fields = 'lead_name,lead_owner,status,contact_by,contact_date' where name = 'Lead'")
elifpatch_no==54:
sql("delete from tabDocField where parent = 'Supplier' and label = 'Supplier Contacts' and fieldtype = 'Section Break'")
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("update tabDocField set `hidden` = 1, `print_hide` = 1, `report_hide` = 1 where options in ('RFQ','Supplier Quotation')")
sql("update tabDocType set `read_only` = 1, in_create = 1 where name in ('RFQ','Supplier Quotation')")
sql("update tabDocField set `report_hide` = 0 where fieldname in ('email_id','phone_1','fax_1') and parent = 'Customer'")
elifpatch_no==65:
# Monthly Trend Analyzer <-> Trend Analyzer
sql("update `tabSearch Criteria` set criteria_name = 'Trend Analyzer' where criteria_name = 'Monthly Trend Analyzer' and name = 'SRCH/00159'")
sql("update `tabModule Def Item` set display_name = 'Trend Analyzer' where parent = 'Analysis' and display_name = 'Monthly Trend Analyzer'")
elifpatch_no==66:
importwebnotes
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")
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')")
fromwebnotes.session_cacheimportclear_cache
clear_cache(webnotes.session['user'])
elifpatch_no==67:
sql("update `tabDocField` set in_filter = 1 where fieldname = 'brand' and parent = 'RV Detail'")
sql("delete from `tabModule Def Item` where (display_name = 'Sales Invoice' and parent = 'CRM') or (display_name = 'Purchase Invoice' and parent = 'SRM')")
sql("update tabDocType set module='System' where name='Search Criteria'")
# Cleanups to 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 depends_on='eval:(cint(doc.is_customer) || cint(doc.is_supplier) || cint(doc.is_sales_partner))' where fieldname='is_primary_contact' and parent='Contact'")
sql("delete from tabDocField where fieldname='last_contact_date' and parent='Lead'")
elifpatch_no==71:
# 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 `width` = '100px' where parent IN ('PO Detail','Purchase Receipt Detail') and fieldname = 'stock_uom'")
sql("Update tabDocField set `description` = 'You can create more earning and deduction type from Setup --> HR' where label = 'Earning & Deduction' and parent = 'Salary Structure' and fieldtype = 'Section Break'")
# delete
sql("update `tabSalary Structure` set net_pay = total")
sql("delete from tabDocField where label in ('LWP Help', 'Calculate Total', 'Total') and parent = 'Salary Structure'")
sql("delete from tabDocPerm where parent in ('Earning Detail', 'Deduction Detail')")
sql("update `tabHoliday List Detail` set description = holiday_name")
sql("delete from tabDocField where parent = 'Holiday List Detail' and fieldname = 'holiday_name'")
sql("update tabDocField set fieldtype = 'Select', options = 'link:Fiscal Year' where parent = 'Holiday List' and fieldname = 'fiscal_year'")
sql("delete from tabDocPerm where role in ('Administrator','HR User') and parent = 'Holiday List'")
# Leave Control Panel
# --------------------
sql("delete from `tabDocField` where parent = 'Leave Control Panel' and label in ('Leave Control Panel','Allocation Details') and fieldtype = 'Section Break'")
sql("delete from tabDocField where parent = 'Leave Control Panel' and fieldname in ('col_brk3','allocation_type','col_brk2','from_date','to_date','leave_transaction_type','posting_date')")
sql("update tabDocField set fieldtype = 'Select', options = 'link:Fiscal Year' where parent = 'Leave Control Panel' and fieldname = 'fiscal_year'")
sql("update tabDocField set fieldtype = 'Select', options = 'link:Leave Type' where parent = 'Leave Control Panel' and fieldname = 'leave_type'")
sql("update tabDocField set reqd = 1 where parent = 'Leave Control Panel' and fieldname = 'no_of_days'")
# Leave Application
# ------------------
fordinsql("select * from `tabLeave Transaction` where leave_transaction_type = 'Deduction' and ifnull(deduction_type, '') = 'Leave'",as_dict=1):
lp=Document('Leave Application')
lp.employee=d['employee']
lp.leave_type=d['leave_type']
lp.posting_date=d['date']
lp.fiscal_year=d['fiscal_year']
lp.leave_balance=d['pre_balance']
lp.half_day=d['half_day']
lp.from_date=d['from_date']
lp.to_date=d['to_date']
lp.total_leave_days=d['total_leave']
lp.description=d['reason']
lp.docstatus=cint(d['docstatus'])
lp.save(1)
# Leave Allocation
# -----------------
fordinsql("select * from `tabLeave Transaction` where leave_transaction_type = 'Allocation'",as_dict=1):
la=Document('Leave Allocation')
la.employee=d['employee']
la.leave_type=d['leave_type']
la.posting_date=d['date']
la.fiscal_year=d['fiscal_year']
la.new_leaves_allocated=d['total_leave']
la.total_leaves_allocated=d['total_leave']
la.description=d['reason']
la.docstatus=cint(d['docstatus'])
la.save(1)
# Payroll Module Def
# -------------------
sql("delete from `tabModule Def Item` where doc_name = 'Leave Transaction' and display_name = 'Leave Transaction' and parent = 'Payroll' and doc_type = 'Forms'")
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("update `tabDocField` set `hidden` = 1, `print_hide` = 1, `report_hide` = 1 where parent = 'Leave Type' and fieldname = 'is_encash'")
elifpatch_no==90:
sql("update `tabLeave Allocation` set docstatus = 1")
elifpatch_no==91:
importwebnotes
webnotes.conn.set_global("system_message","""<h3>System Updates</h3>Based on user feedback, we have cleaned up HR module (Partly):<ul><li>Employee and Employee Profile are merged into a single document</li><li>Salary Structure and Salary Slip are now more user friendly</li><li>Leave Transaction document is now divided into 2 documents Leave Application and Leave Allocation</li></ul>We will work on Reports, Attendance and other documents of Payroll module next week<br><br> Do send us your feedback!""")
webnotes.conn.set_global("system_message_id","5")
elifpatch_no==92:
sql("update tabDocField set label = 'Get Charges' where parent IN ('Sales Order','Delivery Note','Receivable Voucher') and label = 'Get Other Charges' and fieldtype = 'Button'")
# Automated Other Charges Calculation basis
sql("update tabDocField set options = '', `trigger` = 'Client' where parent IN ('Quotation','Sales Order','Delivery Note','Receivable Voucher') and label = 'Get Charges' and fieldtype = 'Button'")
elifpatch_no==93:
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'")
# Leave Application Details and Leave Allocation Details
sql("update tabDocField set search_index = 1, in_filter = 1 where fieldname in ('employee','leave_type','fiscal_year') and parent in ('Leave Application','Leave Allocation')")
get_obj('DocType','Leave Application').doc.save()
get_obj('DocType','Leave Allocation').doc.save()
elifpatch_no==102:
# make item description field editable in production order
sql("update tabDocField set permlevel = 0 where fieldname = 'description' and parent = 'Production Order'")
elifpatch_no==103:
sql("update tabDocField set fieldname = '' where fieldtype = 'HTML'")
sql("delete from `tabModule Def Item` where parent = 'Payroll' and doc_type = 'Reports' and display_name IN ('Employeewise Leave Transaction Details','Employeewise Balance Leave Report')")
# Update Search Fields
sql("update tabDocType set search_fields = 'employee,employee_name,leave_type,from_date,to_date,total_leave_days,fiscal_year' where name = 'Leave Application'")
sql("update tabDocType set search_fields = 'employee,employee_name,leave_type,total_leaves_allocated,fiscal_year' where name = 'Leave Allocation'")
elifpatch_no==106:
fordinsql("select name,employee,employee_name from `tabLeave Allocation`"):
ifnotcstr(d[2]):
sql("update `tabLeave Allocation` set employee_name = '%s' where name = '%s'"%(webnotes.conn.get_value('Employee',cstr(d[1]),'employee_name'),cstr(d[0])))
fordinsql("select name,employee,employee_name from `tabLeave Application`"):
ifnotcstr(d[2]):
sql("update `tabLeave Application` set employee_name = '%s' where name = '%s'"%(webnotes.conn.get_value('Employee',cstr(d[1]),'employee_name'),cstr(d[0])))
elifpatch_no==107:
sql("delete from `tabDocField` where fieldname = 'fiscal_year' and parent = 'Employee'")
webnotes.conn.set_global("system_message","""<h3>Updates(New)</h3>We have added a new report in the Selling Module.<br><br><b>Sales Personwise Transaction Summary: </b>In this report you can see sales person's contribution in a particular order, delivery or invoice. You can select voucher type in "Based On" filter.<br><br> Do send us your feedback!""")
sql("delete from tabDocField where parent = 'Purchase Order' and fieldname in ('test_certificate_required', 'estimated_cost', 'transport', 'vendor_reference', 'transportation_required', 'mode_of_dispatch', 'octroi')")
elifpatch_no==168:
sql("update tabDocField set fieldtype = 'Data', options = 'Suggest' where fieldname = 'bank_name' and parent = 'Employee'")
webnotes.conn.set_global("system_message","""<b>Welcome to the new financial year 2011-2012 !!! </b><br><br> So obvious question in your mind is how to start Entries in the New Fiscal Year in ERPNext? What are the changes you have to make in the system? <br>We have made some guidelines regarding the basic steps you should follow. Please click on link <a href='http://erpnext.blogspot.com/2011/03/how-to-start-entries-in-new-fiscal-year.html'>How to start Entries in the New Fiscal Year in ERPNext?</a>""")
webnotes.conn.set_global("system_message_id","6")
elifpatch_no==173:
sql("delete from tabDocField where label = 'Get Other Charges' and parent = 'Delivery Note'")
sql("update tabDocField set reqd = 0 where fieldname = 'posting_time' and parent = 'Serial No'")
elifpatch_no==174:
c=sql("select count(name) from `tabField Mapper Detail` where parent = 'Delivery Note-Receivable Voucher' and from_field = 'description' and to_field = 'description' and match_id = 2")
ifcandcint(c[0][0])>1:
sql("update `tabField Mapper Detail` set match_id = 1 where parent = 'Delivery Note-Receivable Voucher' and from_field = 'description' and to_field = 'description' limit 1")
elifpatch_no==175:
importwebnotes
webnotes.conn.set_global("system_message","""If your financial year starts on 1st April then you have make some changes in the system to start entry in the new year.<br>We have made some guidelines regarding the basic steps you should follow. Please click on link <a href='http://erpnext.blogspot.com/2011/03/how-to-start-entries-in-new-fiscal-year.html'>How to start Entries in the New Fiscal Year in ERPNext?</a>""")
webnotes.conn.set_global("system_message_id","6")
elifpatch_no==176:
sql("update tabDocPerm set role='Guest', `write`=0, `create`=0 where role='Administrator' and parent='Notification Control' limit 1")
elifpatch_no==177:
sql("delete from `tabDocField` where label = 'Next Steps' and parent = 'Purchase Order'")
sql("update tabDocField set options = 'Material Issue\nMaterial Receipt\nMaterial Transfer\nSales Return\nPurchase Return\nSubcontracting\nProduction Order' where parent = 'Stock Entry' and fieldname = 'purpose'")
sql("delete from `tabDocField` where (label in ('SMS', 'Send SMS') or fieldname in ('message', 'customer_mobile_no')) and parent in ('Quoattion', 'Sales Order', 'Delivery Note', 'Receivable Voucher')")
sql("delete from `tabDocField` where label in ('SMS', 'Send SMS') and parent = 'Purchase Order'")
sql("delete from `tabDocField` where (label in ('Send SMS', 'SMS Html') or fieldname in ('sms_message', 'lead_sms_detail', 'enquiry_sms_detail')) and parent in ('Lead', 'Enquiry')")
fromwebnotes.modelimportdelete_doc
delete_doc('DocType','Lead SMS Detail')
delete_doc('DocType','Enquiry SMS Detail')
elifpatch_no==199:
sql("update tabDocField set reqd = 0 where parent = 'Attendance' and fieldname = 'shifts'")
sql("delete from tabDocField where fieldname in ('pr_no', 'make', 'label', 'delivery_note_no', 'notes') and parent = 'Serial No'")
elifpatch_no==220:
sql("update tabDocField set label = 'Incoming Rate' where fieldname = 'purchase_rate' and parent = 'Serial No'")
sql("update tabDocField set label = 'Incoming Time' where fieldname = 'purchase_time' and parent = 'Serial No'")
elifpatch_no==221:
sql("update tabDocField set reqd = 1 where fieldname in ('purchase_rate', 'warehouse') and parent = 'Serial No'")
elifpatch_no==222:
sql("update tabDocField set options = '\nDelivery Note\nReceivable Voucher\nStock Entry' where fieldname = 'delivery_document_type' and parent = 'Serial No'")
elifpatch_no==223:
sql("update tabDocField set hidden = 0 where fieldname in ('pay_to_recd_from', 'total_amount', 'total_amount_in_words') and parent = 'Journal Voucher'")
sql("update tabDocField set permlevel = 0 where fieldname = 'pay_to_recd_from' and parent = 'Journal Voucher'")
sql("update `tabLetter Head` set content = replace(content, 'http://46.4.50.84/v170-test/', '')")
sql("update `tabSingles` set value = replace(value, 'http://46.4.50.84/v170-test/', '') where field in ('letter_head', 'client_name') and doctype = 'Control Panel'")
sql("update `tabItem` set description_html = replace(description_html, 'http://46.4.50.84/v170-test/', '')")
sql("update tabDocField set `default`=NULL where fieldname = 'naming_series'")
elifpatch_no==259:
sql("update `tabQuotation Detail` set description = replace(description, 'http://46.4.50.84/v170-test/', '')")
sql("update `tabSales Order Detail` set description = replace(description, 'http://46.4.50.84/v170-test/', '')")
sql("update `tabRV Detail` set description = replace(description, 'http://46.4.50.84/v170-test/', '')")
sql("update `tabDelivery Note Detail` set description = replace(description, 'http://46.4.50.84/v170-test/', '')")
elifpatch_no==260:
sql("update `tabLetter Head` set content = replace(content, 'http://46.4.50.84/v170/', '')")
sql("update `tabSingles` set value = replace(value, 'http://46.4.50.84/v170/', '') where field in ('letter_head', 'client_name') and doctype = 'Control Panel'")
sql("update `tabItem` set description_html = replace(description_html, 'http://46.4.50.84/v170/', '')")
sql("update `tabQuotation Detail` set description = replace(description, 'http://46.4.50.84/v170/', '')")
sql("update `tabSales Order Detail` set description = replace(description, 'http://46.4.50.84/v170/', '')")
sql("update `tabRV Detail` set description = replace(description, 'http://46.4.50.84/v170/', '')")
sql("update `tabDelivery Note Detail` set description = replace(description, 'http://46.4.50.84/v170/', '')")
elifpatch_no==261:
sql("update `tabPrint Format` set html = replace(html, 'customer_address', 'address_display')")
elifpatch_no==262:
frompatches.customer_addressimportsync_lead_phone
sync_lead_phone()
elifpatch_no==263:
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'))
elifpatch_no==264:
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 no_copy = 1 where fieldname in ('per_received', 'per_billed', 'per_delivered') and parent in ('Purchase Order', 'Purchase Receipt', 'Sales Order', 'Delivery Note')")
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'")