OdooWiki OCA HUB

Romania - Account ANAF Sync

l10n_ro_account_anaf_sync folder_open OCA/l10n-romania open_in_new
Localization License: AGPL-3

This module will make posible to send e-invoice / e-transport to Romanian goverment anaf.ro.

To use this module you must have a digital signature usb token from Romania connected with a ANAF account.

auto_awesome What this module does

AI-generated from the code · Odoo 17.0

Connect your Odoo company to the Romanian ANAF portal so you can obtain and manage the access tokens needed to send e-invoices and e-transport documents. Configuration is done per company from the Accounting settings.

This module adds an ANAF connection configuration screen per company. From Accounting settings you get a "Configure ANAF sync" button that opens the list of ANAF configurations.

On the configuration form you enter the OAuth client ID and client secret obtained from the ANAF portal, and the module shows the callback address you must register there. Buttons let you: - Get Token From Anaf Website (with usb token inserted): opens the ANAF login page so you can authorise with your Romanian digital certificate. - Refresh Access Token: renews the token using the stored refresh token. - Revoke Access Token: cancels the current token and clears the stored code, tokens and expiry date.

The form also displays the access token, refresh token, the token expiry date (about 90 days) and the last request time. A "Services" tab lists the ANAF services (scopes) with their test or production API address, chosen automatically from the selected state.

Business rules enforced by the code: only one authorisation request per minute is allowed; you cannot request a new token while one already exists; refreshing requires a refresh token; revoking requires an access token; and the company on a configuration cannot be changed once set. Each action posts a message in the chatter. Access is read-only for accountants and invoicing users, full for accounting managers, and records are filtered by company.

Depends on

Models and fields (2)
  • l10n.ro.account.anaf.sync · new modelcode, state, client_id, company_id, access_token, client_secret, refresh_token, anaf_oauth_url, anaf_scope_ids, response_secret, anaf_callback_url, last_request_datetime, client_token_valability
  • l10n.ro.account.anaf.sync.scope · new modelscope, state, company_id, anaf_sync_id, anaf_sync_url, anaf_sync_test_url (API test URL), anaf_sync_production_url (API production URL)

Text generated by AI (DeepSeek) from reading the Odoo 17.0 code on GitHub; it may contain mistakes, so check the code before deciding. View the code on GitHub

Availability by version

Reviewed: 2026-11-03
Confirmed (verified in repository and branch) Estimated (unverified) No information

Confirmation status: 4 confirmed, 5 with no information of 9 versions.

Sources · Odoo 17.0

Confirmed on 2026-11-03 in branch 17.0 of OCA/l10n-romania.

terminal Installation and usage

OCA documentation · Odoo 17.0

To install this module, you need to:

  • clone the branch 14.0 of the repository
  • add the path to this repository in your configuration (addons-path)
  • update the module list
  • search for "Romania - Account ANAF Sync" in your addons
  • install the module
  • Go to put put your username and password and code that came on email (or create a new user if you do not have)
  • Go to "Editare profil Oauth"
  • At profile Oauth
  • put some text at "Denumire Aplicatie"
  • at callback URL 1 put your Odoo instance url: /l10n_ro_account_anaf_sync/anaf_oauth
  • (if you odoo site is you must put url shown also in odoo company e-invoice tab)
  • at Serviciu check e-factura and/or e-transport
  • press Generare Client ID
  • Copy the Client ID and Client Secret.
  • Go to Odoo instance and from Settings -\> Romania -\> Configure ANAF sync create a new record for each company that you have access on ANAF website.
  • From a computer that can connect to anaf.ro and login with digital signature. > With the usb Token inserted press in Odoo the button Get Token > from Anaf. It will ask you for usb token pin. You will get a error > or a token and a new valability date If the ANAF website is not > asking for a pin you must open and close your browser to ask you > again the signature token pin
  • If you do not have errors press the test button and all should be ok.
  • The access token can be used also to test in other ways like
> curl "https://api.anaf.ro/TestOauth/jaxrs/hello?name=bbb" -H "Authorization: Bearer a010f5e7dd3e44d114d73729419bd1b9968b92fe2015f0512dcZZZZZZZZ" -i Future

Info:

> > > > >

No verified information in OCA: Usage.

info

Data imported from GitHub: this sheet reflects the latest catalog review, not a live lookup. Always check the module documentation and staging before installing in production.