Skip to content

[19.0][IMP] contract: harden the recurring-invoice cron#1459

Open
bosd wants to merge 1 commit into
OCA:19.0from
bosd:19.0-imp-contract-cron
Open

[19.0][IMP] contract: harden the recurring-invoice cron#1459
bosd wants to merge 1 commit into
OCA:19.0from
bosd:19.0-imp-contract-cron

Conversation

@bosd

@bosd bosd commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Split out from #1427 (per @pedrobaeza's request to break the big PR into focused ones).

Hardens the recurring-invoice cron so one bad contract can no longer block a whole company's batch.

Two-tier execution

  • Fast path — one batched account.move.create([...]) per company (unchanged behaviour/performance).
  • On failure — fall back to per-contract processing inside cr.savepoint(), so a single contract with bad data doesn't poison the transaction for the rest (SQL-level errors included).

Per-contract failure trail

  • New fields invoice_generation_error / invoice_generation_error_date / has_invoice_generation_error.
  • "Invoice Generation Failed" search filter, a warning icon + decoration-warning row tint in the list, and a form banner with a Dismiss button.
  • Chatter post + de-duplicated TODO activity for the responsible user.
  • Auto-clears on the next successful run.

Tests: isolation of a failing contract, error/activity population, recovery clearing, no duplicate chatter/activity, fast-path retention, and the dismiss/view actions.

Make the recurring-invoice cron robust with a per-contract failure flag,
mute the logger when tests seed an invoice-generation error, and tidy the
cron error log.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants