[16.0][MIG] mail_broker + mail_broker_telegram + mail_broker_whatsapp: migration to 16.0
TODO:
- In the chat window with contacts:
- [ ] Ability to switch the communication medium to one incorporated by this system.
- [x] Reception of responses in the same window.
- [x] Support for reactions and emojis.
- [x] Support for voice messages, images, and stickers.
- [x] Support edition of messages
- In the chatter of documents:
- [x] Ability to send messages through one of these communication mediums.
- [x] These messages will also be displayed in the contact's chat window with a navigable reference to the document.
- [ ] Ability for direct navigation from each message to the general chat window with scrolling to the conversation fragment. --> Partially done. Odoo is not using it by default :thinking:
- [x] If the WhatsApp/Telegram reply option is used, identifying only the message origin, then the reply will also be placed in the chatter of the original document of the reply.
- Documentation
- [x] Add documentation for whatsapp configuration
- [x] Add documentation for telegram configuration
Also it includes web_broker_telegram for testing, because it is easier to configure for testing purposes.
Now it starts to look properly.
I will add Whatsapp functionality and then I will finish with the change automatic sending using message templates :tada:
@etobella can you rebase please :) ??
Added a whatsapp automatic view in order to start conversations.
We cannot know if a number exists in whatsapp before we sand a message :disappointed:
Nice start! Is there any plan to handle situations, where telegram bot is used to post messages on telegram channel?
hi @etobella , awesome work with that, i know that is a bit soon, but i was testing in one of my instances, and with the telegram bot, when i receive (the "client" sends) any attachment (image, sticker, audio etc.) that error starts to "explode", blocking the bot to continue receiving messages...
https://gist.github.com/augustodinizl/85043550942d1c907505c4c1dda6f9b1
Thank you for your awesome work
Thanks @augustodinizl I will check what might happen. Thanks for reviewing it.
@etobella , you have plans to include a debug tool into the mail_broker_whatsapp? since meta has it already here: https://developers.facebook.com/docs/whatsapp/on-premises/guides/wadebug
WADebug is for On-Premises API, but this API is being deprecated by Meta
@augustodinizl Error should be fixed right now.
WADebug is for On-Premises API, but this API is being deprecated by Meta
Tks man, srry
@augustodinizl Ya debería estar arreglado el error que encontraste.
No errors... But it was preliminary tests with WABA, it says connected, but I couldn't be able to get logs yet, again, thank you for the awesome work
where does it says connected?
@augustodinizl Error should be fixed right now.
Tks for the effort and awesome work man, i can confirm that images and audios are working now for telegram, but stickers are causing troubles yet: https://gist.github.com/augustodinizl/3415b9ece314ae5c519419be05d94e5a
where does it says connected?
now, for the broker_whatsapp, i got that one:
https://gist.github.com/augustodinizl/59dfeaeb520b897ecd396b8264e17971
On the whastapp from phone you need to write the Identifier of the number, not the number.
On the whastapp from phone you need to write the Identifier of the number, not the number.
changed and getting the same error
2024-03-04 19:22:12,158 1 ERROR ltxxxxxd odoo.addons.mail_broker_whatsapp.models.mail_broker_whatsapp: Traceback (most recent call last): File "/mnt/extra-addons/mail_broker_whatsapp/models/mail_broker_whatsapp.py", line 250, in _send response.raise_for_status() File "/usr/lib/python3/dist-packages/requests/models.py", line 943, in raise_for_status raise HTTPError(http_error_msg, response=self) requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https://graph.facebook.com/v19.0/2xxxxxx9/messages
Can you check here https://github.com/OCA/social/pull/1305/files#diff-f895447007b77592f5fc6891519e5fb56edfd9334069b6d877bdfc7e0f04531aR250 the result of the request before raising the error?
Can you check here https://github.com/OCA/social/pull/1305/files#diff-f895447007b77592f5fc6891519e5fb56edfd9334069b6d877bdfc7e0f04531aR250 the result of the request before raising the error?
@etobella , sorry about the hiatus, i found one of the causes for whatsapp broker don't worked properly for me at first, one setting on api was wrong (my mistake), now i can receive messages in odoo... But i`m still unable to send messages (the odoo log says 200 when i send a message), but i don't know yet how to "debug" it in meta side...
The logs on odoo:
2024-03-15 20:21:36,517 1 INFO ltcs_prod werkzeug: 192.168.0.67 - - [15/Mar/2024 20:21:36] "POST /mail/channel/notify_typing HTTP/1.1" 200 - 11 0.005 0.050 2024-03-15 20:21:37,323 1 INFO ltcs_prod werkzeug: 192.168.0.67 - - [15/Mar/2024 20:21:37] "POST /mail/channel/notify_typing HTTP/1.1" 200 - 11 0.005 0.058 2024-03-15 20:21:37,985 1 INFO ltcs_prod werkzeug: 192.168.0.67 - - [15/Mar/2024 20:21:37] "POST /mail/message/post HTTP/1.1" 200 - 31 0.020 0.661 2024-03-15 20:21:38,069 1 INFO ltcs_prod werkzeug: 192.168.0.67 - - [15/Mar/2024 20:21:38] "POST /mail/link_preview HTTP/1.1" 200 - 5 0.003 0.004 2024-03-15 20:21:39,016 1 INFO ltcs_prod werkzeug: 192.168.0.79 - - [15/Mar/2024 20:21:39] "POST /broker/whatsapp/ltcs/update HTTP/1.1" 200 - 5 0.004 0.015
@etobella , i'm still struggling to send messages from odoo to WaBa, is there some setting to show that answer from meta servers in the logs or some other place? TIA
@liebana I think you are talking about automation, isn't it?
@etobella , i found another "adverse behavior" here in my tests, when the mail_gatewat is installed, odoo is unable to complete requests for video meetings, the error states that mail.gateway is blocking the attempt...
here's the error: https://gist.github.com/augustodinizl/0da08ff7865df22ddeb861f36949e620
Steps to reproduce:
- install mail.gateway 2)in mail, click on "Start a meeting" 3)copy the link to share the meeting 4)try to open that link in other browser (different device) 5)500 error is showed in that device when we access the link
@augustodinizl It is fixed now. Thanks for the review!! :smile:
@augustodinizl It is fixed now. Thanks for the review!! :smile:
Thanks man...
Awesome work!!!
@etobella , do you tested the mail_gateway_whatsapp using cloudflared as solution for proxy+SSL? i think my problem here with outbound messages from odoo to WaBa API have roots there...
I tested it using ngrok. Usually I test with telegram because it is easier to configure
Is this finally ready? Can you squash a bit commit history?
History has been squashed. This weekend I will recheck Whatsapp in order to ensure that everything is right, and then we could proceed with merge :tada:
@pedrobaeza I tested today whatsapp Again and works like a charm. IMO, we can proceed with merge :smile:
I still need to improve coverage, but at least the comments have been attended (pushing in order to ensure that all is fine)
OK, waiting for that.
