Repository navigation
Conversation
send_context is a Json field and base_automation leaves __action_done in the context: a dict keyed by recordsets. Creating the scheduled message crashed with "TypeError: keys must be str, int, float, bool or None, not base.automation". Resetting the key before _action_schedule_message was not enough: the context dict is shared by reference and base_automation mutates it in place while the composer runs, so the private keys are now dropped where send_context is built. Change note: al pasar una tarea a una etapa con plantilla de mail, a los usuarios con "retraso de envío" configurado les fallaba el guardado y la etapa no cambiaba. Ahora el mensaje programado se crea sin error.
Contributor
This branch has not been deployed
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.

Ticket: https://www.adhoc.inc/odoo/helpdesk.ticket/129879
Qué pasa
Con "retraso de envío" configurado (
send_message_delay), el mail no se envía: se programa comomail.scheduled.message. Ese modelo guarda el contexto ensend_context, que es un campoJson, ybase_automationdeja en el contexto__action_done, un diccionario cuyas claves son recordsets. Al crear el registro:El síntoma al usuario es que la etapa no se guarda: pasa al mover un registro a una etapa que tiene plantilla de mail, porque el seguimiento postea la plantilla y de ahí sale el composer.
Por qué el guard anterior no alcanzaba
_action_send_mailreseteaba__action_donea{}antes de_action_schedule_message, pero el contexto se comparte por referencia ybase_automation._processlo muta en el lugar cuando evalúa sus dominios (__action_feedback), mientras el composer corre. Con un espía enmail.scheduled.message.createel dict llega como{base.automation(2,): project.task()}— la automatización queda marcada y después filtrada, así que el valor es un recordset vacío: contaminación sin efecto funcional. Por eso tampoco falla siempre: depende de que una automatización se procese en esa ventana.Qué cambia
Las claves privadas (
__*) se descartan donde se armasend_context. Cubre cualquier clave no serializable, no solo__action_done.Cómo se probó
project+mail_ux+base_automation: mismo traceback que el ticket; con el fix el mensaje programado se crea y queda agendado con el retraso del usuario.mail_ux:0 failed, 0 error(s) of 1 tests. Sin el fix falla. No reproduce el camino completo (necesitaríabase_automationyprojectcomo dependencias): asegura el invariante, que ninguna clave privada llegue asend_context.