OCA / odoo-test-helper

Odoo Test Helper
11 stars 14 forks source link

[FIX] restore_registry in Odoo 16 #22

Closed StefanRijnhart closed 1 year ago

StefanRijnhart commented 1 year ago

See https://github.com/odoo/odoo/commit/cd122933867c096f61fae945f11e842ea84d06b8

This new attribute is the source of truth for the base classes, and in setup_models (called further down in the modified code in this PR), the model's base classes are reset from it: https://github.com/odoo/odoo/blob/e1f06479a526c703ccabc441b1e194646206b966/odoo/models.py#L2728-L2730.

The test failure fixed by this PR can be inspected in https://app.travis-ci.com/github/OCA/odoo-test-helper/builds/258453331

rousseldenis commented 1 year ago

I can confirm this solves problems like https://github.com/OCA/stock-logistics-barcode/pull/450

rousseldenis commented 1 year ago

@OCA/core-maintainers

rousseldenis commented 1 year ago

@sebastienbeau

simahawk commented 1 year ago

Sorry to be late to the party. I'm sick and missed this change :sweat: Released https://github.com/OCA/odoo-test-helper/commit/dc05cb7fd62b54e72e962bdbc3727bdd48fd2180 Should be avail soon on pypi.

StefanRijnhart commented 1 year ago

@simahawk take care!

rousseldenis commented 1 year ago

@StefanRijnhart Could you check this as it seems to fail now: https://github.com/OCA/stock-logistics-workflow/actions/runs/4132016101/jobs/7140224436#step:8:244

rousseldenis commented 1 year ago

It seems that this line is causing trouble:

image

I'm wondering how if an attribute exists in a model, the following line that tries to delete it fails on retrieving it...

@sebastienbeau @simahawk

StefanRijnhart commented 1 year ago

Thanks for noting, I'll have a look.

StefanRijnhart commented 1 year ago

@rousseldenis https://github.com/OCA/odoo-test-helper/pull/24 should fix it, I think.