Skip to content

[T1984] FIX : Prevent automatic letter publishing on translation removal - #2117

Merged
Danielgergely merged 2 commits into
18.0from
T1984-FIX-Prevent-automatic-letter-publishing-on-translation-removal-v18
Jul 30, 2026
Merged

[T1984] FIX : Prevent automatic letter publishing on translation removal#2117
Danielgergely merged 2 commits into
18.0from
T1984-FIX-Prevent-automatic-letter-publishing-on-translation-removal-v18

Conversation

@Ylulu71D

Copy link
Copy Markdown

Goal

Update action_remove_local_translate to safely remove B2S letters from the translation platform upon activation of the existing "Remove from translation" button, revert its state to "Received in the system", and clean up translation metadata without triggering automated publishing or email workflows.

Technical Aspects

  • Record Enforcement & State Reset:

    • Enforced single-record execution using self.ensure_one().
    • Updated record fields via write():
      • Reverted state to "Received in the system".
      • Cleared translator and translation_status (reset to False).
  • Retained The Existing Directional Handling for S2B

MISC

  • In theory, this action intentionally avoids triggering standard automated publishing or email notifications by resetting the state to "Received in the system" (previously to "Published" which activates downstream workflows).
  • MailHog tests have been conducted in local instances but did not yield concrete validating results. Further investigation in Stage environment is advised.

@Ylulu71D
Ylulu71D requested a review from Danielgergely July 23, 2026 14:57
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@Ylulu71D
Ylulu71D marked this pull request as ready for review July 23, 2026 15:00
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@greptile-apps

greptile-apps Bot commented Jul 23, 2026

Copy link
Copy Markdown

Confidence Score: 5/5

Safe to merge with low risk.

The change is localized to one action, removes the previous forced B2S publishing path, preserves S2B commkit handling, and clears both legacy and current translator fields.

No files require special attention.

T-Rex T-Rex Logs

What T-Rex did

  • Reviewed the before-state logs to verify the reconstructed B2S behavior and the S2B create_commkit baseline.
  • Verified the after-state changes by examining the updated method execution, noting that B2S writes state: Received, metadata cleanup occurs, and create_commkit_calls counts differ (0 for B2S, 1 for S2B).
  • Confirmed that the translation file and the test harness compiled successfully.
  • Observed that full ORM/mail validation could not be attempted due to the missing Odoo spec and a ModuleNotFoundError.
  • Collected and linked the relevant run and validation artifacts to support the assessment of before/after behavior and compilation results.

View all artifacts

T-Rex Ran code and verified through T-Rex

Important Files Changed

Filename Overview
sbc_translation/models/correspondence.py Updates translation removal to reset letters to the received state, clear translator assignment/status metadata, and avoid forced B2S publishing while retaining S2B commkit creation.

Sequence Diagram

sequenceDiagram
participant User as Odoo user / Translation Platform
participant Letter as correspondence.action_remove_local_translate
participant Odoo as Odoo correspondence record
participant GMC as CommKit creation

User->>Letter: Remove from translation
Letter->>Letter: ensure_one()
Letter->>Odoo: write state and clear translation metadata
alt Supporter To Beneficiary
    Letter->>GMC: create_commkit()
else Beneficiary To Supporter
    Letter-->>User: return True without forced publishing
end
Loading

Reviews (2): Last reviewed commit: "[T1984] FIX : Clear new_translator_id" | Re-trigger Greptile

Comment thread sbc_translation/models/correspondence.py

@Danielgergely Danielgergely left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

  • Before: the B2S branch (Published to Global Partner + process_letter(force_publish=True)) actually raises AttributeError: 'super' object has no attribute 'process_letter' on the v18 branch — old code was broken, not just over-sending.
  • After: B2S → Received in the system, metadata cleared, no gmc.message/comm job. S2B → Received in the system + commkit still created (preserved).

Confirms the requirement: removed B2S letters are parked, not auto-sent.

@Danielgergely
Danielgergely merged commit 3ae81c7 into 18.0 Jul 30, 2026
2 checks passed
@Danielgergely
Danielgergely deleted the T1984-FIX-Prevent-automatic-letter-publishing-on-translation-removal-v18 branch July 30, 2026 05:59
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.

2 participants