-
-
Notifications
You must be signed in to change notification settings - Fork 310
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[13.0][BKP][ADD]backport endpoint
modules
#1059
Closed
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
When an endpoint is archived it must be dropped. When it's unarchive it must be restored.
Routing maps are generated **per env** which means that every new env will have its own routing map attached to `ir.http` registry class. This is not desired (as per core Odoo comment) but it's like this today :/ Hence, before this change, the routing map could be mis-aligned across different envs leading to random responses for custom endpoints. This refactoring simplifies a lot the handling of the rules leaving to std `_generate_routing_rules` the duty to yield rules and to `routing_map` to generate them for the new route map. EndpointRegistry memory consumption is improved too thanks to smaller data to store and to the usage of __slots__.
To avoid multiple invalidation of all envs on each edit or create of persistent records, a new flag is introduced: 'registry_sync'. This flag delays the sync of the rule registry till manual action occurs. Records in the UI are decorated accordingly to notify users of the need to reflect changes on ther registry to make them effective. The sync happens in a post commit hook to ensure all values are in place for the affected records.
Depending on your modules inheritance and upgrade order when you introduce this mixin on an existing model it might happen that gets called before the model's table is ready (eg: another odoo service loading the env before the upgrade happens). Let if fail gracefully since the hook will be called again later.
As routes are registered automatically in the db after sync there's no reason to look for non registered routes at boot. Furthermore, this is causing access conflicts on the table when multiple instances w/ multiple workers are spawned.
* more efficient w/ read_group * consider only active records explicitly
I don't know why but when test_edi_endpoint runs before these tests the rollback of the exception catched within the test `test_archive_check` make the controller lookup fail. Since the whole routing registry machinery is going to be refactored in OCA#633 let's survive w/ this forced registration for now.
Former version of `endpoint_route_handler` had a major flaw: routing rule registry was not properly shared across workers forcing us to restart the instance to make sure all envs were inline w/ it. This change adapts edi_endpoint_oca to the new version which contains some refactoring.
It's very handy to know which endpoint generated a record.
Currently translated at 60.0% (30 of 50 strings) Translation: edi-14.0/edi-14.0-edi_endpoint_oca Translate-URL: https://translation.odoo-community.org/projects/edi-14-0/edi-14-0-edi_endpoint_oca/es/
Currently translated at 100.0% (50 of 50 strings) Translation: edi-14.0/edi-14.0-edi_endpoint_oca Translate-URL: https://translation.odoo-community.org/projects/edi-14-0/edi-14-0-edi_endpoint_oca/es/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: edi-14.0/edi-14.0-edi_endpoint_oca Translate-URL: https://translation.odoo-community.org/projects/edi-14-0/edi-14-0-edi_endpoint_oca/
The new mixin view won't be affected by weird extensions. Requires OCA/web-api#56 Solves conflict w/ OCA/web-api-contrib#1
Backport module from v14: https://github.dev/OCA/edi/blob/14.0/edi_endpoint_oca
In line with the `edi_webservice` from v13: https://github.com/OCA/edi/tree/13.0/edi_webservice
GuillemCForgeFlow
force-pushed
the
13.0-bkp-endpoint
branch
from
November 7, 2024 12:53
c6d467f
to
dd87d89
Compare
This was referenced Nov 7, 2024
closing this one, as the respective PRs have been created: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Depends on OCA/server-tools#3098
edi_endpoint
to align withedi_webservice
modulecc @ForgeFlow