[FIX] confisa_notification: prevent duplicated enqueue event after edit#37
Open
IrvingReyes wants to merge 2 commits into16.0from
Open
[FIX] confisa_notification: prevent duplicated enqueue event after edit#37IrvingReyes wants to merge 2 commits into16.0from
IrvingReyes wants to merge 2 commits into16.0from
Conversation
Migrated the `data_merge_detail` module from Odoo 16.0 to 18.0 to ensure compatibility with the new version. The following changes were applied: - Updated the module version to `18.0.1.0.0` in the manifest. - Replaced dependencies on `data_merge` with `data_cleaning` to align with the new Odoo structure. - Refactored `ir.cron` records and updated the cron job references to use the `data_cleaning` model for handling data merge operations. - Replaced deprecated `tree` views with `list` views in the UI to comply with the Odoo 18.0 update. - Updated the wizard and view references to reflect changes in the `data_cleaning` module and its views. - Modified `ir_actions.act_window` references to ensure compatibility with the new `list` view mode in Odoo 18.0. These changes ensure the module operates as expected on Odoo 18.0, with no functional changes, just structural updates to match the new version's requirements.
a35b3d8 to
daa4ee8
Compare
Previously, every time a project.task record with fsm_done=True was
updated, the system triggered _enqueue_event("task.updated") again,
even if the task had already been marked as done in a prior write.
This fix ensures that the event is only enqueued when the task
transitions from fsm_done=False to fsm_done=True, avoiding multiple
notifications for subsequent field updates such as name or description
changes on already closed tasks.
The modification filters tasks before the write() call to detect only
those newly marked as done, preserving expected behavior and preventing
redundant API calls to client.notification.
[REF] confisa_notification: remove unused parameter from payload
The method _prepare_confisa_payload_and_values no longer requires a
task_id argument, as the current record (self) already provides the
necessary context to build the payload.
This refactor simplifies the method signature, improves readability,
and prevents confusion about external parameter dependencies.
[IMP] confisa_notification: improve Confisa API Docstrings
Enhances the docstring and exception handling in
`_send_confisa_notifications` to improve clarity and debugging
capabilities when communicating with the Confisa API.
The method now provides a more detailed explanation of how
notifications are sent when a sale order is canceled or when a
related task is marked as done. It also documents the endpoint
(`/api/servicioslocalizadores`), payload structure (`idRegistro`,
`estado`), and potential error conditions.
daa4ee8 to
474459c
Compare
This file contains hidden or 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
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.
Related ISSUE#7
Related MR
Previously, every time a project.task record with fsm_done=True was updated, the system triggered _enqueue_event("task.updated") again, even if the task had already been marked as done in a prior write.
This fix ensures that the event is only enqueued when the task transitions from fsm_done=False to fsm_done=True, avoiding multiple notifications for subsequent field updates such as name or description changes on already closed tasks.
The modification filters tasks before the write() call to detect only those newly marked as done, preserving expected behavior and preventing redundant API calls to client.notification.
[REF] confisa_notification: remove unused parameter from payload
The method _prepare_confisa_payload_and_values no longer requires a task_id argument, as the current record (self) already provides the necessary context to build the payload.
This refactor simplifies the method signature, improves readability, and prevents confusion about external parameter dependencies.
[IMP] confisa_notification: improve Confisa API Docstrings
Enhances the docstring and exception handling in
_send_confisa_notificationsto improve clarity and debugging capabilities when communicating with the Confisa API.The method now provides a more detailed explanation of how notifications are sent when a sale order is canceled or when a related task is marked as done. It also documents the endpoint (
/api/servicioslocalizadores), payload structure (idRegistro,estado), and potential error conditions.