[Fix] After amend the status become cancelled even if docstatus is zero

This commit is contained in:
Rohit Waghchaure
2017-01-13 12:51:19 +05:30
parent b8350353ea
commit 29458836e4
3 changed files with 14 additions and 0 deletions

View File

@@ -0,0 +1,11 @@
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
def execute():
doctypes = ["Opportunity", "Quotation", "Sales Order", "Sales Invoice", "Purchase Invoice", "Purchase Order", "Delivery Note", "Purchase Receipt"]
for doctype in doctypes:
frappe.db.sql(""" update `tab{doctype}` set status = 'Draft'
where status = 'Cancelled' and docstatus = 0 """.format(doctype = doctype))