Merge pull request #3125 from nabinhait/v4.x.x

hotfix in patch
This commit is contained in:
Nabin Hait 2015-04-17 16:16:35 +05:30
commit 1b26c6f02a

View File

@ -8,6 +8,7 @@ def execute():
cancelled_invoices = frappe.db.sql_list("""select name from `tabSales Invoice`
where docstatus = 2 and ifnull(update_stock, 0) = 1""")
frappe.db.sql("""delete from `tabGL Entry`
where voucher_type = 'Sales Invoice' and voucher_no in (%s)"""
% (', '.join(['%s']*len(cancelled_invoices))), tuple(cancelled_invoices))
if cancelled_invoices:
frappe.db.sql("""delete from `tabGL Entry`
where voucher_type = 'Sales Invoice' and voucher_no in (%s)"""
% (', '.join(['%s']*len(cancelled_invoices))), tuple(cancelled_invoices))