fix: patch for updating shipment status

This commit is contained in:
Ankush Menat 2021-04-17 15:42:03 +05:30
parent 9229ee1745
commit e972ceb798
No known key found for this signature in database
GPG Key ID: 8EA82E09BBD13AAF
2 changed files with 15 additions and 0 deletions

View File

@ -772,3 +772,4 @@ erpnext.patches.v12_0.purchase_receipt_status
erpnext.patches.v13_0.fix_non_unique_represents_company
erpnext.patches.v12_0.add_document_type_field_for_italy_einvoicing
erpnext.patches.v13_0.make_non_standard_user_type #13-04-2021
erpnext.patches.v13_0.update_shipment_status

View File

@ -0,0 +1,14 @@
import frappe
def execute():
frappe.reload_doc("stock", "doctype", "shipment")
# update submitted status
frappe.db.sql("""UPDATE `tabShipment`
SET status = "Submitted"
WHERE status = "Draft" AND docstatus = 1""")
# update cancelled status
frappe.db.sql("""UPDATE `tabShipment`
SET status = "Cancelled"
WHERE status = "Draft" AND docstatus = 2""")