Skip to content

[ADD] orm_forward_compatibility: Odoo 19+ ORM helpers backported to 18.0 - #3701

Open
divad1196 wants to merge 1 commit into
OCA:18.0from
camptocamp:add_orm_forward_compatibility
Open

divad1196 wants to merge 1 commit into
OCA:18.0from
camptocamp:add_orm_forward_compatibility

Conversation

@divad1196

Copy link
Copy Markdown

Minimal Domain shim (delegates to odoo.osv.expression) plus the typed ir.config_parameter getters get_str/get_int/get_float/get_bool.

Purpose: cut the effort of backporting 19/20 modules to 18.0 by keeping their call sites 1-1 with upstream instead of rewriting them.

@OCA-git-bot OCA-git-bot added series:18.0 mod:orm_forward_compatibility Module orm_forward_compatibility labels Aug 14, 2026
@divad1196
divad1196 force-pushed the add_orm_forward_compatibility branch from 022dffe to 25fc8fe Compare August 14, 2026 13:29
Minimal `Domain` shim (delegates to odoo.osv.expression) plus the typed
`ir.config_parameter` getters get_str/get_int/get_float/get_bool.

Purpose: cut the effort of backporting 19/20 modules to 18.0 by keeping
their call sites 1-1 with upstream instead of rewriting them.
@divad1196
divad1196 force-pushed the add_orm_forward_compatibility branch from 25fc8fe to 61abc07 Compare August 14, 2026 13:36
@divad1196
divad1196 marked this pull request as draft August 14, 2026 13:37
@legalsylvain

Copy link
Copy Markdown
Contributor

interesting !

@divad1196
divad1196 marked this pull request as ready for review August 18, 2026 19:04
@divad1196

Copy link
Copy Markdown
Author

@legalsylvain Don't hesitate to leave a review ! 😄

@divad1196

Copy link
Copy Markdown
Author

Review needed @OCA/server-tools-maintainers Possible review
@simahawk @santostelmo

- ``Domain.TRUE`` / ``Domain.FALSE``
- ``.optimize_full(model)`` -> validates against the model, returns self

NOT supported (keep such call sites hand-adapted on 18):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

which kind of impact has such limitation?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I personnally didn't need them.
any! isn't popular yet, and -1d is usually done with date/datetime and timedelta.

@@ -0,0 +1,34 @@
# Copyright 2026 Camptocamp SA

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ we should keeo Odoo SA copyright w/ the correct year and add ours only if we touched anything

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not copied from Odoo's code.
Here is how Odoo does it: odoo/odoo@22fa8e6

The code here only fill the gap by mimicking V20 interface.

@legalsylvain

Copy link
Copy Markdown
Contributor

@legalsylvain Don't hesitate to leave a review ! 😄

too complex for me !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mod:orm_forward_compatibility Module orm_forward_compatibility series:18.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants