added patch for fixing sales order delivered qty

This commit is contained in:
Rushabh Mehta 2014-07-01 18:08:37 +05:30
parent c53efc0d6c
commit 5f42276dbd
2 changed files with 16 additions and 0 deletions

View File

@ -66,3 +66,4 @@ erpnext.patches.v4_0.set_pricing_rule_for_buying_or_selling
erpnext.patches.v4_0.set_naming_series_property_setter
erpnext.patches.v4_1.set_outgoing_email_footer
erpnext.patches.v4_1.fix_jv_remarks
erpnext.patches.v4_1.fix_sales_order_delivered_status

View File

@ -0,0 +1,15 @@
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
def execute():
for si in frappe.db.sql_list("""select name
from `tabSales Invoice`
where ifnull(update_stock,0) = 1 and docstatus = 1 and exists(
select name from `tabSales Invoice Item` where parent=`tabSales Invoice`.name and
ifnull(so_detail, "") != "")"""):
invoice = frappe.get_doc("Sales Invoice", si)
invoice.update_qty()