From 3957880370eeb0df6a3a7185f6f8accab6efddfb Mon Sep 17 00:00:00 2001 From: Deepesh Garg <42651287+deepeshgarg007@users.noreply.github.com> Date: Wed, 26 Jun 2019 11:06:14 +0530 Subject: [PATCH] fix: Removed submitted status from quotation (#18054) * fix: Change in list view and status updater * fix: Change status in doctype * fix: Patch for submitted status --- erpnext/controllers/status_updater.py | 2 +- erpnext/patches.txt | 3 ++- erpnext/patches/v11_1/set_quotation_status.py | 7 +++++++ erpnext/selling/doctype/quotation/quotation.json | 4 ++-- erpnext/selling/doctype/quotation/quotation_list.js | 4 ++-- 5 files changed, 14 insertions(+), 6 deletions(-) create mode 100644 erpnext/patches/v11_1/set_quotation_status.py diff --git a/erpnext/controllers/status_updater.py b/erpnext/controllers/status_updater.py index 2484586d041..a3018029bc0 100644 --- a/erpnext/controllers/status_updater.py +++ b/erpnext/controllers/status_updater.py @@ -27,7 +27,7 @@ status_map = { ], "Quotation": [ ["Draft", None], - ["Submitted", "eval:self.docstatus==1"], + ["Open", "eval:self.docstatus==1"], ["Lost", "eval:self.status=='Lost'"], ["Ordered", "has_sales_order"], ["Cancelled", "eval:self.docstatus==2"], diff --git a/erpnext/patches.txt b/erpnext/patches.txt index 3ed19169295..962ef8a8a8d 100755 --- a/erpnext/patches.txt +++ b/erpnext/patches.txt @@ -601,4 +601,5 @@ execute:frappe.delete_doc("Report", "Inactive Items") erpnext.patches.v11_1.delete_scheduling_tool erpnext.patches.v11_1.update_bank_transaction_status erpnext.patches.v11_1.renamed_delayed_item_report -erpnext.patches.v11_1.set_missing_opportunity_from \ No newline at end of file +erpnext.patches.v11_1.set_missing_opportunity_from +erpnext.patches.v11_1.set_quotation_status \ No newline at end of file diff --git a/erpnext/patches/v11_1/set_quotation_status.py b/erpnext/patches/v11_1/set_quotation_status.py new file mode 100644 index 00000000000..87643a23545 --- /dev/null +++ b/erpnext/patches/v11_1/set_quotation_status.py @@ -0,0 +1,7 @@ +from __future__ import unicode_literals +import frappe + +def execute(): + + frappe.db.sql(""" UPDATE `tabQuotation` set status = 'Open' + where docstatus = 1 and status = 'Submitted' """) diff --git a/erpnext/selling/doctype/quotation/quotation.json b/erpnext/selling/doctype/quotation/quotation.json index 33fc4dbeb04..65fbe52d9a4 100644 --- a/erpnext/selling/doctype/quotation/quotation.json +++ b/erpnext/selling/doctype/quotation/quotation.json @@ -3096,7 +3096,7 @@ "no_copy": 1, "oldfieldname": "status", "oldfieldtype": "Select", - "options": "Draft\nSubmitted\nOrdered\nLost\nCancelled\nOpen\nReplied", + "options": "Draft\nOpen\nReplied\nOrdered\nLost\nCancelled", "permlevel": 0, "print_hide": 1, "print_hide_if_no_value": 0, @@ -3224,7 +3224,7 @@ "istable": 0, "max_attachments": 1, "menu_index": 0, - "modified": "2019-05-11 19:26:50.735628", + "modified": "2019-06-25 15:31:04.724730", "modified_by": "Administrator", "module": "Selling", "name": "Quotation", diff --git a/erpnext/selling/doctype/quotation/quotation_list.js b/erpnext/selling/doctype/quotation/quotation_list.js index 61a8bc1cab3..5f4e2546fbc 100644 --- a/erpnext/selling/doctype/quotation/quotation_list.js +++ b/erpnext/selling/doctype/quotation/quotation_list.js @@ -13,11 +13,11 @@ frappe.listview_settings['Quotation'] = { }, get_indicator: function(doc) { - if(doc.status==="Submitted") { + if(doc.status==="Open") { if (doc.valid_till && doc.valid_till < frappe.datetime.nowdate()) { return [__("Expired"), "darkgrey", "valid_till,<," + frappe.datetime.nowdate()]; } else { - return [__("Submitted"), "blue", "status,=,Submitted"]; + return [__("Open"), "orange", "status,=,Open"]; } } else if(doc.status==="Ordered") { return [__("Ordered"), "green", "status,=,Ordered"];