brotherton-erpnext/patches/october_2013/p01_update_delivery_note_prevdocs.py
2013-11-20 13:00:28 +05:30

13 lines
544 B
Python

# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import webnotes
def execute():
webnotes.reload_doc("stock", "doctype", "delivery_note_item")
webnotes.conn.sql("""update `tabDelivery Note Item` set against_sales_order=prevdoc_docname
where prevdoc_doctype='Sales Order' """)
webnotes.conn.sql("""update `tabDelivery Note Item` set against_sales_invoice=prevdoc_docname
where prevdoc_doctype='Sales Invoice' """)