ERPGulf / ultramsg_4_ERPNext

App for Frappe ERPNext to send Whatsapp message using service provider ultramsg.com
Other
1 stars 11 forks source link

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

Open Mar87iam opened 5 months ago

Mar87iam commented 5 months ago

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 commented 5 months ago

Aysha

Please look into this and fix.

Farook Kalpana 00974- 55124924 @.***

On Thu, 18 Apr 2024 at 7:17 AM Mar87iam @.***> wrote:

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.png (view on web) https://github.com/ERPGulf/ultramsg_4_ERPNext/assets/48872986/ddefc085-280f-4ff1-a72b-20390647d52d

— Reply to this email directly, view it on GitHub https://github.com/ERPGulf/ultramsg_4_ERPNext/issues/2, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQSDCDCLSB6V3GXX6THGQODY55CN3AVCNFSM6AAAAABGMPNYHGVHI2DSMVQWIX3LMV43ASLTON2WKOZSGI2DSNZQGEZDMNY . You are receiving this because you are subscribed to this thread.Message ID: @.***>

moizsami commented 4 months ago

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 commented 4 months ago

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

moizsami commented 4 months ago

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 commented 4 months ago

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

fkalpana commented 4 months ago

Send details. lets check

moizsami commented 4 months ago

Send details. lets check

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 commented 4 months ago

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 commented 4 months ago

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