brotherton-erpnext/patches/august_2012/repost_billed_amt.py
2012-09-24 19:13:42 +05:30

10 lines
401 B
Python

from __future__ import unicode_literals
def execute():
import webnotes
from webnotes.model.code import get_obj
from selling.doctype.sales_common.sales_common import StatusUpdater
invoices = webnotes.conn.sql("select name from `tabSales Invoice` where docstatus = 1")
for inv in invoices:
inv_obj = get_obj('Sales Invoice', inv[0], with_children=1)
StatusUpdater(inv_obj, 1).update_all_qty()