[fix] issues encountered migrating from v3/4 to 6

This commit is contained in:
Anand Doshi 2015-10-31 22:49:42 +05:30
parent c39cef363c
commit aba8fdd18d
5 changed files with 24 additions and 4 deletions

View File

@ -163,7 +163,7 @@ def validate_recurring_document(doc):
raise_exception=1)
elif not (doc.from_date and doc.to_date):
throw(_("Period From and Period To dates mandatory for recurring %s") % doc.doctype)
throw(_("Period From and Period To dates mandatory for recurring {0}").format(doc.doctype))
#
def convert_to_recurring(doc, posting_date):

View File

@ -9,7 +9,9 @@ def execute():
if outgoing and outgoing['mail_server'] and outgoing['mail_login']:
account = frappe.new_doc("Email Account")
mapping = {
"email_id": "mail_login",
"login_id_is_different": 1,
"email_id": "auto_email_id",
"login_id": "mail_login",
"password": "mail_password",
"footer": "footer",
"smtp_server": "mail_server",

View File

@ -1,3 +1,5 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import frappe
def execute():
@ -11,9 +13,12 @@ def execute():
for m in frappe.get_all("Project Milestone", "*"):
if (m.milestone and m.milestone_date
and frappe.db.exists("Project", m.parent)):
subject = (m.milestone[:139] + "") if (len(m.milestone) > 140) else m.milestone
description = m.milestone
task = frappe.get_doc({
"doctype": "Task",
"subject": m.milestone,
"subject": subject,
"description": description if description!=subject else None,
"expected_start_date": m.milestone_date,
"status": "Open" if m.status=="Pending" else "Closed",
"project": m.parent,

View File

@ -40,7 +40,17 @@ def fix_files_for_item(files_path, unlinked_files):
file_data = frappe.get_doc("File", unlinked_files[file_url]["file"])
file_data.attached_to_doctype = "Item"
file_data.attached_to_name = item_code
file_data.flags.ignore_folder_validate = True
try:
file_data.save()
except IOError:
print "File {0} does not exist".format(new_file_url)
# marking fix to prevent further errors
fixed_files.append(file_url)
continue
# set it as image in Item
if not frappe.db.get_value("Item", item_code, "image"):

View File

@ -30,3 +30,6 @@ def execute():
frappe.reload_doctype("Sales Invoice")
frappe.db.sql("""update `tabSales Invoice` set title = customer_name""")
frappe.reload_doctype("Expense Claim")
frappe.db.sql("""update `tabExpense Claim` set title = employee_name""")