Skip to content

[19.0][IMP] contract: notify when there is nothing to invoice - #1510

Draft
bosd wants to merge 1 commit into
OCA:19.0from
bosd:19.0-imp-contract-nothing-to-invoice
Draft

[19.0][IMP] contract: notify when there is nothing to invoice#1510
bosd wants to merge 1 commit into
OCA:19.0from
bosd:19.0-imp-contract-nothing-to-invoice

Conversation

@bosd

@bosd bosd commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

The Create invoices button on a contract form stays visible while the contract has nothing left to invoice (for instance when all of its lines are canceled, so create_invoice_visibility is still true but no line can be invoiced).

Clicking it in that situation silently did nothing: no invoice, no message, no error. Users reasonably assume the action failed.

This PR adds action_recurring_create_invoice, which the button now calls. It delegates to recurring_create_invoice and, when no invoice was created, returns a display_notification warning ("Nothing to invoice") in the top right corner instead of returning nothing.

recurring_create_invoice itself is left untouched, so modules inheriting or calling it keep their current behaviour.

Covered by two new tests in contract/tests/test_contract.py.

The "Create invoices" button on a contract stays visible while the
contract has nothing left to invoice (e.g. all its lines are canceled).
In that case clicking it silently did nothing, leaving the user
wondering whether the action failed.

Add `action_recurring_create_invoice`, used by the button, which falls
back to a warning notification when `recurring_create_invoice` did not
create any invoice.
@bosd
bosd marked this pull request as draft September 2, 2026 15:34
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