fix(event)!: Move "Cancelled" to status instead of event_type (#21471)

This commit is contained in:
Corentin Flr 2023-07-11 15:26:57 +02:00 committed by GitHub
parent e8a57c63ce
commit 3229e2869c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 3 deletions

View file

@ -75,7 +75,7 @@
"label": "Event Type",
"oldfieldname": "event_type",
"oldfieldtype": "Select",
"options": "Private\nPublic\nCancelled",
"options": "Private\nPublic",
"reqd": 1,
"search_index": 1
},
@ -223,7 +223,7 @@
"in_list_view": 1,
"in_standard_filter": 1,
"label": "Status",
"options": "Open\nCompleted\nClosed"
"options": "Open\nCompleted\nClosed\nCancelled"
},
{
"collapsible": 1,
@ -295,7 +295,7 @@
"icon": "fa fa-calendar",
"idx": 1,
"links": [],
"modified": "2022-08-12 19:24:34.794098",
"modified": "2023-06-23 10:33:15.685368",
"modified_by": "Administrator",
"module": "Desk",
"name": "Event",

View file

@ -226,3 +226,4 @@ frappe.desk.doctype.form_tour.patches.introduce_ui_tours
execute:frappe.delete_doc_if_exists("Workspace", "Customization")
execute:frappe.db.set_single_value("Document Naming Settings", "default_amend_naming", "Amend Counter")
execute:frappe.delete_doc_if_exists("DocType", "Error Snapshot")
frappe.patches.v15_0.move_event_cancelled_to_status

View file

@ -0,0 +1,12 @@
import frappe
def execute():
Event = frappe.qb.DocType("Event")
query = (
frappe.qb.update(Event)
.set(Event.event_type, "Private")
.set(Event.status, "Cancelled")
.where(Event.event_type == "Cancelled")
)
query.run()