2015-03-03 14:55:30 +05:30
|
|
|
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
|
2014-07-01 18:12:26 +05:30
|
|
|
# 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 17:14:18 +05:30
|
|
|
for name in frappe.db.sql_list("""select name from `tabJournal Entry`
|
2014-12-31 13:24:36 +05:30
|
|
|
where date(creation)>=%s""", reference_date):
|
2014-12-25 17:14:18 +05:30
|
|
|
jv = frappe.get_doc("Journal Entry", name)
|
2014-07-01 18:12:26 +05:30
|
|
|
try:
|
|
|
|
jv.create_remarks()
|
|
|
|
except frappe.MandatoryError:
|
|
|
|
pass
|
|
|
|
else:
|
2014-12-25 17:14:18 +05:30
|
|
|
frappe.db.set_value("Journal Entry", jv.name, "remark", jv.remark)
|
2014-07-01 18:12:26 +05:30
|
|
|
|
|
|
|
def guess_reference_date():
|
|
|
|
return (frappe.db.get_value("Patch Log", {"patch": "erpnext.patches.v4_0.validate_v3_patch"}, "creation")
|
|
|
|
or "2014-05-06")
|