Contributors mailing list archives

Browse archives


Re: Technical Question: Restart Odoo process after res.partner model change

Therp, Tom Blauwendraat
- 20/06/2024 17:39:33

20 jun. 2024 17:22:17 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 

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.



Here is a guide to reproduce the issue with

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 


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:
Send application to:

CTO Mint System GmbH
Tel: +41 44 244 7222

Post to: