Migration of custom Module from Odoo 13 to 15

1.3k Views Asked by At

Hello to all Odoo Developers!

I am currently trying to migrate a addon from Odoo 13 to 15. My addon worked fine in Odoo 13 so I am trying to understand which changes were made in Odoo 15 to upgrade my module.

First error I got was the following:

Field selection_mobile_tablet referenced in related field definition devices.inuse.selection_mobile_tablet does not exist.

for the code:


devices_in_use_ids = fields.One2many(
        'devices.inuse', 'contacts_addon_class_id', string="Secure APPS Versions")


class DevicesInUse(models.Model):
    _name = 'devices.inuse'
    _rec_name = 'devices_in_use'

    contacts_addon_class_id = fields.Many2one(
        'res.partner', string="Contacts Class")

    devices_in_use = fields.Many2one(
        'device.setup', string="Devices In Use", tracking=1)
    selection_mobile_tablet = fields.Selection(
        related='devices_in_use.selection_mobile_tablet', string="Mobile / Tablet", tracking=1)

It seems that the Selection field is not working, has anyone made this experience in Odoo 15 and figured that out ?

Thanks.


UPDATE:

I commentend the above mentioned code out in the hope that It would take me any further but now I get an error which I understand even less.But maybe someone can help with that one:

psycopg2.errors.InvalidTableDefinition: column "id" is in a primary key

2

There are 2 best solutions below

2
Odoo Mates On

Error message says that the related field "devices_in_use.selection_mobile_tablet", ie, the field named selection_mobile_tablet is not existing in the model "device.setup". Can you check and confirm whether the field is there ?

0
q.reb On

As Odoo Mates said at begining you havea problem whith "devices_in_use.selection_mobile_tablet". As you said it's in another module not migrated. So I understand you have a dependency to the other module.

First things first. All migration should began with dependences you cannot migrate a module if his dependences aren't migrated.

Error you are facing now is caused by an misactualitzation of your module. Table (as there are some fields "disapered"/commented) is inconsistent. Which lines have you commented?

IMHO You should uncomment that code and begin migrating dependent module.