Skip to content

[FIX] mail_log_only_internal: apply internal partner filter to all mention contexts#333

Closed
matiasperalta1 wants to merge 1 commit intoingadhoc:19.0from
adhoc-dev:19.0-h-107773-mnp
Closed

[FIX] mail_log_only_internal: apply internal partner filter to all mention contexts#333
matiasperalta1 wants to merge 1 commit intoingadhoc:19.0from
adhoc-dev:19.0-h-107773-mnp

Conversation

@matiasperalta1
Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI review requested due to automatic review settings January 7, 2026 13:40
@roboadhoc
Copy link
Copy Markdown
Contributor

Pull request status dashboard

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_suggestions además del existente _get_mention_suggestions_domain
  • Utiliza la API Domain de 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")
Copy link

Copilot AI Jan 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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")

Copilot uses AI. Check for mistakes.
@matiasperalta1 matiasperalta1 force-pushed the 19.0-h-107773-mnp branch 2 times, most recently from b275af6 to 1909100 Compare January 19, 2026 20:51
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)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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')

@augusto-weiss
Copy link
Copy Markdown
Contributor

@roboadhoc r+

@roboadhoc roboadhoc closed this in e792703 Jan 22, 2026
@roboadhoc roboadhoc added the 18.1 label Jan 22, 2026
@roboadhoc roboadhoc deleted the 19.0-h-107773-mnp branch January 22, 2026 17:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants