seitime-frappe/frappe/patches/v13_0/rename_notification_fields.py
Suraj Shetty c0c5b2ebdd
style: format all python files using black (#16453)
Co-authored-by: Frappe Bot <developers@frappe.io>
2022-04-12 10:59:25 +05:30

16 lines
559 B
Python

# Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and Contributors
# License: MIT. See LICENSE
import frappe
from frappe.model.utils.rename_field import rename_field
def execute():
"""
Change notification recipient fields from email to receiver fields
"""
frappe.reload_doc("Email", "doctype", "Notification Recipient")
frappe.reload_doc("Email", "doctype", "Notification")
rename_field("Notification Recipient", "email_by_document_field", "receiver_by_document_field")
rename_field("Notification Recipient", "email_by_role", "receiver_by_role")