Search code examples
odooodoo-8odoo-10

Attributes of extended - traditional inheritance - odoo module not created in the database


I extended the 'res.partner' odoo module with the following code

class ResPartner(models.Model): _name = 'res.partner' _inherit = 'res.partner' sales_force_ids = fields.One2many('sales_calc.sales_calc') ake_code = fields.Char('AKE Code')

I restarted Odoo server nut when I'm trying to go to the module in apps to upgrade the module, the apps page is displayed as white screen

In odoo log the following error is found.

ProgrammingError: column res_partner.ake_code does not exist


Solution

  • The problem not in the inheritance mechanism but upgrading module only is not enough, I had to uninstall and install module again.

    I commented ake_code = fields.Char('AKE Code'), restarted odoo server, uninstalled the module, uncommented ake_code = fields.Char('AKE Code'), restarted odoo server and Finally installed the module again.

    I was confused by another raised warning while installing the module again:

    There is no reference field 'None' found for 'sales_calc.sales_calc'

    The problem is related to sales_force_ids = fields.One2many('sales_calc.sales_calc') I had to write the related field id as sales_force_ids = fields.One2many('sales_calc.sales_calc', 'id') to install the module normally without this warning.