On 02eba891cb8cd58985837090f2b60cf263bce065 we changed https://github.com/odoo/odoo/blob/b5cf1ee3e21f2e60b8edd64f24c04c952fb7df3f/addons/payment/models/account_payment.py#L47 to https://github.com/odoo/odoo/blob/02eba891cb8cd58985837090f2b60cf263bce065/addons/payment/models/account_payment.py#L47-L48 Effectively moving the place where `sudo` is called. This causes issues during migration of some DBs upg-328570 closes odoo/odoo#92651 X-original-commit: 90c321cc8bad04f7f094a221a39ca6f647944f5d Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>