"post_init_hook" not working - Odoo 17
I'm trying to initialize the signature for base.user_root by creating a post_init_hook.
In the __init__.py file, I wrote the following code:
def update_odoo_bot_signature(env):
user = env.ref('base.user_root')
print(">>> Running post_init_hook to update OdooBot signature >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>")
signature = '''
<div style="font-family: Arial; font-size: 14px;">
<p>Trân trọng,</p>
<p><strong>Odoo Bot</strong></p>
<p>Công ty TNHH ABC 12344444</p>
<p><a href="https://yourcompany.com">https://yourcompany.com</a></p>
</div>
'''
user.write({'signature': signature})
And in the __manifest__.py file, I configured it like this: "post_init_hook": "update_odoo_bot_signature",
However, when I upgrade the module, the signature for the OdooBot record is not updated.