[Fix] After amend the status become cancelled even if docstatus is zero
This commit is contained in:
parent
b8350353ea
commit
29458836e4
@ -103,6 +103,8 @@ class StatusUpdater(Document):
|
||||
|
||||
def set_status(self, update=False, status=None, update_modified=True):
|
||||
if self.is_new():
|
||||
if self.get('amended_from'):
|
||||
self.status = 'Draft'
|
||||
return
|
||||
|
||||
if self.doctype in status_map:
|
||||
|
@ -360,3 +360,4 @@ erpnext.patches.v7_1.set_sales_person_status
|
||||
erpnext.patches.v7_1.repost_stock_for_deleted_bins_for_merging_items
|
||||
execute:frappe.delete_doc('Desktop Icon', {'module_name': 'Profit and Loss Statment'})
|
||||
erpnext.patches.v7_2.update_website_for_variant
|
||||
erpnext.patches.v7_2.update_doctype_status
|
11
erpnext/patches/v7_2/update_doctype_status.py
Normal file
11
erpnext/patches/v7_2/update_doctype_status.py
Normal 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))
|
Loading…
Reference in New Issue
Block a user