Skip to content

Commit 6bb5355

Browse files
committed
[FIX] orm: patch manual field names
The check for manual field names moved from being a model method to a util function. It needs to be patched starting version saas~18.4 to allow loading custom module fields as manual for tests during the upgrade process. odoo/odoo#224524 odoo/enterprise#93335
1 parent d94144b commit 6bb5355

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/util/orm.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -726,10 +726,15 @@ def _add_magic_fields(self):
726726

727727
patches.append(patch.object(BaseModel, "_add_magic_fields", _add_magic_fields))
728728

729-
if version_gte("saas~16.4"):
730-
# 3.5.3 allow loading manual fields
729+
# 3.5.3 allow loading manual fields
730+
731+
if version_between("saas~16.4", "saas~18.4"):
731732
patches.append(patch("odoo.addons.base.models.ir_model.IrModelFields._is_manual_name", lambda self, name: True))
732733

734+
if version_gte("saas~18.4"):
735+
patches.append(patch("odoo.fields.is_manual_fieldname", lambda name: True))
736+
patches.append(patch("odoo.orm.model_classes.is_manual_fieldname", lambda name: True))
737+
733738
with all_patches():
734739
# 4. Reload the registry with the models and fields converted to manual.
735740
setup_models = (

0 commit comments

Comments
 (0)