From 6b651d734e714f2c4b7f48dfda1d5dade1c89004 Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Thu, 24 Aug 2017 15:47:49 +0530 Subject: [PATCH] [fix] status in purchase_receipt.py (#10534) --- erpnext/patches.txt | 3 ++- erpnext/patches/v8_7/fix_purchase_receipt_status.py | 12 ++++++++++++ .../doctype/purchase_receipt/purchase_receipt.py | 5 ----- 3 files changed, 14 insertions(+), 6 deletions(-) create mode 100644 erpnext/patches/v8_7/fix_purchase_receipt_status.py diff --git a/erpnext/patches.txt b/erpnext/patches.txt index d781ec788f..35530fd9cf 100644 --- a/erpnext/patches.txt +++ b/erpnext/patches.txt @@ -432,4 +432,5 @@ erpnext.patches.v8_5.update_customer_group_in_POS_profile erpnext.patches.v8_6.update_timesheet_company_from_PO erpnext.patches.v8_6.set_write_permission_for_quotation_for_sales_manager erpnext.patches.v8_5.remove_project_type_property_setter -erpnext.patches.v8_7.add_more_gst_fields \ No newline at end of file +erpnext.patches.v8_7.add_more_gst_fields +erpnext.patches.v8_7.fix_purchase_receipt_status \ No newline at end of file diff --git a/erpnext/patches/v8_7/fix_purchase_receipt_status.py b/erpnext/patches/v8_7/fix_purchase_receipt_status.py new file mode 100644 index 0000000000..f7037dd7df --- /dev/null +++ b/erpnext/patches/v8_7/fix_purchase_receipt_status.py @@ -0,0 +1,12 @@ +import frappe + +def execute(): + # there is no more status called "Submitted", there was an old issue that used + # to set it as Submitted, fixed in this commit + frappe.db.sql(""" + update + `tabPurchase Receipt` + set + status = 'To Bill' + where + status = 'Submitted'""") \ No newline at end of file diff --git a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py index 0444369ff3..d12c288a28 100644 --- a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py +++ b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py @@ -115,9 +115,6 @@ class PurchaseReceipt(BuyingController): frappe.get_doc('Authorization Control').validate_approving_authority(self.doctype, self.company, self.base_grand_total) - # Set status as Submitted - frappe.db.set(self, 'status', 'Submitted') - self.update_prevdoc_status() if self.per_billed < 100: self.update_billing_status() @@ -152,8 +149,6 @@ class PurchaseReceipt(BuyingController): if submitted: frappe.throw(_("Purchase Invoice {0} is already submitted").format(submitted[0][0])) - frappe.db.set(self,'status','Cancelled') - self.update_prevdoc_status() self.update_billing_status()