Skip to Content

Contributors

RE: cancel state on account.move

Thank you!

 

Dear Alexis & OCA Friends,

 

I agree. Thank you, Alexis.

 

> For v16, maybe we should switch from the term "All entries" to "Draft and Posted entries"... what do you think ?

> Concerning naming on the report wizards: I think we should align with the naming of the Odoo financial reporting engine.

 

I agree. It is a misunderstanding for users. The estate of moves should be coherent with filters. 😊

 

+1

 

Best regards,

Rafael

 

 

De: Alexis de Lattre <notifications@odoo-community.org>
Enviado el: jueves, 6 de octubre de 2022 20:37
Para: Contributors <contributors@odoo-community.org>
Asunto: Re: cancel state on account.move

 

Thanks for your answers ! We agree that moves with state = 'cancel' should always be ignored.

 

Here are my PRs for v14 to fix this issue :

- l10n_fr_account_vat_return : https://github.com/OCA/l10n-france/pull/374

 

If you know a module that doesn't handle the "cancel" state on account.move correctly, please report it !

 

Alexis

 


by Rafael Blasco (Moduon) - 10:25 - 8 Oct 2022

Reference

  • cancel state on account.move
    Dear OCA friends,

    Up to Odoo v12, the "state" of an account.move had 2 possible values : "draft" and "posted".
    Starting from Odoo v13, the "state" field has one more possible value : "cancel". I hate that, but it's a fact :(

    The problem is : how should we handle these "cancel" moves. In several wizards/models, we give the user the choice between "posted moves only" and "all moves" ; does "all moves" means draft+posted or draft+posted+cancel ? Maybe a developer would consider that "all moves" means draft+posted+cancel, but a user often considers that cancelled moves should never be taken into account and "all moves" means draft+posted.

    Here is a summary of the situation on Odoo v14 in different modules :
    • account_financial_report : when the user selects "All entries", Odoo takes draft+posted
    • sale and purchase : the "Invoiced qty" on the sale.order.line/purchase.order.line doesn't take into account the cancelled invoices (it only takes draft and posted invoices)
    • l10n_fr_fec : when the user selects "Non-official FEC report (posted and unposted entries)", Odoo takes draft+posted+cancel
    • lock dates : odoo allows to have moves with state="cancel" in a locked period (but moves in draft state are not allowed)
    So the majority of modules considers that "all moves" means "draft + posted" and excludes "cancel" state. The fact that Odoo accepts cancel entries in a locked period confirms that cancelled moves should always be ignored, even when Odoo says "all entries".

    I think l10n_fr_fec should be fixed to adopt this behavior (I can make a PR for l10n_fr_fec_oca).
    The OCA modules account_cutoff_xxx from https://github.com/OCA/account-closing don't even have a field to say if you should select "all moves" (draft + posted) or "posted moves only" (at the moment, it takes all moves including cancelled moves). I'll make a PR to fix this.

    Do you know other modules that should be fixed on this ?

    For v16, maybe we should switch from the term "All entries" to "Draft and Posted entries"... what do you think ?

    --
    Alexis de Lattre

    by Alexis de Lattre - 03:55 - 6 Oct 2022