From 86125b2b9f5fccc6be96441669c4f2adaf397abd Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Tue, 13 Oct 2015 11:48:08 +0530 Subject: [PATCH] [fix] sales order status for maintenance --- erpnext/controllers/status_updater.py | 1 + erpnext/patches.txt | 3 ++- erpnext/patches/v6_4/fix_sales_order_maintenance_status.py | 7 +++++++ 3 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 erpnext/patches/v6_4/fix_sales_order_maintenance_status.py diff --git a/erpnext/controllers/status_updater.py b/erpnext/controllers/status_updater.py index 7d18867869..94cddeeac3 100644 --- a/erpnext/controllers/status_updater.py +++ b/erpnext/controllers/status_updater.py @@ -34,6 +34,7 @@ status_map = { ["To Bill", "eval:self.per_delivered == 100 and self.per_billed < 100 and self.docstatus == 1"], ["To Deliver", "eval:self.per_delivered < 100 and self.per_billed == 100 and self.docstatus == 1"], ["Completed", "eval:self.per_delivered == 100 and self.per_billed == 100 and self.docstatus == 1"], + ["Completed", "eval:self.order_type == 'Maintenance' and self.per_billed == 100 and self.docstatus == 1"], ["Stopped", "eval:self.status=='Stopped'"], ["Cancelled", "eval:self.docstatus==2"], ], diff --git a/erpnext/patches.txt b/erpnext/patches.txt index efa49060c7..bf33fb3281 100644 --- a/erpnext/patches.txt +++ b/erpnext/patches.txt @@ -216,4 +216,5 @@ erpnext.patches.v6_4.repost_gle_for_journal_entries_where_reference_name_missing erpnext.patches.v6_4.fix_journal_entries_due_to_reconciliation erpnext.patches.v6_4.fix_status_in_sales_and_purchase_order erpnext.patches.v6_4.fix_modified_in_sales_order_and_purchase_order -erpnext.patches.v6_4.fix_duplicate_bins \ No newline at end of file +erpnext.patches.v6_4.fix_duplicate_bins +erpnext.patches.v6_4.fix_sales_order_maintenance_status diff --git a/erpnext/patches/v6_4/fix_sales_order_maintenance_status.py b/erpnext/patches/v6_4/fix_sales_order_maintenance_status.py new file mode 100644 index 0000000000..dbd34d54d1 --- /dev/null +++ b/erpnext/patches/v6_4/fix_sales_order_maintenance_status.py @@ -0,0 +1,7 @@ +import frappe + +def execute(): + for doc in frappe.get_all("Sales Order", filters={"docstatus": 1, + "order_type": "Maintenance"}): + doc = frappe.get_doc("Sales Order", doc.name) + doc.set_status(update=True)