diff --git a/addons/l10n_eg_edi_eta/models/account_edi_format.py b/addons/l10n_eg_edi_eta/models/account_edi_format.py index beb8ed3835e..d3b95722967 100644 --- a/addons/l10n_eg_edi_eta/models/account_edi_format.py +++ b/addons/l10n_eg_edi_eta/models/account_edi_format.py @@ -18,6 +18,8 @@ _logger = logging.getLogger(__name__) ETA_DOMAINS = { 'preproduction': 'https://api.preprod.invoicing.eta.gov.eg', 'production': 'https://api.invoicing.eta.gov.eg', + 'invoice.preproduction': 'https://preprod.invoicing.eta.gov.eg/', + 'invoice.production': 'https://invoicing.eta.gov.eg', 'token.preproduction': 'https://id.preprod.eta.gov.eg', 'token.production': 'https://id.eta.gov.eg', } @@ -41,6 +43,10 @@ class L10nEgHTTPAdapter(requests.adapters.HTTPAdapter): class AccountEdiFormat(models.Model): _inherit = 'account.edi.format' + @api.model + def _l10n_eg_get_eta_qr_domain(self, production_enviroment=False): + return production_enviroment and ETA_DOMAINS['invoice.production'] or ETA_DOMAINS['invoice.preproduction'] + @api.model def _l10n_eg_get_eta_api_domain(self, production_enviroment=False): return production_enviroment and ETA_DOMAINS['production'] or ETA_DOMAINS['preproduction'] diff --git a/addons/l10n_eg_edi_eta/models/account_move.py b/addons/l10n_eg_edi_eta/models/account_move.py index 8ca1f05bff7..c34c758ff9e 100644 --- a/addons/l10n_eg_edi_eta/models/account_move.py +++ b/addons/l10n_eg_edi_eta/models/account_move.py @@ -43,8 +43,8 @@ class AccountMove(models.Model): for move in self: if move.invoice_date and move.l10n_eg_uuid and move.l10n_eg_long_id: is_prod = move.company_id.l10n_eg_production_env - base_url = self.env['account.edi.format']._l10n_eg_get_eta_api_domain(production_enviroment=is_prod) - qr_code_str = '%s/documents/search/%s/share/%s' % (base_url, move.l10n_eg_uuid, move.l10n_eg_long_id) + base_url = self.env['account.edi.format']._l10n_eg_get_eta_qr_domain(production_enviroment=is_prod) + qr_code_str = '%s/documents/%s/share/%s' % (base_url, move.l10n_eg_uuid, move.l10n_eg_long_id) move.l10n_eg_qr_code = qr_code_str else: move.l10n_eg_qr_code = ''