[IMP] l10n_in_edi*: added connection successful notification

Whenever a user's is  successfully connected with l10n_in_edi* it will display
the user a notification of successfully being  connected with Indian EDI
Services

closes odoo/odoo#148418

X-original-commit: 9c0e6123c4b03ca27e1855755ce2728faeb567e6
Signed-off-by: Josse Colpaert <jco@odoo.com>
Signed-off-by: Harsh Modi (hamo) <hamo@odoo.com>
This commit is contained in:
Harsh Modi
2024-01-10 05:04:39 +00:00
parent 212d0dd4fc
commit e128287e8e
2 changed files with 18 additions and 0 deletions
@@ -32,6 +32,15 @@ class ResConfigSettings(models.TransientModel):
self.env["account.edi.format"]._l10n_in_edi_authenticate(self.company_id)
if not self.company_id.sudo()._l10n_in_edi_token_is_valid():
raise UserError(_("Incorrect username or password, or the GST number on company does not match."))
return {
'type': 'ir.actions.client',
'tag': 'display_notification',
'params': {
'type': 'info',
'sticky': False,
'message': _("API credentials validated successfully"),
}
}
def l10n_in_edi_buy_iap(self):
if not self.l10n_in_edi_production_env:
@@ -22,3 +22,12 @@ class ResConfigSettings(models.TransientModel):
if response.get("error"):
error_message = "\n".join(["[%s] %s" % (e.get("code"), html_escape(e.get("message"))) for e in response["error"]])
raise UserError(error_message)
return {
'type': 'ir.actions.client',
'tag': 'display_notification',
'params': {
'type': 'info',
'sticky': False,
'message': _("API credentials validated successfully"),
}
}