Skip to content

[10.0][IMP] Set invoices paid - #2611

Merged
pedrobaeza merged 1 commit into
OCA:10.0from
VanMoof:imp/10.0/set_invoices_paid
Mar 21, 2021
Merged

[10.0][IMP] Set invoices paid#2611
pedrobaeza merged 1 commit into
OCA:10.0from
VanMoof:imp/10.0/set_invoices_paid

Conversation

@StefanRijnhart

@StefanRijnhart StefanRijnhart commented Mar 16, 2021

Copy link
Copy Markdown
Member

In Odoo 9.0, an invoice was moved from state 'open' to state 'paid'
on reconciliation of the move line that was linked as the trigger of
payment subflow in the invoice workflow. This flow usually prevented
zero amount invoices from getting into state paid because zero amount
move lines are usually not reconciled. The invoice would be marked as
reconciled correctly, because there was no residual amount.
In Odoo 10.0, any invoice that is marked as reconciled will be moved to
state paid as per action_invoice_paid that is triggered from the
model's _write method1. Preemtively set the correct state using SQL here
for performance reasons.

1 https://github.com/odoo/odoo/blob/10.0/addons/account/models/account_invoice.py#L365

--
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr

@StefanRijnhart StefanRijnhart added this to the 10.0 milestone Mar 16, 2021

@MiquelRForgeFlow MiquelRForgeFlow left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@OCA-git-bot

Copy link
Copy Markdown
Contributor

This PR has the approved label and has been created more than 5 days ago. It should therefore be ready to merge by a maintainer (or a PSC member if the concerned addon has no declared maintainer). 🤖

@pedrobaeza
pedrobaeza merged commit 56bc56f into OCA:10.0 Mar 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants