Contributors mailing list archives
contributors@odoo-community.org
Browse archives
Technical Question: Restart Odoo process after res.partner model change
by
Mint System GmbH, Janik von Rotz
Hello Odoo contributors,
I am developing, deploying and fixing Odoo for a while and there is one
issue I haven't bothered enough to come up with a proper solution or
strategy.
The problem is simple: I have an Odoo instance running with a module
that extends the res.partner model. The res.partner code of this module
is updated with a new field. The Odoo server is restarted and exits with
a "column does not exist" error.
The same procedure works for modules that extend other models than
res.partner or res.user. As I understand the res.partner (and other)
tables are queried when the Odoo process starts. The SQL queries fail,
because the model code does not match the database schema.
The solution to the problem seems obvious, before starting the Odoo
server with the new code you install module (odoo-bin -i ...). However,
automating this step in a deployment pipeline is difficult as you don't
know which module needs to be updated. Always updating the base module
seems like an overkill.
Do you know this problem? Have you solved this problem?
I would be glad to hear from you.
Regards,
Janik
Here is a guide to reproduce the issue with https://odoo.build/:
1. Init a new datbase and start the Odoo server: `task start db; task
init-db; task start native`
2. Install the contacts module: `task install-module contacts`
3. Stop the Odoo process.
4. Add a new field to the res.partner code: `vi
odoo/odoo/addons/base/models/res_partner.py`
```python
xy = fields.Char()
```
5. Start the Odoo server: `task start native`
It fails with:
```
...
psycopg2.errors.UndefinedColumn: column res_partner.xy does not exist
LINE 1: ..."message_bounce", "res_partner"."name" AS "name", "res_partn...
``` ^
--
We are hiring: https://www.mint-system.ch/jobs
Send application to: jobs@mint-system.ch
CTO Mint System GmbH
Tel: +41 44 244 7222
Follow-Ups
-
Re: Technical Question: Restart Odoo process after res.partner model change
byTherp, Tom Blauwendraat -
Re: Technical Question: Restart Odoo process after res.partner model change
byMint System GmbH, Janik von Rotz -
Re: Technical Question: Restart Odoo process after res.partner model change
byTecnativa. S. L., Pedro M. Baeza -
Re: Technical Question: Restart Odoo process after res.partner model change
byNICO SOLUTIONS - ENGINEERING & IT , Nils Coenen -
Re: Technical Question: Restart Odoo process after res.partner model change
byMint System GmbH, Janik von Rotz -
Re: Technical Question: Restart Odoo process after res.partner model change
byTecnativa. S. L., Pedro M. Baeza -
Re: Technical Question: Restart Odoo process after res.partner model change
byMint System GmbH, Janik von Rotz -
Re: Technical Question: Restart Odoo process after res.partner model change
by "Graeme Gellatly" <graeme@moahub.nz> - 20/06/2024 22:00:07 - 0 -
Re: Technical Question: Restart Odoo process after res.partner model change
byMint System GmbH, Janik von Rotz -
Re: Technical Question: Restart Odoo process after res.partner model change
byTherp, Tom Blauwendraat