Merge pull request #1612 from pdvyas/migrate-3to4

3 to 4 migration
This commit is contained in:
Nabin Hait 2014-05-09 12:07:11 +05:30
commit a5ac0149af
3 changed files with 13 additions and 2 deletions

View File

@ -6,6 +6,7 @@ import frappe
from frappe.core.doctype.custom_field.custom_field import create_custom_field_if_values_exist
def execute():
frappe.db.sql("delete from tabDocField where parent='Salary Slip' and options='Grade'")
docfields = {
("Purchase Receipt", "challan_no"): frappe.get_meta("Purchase Receipt").get_field("challan_no"),
("Purchase Receipt", "challan_date"): frappe.get_meta("Purchase Receipt").get_field("challan_date"),
@ -18,6 +19,8 @@ def execute():
}
for (doctype, fieldname), df in docfields.items():
if not df:
continue
opts = df.as_dict()
if df.idx >= 2:
opts["insert_after"] = frappe.get_meta(doctype).get("fields")[df.idx - 2].fieldname

View File

@ -8,7 +8,7 @@ def execute():
frappe.reload_doc("core", "doctype", "outgoing_email_settings")
frappe.reload_doc("support", "doctype", "support_email_settings")
email_settings = frappe.get_doc("Email Settings")
email_settings = get_email_settings()
map_outgoing_email_settings(email_settings)
map_support_email_settings(email_settings)
frappe.delete_doc("Doctype", "Email Settings")
@ -48,3 +48,9 @@ def map_support_email_settings(email_settings):
support_email_settings.save()
def get_email_settings():
ret = {}
for field, value in frappe.db.sql("select field, value from tabSingles where doctype='Email Settings'"):
ret[field] = value
return ret

View File

@ -86,7 +86,9 @@ def add_employee_restrictions_to_leave_approver():
where `tabEmployee Leave Approver`.parent=`tabEmployee`.name)
or ifnull(`reports_to`, '')!=''"""):
frappe.get_doc("Employee", employee).save()
emp = frappe.get_doc("Employee", employee)
emp.ignore_links = True
emp.save()
def update_permissions():
# clear match conditions other than owner