diff --git a/erpnext/patches.txt b/erpnext/patches.txt index 9eaa0121da..85bf3cb131 100644 --- a/erpnext/patches.txt +++ b/erpnext/patches.txt @@ -215,3 +215,4 @@ erpnext.patches.v6_4.round_status_updater_percentages erpnext.patches.v6_4.repost_gle_for_journal_entries_where_reference_name_missing erpnext.patches.v6_4.fix_journal_entries_due_to_reconciliation erpnext.patches.v6_4.fix_status_in_sales_and_purchase_order +erpnext.patches.v6_4.fix_modified_in_sales_order_and_purchase_order \ No newline at end of file diff --git a/erpnext/patches/v6_4/fix_modified_in_sales_order_and_purchase_order.py b/erpnext/patches/v6_4/fix_modified_in_sales_order_and_purchase_order.py new file mode 100644 index 0000000000..f27489e7b0 --- /dev/null +++ b/erpnext/patches/v6_4/fix_modified_in_sales_order_and_purchase_order.py @@ -0,0 +1,10 @@ +from __future__ import unicode_literals +import frappe + +def execute(): + for doctype in ("Sales Order", "Purchase Order"): + data = frappe.db.sql("""select parent, modified_by, modified + from `tab{doctype} Item` where docstatus=1 group by parent""".format(doctype=doctype), as_dict=True) + for item in data: + frappe.db.sql("""update `tab{doctype}` set modified_by=%(modified_by)s, modified=%(modified)s + where name=%(parent)s""".format(doctype=doctype), item)