Skip to content

[FIX] confisa_notification: prevent duplicated enqueue event after edit#37

Open
IrvingReyes wants to merge 2 commits into16.0from
16.0-fix-bug-for-project-task-write-enqueue-event-irvingreyes
Open

[FIX] confisa_notification: prevent duplicated enqueue event after edit#37
IrvingReyes wants to merge 2 commits into16.0from
16.0-fix-bug-for-project-task-write-enqueue-event-irvingreyes

Conversation

@IrvingReyes
Copy link
Copy Markdown
Contributor

@IrvingReyes IrvingReyes commented Oct 22, 2025

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_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.

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.
@IrvingReyes IrvingReyes force-pushed the 16.0-fix-bug-for-project-task-write-enqueue-event-irvingreyes branch from a35b3d8 to daa4ee8 Compare December 10, 2025 17:27
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.
@IrvingReyes IrvingReyes force-pushed the 16.0-fix-bug-for-project-task-write-enqueue-event-irvingreyes branch from daa4ee8 to 474459c Compare January 14, 2026 19:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant