[19.0][FIX] endpoint_route_handler: precompute=True on route field - #136
[19.0][FIX] endpoint_route_handler: precompute=True on route field#136AungKoKoLin1997 wants to merge 1 commit into
Conversation
|
Hi @simahawk, |
b81ed4d to
1d55f71
Compare
smorita7749
left a comment
There was a problem hiding this comment.
Functional review: LGTM
The error is fixed.
|
This PR has the |
| new_route.route += "/new" | ||
| self.assertNotEqual(new_route.endpoint_hash, first_hash) | ||
|
|
||
| def test_route_field_precomputed(self): |
There was a problem hiding this comment.
do we really need this test? It's kind of testing an odoo core feature 🤔
There was a problem hiding this comment.
My purpose is to be sure the fix is working well.
There was a problem hiding this comment.
@simahawk
To clarify further — the test is not meant to verify Odoo's precompute mechanism itself. It's a regression guard to ensure precompute=True stays on the route field. If someone removes it during a future migration or refactor, this test will catch the breakage. Without it, the only way to notice would be a failure in a downstream module at runtime.
There was a problem hiding this comment.
ok, you could rewrite the docstring of the test by removing repeated information (sounds quite verbose ATM for little value) and add a synthetic version of the purpose that you've just explained.
Without precompute, the required computed field is evaluated after INSERT (during flush), so creating an endpoint whose route is derived from other fields by a downstream module fails with "Missing required value for the field 'Route'" — the INSERT runs before the compute can populate the column.
1d55f71 to
fb83e40
Compare
Related: #135
Without precompute, the required computed field is evaluated after INSERT (during flush), so creating an endpoint whose route is derived from other fields by a downstream module fails with "Missing required value for the field 'Route'" — the INSERT runs before the compute can populate the column.
@qrtl QT6769