Monday, July 8, 2024
1 change · 17.0
New functionality added to Odoo
Romanian companies can now authenticate with ANAF and send electronic invoices and credit notes directly from Odoo to the E-Factura platform. The update also retrieves official responses, records successful submissions, and shows clear error details when ANAF rejects a document.
Original PR description
Romania requires its companies to send all invoices to a specific web service on their E-Factura platform. Now that we can generate the file (CIUS-RO XML), our next obvious step is to send them to…
Romania requires its companies to send all invoices to a specific web service on their E-Factura platform. Now that we can generate the file (CIUS-RO XML), our next obvious step is to send them to their SPV (the ANAF platform). This commit implements 2 big part: - the full OAUTH/authentication process and its token generation - sending/fetching/downloading data to and from the SPV --- The Authentication To be able to generate the token needs a special USB key from Romania connected with an ANAF account. The full process on what needs to be done is explained in the settings view, in the "Romanian E-Factura" block. Once a token is generated, we'll be able to use it in all of our request to send/fetch/download data to/from ANAF. --- The Full Sending E-Factura Flow (requires access token) - Upload invoice/credit note to SPV -> get "loading ID" - The invoice gets processed by ANAF (State: "sending") - After some time, fetch the invoice using the acquired loading ID. - If processed, there will be 2 kind of answer: "OK" or "NOK" (not ok) - Either way, we will get a "download ID", which we can then use to download the answer. - If "NOK" -> "Error". Read the zip file and display the error message - If "OK" -> "Sent". Save the zip file attachment task-id: 3595436 related enterprise PR: https://github.com/odoo/enterprise/pull/65602