Search code examples
odoo

Cannot find where the table where the stage history for a lead is stored


The element in the screenshot comes from the mail_message table and show a stage change for a lead from QUALIFIES to INACTIFS but the body column of the table is empty so I suspect that there is an other table that store this information but I can't find it. enter image description here

I have tried to find any table that use or is linked to the crm_stage table or try to find table that are linked to crm_lead that may be connected to the stage but I found nothing that could help. I have tried to look into the all related table to both crm_lead and mail_message as well but none of them have any table that contains any stage_id or similar column.


Solution

  • If you wanna find out how that works you need to debug in the tracking methods of the mail.thread model located in the mail module

    https://github.com/odoo/odoo/blob/750d8d939b7e36cf2be810ed450e28827e871a51/addons/mail/models/mail_thread.py#L498-L663