-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
[17.0] [MIG] web_notify #2747
[17.0] [MIG] web_notify #2747
Conversation
7540664
to
1e7ddfe
Compare
Hii @lmignon @pedrobaeza Can you please review this PR? |
/ocabot migration web_notify I don't know enough about the module itself. |
@shepilov-vladislav @kevinkhao @chienandalu Can you please take a look? |
1e7ddfe
to
34a29ff
Compare
@Nikul-OSI Why are all the commit prefixed with |
@lmignon I captured only preserve history, I don't why it happens. Using git format-patch --stdout origin/17_mig_nc_web_notify..ups/16.0 -- web_notify | git am -3 --keep same commend I used others repo. too, but not add prefixed. |
…t notification messages from the server to the user in live.
Fix a check when comparing a user count with items within a mock call. The previous method was succeeding by pure luck because OCA test databases contain 2 users, which happens to be the amount of items within a mock "call_args" (it contains args + kwargs).
- Use the 'session' class of the JS Framework (session no lounger bound to web client) - Test change: compare emitted & received messages based on content, not order. Using string comparison raises false positives.
Currently translated at 100,0% (5 of 5 strings) Translation: web-11.0/web-11.0-web_notify Translate-URL: https://translation.odoo-community.org/projects/web-11-0/web-11-0-web_notify/pt_BR/
Currently translated at 40.0% (2 of 5 strings) Translation: web-11.0/web-11.0-web_notify Translate-URL: https://translation.odoo-community.org/projects/web-11-0/web-11-0-web_notify/da/
Only the admin user (sudo) is allowed to send notifications to other users. The normal users can only send notifications to themselves. This is to prevent attackers to craft malicious notifications and send them to other users using RPC. Correction based on the idea of @hbrunn
…nt, Updated readme to show how to test it. Add buttons to users form Do not rely on SUPERUSER_ID and avoid getattr usage
Updated by Update PO files to match POT (msgmerge) hook in Weblate.
* [ADD]: all available bootstrap notifications (success/danger/warning/info/default) * [IMP] use black color for text for default notification. * [FIX] reverted require string for `bus.Longpolling` and rename `on_message_received` to `on_message` to prevent collisions.
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: web-12.0/web-12.0-web_notify Translate-URL: https://translation.odoo-community.org/projects/web-12-0/web-12-0-web_notify/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: web-12.0/web-12.0-web_notify Translate-URL: https://translation.odoo-community.org/projects/web-12-0/web-12-0-web_notify/
It seems besides the custom channels provided in this addon it also catches messages from other channels. E.g. in this case it seems the void popup is triggered by these activity creation bus messages. **Steps to reproduce** Odoo commit: could reproduce on 5e8b667951 and 4da82776ff OCA/web commit: 2465278 * Install crm and web_notify modules * Create an activity for yourself (tried for admin user) * Empty popup appears **Attempt to solve** It seems the bus handles all messages non exclusively. I've hacked in a conditional to handle only messages from web_notify addon, but its unclear wether this does not break something else.
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: web-15.0/web-15.0-web_notify Translate-URL: https://translation.odoo-community.org/projects/web-15-0/web-15-0-web_notify/
Currently translated at 100.0% (18 of 18 strings) Translation: web-15.0/web-15.0-web_notify Translate-URL: https://translation.odoo-community.org/projects/web-15-0/web-15-0-web_notify/it/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: web-16.0/web-16.0-web_notify Translate-URL: https://translation.odoo-community.org/projects/web-16-0/web-16-0-web_notify/
Currently translated at 94.4% (17 of 18 strings) Translation: web-16.0/web-16.0-web_notify Translate-URL: https://translation.odoo-community.org/projects/web-16-0/web-16-0-web_notify/it/
Currently translated at 100.0% (18 of 18 strings) Translation: web-16.0/web-16.0-web_notify Translate-URL: https://translation.odoo-community.org/projects/web-16-0/web-16-0-web_notify/de/
Currently translated at 100.0% (18 of 18 strings) Translation: web-16.0/web-16.0-web_notify Translate-URL: https://translation.odoo-community.org/projects/web-16-0/web-16-0-web_notify/es/
Currently translated at 100.0% (18 of 18 strings) Translation: web-16.0/web-16.0-web_notify Translate-URL: https://translation.odoo-community.org/projects/web-16-0/web-16-0-web_notify/it/
Currently translated at 100.0% (18 of 18 strings) Translation: web-16.0/web-16.0-web_notify Translate-URL: https://translation.odoo-community.org/projects/web-16-0/web-16-0-web_notify/pt_BR/
When trying to use the notify function that comes from a normal user with sudo flag enabled, it wasn't letting the user access it. Adding the su flag to the check should allow sudo users using this feature.
34a29ff
to
2e5d264
Compare
Fixed Prefix, Ready to review. |
I can review and contribute as I have made the same upgrade to version 17, but people in OCA sent me this PR so it is better to cooperate to publish it. I checked all parts that need to be modified in order to make the upgrade successful, and I see they are met. if the author @Nikul-OSI needs to recheck or inspect my upgrade, here is my module: |
@Nikul-OSI Do you estimate when you are going to close this PR ? |
Yes, I reviewed, can you please create new PR. Thank you |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- UI tests: ok
- But, need to move the pre-commit stuff into another commit:
[IMP] $module: pre-commit auto fixes
. Fyi, https://github.com/OCA/maintainer-tools/wiki/Migration-to-version-17.0#tasks-to-do-in-the-migration
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code review ok. However, apply the requested guidelines so its correct in form
Superseded by #2948 |
No description provided.