[fix] modified in sales order and purchase order

This commit is contained in:
Anand Doshi 2015-10-07 17:26:19 +05:30
parent 5812fdb574
commit 7866c6e6db
2 changed files with 11 additions and 0 deletions

View File

@ -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.repost_gle_for_journal_entries_where_reference_name_missing
erpnext.patches.v6_4.fix_journal_entries_due_to_reconciliation 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_status_in_sales_and_purchase_order
erpnext.patches.v6_4.fix_modified_in_sales_order_and_purchase_order

View File

@ -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)