This question has been flagged
3 Replies
7414 Views

Hello, Please help. I have this annoying error when I try to inherit the res.partner and create a field inside it:

class SampleSomething(models.Model):
_inherit = 'res.partner'

something = fields.Char(string='Sample')

I got this error:

psycopg2.errors.UndefinedColumn: column res_partner.something does not exist

LINE 1: ...res_partner"."region_contact" as "region_contact","res_partn...


It seems like it's querying the defined field but it should not be the odoo's default behavior when defining/adding a field, instead it should be migrating because I'm adding a new field. Any help will be highly appreciated. Thanks in advance.

Avatar
Discard
Best Answer

Hi,

Once you add the new field to res.partner try to upgrade the module from terminal rather than going to apps menu to upgrade. I think the same issue wont be there if you upgrade module from terminal.


To upgrade the module from terminal : odoo-bin -c conf_file -d db_name -u module_name


also see:  https://www.youtube.com/watch?v=ErzOia_A21w


Thanks

Avatar
Discard
Author

Thank you very much brother Niyas. It works. God bless.

@Niyas Raphy

I am working with Jenkins pipeline, (get the production DB -> upgrade to staging server)

How I Can fix this, please?

I don't want to connect with ssh because I should have a successful build from Jenkins.