Files
odoo_source/addons
Dylan Kiss (dyki) 72b580243a [FIX] account: reset draft move name in nonempty period
Currently, when we create a draft move in an empty period, a sequence
number (name) gets generated and set on the move. This is fine.

When subsequently we change the date of that move to a period that
already has entries in it, the sequence number (name) for our draft move
is recalculated according to the new period.

When we post a new move in this same period afterwards, and then
delete our previous draft move, we are left with a gap in the sequence.

Example: We already have a move on 2023-01-01 with name `2023/01/0001`.
We add two new moves `A` and `B` as follows.

| Step | Move | Action      | Date       | Name           |
| ---- | ---- | ----------- | ---------- | -------------- |
| 1    | `A`  | Add         | 2023-02-01 | `2023/02/0001` |
| 2    | `A`  | Change date | 2023-01-10 | `2023/01/0002` |
| 3    | `B`  | Add         | 2023-01-15 | `/`            |
| 4    | `B`  | Post        | 2023-01-15 | `2023/01/0003` |
| 5    | `A`  | Delete      |            |                |

A gap is now created, since we have `2023/01/0001` and `2023/01/0003`,
but `2023/01/0002` was deleted (possible since it was in draft).

To solve this issue, we now make sure that when a draft entry is moved
to a period that already has entries in it, we reset the name to `/`,
to not consume a sequence number and prevent possible gaps in the
sequence later on.

task-3326834

closes odoo/odoo#123329

X-original-commit: 31f94b31b820799459ad70593abb74a2f5415b47
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Dylan Kiss (dyki) <dyki@odoo.com>
2023-06-01 19:09:02 +02:00
..
2023-05-11 18:25:38 +02:00
2023-05-10 19:16:47 +02:00
2023-05-10 18:16:24 +02:00
2023-05-10 18:16:21 +02:00
2023-05-10 20:15:02 +02:00
2023-05-10 20:14:59 +02:00
2023-05-11 18:24:53 +02:00
2023-05-10 20:15:12 +02:00
2023-05-11 10:40:53 +02:00
2023-05-11 10:40:55 +02:00
2023-05-10 18:16:19 +02:00
2023-05-31 09:23:27 +02:00
2023-05-17 16:48:30 +02:00
2023-05-12 09:21:49 +02:00