diff --git a/frappe/email/doctype/notification/notification.py b/frappe/email/doctype/notification/notification.py index f523d835e9..6b4ee92043 100644 --- a/frappe/email/doctype/notification/notification.py +++ b/frappe/email/doctype/notification/notification.py @@ -146,6 +146,7 @@ def get_context(context): if doc.meta.get_field(fieldname).fieldtype in frappe.model.numeric_fieldtypes: value = frappe.utils.cint(value) + doc.reload() doc.set(fieldname, value) doc.flags.updater_reference = { 'doctype': self.doctype, diff --git a/frappe/email/doctype/notification/test_notification.py b/frappe/email/doctype/notification/test_notification.py index 8e814e0245..a086ded3fb 100644 --- a/frappe/email/doctype/notification/test_notification.py +++ b/frappe/email/doctype/notification/test_notification.py @@ -20,6 +20,8 @@ class TestNotification(unittest.TestCase): notification.event = 'Value Change' notification.value_changed = 'status' notification.send_to_all_assignees = 1 + notification.set_property_after_alert = 'description' + notification.property_value = 'Changed by Notification' notification.save() if not frappe.db.exists('Notification', {'name': 'Contact Status Update'}, 'name'): @@ -237,6 +239,9 @@ class TestNotification(unittest.TestCase): self.assertTrue(email_queue) + # check if description is changed after alert since set_property_after_alert is set + self.assertEquals(todo.description, 'Changed by Notification') + recipients = [d.recipient for d in email_queue.recipients] self.assertTrue('test2@example.com' in recipients) self.assertTrue('test1@example.com' in recipients)