Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

not sending notifications for multiple receipients if received by role was set in erpnext notifications #2

Open
Mar87iam opened this issue Apr 18, 2024 · 9 comments

Comments

@Mar87iam
Copy link

good morning
thanks for the application but i noticed that

1-if we created erpnext notification and receipients were set to be by role

notifications not sent or sent to only one of all the users assigned to this role
2-cant combine system notification with whatsapp notification
3-ultraamsg log report not recording any successful sent whatsapp notification
Screenshot from 2024-04-18 07-15-19

@fkalpana
Copy link
Contributor

fkalpana commented Apr 18, 2024 via email

@moizsami
Copy link

moizsami commented May 9, 2024

Yes I can confirm that by role feature is not working.
It is throwing below error:
Traceback (most recent call last): File "apps/ultramsg_4_erpnext/ultramsg_4_erpnext/overrides/notification.py", line 50, in send_whatsapp_with_pdf frappe.get_doc({"doctype":"ultramsg_4_ERPNext log","title":"Whatsapp message and pdf successfully sent ","message":msg1,"to_number":doc.custom_mobile_phone,"time":current_time }).insert() ^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'SalesInvoice' object has no attribute 'custom_mobile_phone'

@fkalpana
Copy link
Contributor

fkalpana commented May 9, 2024

we have a filed in sales invoice ( custom_mobile_phone ) , to send whatsapp. pls create that, it should work

@moizsami
Copy link

moizsami commented May 9, 2024

we have a filed in sales invoice ( custom_mobile_phone ) , to send whatsapp. pls create that, it should work

I created the field, i didnt get any failed msg error log, but the success log was created with empty mobile number as I had left the field empty.
image

What I want is based on the role it should get the mobile number. In user form I have filled the 'Mobile No' field with value.

@moizsami
Copy link

Is there any plan in the near future to fix the send to multiple users based on Role ?

@fkalpana
Copy link
Contributor

Send details. lets check

@moizsami
Copy link

Send details. lets check

  • I have created a new Role.

  • Assigned two users to that role

  • Made sure they both have mobile_no field filled in User form

  • Once the condition is triggered only one user receives the notification, the second one doesnt.

  • Nothing gets written in the ultramsg success log doctype

  • in the error list, new record gets created

Traceback (most recent call last):
  File "apps/ultramsg_4_erpnext/ultramsg_4_erpnext/overrides/notification.py", line 90, in send_whatsapp_without_pdf
    frappe.get_doc({"doctype":"ultramsg_4_ERPNext log","title":"Whatsapp message successfully sent ","message":msg1,"to_number":doc.custom_mobile_phone,"time":current_time }).insert()
                                                                                                                                ^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'Contact' object has no attribute 'custom_mobile_phone'

And if we create the custom field, the error does not appear and the success log is written but with empty 'to_number' field and still the message is sent to only one user.

@moizsami
Copy link

moizsami commented May 18, 2024

I think in notification.py, indentation of the return receiver_list statement is incorrect, it should be maybe out of the for loop in order to work correctly.

image

@moizsami
Copy link

moizsami commented Jun 4, 2024

Hi just asking is there any update regarding the issue for Multiple users in one role not receiving the message

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants