Skip to content

[17.0][REF] account_caba_payment_date: absorb account_cash_basis_lock_date task#32267 - #9

Merged
alan196 merged 1 commit into
Jarsa:17.0from
Jarsa-dev:17.0-task-32267-caba-refactor
Aug 12, 2026
Merged

alan196 merged 1 commit into
Jarsa:17.0from
Jarsa-dev:17.0-task-32267-caba-refactor

Conversation

@alan196

@alan196 alan196 commented Aug 12, 2026

Copy link
Copy Markdown

Merges the functionality of the account_cash_basis_lock_date module (mtnmx repo, task#31178) into account_caba_payment_date, so a single module with a single configuration governs the date of the cash basis entry.

Why

Both modules manipulate the date of the tax cash basis (CABA) entry and overlapped:

  • account_caba_payment_date dates the entry on the payment date, with a configurable policy when that date falls in a locked period.
  • account_cash_basis_lock_date (mtnmx) made the reconciliation work when the source documents' period is closed through the tax lock date, which standard Odoo ignores when choosing the entry date (_get_user_fiscal_lock_date only considers fiscal/period locks), plus exchange difference handling and chatter traceability.

The absorbed behavior operates at a layer the lock policy cannot reach: the failure happens inside super()._create_tax_cash_basis_moves(), before the policy code runs.

Changes

  • res.company._get_user_fiscal_lock_date now includes the tax lock date under the cash_basis_check_tax_lock context key, making the standard fallback (date the entry on the operation date) trigger for tax-locked periods.
  • The same criterion is applied to the exchange rate difference entry generated by the reconciliation.
  • A traceability message (expected date vs applied date) is posted on the shifted entries and their source documents.
  • The account.move.write guard of the absorbed module is dropped: it only defended against this module rewriting the entry date after the fact, which the lock policy now handles at the source.
  • Tests ported (12 tests total, all green). Version bumped to 17.0.3.0.0.

Companion

The mtnmx MR removing account_cash_basis_lock_date follows; that module must be uninstalled from the databases before deploying the removal.

🤖 Generated with Claude Code

…task#32267

Merge the functionality of the mtnmx module account_cash_basis_lock_date,
which overlapped with this module on the same flow (the date of the tax
cash basis entry vs the lock dates):

- Include the tax lock date in the effective lock date used by the
  standard _create_tax_cash_basis_moves fallback (context key
  cash_basis_check_tax_lock), so document-vs-document reconciliations
  (e.g. a credit note applied to an invoice of a closed month) date the
  entry on the operation date instead of failing to post, subject to the
  existing lock policy.
- Apply the same criterion to the exchange rate difference entry
  generated by the reconciliation.
- Post a traceability message on the shifted entries and their source
  documents (expected date vs applied date).

The account.move write guard of the absorbed module is dropped: it only
defended against this module rewriting the entry date after the fact,
which the lock policy now handles at the source.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@jarsabot

Copy link
Copy Markdown

Linked to Odoo task #32267

@alan196
alan196 merged commit 60faab6 into Jarsa:17.0 Aug 12, 2026
1 of 4 checks passed
@alan196
alan196 deleted the 17.0-task-32267-caba-refactor branch August 12, 2026 00:48
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