Contributors mailing list archives

contributors@odoo-community.org

Browse archives

Avatar

RE: cancel state on account.move

by
Noviat sa/nv, Luc De Meyer.
- 06/10/2022 16:50:07

Imho ‘cancelled’ entries are functionally equal to no entry at all, hence unposted & posted is sufficient in the reports.

I do like having cancelled entries since it allows the customer (and external auditors) to analyze historical transactions (useful when there are gaps in the invoice numbering due to cancel).

 

Up till now I haven’t seen any demand in our customer base to develop a report on cancelled entries. The standard list view filters and export features are sufficient.

 

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

 

Regards,

Luc

 

From: Alexis de Lattre <notifications@odoo-community.org>
Sent: Thursday, 6 October 2022 15:57
To: Contributors <contributors@odoo-community.org>
Subject: 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 + po sted) 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

Reference