瀏覽代碼

Merge pull request #14048 from shariquerik/set-property-after-alert-fix

version-14
Suraj Shetty 3 年之前
committed by GitHub
父節點
當前提交
4790e23fbf
沒有發現已知的金鑰在資料庫的簽署中 GPG 金鑰 ID: 4AEE18F83AFDEB23
共有 2 個檔案被更改,包括 6 行新增0 行删除
  1. +1
    -0
      frappe/email/doctype/notification/notification.py
  2. +5
    -0
      frappe/email/doctype/notification/test_notification.py

+ 1
- 0
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,


+ 5
- 0
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)


Loading…
取消
儲存