2015-03-03 09:25:30 +00:00
|
|
|
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
|
2014-07-01 12:42:26 +00:00
|
|
|
# License: GNU General Public License v3. See license.txt
|
|
|
|
|
|
|
|
from __future__ import unicode_literals
|
|
|
|
import frappe
|
|
|
|
|
|
|
|
def execute():
|
|
|
|
reference_date = guess_reference_date()
|
2014-12-25 11:44:18 +00:00
|
|
|
for name in frappe.db.sql_list("""select name from `tabJournal Entry`
|
2014-12-31 07:54:36 +00:00
|
|
|
where date(creation)>=%s""", reference_date):
|
2014-12-25 11:44:18 +00:00
|
|
|
jv = frappe.get_doc("Journal Entry", name)
|
2014-07-01 12:42:26 +00:00
|
|
|
try:
|
|
|
|
jv.create_remarks()
|
|
|
|
except frappe.MandatoryError:
|
|
|
|
pass
|
|
|
|
else:
|
2014-12-25 11:44:18 +00:00
|
|
|
frappe.db.set_value("Journal Entry", jv.name, "remark", jv.remark)
|
2014-07-01 12:42:26 +00:00
|
|
|
|
|
|
|
def guess_reference_date():
|
|
|
|
return (frappe.db.get_value("Patch Log", {"patch": "erpnext.patches.v4_0.validate_v3_patch"}, "creation")
|
|
|
|
or "2014-05-06")
|