Skip to content

[FIX] sale_automatic_workflow: skip invoice creation when refund exists - fwp 4302#4444

Draft
rvalyi wants to merge 1 commit into
OCA:18.0from
akretion:18.0-port-pr-4302
Draft

[FIX] sale_automatic_workflow: skip invoice creation when refund exists - fwp 4302#4444
rvalyi wants to merge 1 commit into
OCA:18.0from
akretion:18.0-port-pr-4302

Conversation

@rvalyi

@rvalyi rvalyi commented Jul 2, 2026

Copy link
Copy Markdown
Member

When a posted invoice is reversed by a credit note, the automatic workflow incorrectly creates a new invoice because the credit note reduces qty_invoiced, making invoice_status = 'to invoice' again.

Skip invoice creation when:

  • A posted out_invoice already exists, or
  • A posted out_refund linked to that invoice exists.

Forward-port of fix from PR #4302 (OCA/sale-workflow, 16.0). Original author: muslim-foda

@OCA-git-bot OCA-git-bot added series:18.0 mod:sale_automatic_workflow Module sale_automatic_workflow labels Jul 2, 2026
@rvalyi
rvalyi force-pushed the 18.0-port-pr-4302 branch from 878a258 to e3f7740 Compare July 2, 2026 13:35
@rvalyi rvalyi changed the title [FIX] sale_automatic_workflow: skip invoice creation when refund exists [FIX] sale_automatic_workflow: skip invoice creation when refund exists - fwp 4302 Jul 2, 2026
@rvalyi
rvalyi marked this pull request as draft July 2, 2026 15:19
When a posted invoice is reversed by a credit note, the automatic
workflow incorrectly creates a new invoice because the credit note
reduces qty_invoiced, making invoice_status = 'to invoice' again.

Skip invoice creation when:
- A posted out_invoice already exists, or
- A posted out_refund linked to that invoice exists.

Forward-port of fix and tests from PR OCA#4302 (OCA/sale-workflow, 16.0).
Original author: muslim-foda
@rvalyi
rvalyi force-pushed the 18.0-port-pr-4302 branch from 07e852c to 436875b Compare July 2, 2026 16:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mod:sale_automatic_workflow Module sale_automatic_workflow series:18.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants