odoo/odoo#244366
Created by fw-bot
Statuses:
- legal/cla: Contributor License Agreement check
- ci/runbot: Odoo Test Suite
- ci/upgrade_enterprise: Test upgrades for enterprise master
- ci/style: Optional style check. Ignore it only if strictly necessary.
- ci/security: Required security check. Can only be ignored by security team.
- label
- odoo-dev:master-19.0-opw-5386575-changing_sequence_traceback-artn-491458-fw
- head
- e45be0b89f4551143b2d427e8784be3d92b4a908
- merged
- 2 days ago by Arthur Nanson (artn)
| odoo/odoo | |
|---|---|
| 19.0 | #239515 |
| saas-19.1 | #244346 |
| master | #244366 |
[FIX] point_of_sale: prevent traceback with sequence prefix
Steps to reproduce:
- Go to the sequence interface, and chose the config number 1 for a pos.order
- In the prefix field, enter something with characters that are not numbers
- Go to a PoS with config number 1 active and make a purchase
- A traceback appears saying that we can't convert the sequence to an Integer
Why the fix:
Having a custom prefix with letters used to work, but in version 19, we now store the sequence_number with the prefix, which can be composed of characters which can not be stored in an Integer field such as sequence_number.
To prevent this error, we remove the prefix and the suffix (which has the same issue) from the sequence_number before storing it. We then add the prefix and the suffix back when computing the order's name, so that it's consistant with the prefix and the suffix the user chose.
This is the way the order's name was computed before version 19.0, which saw the prefix and suffix disappear from the order's name.
Forward-Port-Of: #239515