Skip to content

[17.0][OU-IMP] base: Delete tracking messages in private partners - #6120

Open
pedrobaeza wants to merge 1 commit into
OCA:17.0from
Tecnativa:17.0-ou_imp-base-delete_tracking_messages
Open

pedrobaeza wants to merge 1 commit into
OCA:17.0from
Tecnativa:17.0-ou_imp-base-delete_tracking_messages

Conversation

@pedrobaeza

@pedrobaeza pedrobaeza commented Nov 25, 2026 •

Copy link
Copy Markdown
Member

Tracking messages on private partners may leak data through the chatter, like a phone number change, showing both the old and the new one, so let's remove them.

@Tecnativa

Tracking messages on private partners may leak data through the chatter,
like a phone number change, showing both the old and the new one, so
let's remove them.
@pedrobaeza pedrobaeza added this to the 17.0 milestone Nov 25, 2026
@OCA-git-bot OCA-git-bot added mod:openupgrade_scripts Module openupgrade_scripts series:17.0 labels Nov 25, 2026
@MiquelRForgeFlow

MiquelRForgeFlow commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

You want to delete messages like "Partner phone changed from 1234 to 4321", right? Instead, cannot it be updated to "Partner phone changed from **** to ****"?

@MiquelRForgeFlow

MiquelRForgeFlow commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

So, instead of deleting, do this in mail pre-migration:

    openupgrade.logged_query(
        cr,
        """
        UPDATE mail_tracking_value mtv
        SET old_value_char = CASE WHEN mtv.old_value_char IS NULL THEN NULL ELSE '*****' END,
            new_value_char = CASE WHEN mtv.new_value_char IS NULL THEN NULL ELSE '*****' END,
            old_value_text = CASE WHEN mtv.old_value_text IS NULL THEN NULL ELSE '*****' END,
            new_value_text = CASE WHEN mtv.new_value_text IS NULL THEN NULL ELSE '*****' END
        FROM mail_message mm
        JOIN ou_res_partner_private p ON p.id = mm.res_id
        WHERE mtv.mail_message_id = mm.id AND mm.model = 'res.partner'
        """,
    )

@pedrobaeza

Copy link
Copy Markdown
Member Author

They don't add value with ****, so better to simply remove them.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mod:openupgrade_scripts Module openupgrade_scripts series:17.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants