Steps to reproduce:
There is no possibility to reproduce it in test mode
But the flow would be:
- create a company with a NIF not registered
- Set up the EDI invoice
- Create an invoice
Issue:
When the NIF is not registered, is is possible to use it. It will only create an error `approbado con errores` which is apparently fine
Solution:
Whenever the server sent us an '1117' error code, we call again the post_invoice with a new context so we are able to send the request with the right information; that is, the correct ID Type whenever a NIF is not registered.
Indeed, whenever the error code is related to the NIF, is is possible to send again a request without having the invoice defined as "duplicated". It will only go through the process "AceptadoConErrores".
opw-2952108
closesodoo/odoo#104375
X-original-commit: 415d095cd418fd38d5749200724b6ce775ffa7f8
Signed-off-by: Josse Colpaert <jco@odoo.com>
Signed-off-by: Yolann Sabaux (yosa) <yosa@odoo.com>