Commit 239a5cb
committed
[FIX] point_of_sale: prevent traceback with sequence prefix
**Steps to reproduce:**
- Go to the sequence interface, and chose the config #1 for a pos.order
- In the prefix field, enter something with characters that are not numbers
- Go to a PoS with config #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.
opw-5386575
closes odoo#244366
X-original-commit: 67fc637
Signed-off-by: Adrien Guilliams (adgu) <adgu@odoo.com>
Signed-off-by: Arthur Nanson (artn) <artn@odoo.com>1 parent 8444c6b commit 239a5cb
2 files changed
Lines changed: 45 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
571 | 571 | | |
572 | 572 | | |
573 | 573 | | |
574 | | - | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
575 | 581 | | |
576 | 582 | | |
577 | 583 | | |
| |||
692 | 698 | | |
693 | 699 | | |
694 | 700 | | |
695 | | - | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
696 | 704 | | |
697 | 705 | | |
698 | 706 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2099 | 2099 | | |
2100 | 2100 | | |
2101 | 2101 | | |
| 2102 | + | |
| 2103 | + | |
| 2104 | + | |
| 2105 | + | |
| 2106 | + | |
| 2107 | + | |
| 2108 | + | |
| 2109 | + | |
| 2110 | + | |
| 2111 | + | |
| 2112 | + | |
| 2113 | + | |
| 2114 | + | |
| 2115 | + | |
| 2116 | + | |
| 2117 | + | |
| 2118 | + | |
| 2119 | + | |
| 2120 | + | |
| 2121 | + | |
| 2122 | + | |
| 2123 | + | |
| 2124 | + | |
| 2125 | + | |
| 2126 | + | |
| 2127 | + | |
| 2128 | + | |
| 2129 | + | |
| 2130 | + | |
| 2131 | + | |
| 2132 | + | |
| 2133 | + | |
| 2134 | + | |
| 2135 | + | |
| 2136 | + | |
0 commit comments