Commit 3e55774
committed
[FIX] l10n_it_edi_ndd: prevent wrong value error
The computation of `l10n_it_document_type` fails when multiple
`l10n_it.document.type` records share the same code.
This can happen if a user duplicates an existing Document Type or creates a new
one with the same code, causing `get()` on the grouped recordset to return
multiple results.
This fix adds a check to ensure that the `code` field remains
unique across all `l10n_it.document.type` records.
Steps to Reproduce:
- Install the `l10n_it_edi_ndd` module.
- create a new invoice and confirm it.
- from `Electronic Invoicing` page, Open Document Type and duplicate it.
- Create another invoice and confirm it.
observation: you will receive a traceback for wrong value error
opw - 4902513
closes odoo#217155
Signed-off-by: Wala Gauthier (gawa) <[email protected]>1 parent 7df78a2 commit 3e55774
File tree
3 files changed
+28
-1
lines changed- addons/l10n_it_edi_ndd
- i18n
- models
3 files changed
+28
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
78 | 85 | | |
79 | 86 | | |
80 | 87 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
78 | 85 | | |
79 | 86 | | |
80 | 87 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| 2 | + | |
2 | 3 | | |
3 | 4 | | |
4 | 5 | | |
| |||
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
0 commit comments