23 Commits
Author SHA1 Message Date
Cédric Krier 19667f95fc Add test to check replaced field of replace party wizard 2025-10-31 12:03:02 +01: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 a4a655b05e Use explicit key when computing taxes and object instead of dict
This defines explicitly the available attribute and unify the use the values as
tax line instead of the keys.
2025-05-30 21:35:55 +02:00
Cédric Krier cc8901276e Round only the tax amount of the line when rounding per line
If we round the tax amount already added to the other line, the result may vary
depending on the order of the lines.
This is because round half even is used so the result may depend on the already
summed tax amounts.

Closes #14047
2025-05-30 18:10:27 +02: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 93b3d27117 Replace account move number by post number
Closes #13864
2025-02-11 12:50:48 +01:00
Cédric Krier eda1f8e7de Merge tax line with the same key but computed separately
Closes #13777
2024-12-24 14:54:47 +01:00
Cédric Krier e9104be1ee Round together only taxable lines with the same taxes and sign
The rounding error must not be distributed between taxable lines having
different taxes otherwise the tax amount is not stable for the same base
amount.

Closes #13673
2024-11-12 17:39:42 +01:00
Cédric Krier a3ada4ef98 Replace minimal by universal chart of account
Closes #9642
2024-10-13 23:55:37 +02:00
Cédric Krier 6f4fbb008a Replace dates checks of fiscal year and period by overlap SQL constraint 2024-10-09 17:29:27 +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 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 cee75c14a1 Do not distribute residual rounding to tax with 0 amount
Closes #13098
2024-03-15 13:16:33 +01:00
Cédric Krier 4632152d2b Do not fail on leap day to create next fiscal year
Replace the year of a date is not safe, it is better to use relativedelta.

Closes #13064
2024-02-29 15:36:16 +01:00
Cédric Krier c6335a368c Update trees of chart of accounts with 2 passes
When a new parent is added to a tree template like types, taxes or tax codes,
the corresponding record of the new template parent is not yet created.
So we need to use a default value for the parent and update again the tree
after creating the new records.

Closes #12755
2023-11-16 16:32:43 +01:00
Cédric Krier 592edc13dd Allow modifying account period dates with account moves
As long as the existing moves has still a date inside the new period dates.

Closes #12667
2023-11-06 15:44:47 +01:00
Cédric Krier 91f4c6b2b8 Check dates of periods when changing fiscal year dates
Closes #12667
2023-11-06 16:19:33 +01:00
Cédric Krier 84d83120c5 Add receivable/payable to company 2023-04-07 18:24:09 +02:00
Nicolas Évrard ab020a78e8 Reconcile the zero lines after saving moves 2023-01-23 17:05:55 +01:00
Cédric Krier b48e4966d5 Add functions and attribute to handle check access and active records
Closes #11863
2022-12-30 13:56:10 +01:00
Sergi Almacellas Abellana 0287507f85 Update parent and replaced_by when template has no taxes
Closes #11891
2023-01-09 14:34:21 +01:00
Nicolas Évrard 2da82e2b94 Accrue and allocate rounding errors when there are multiple taxes
Closes #11317
2022-12-25 18:55:17 +01:00
Cédric Krier fb14b53030 Prepare migration to monorepo 2022-12-16 21:09:21 +01:00