diff --git a/erpnext/patches/Discount_purchase_cycle.py b/erpnext/patches/Discount_purchase_cycle.py index 6be37f242b..8c41d5dd27 100755 --- a/erpnext/patches/Discount_purchase_cycle.py +++ b/erpnext/patches/Discount_purchase_cycle.py @@ -5,3 +5,5 @@ def execute(): reload_doc('accounts', 'doctype', 'pv_detail') reload_doc('buying', 'doctype', 'po_detail') reload_doc('stock', 'doctype', 'purchase_receipt_detail') + if webnotes.conn.sql("select name from 'tabDocField` where parent = 'PO Detail' and fieldname = 'discount'"): + webnotes.conn.sql("update `tabPO Detail` set discount_rate=discount")