Skip to content
Advertisement

Error column doesn’t exist on custom module Odoo

I’m working on a custom module and i need to add field to res.partner model. I’ve add some field to this model but since 1 week, when i try to add a new one i got this error :

ERROR: column res_partner.my_field does not exist

Other field works good but not this one :

my_field = fields.Boolean(default=False)

I really don’t unterstand why i have this issue. I’ve try to add ‘contacts’ dependencies to my module, it have work on my local version but not on my online verison

If somone has any idea it could be really nice

Thanks for your help

Edit res.partner classe

from odoo import api, fields, models
    
class ResPartner(models.Model):
    _inherit = 'res.partner'
    
    badge_ids = fields.One2many('mymodule.badge','client_i
    sub_ids = fields.One2many('mymodule.subs','client_id')
    #field that doesn't work
    my_field = fields.Boolean(default=False)

Manifest dependencies

'depends': ['base', 'sale', 'website', 'calendar','contacts', 'point_of_sale', 'base_automation'],

Advertisement

Answer

Looks like a bug. Here’s possible workaround:

Add ‘res’ to dependencies as well as ‘base’, then restart odoo instance.

after confirming fields updated; remove ‘res’ from dependencies then upgrade module.

This behavior exist on Odoo versions above 8.0

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement