Skip to content

Commit

Permalink
Merge PR #657 into 16.0
Browse files Browse the repository at this point in the history
Signed-off-by dhongu
  • Loading branch information
OCA-git-bot committed Oct 12, 2023
2 parents 6c1298e + f64a44c commit 92f6c3c
Showing 1 changed file with 7 additions and 14 deletions.
21 changes: 7 additions & 14 deletions l10n_ro_account_anaf_sync/controllers/anaf_oauth.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,10 @@ def redirect_anaf(self, anaf_config_id, **kw):
"last_request_datetime": now,
}
)
anaf_oauth_url = anaf_config.anaf_oauth_url
client_id = anaf_config.client_id
odoo_oauth_url = user.get_base_url() + "/l10n_ro_account_anaf_sync/anaf_oauth"
redirect_url = "%s?response_type=code&client_id=%s&redirect_uri=%s" % (
anaf_oauth_url,
anaf_config.anaf_oauth_url + "/authorize",
client_id,
odoo_oauth_url,
)
Expand Down Expand Up @@ -122,18 +121,12 @@ def get_anaf_oauth_code(self, **kw):
redirect_uri = user.get_base_url() + "/l10n_ro_account_anaf_sync/anaf_oauth"
data = {
"grant_type": "authorization_code",
"client_id": "%s",
"client_secret": "%s",
"code": "%s",
"access_key": "%s",
"redirect_uri": "%s",
} % (
anaf_config.client_id,
anaf_config.client_secret,
code,
code,
redirect_uri,
)
"client_id": "{}".format(anaf_config.client_id),
"client_secret": "{}".format(anaf_config.client_secret),
"code": "{}".format(code),
"access_key": "{}".format(code),
"redirect_uri": "{}".format(redirect_uri),
}
response = requests.post(
anaf_config.anaf_oauth_url + "/token",
data=data,
Expand Down

0 comments on commit 92f6c3c

Please sign in to comment.