brotherton-erpnext/patches/march_2013/p03_update_buying_amount.py

10 lines
378 B
Python
Raw Normal View History

2013-03-11 11:02:33 +00:00
import webnotes
def execute():
dn_list = webnotes.conn.sql("""select name from `tabDelivery Note` where docstatus < 2""")
for dn in dn_list:
webnotes.bean("Delivery Note", dn[0]).set_buying_amount()
si_list = webnotes.conn.sql("""select name from `tabSales Invoice` where docstatus < 2""")
for si in si_list:
webnotes.bean("Sales Invoice", si[0]).set_buying_amount()