Skip to content

Commit

Permalink
feat : Added notification function
Browse files Browse the repository at this point in the history
  • Loading branch information
nidh-eesh committed Nov 3, 2023
1 parent 5a9c15f commit 144e6ff
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions aumms/aumms/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,3 +268,24 @@ def get_advances_payments_against_so_in_gold(sales_order, item_type, purity, sto
if advance.get('amount'):
advance['qty_obtained'] = float(advance.get('amount'))/float(board_rate)
return advances

# Notification Function
@frappe.whitelist()
def create_notification_log(doctype, docname, recipient, subject, content=None, type=None):
"""method is used to create notification log
args:
doc: document object
recipient: notification receiving user
subject: subject of notification log
type: type of the notification log"""
notification_log = frappe.new_doc("Notification Log")
notification_log.type = "Mention"
if type:
notification_log.type = type
notification_log.document_type = doctype
notification_log.document_name = docname
notification_log.for_user = recipient
notification_log.subject = subject
if content:
notification_log.email_content = content
notification_log.save(ignore_permissions=True)

0 comments on commit 144e6ff

Please sign in to comment.