Skip to content

Conversation

@cav-adhoc
Copy link
Contributor

Reverts commit 0703bc4

Copilot AI review requested due to automatic review settings January 5, 2026 11:35
@roboadhoc
Copy link

Pull request status dashboard

Copy link

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 revierte un commit previo (#857), cambiando el método sobreescrito de _post a action_post en el modelo account.move. El método action_post es la API pública estándar en Odoo para extender el comportamiento de publicación de movimientos contables, mientras que _post es un método interno. Este cambio asegura que el envío automático de emails a los partners (cuando el journal tiene configurado mail_template_id) se ejecute correctamente al publicar facturas.

Comment on lines +23 to 28
def action_post(self):
"""After validate invoice will sent an email to the partner if the related journal has mail_template_id set"""
res = super()._post(soft=soft)
# Use action_post to ensure the mail is sent only when the move is posted
res = super().action_post()
self.action_send_invoice_mail()
return res
Copy link

Copilot AI Jan 5, 2026

Choose a reason for hiding this comment

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

El método action_post sobreescrito ejecuta action_send_invoice_mail() después del post, pero no hay tests que verifiquen este comportamiento. Se recomienda agregar un test que valide:

  • Que se envíe el correo cuando el journal tiene mail_template_id configurado y el partner tiene email
  • Que se registre un mensaje en el chatter cuando falla el envío
  • Que se registre un mensaje cuando el partner no tiene email

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants