Перейти к содержимому
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
7 Ответы
10355 Представления

Hi,

I have a simple module, where I have 3 fields added to res.partner.

Now when I want to add 1 new field in the .py file.

I get this error:

psycopg2.ProgrammingError: column res_partner.new_field4 does not exist


Why is that so? It is only working for me when I uninstall, and reinstall the modul. But this way is very bad, because you will lose all values in the old fields.

Any solution for this?????


thx

Аватар
Отменить

Hello Can you share your code ..

Лучший ответ

Hello @Wizardz,

This type error also faced many times. But install/unstall is not good approch. I have solve this problem first comment field in py field and update module. when it show me error for xml file then i uncomment my python file field and update module after server restart. This work for me. I think this will also helpful for you.

Аватар
Отменить
Автор

hm, ok, but is there not a way to update the module when I restart the server ? sudo service odoo restart -u module_name -d database ?

Yes, you can also do like that.

Автор

Do you know the exact command for that?

For ubuntu you can use:

./odoo-bin -u module_name

for window:

odoo.py -u module_name

Faced the same problem. Commenting out in model first also helps in my case! I'd consider that a bug!

Лучший ответ

There is a direct solution for this.

if you add any new fields to the res_company, res_partner, res_users tables you have to follow the following steps.

1) add new fields

2) open your custom module from the apps list

3) restart server, do immediate upgrade of custom module

Note : Here the problem is if you add any new fields to the res_company, res_partner, res_users tables every request it will check. If you upgrade after restart without any request it will work.

Аватар
Отменить
Related Posts Ответы Просмотры Активность
8
июн. 18
48126
1
нояб. 17
7326
1
мая 17
3393
0
мар. 16
5660
0
мар. 15
3880