server-tools icon indicating copy to clipboard operation
server-tools copied to clipboard

[18.0][ADD] module_version_auto_upgrade

Open ryanc-me opened this issue 4 months ago • 6 comments

Make Odoo upgrade modules automatically when their version number changes, like Odoo.sh does.

Useful when adding fields to res.partner/res.users, which often breaks the UI (and as-of Odoo 18.0, keeping the module page open before restart no longer works)

ryanc-me avatar Aug 20 '25 22:08 ryanc-me

@pedrobaeza just wondering if you have any guidance re testing for this module? the interesting part happens during Odoo (re)start, so I'm not sure if the regular self-testing approach will work

ryanc-me avatar Aug 20 '25 22:08 ryanc-me

@ryanc-me I don't know how to test that at Odoo level, but I think you shouldn't reinvent the wheel, as this already exists through click-odoo-update, and the check is done through a checksum, not module version change (which is not the only indicator that something has changed, i. e., translations).

pedrobaeza avatar Aug 21 '25 06:08 pedrobaeza

This was a tool we built internally - specifically to solve the res.users/res.partner issue. I think the main difference is, we can choose when to trigger a module upgrade automatically, by either updating/not the version. It also works as a drop-in (no external tools needed).

I do see your point though - maybe I can leave the PR open for some other feedback?

ryanc-me avatar Aug 21 '25 06:08 ryanc-me

Yes. You also have https://github.com/OCA/server-tools/tree/18.0/module_auto_update for similar features.

pedrobaeza avatar Aug 21 '25 06:08 pedrobaeza

After looking at those more, I think they solve a different issue.

Imagine the situation is:

  • Odoo hosted on AWS Fargate or s/o (e.g., developer doesn't have shell access, Postgres is locked-down, etc)
  • Developer has added a field to res.users, so after a restart, the Odoo UI is broken (can't access apps page)

Neither click-odoo-upgrade nor module_auto_update helps in that case - they require container shell access, or require that the UI is working.

With this module, the dev can bump the module version, then the app is auto-upgraded, no other interaction/access needed

ryanc-me avatar Aug 21 '25 20:08 ryanc-me

OK, as your prefer. I think the deployment strategy should include the auto-update, not to let Odoo to do that task, but anyway, if you explain the use case in the module, it's OK.

pedrobaeza avatar Aug 22 '25 06:08 pedrobaeza