[FIX] mail_log_only_internal: apply internal partner filter to all mention contexts#333
Closed
matiasperalta1 wants to merge 1 commit intoingadhoc:19.0from
Closed
[FIX] mail_log_only_internal: apply internal partner filter to all mention contexts#333matiasperalta1 wants to merge 1 commit intoingadhoc:19.0from
matiasperalta1 wants to merge 1 commit intoingadhoc:19.0from
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Este PR refactoriza la lógica de filtrado de partners internos para aplicarla consistentemente en todos los contextos de menciones. La extracción del método _get_allowed_partner_ids permite reutilizar la lógica y asegura que tanto _get_mention_suggestions_domain como _search_mention_suggestions apliquen el mismo filtro de partners permitidos.
- Extrae la lógica de obtención de partners permitidos en un método reutilizable
_get_allowed_partner_ids - Aplica el filtro de partners internos al nuevo método
_search_mention_suggestionsademás del existente_get_mention_suggestions_domain - Utiliza la API
Domainde Odoo 19 para combinar condiciones de manera más legible
| ] | ||
| ) | ||
| .mapped("partner_id.id") | ||
| self.env["res. users"].search([("group_ids", "in", internal_group.id)]).mapped("partner_id. id") |
There was a problem hiding this comment.
Errores de tipeo en los nombres de modelos y campos: se agregaron espacios incorrectos en "res. users" (debería ser "res.users") y "partner_id. id" (debería ser "partner_id.id").
Suggested change
| self.env["res. users"].search([("group_ids", "in", internal_group.id)]).mapped("partner_id. id") | |
| self.env["res.users"].search([("group_ids", "in", internal_group.id)]).mapped("partner_id.id") |
267d9ae to
68b91fa
Compare
b275af6 to
1909100
Compare
Comment on lines
+16
to
+19
| for user in all_users: | ||
| if user.has_group("base.group_user"): | ||
| if user.partner_id: | ||
| internal_users.append(user.partner_id.id) |
Contributor
There was a problem hiding this comment.
Suggested change
| for user in all_users: | |
| if user.has_group("base.group_user"): | |
| if user.partner_id: | |
| internal_users.append(user.partner_id.id) | |
| internal_users = all_users.filtered(lambda u: u.has_group("base.group_user") and u.partner_id).mapped('id') |
1909100 to
17c4dfb
Compare
Contributor
|
@roboadhoc r+ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

No description provided.