brotherton-erpnext/erpnext/patches/before_jan_2012/Discount_purchase_cycle.py

15 lines
573 B
Python
Raw Normal View History

2011-11-22 09:51:42 +00:00
def execute():
import webnotes
from webnotes.modules.module_manager import reload_doc
2011-11-24 10:48:42 +00:00
reload_doc('accounts', 'doctype', 'pv_detail')
reload_doc('buying', 'doctype', 'po_detail')
2011-11-22 09:51:42 +00:00
reload_doc('stock', 'doctype', 'purchase_receipt_detail')
2011-12-13 13:35:13 +00:00
if webnotes.conn.sql("select name from `tabDocField` where parent = 'PO Detail' and fieldname = 'discount'"):
2011-12-13 13:01:42 +00:00
webnotes.conn.sql("update `tabPO Detail` set discount_rate=discount")
# Features setup
reload_doc('setup', 'doctype', 'features_setup')
from webnotes.model.code import get_obj
get_obj('Features Setup').validate()