william-andre aa041fc75f [FIX] account: compute name of multiple moves at the same time
Computing the name of multiple moves at the same time could lead to some
errors because we don't know when the field will be flushed:
1: We can't rely on the context to compute moves, for instance when
   mixing payments and other moves in a bank journal. The context key
   has been removed as it could be useful only when the `payment_id` was
   not set yet, which should only happen in the Form view. But the name
   of payments was not editable before posting a first time(like it is
   for invoices)
   Was failing following test with only `account_reports` installed
   `TestReconciliationReport.test_reconciliation_report_multi_currencies`
2: There was an optimization tho avoid doing `O(n)` queries to find if
   the current move is the first one of the sequence (and needs to be
   precomputed in draft because of that). The algorithm is doing the
   same `SELECT` after anyways[1] or even a second one to relax the
   domain, followed by an `UPDATE` right after. This can't be batched
   and delayed because we rely on the SQL unique constraint to assign
   the numbers.
   Was failing folloing test with only `account_reports` installed
   `TestAgedReceivableReport.test_aged_receivable_sort_lines_by_date`

The reason why it started causing issues on some test databases (only
`account_reports` installed, not on a full runbot build) is still
unknown.

[1]: In order to reduce the number of duplicated queries, we could do it
only once per tuple (journal, date range, is_refund, is_payment), but
getting this tuple is not so easy and reliable without a complex
implementation. It is also not really possible to cache and reuse (i.e
in `highest_number`) because the value changes when other moves are
posted.

Part-of: odoo/odoo#110016
2023-02-17 19:30:39 +01:00
2023-02-14 17:09:59 +01:00
…
…
…
…
2023-01-03 13:16:02 +01:00
2023-01-03 13:16:02 +01:00

Build Status Tech Doc Help Nightly Builds

Odoo

Odoo is a suite of web based open source business apps.

The main Odoo Apps include an Open Source CRM, Website Builder, eCommerce, Warehouse Management, Project Management, Billing & Accounting, Point of Sale, Human Resources, Marketing, Manufacturing, ...

Odoo Apps can be used as stand-alone applications, but they also integrate seamlessly so you get a full-featured Open Source ERP when you install several Apps.

Getting started with Odoo

For a standard installation please follow the Setup instructions from the documentation.

To learn the software, we recommend the Odoo eLearning, or Scale-up, the business game. Developers can start with the developer tutorials

S
Description
No description provided
Readme LGPL-3.0
3.4 GiB
Languages
Python 49.6%
JavaScript 47.8%
SCSS 2%
CSS 0.3%
HTML 0.2%