brotherton-erpnext/erpnext/patches/v5_0/update_dn_against_doc_fields.py

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

15 lines
539 B
Python
Raw Normal View History

# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
def execute():
frappe.reload_doc('stock', 'doctype', 'delivery_note_item')
frappe.db.sql("""update `tabDelivery Note Item` set so_detail = prevdoc_detail_docname
where ifnull(against_sales_order, '') != ''""")
frappe.db.sql("""update `tabDelivery Note Item` set si_detail = prevdoc_detail_docname
where ifnull(against_sales_invoice, '') != ''""")