Procházet zdrojové kódy

fix: replace owner with allocated_to

version-14
shadrak gurupnor před 3 roky
committed by Gavin D'souza
rodič
revize
1832df06ad
2 změnil soubory, kde provedl 5 přidání a 5 odebrání
  1. +2
    -2
      frappe/email/doctype/notification/notification.py
  2. +3
    -3
      frappe/model/document.py

+ 2
- 2
frappe/email/doctype/notification/notification.py Zobrazit soubor

@@ -435,8 +435,8 @@ def get_context(doc):
def get_assignees(doc):
assignees = []
assignees = frappe.get_all('ToDo', filters={'status': 'Open', 'reference_name': doc.name,
'reference_type': doc.doctype}, fields=['owner'])
'reference_type': doc.doctype}, fields=['allocated_to'])

recipients = [d.owner for d in assignees]
recipients = [d.allocated_to for d in assignees]

return recipients

+ 3
- 3
frappe/model/document.py Zobrazit soubor

@@ -1347,15 +1347,15 @@ class Document(BaseDocument):
), frappe.exceptions.InvalidDates)

def get_assigned_users(self):
assignments = frappe.get_all('ToDo',
assigned_users = frappe.get_all('ToDo',
fields=['allocated_to'],
filters={
'reference_type': self.doctype,
'reference_name': self.name,
'status': ('!=', 'Cancelled'),
})
}, pluck='allocated_to')

users = set([assignment.owner for assignment in assignments])
users = set(assigned_users)
return users

def add_tag(self, tag):


Načítá se…
Zrušit
Uložit