Commit Graph
82 Commits
Author SHA1 Message Date
Nicolas Évrard 818f26253a Remove has_window_functions on Database 2025-10-04 22:45:53 +02:00
Cédric Krier c9980988cc Store in the cache all the lines to reconcile when searching for the best reconciliation
When the last line is pop from the debit/credit list, the access to the balance
may invalidate the cache of other records to fill the cache of the last one.
This may become very inefficient on large list of lines.
So by setting the record cache size to the size of the list of lines, we ensure
that no cache is invalidated during the calculation.

Closes #14230
2025-09-15 13:18:39 +02:00
Cédric Krier 86c9db5ad9 Unpack move table when converting domain for payable/receivable date
Closes #14158
2025-08-23 21:21:10 +02:00
Adrià Tarroja Caubet 3ed4e9c168 Unpack tables move when ordering by payable_receivable_date
Closes #14158
2025-08-13 11:35:04 +02:00
Cédric Krier f958c59d05 Test if party is set before using its record name for reconciliation error message
Closes #14127
2025-07-30 15:12:15 +02:00
Cédric Krier da57dd5f78 Reset period of move when company is changed
Closes #13999
2025-05-05 16:26:06 +02:00
Cédric Krier 74186a04c8 Improve error message when delete or modify reconciled line 2025-05-21 17:15:31 +02:00
Cédric Krier b0f7d45254 Manage readonly wizard
readonly wizards do not check for write access on the active model.

Closes #13989
2025-04-29 09:31:05 +02:00
Cédric Krier b859ee5074 Invert boolean operator when searching description with negative operator
Closes #14037
2025-05-27 19:57:03 +02:00
Cédric Krier 5b01323986 Coalesce boolean account type columns on negative clause
In SQL the negation of NULL is still NULL.

Closes #13967
2025-04-11 09:24:13 +02:00
Cédric Krier 5aeff66acd Use ModelStorage hooks instead of extending create/write/delete 2025-04-06 00:14:17 +02:00
Cédric Krier 45122b77c0 Add on_write to ModelStorage 2025-02-24 13:39:52 +01:00
Cédric Krier 1772caec90 Clean migrations for series before 6.0 2025-01-04 00:19:42 +01:00
Nicolas Évrard cbdad75620 Remove old-style of super() calls 2025-04-04 00:45:18 +02:00
Cédric Krier e5c727a12f Add payable/receivable date on move line group
Same as 7caa97a96b95 but for move line group.
2025-03-27 23:53:17 +01:00
Cédric Krier 0fd308172e Use strict sequence to number account moves
Closes #12603
2025-02-11 12:04:55 +01:00
Cédric Krier 262a8b894b Add payable/receivable date
The date is the maturity date and if it is empty, fallback to the effective
date.
This gives a better chronology of the lines.
2025-02-14 10:43:15 +01:00
Cédric Krier 93b3d27117 Replace account move number by post number
Closes #13864
2025-02-11 12:50:48 +01:00
Cédric Krier 55bd6d327e Remove or convert company domain into context domain
Closes #10506
2025-01-21 13:39:30 +01:00
Cédric Krier 184536c72a Remove usage of getattr to access state view fields of wizard 2024-11-20 10:35:06 +01:00
Cédric Krier ecaf2bc391 Setup explicitly the accounts, parties and currencies of reconciliation wizard
It is better to not rely on missing the field on the state view but to have an
explicit transition to setup the values.
2024-11-20 10:32:24 +01:00
Cédric Krier 60cd69732f Try to reconcile only valid account move line
Closes #13847
2025-01-29 18:20:46 +01:00
Cédric Krier 801a06970b Use proper default value for Eval on account move 2024-12-26 18:55:47 +01:00
Cédric Krier 5299f36eb9 Include amount in record name of account move line
Only the account code is used to limit the size of the name.
2024-10-30 16:19:57 +01:00
Cédric Krier c40169b8a9 Do not call next_party for account without party required
next_party assign a list with None as parties for the account without party
required. But since 81e16830e46e it is no more valid.
Instead we need to manage account without party explicitly without calling
next_party.

Closes #13760
2024-12-17 17:31:57 +01:00
Cédric Krier ccd026c9c6 Compute maturity date of grouped account move lines per debit/credit
Closes #8876
2024-10-23 20:02:00 +02:00
Cédric Krier 21d30ebd42 Use defaultdict when computing grouping move lines 2024-10-23 19:54:03 +02:00
Cédric Krier 6e3817ba05 Add equivalent domain of SQL constraints
When possible we should also add a domain so the client can provide better
feedback to the user.

Closes #9432
2024-10-27 16:20:45 +01:00
Udo Spallek 8b252472c4 Replace usage of docstring of Model by __string__ attribute
Closes #8402
2024-11-19 10:09:52 +01:00
Cédric Krier f10ee771e0 Round payable and receivable balance on account move line 2024-10-08 14:43:51 +02:00
Nicolas Évrard 6907ea5b7b Add warning when using implicit rec_name target for relational domain 2024-09-07 00:39:55 +02:00
Cédric Krier 1da4e8811e Group numbering account move when posting 2024-08-27 13:35:18 +02:00
Cédric Krier 2c87de506c Group numbering account move at creation 2024-08-25 10:58:04 +02:00
Cédric Krier 9dc25266b0 Implement a strategy of O(n) to find the best combination of lines to reconcile
The combination implementation is replaced by strategy that search the
smallest remaining from the order lines by removing the last debit or credit
depending on the remaining sign.

Closes #13451
2024-08-19 23:58:41 +02:00
Cédric Krier a2dfc4455b Refine index definition
- Set low and high cardinality to index usage
- Use Range usage for numerical expression instead of Equality
2024-07-27 18:36:14 +02:00
Cédric Krier b41ee38f1a Allow copying move from closed period
Closes #13361
2024-06-26 09:39:26 +02:00
Cédric Krier 147be849f4 Prevent reconcile lines using write-off with the same account
Closes #13425
2024-07-27 15:15:55 +02:00
Richard Vong e48510503f Do not try to reconcile posted lines without debit/credit but with second currency amount
Closes #13293
2024-06-28 00:59:01 +02:00
Cédric Krier 9e759e9604 Sort posted lines to reconcile at last by party
The lines may or may not have a party depending on the account.
So the order key must avoid compare party instance with None value.

Closes #13268
2024-05-21 10:12:46 +02:00
Cédric Krier 06270e6a7a Use decimal 0 without digits as default value
If the digits of the field is 0, than using '0.0' trigger the validation error
introduced by 2be02f249a1d.

Closes #13197
2024-04-30 19:15:44 +02:00
Cédric Krier 891423c6b2 Set default value from account move using line field name
Some Function fields has the move as prefix which is removed when applied to
the move. But when setting default value for the line, the move prefix must
not be removed.

Closes #12967
2024-04-27 18:36:49 +02:00
Cédric Krier e69fbf7a9e Convert recursive calls of reconcile accounts wizard into loop
The recursive calls may reach the Python recursion limit if there are a lot of
accounts and parties to process.
So converting the recursion into a loop prevent reaching this limit.

Closes #13164
2024-04-05 14:39:23 +02:00
Cédric Krier 743e938baa Set empty currency when reconcile no lines
Since f9560247a0fc the currency for the reconciled lines is computed but when
there is no line, there is no company to get currency from.

Closes #13047
2024-03-02 11:39:29 +01:00
Cédric Krier f6d8247263 Use AccountMissing and JournalMissing exception for reconciliation 2023-12-23 23:12:41 +01:00
Cédric Krier e9f90b7944 Use 0 as fallback for missing debit or credit in on_change functions
Closes #12823
2023-12-12 17:02:31 +01:00
Cédric Krier 0d625d4010 Remove usage of set_user to skip check access
Since ce8d7a19766a the access rule are enforced only if check access is set.
2023-12-01 21:14:37 +01:00
Cédric Krier a88682d1a6 Fallback to move date when ordering by maturity date and it is empty
Closes #12722
2023-11-09 09:40:49 +01:00
Cédric Krier d10a47f7d1 Do not fail when reconciling an empty list
Closes #12626
2023-10-21 15:46:53 +02:00
Cédric Krier caf654f1ec Set party clause to None when retrieve currencies to reconcile without party
Closes #12601
2023-10-11 18:34:32 +02:00
Cédric Krier 590fbe3aa8 Use origin description as fallback description for account move and line
Closes #12571
2023-09-16 10:30:44 +02:00