Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[IMP] l10n_ar_edi_ux: uso certificado digital en update from afip #421

Open
wants to merge 1 commit into
base: 17.0
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions l10n_ar_edi_ux/models/res_partner.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,11 @@ def get_data_from_padron_afip(self):
vat = self.ensure_vat()

# if there is certificate for current company use that one, if not use the company with first certificate found
company = self.env.company if self.env.company.sudo().l10n_ar_afip_ws_crt else self.env['res.company'].sudo().search(
[('l10n_ar_afip_ws_crt', '!=', False)], limit=1)
today = fields.Date.context_today(self.with_context(tz='America/Argentina/Buenos_Aires'))
company = self.env.company if self.env.company.sudo().l10n_ar_afip_ws_crt and self.env.company.sudo().l10n_ar_crt_exp_date > today else self.env['res.company'].sudo().search(
[('l10n_ar_afip_ws_crt', '!=', False), ('l10n_ar_crt_exp_date', '>', today)], limit=1)
if not company:
raise UserError(_('Please configure an AFIP Certificate in order to continue'))
raise UserError(_('Please configure an active AFIP Certificate in order to continue'))
client, auth = company._l10n_ar_get_connection('ws_sr_constancia_inscripcion')._get_client()

error_msg = _(
Expand Down