Kaynağa Gözat

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

version-14
Suraj Shetty 3 yıl önce
committed by GitHub
ebeveyn
işleme
4790e23fbf
Veri tabanında bu imza için bilinen anahtar bulunamadı GPG Anahtar Kimliği: 4AEE18F83AFDEB23
2 değiştirilmiş dosya ile 6 ekleme ve 0 silme
  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 Dosyayı Görüntüle

@@ -146,6 +146,7 @@ def get_context(context):
if doc.meta.get_field(fieldname).fieldtype in frappe.model.numeric_fieldtypes: if doc.meta.get_field(fieldname).fieldtype in frappe.model.numeric_fieldtypes:
value = frappe.utils.cint(value) value = frappe.utils.cint(value)


doc.reload()
doc.set(fieldname, value) doc.set(fieldname, value)
doc.flags.updater_reference = { doc.flags.updater_reference = {
'doctype': self.doctype, 'doctype': self.doctype,


+ 5
- 0
frappe/email/doctype/notification/test_notification.py Dosyayı Görüntüle

@@ -20,6 +20,8 @@ class TestNotification(unittest.TestCase):
notification.event = 'Value Change' notification.event = 'Value Change'
notification.value_changed = 'status' notification.value_changed = 'status'
notification.send_to_all_assignees = 1 notification.send_to_all_assignees = 1
notification.set_property_after_alert = 'description'
notification.property_value = 'Changed by Notification'
notification.save() notification.save()


if not frappe.db.exists('Notification', {'name': 'Contact Status Update'}, 'name'): if not frappe.db.exists('Notification', {'name': 'Contact Status Update'}, 'name'):
@@ -237,6 +239,9 @@ class TestNotification(unittest.TestCase):


self.assertTrue(email_queue) 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] recipients = [d.recipient for d in email_queue.recipients]
self.assertTrue('test2@example.com' in recipients) self.assertTrue('test2@example.com' in recipients)
self.assertTrue('test1@example.com' in recipients) self.assertTrue('test1@example.com' in recipients)


Yükleniyor…
İptal
Kaydet