Modulo Base para los Web Services de AFIP

l10n_ar_afipws
REPOSITORY
REPOSITORYOCA/l10n-argentina
GIT
GIThttps://github.com/OCA/l10n-argentina.git
GIT FOLDER
GIT FOLDERhttps://github.com/OCA/l10n-argentina/tree/16.0/l10n_ar_afipws
VERSION
VERSION 1.0.0
CATEGORY
CATEGORYAccounting/Localizations
LICENSE
LICENSEAGPL-3
APPLICATION
APPLICATIONNo
AUTO-INSTALLABLE
AUTO-INSTALLABLENo
AUTHORS
AUTHORSOdoo Community Association (OCA), ADHOC SA, Nimarosa, Moldeo Interactive, Exemax, Codize
MAINTAINERS
MAINTAINERSOdoo Community Association (OCA), ADHOC SA, Nimarosa, Moldeo Interactive, Exemax, Codize
COMMITTERS
COMMITTERSWeblate, OCA-git-bot, oca-ci, nicolasrsande
WEBSITE
WEBSITEhttps://github.com/OCA/l10n-argentina
LAST TRACKING UPDATE
LAST TRACKING UPDATE2026-07-06 00:54:00
ODOO DEPENDENCIES
ODOO DEPENDENCIES odoo/odoo:
    - l10n_ar
    - l10n_latam_invoice_document
    - account
    - base_setup
    - base
    - web
    - product
    - mail
    - bus
    - web_tour
    - uom
    - analytic
    - portal
    - web_editor
    - http_routing
    - auth_signup
    - digest
    - resource
    - account_debit_note
    - l10n_latam_base
    - contacts
    - base_vat
PYTHON DEPENDENCIES
PYTHON DEPENDENCIES OpenSSL
future
pysimplesoap
SYSTEM DEPENDENCIES
SYSTEM DEPENDENCIES Not have
DESCRIPTION
DESCRIPTION

Code Analysis

Views touched (9)
XML IDNameModelTypeStatus
res_config_settings_view_form res.config.settings.view.form.inherit.account res.config.settings xpath Inherits account.res_config_settings_view_form
view_afipws_auth_form afipws.auth.form afipws.connection form New
view_afipws_auth_tree afipws.auth.tree afipws.connection tree New
view_afipws_certificate_alias_filter afipws.certificate_alias.filter afipws.certificate_alias search New
view_afipws_certificate_alias_form afipws.certificate_alias.form afipws.certificate_alias form New
view_afipws_certificate_alias_tree afipws.certificate_alias.tree afipws.certificate_alias tree New
view_afipws_certificate_form afipws.certificate.form afipws.certificate form New
view_afipws_certificate_tree afipws.certificate.tree afipws.certificate tree New
view_upload_certificate_form afipws.upload_certificate.wizard.form afipws.upload_certificate.wizard form New
Models touched (6)

New fields (7)
  • alias_id Many2one → afipws.certificate_alias
    auto_join=True index=True ondelete='cascade' required=True string='Certificate Alias' args: 'afipws.certificate_alias'
  • company_id Many2one → res.company
    auto_join=True default=<expr> index=True readonly=True required=True states={'draft': [('readonly', False)]} args: 'res.company', 'Company'
  • crt Text
    help='Certificate in PEM format.' readonly=True states={'draft': [('readonly', False)]} args: 'Certificate'
  • csr Text
    help='Certificate Request in PEM format.' readonly=True states={'draft': [('readonly', False)]} args: 'Request Certificate'
  • request_file Binary
    compute='_compute_request_file' readonly=True store=True args: 'Download Signed Certificate Request'
  • request_filename Char
    compute='_compute_request_file' readonly=True store=True args: 'Filename'
  • state Selection
    default='draft' help="* The 'Draft' state is used when a user is creating a new pair key. Warning: everybody can see the key.\n* The 'Confirmed' state is used when a certificate is valid.\n* The 'Canceled' state is used when the key is not more used. You cant use this key again." index=True readonly=True args: [('draft', 'Draft'), ('confirmed', 'Confirmed'), ('cancel', 'Cancelled')]
Public methods (5)
  • action_cancel(self)
  • action_confirm(self)
  • action_to_draft(self)
  • get_certificate(self)
    Return Certificate object.
  • verify_crt(self)
    Verify if certificate is well formed

New fields (14)
  • certificate_ids One2many → afipws.certificate
    auto_join=True states={'cancel': [('readonly', True)]} args: 'afipws.certificate', 'alias_id', 'Certificates'
  • city Char
    readonly=True required=True states={'draft': [('readonly', False)]}
  • common_name Char
    default='AFIP WS' help='Just a name, you can leave it this way' readonly=True required=True size=64 states={'draft': [('readonly', False)]}
  • company_cuit Char
    readonly=True size=16 states={'draft': [('readonly', False)]} args: 'Company CUIT'
  • company_id Many2one → res.company
    auto_join=True default=<expr> index=True readonly=True required=True states={'draft': [('readonly', False)]} args: 'res.company', 'Company'
  • country_id Many2one → res.country
    readonly=True required=True states={'draft': [('readonly', False)]} args: 'res.country', 'Country'
  • cuit Char
    compute='_compute_cuit' required=True args: 'CUIT'
  • department Char
    default='IT' readonly=True required=True states={'draft': [('readonly', False)]}
  • key Text
    readonly=True states={'draft': [('readonly', False)]} args: 'Private Key'
  • service_provider_cuit Char
    readonly=True size=16 states={'draft': [('readonly', False)]} args: 'Service Provider CUIT'
  • service_type Selection
    default='in_house' readonly=True required=True states={'draft': [('readonly', False)]} args: [('in_house', 'En Casa'), ('outsourced', 'Subcontratado')]
  • state Selection
    default='draft' help="* The 'Draft' state is used when a user is creating a new pair key. Warning: everybody can see the key.\n* The 'Confirmed' state is used when the key is completed with public or private key.\n* The 'Canceled' state is used when the key is not more used. You cant use this key again." index=True readonly=True args: [('draft', 'Borrador'), ('confirmed', 'Confirmado'), ('cancel', 'Cancelado')], 'Status'
  • state_id Many2one → res.country.state
    readonly=True states={'draft': [('readonly', False)]} args: 'res.country.state', 'State'
  • type Selection
    default='production' readonly=True required=True states={'draft': [('readonly', False)]} args: [('production', 'Producción'), ('homologation', 'Homologación')]
Public methods (8)
  • action_cancel(self)
  • action_confirm(self)
  • action_create_certificate_request(self)
    Generates a certificate request to ask AFIP for the certificate
  • action_to_draft(self)
  • change_company_id(self)
    @api.onchange('company_id')
  • change_company_name(self)
    @api.onchange('company_id')
  • check_common_name_len(self)
    @api.constrains('common_name')
  • generate_key(self, key_length=2048)
    Generates a private key with pyafipws

New fields (10)
  • afip_login_url Char
    compute='_compute_afip_urls' args: 'AFIP Login URL'
  • afip_ws Selection
    required=True args: [('ws_sr_padron_a4', 'Servicio de Consulta de Padrón Alcance 4'), ('ws_sr_padron_a5', 'Servicio de Consulta de Padrón Alcance 5'), ('ws_sr_padron_a10', 'Servicio de Consulta de Padrón Alcance 10'), ('ws_sr_padron_a100', 'Servicio de Consulta de Padrón Alcance 100')], 'AFIP WS'
  • afip_ws_url Char
    compute='_compute_afip_urls' args: 'AFIP WS URL'
  • company_id Many2one → res.company
    auto_join=True index=True required=True args: 'res.company', 'Company'
  • expirationtime Datetime
    readonly=True args: 'Expiration Time'
  • generationtime Datetime
    readonly=True args: 'Generation Time'
  • sign Text
    readonly=True
  • token Text
    readonly=True
  • type Selection
    required=True args: [('production', 'Producción'), ('homologation', 'Homologación')]
  • uniqueid Char
    readonly=True args: 'Unique ID'
Public methods (3)
  • connect(self)
    Method to be called
  • get_afip_login_url(self, environment_type)
    @api.model
  • get_afip_ws_url(self, afip_ws, environment_type)
    @api.model
    Function to be inherited on each module that add a new webservice

New fields (2)
  • certificate_file Binary
    required=True args: 'Upload Certificate'
  • certificate_id Many2one → afipws.certificate
    default=get_certificate ondelete='cascade' readonly=True required=True args: 'afipws.certificate'
Public methods (2)
  • action_confirm(self)
  • get_certificate(self)
    @api.model

New fields (3)
  • afip_ws_env_type Selection
    default='production' help='Environment is used to connect AFIP Web Services.\nProduction: This is the connection used in real world.\nHomologation: Use this environment to test AFIP Web Services.' string='AFIP WS Environment' args: [('homologation', 'Homologation'), ('production', 'Production')]
  • alias_ids One2many → afipws.certificate_alias
    auto_join=True args: 'afipws.certificate_alias', 'company_id', 'Aliases'
  • connection_ids One2many → afipws.connection
    auto_join=True args: 'afipws.connection', 'company_id', 'Connections'
Public methods (3)
  • authenticate(self, service, certificate, private_key, force=False, cache='', wsdl='', proxy='')
    @api.model
    Call AFIP Authentication webservice to get token & sign or error message
  • get_connection(self, afip_ws)
  • get_key_and_certificate(self, environment_type)
    Funcion que busca para el environment_type definido, una clave y un certificado en los siguientes lugares y segun estas prioridades: * en el conf del server de odoo * en registros de esta misma clase

New fields (1)
  • afip_ws_env_type Selection
    readonly=False related='company_id.afip_ws_env_type'
Public methods (0)

No public methods.

REPOSITORY
REPOSITORYOCA/l10n-argentina
GIT
GIThttps://github.com/OCA/l10n-argentina.git
GIT FOLDER
GIT FOLDERhttps://github.com/OCA/l10n-argentina/tree/14.0/l10n_ar_afipws
VERSION
VERSION 1.0.1
CATEGORY
CATEGORYAccounting/Localizations
LICENSE
LICENSEAGPL-3
APPLICATION
APPLICATIONNo
AUTO-INSTALLABLE
AUTO-INSTALLABLENo
AUTHORS
AUTHORSOdoo Community Association (OCA), ADHOC SA, Nimarosa, Moldeo Interactive, Exemax, Codize
MAINTAINERS
MAINTAINERSOdoo Community Association (OCA), ADHOC SA, Nimarosa, Moldeo Interactive, Exemax, Codize
COMMITTERS
COMMITTERSWeblate, OCA-git-bot, oca-ci, nicolasrsande, adrianpaesani
WEBSITE
WEBSITEhttps://github.com/OCA/l10n-argentina
LAST TRACKING UPDATE
LAST TRACKING UPDATE2026-07-06 00:41:13
ODOO DEPENDENCIES
ODOO DEPENDENCIES odoo/odoo:
    - l10n_ar
    - l10n_latam_invoice_document
    - account
    - base_setup
    - base
    - web
    - product
    - mail
    - bus
    - web_tour
    - uom
    - analytic
    - portal
    - web_editor
    - http_routing
    - auth_signup
    - digest
    - resource
    - account_debit_note
    - l10n_latam_base
    - contacts
    - base_vat
PYTHON DEPENDENCIES
PYTHON DEPENDENCIES OpenSSL
pysimplesoap
SYSTEM DEPENDENCIES
SYSTEM DEPENDENCIES Not have
DESCRIPTION
DESCRIPTION

Code Analysis

Views touched (9)
XML IDNameModelTypeStatus
res_config_settings_view_form res.config.settings.view.form res.config.settings xpath Inherits account.res_config_settings_view_form
view_afipws_auth_form afipws.auth.form afipws.connection form New
view_afipws_auth_tree afipws.auth.tree afipws.connection tree New
view_afipws_certificate_alias_filter afipws.certificate_alias.filter afipws.certificate_alias search New
view_afipws_certificate_alias_form afipws.certificate_alias.form afipws.certificate_alias form New
view_afipws_certificate_alias_tree afipws.certificate_alias.tree afipws.certificate_alias tree New
view_afipws_certificate_form afipws.certificate.form afipws.certificate form New
view_afipws_certificate_tree afipws.certificate.tree afipws.certificate tree New
view_upload_certificate_form afipws.upload_certificate.wizard.form afipws.upload_certificate.wizard form New
Models touched (6)

New fields (7)
  • alias_id Many2one → afipws.certificate_alias
    auto_join=True index=True ondelete='cascade' required=True string='Certificate Alias' args: 'afipws.certificate_alias'
  • company_id Many2one → res.company
    auto_join=True default=<expr> index=True readonly=True required=True states={'draft': [('readonly', False)]} args: 'res.company', 'Company'
  • crt Text
    help='Certificate in PEM format.' readonly=True states={'draft': [('readonly', False)]} args: 'Certificate'
  • csr Text
    help='Certificate Request in PEM format.' readonly=True states={'draft': [('readonly', False)]} args: 'Request Certificate'
  • request_file Binary
    compute='_compute_request_file' readonly=True store=True args: 'Download Signed Certificate Request'
  • request_filename Char
    compute='_compute_request_file' readonly=True store=True args: 'Filename'
  • state Selection
    default='draft' help="* The 'Draft' state is used when a user is creating a new pair key. Warning: everybody can see the key.\n* The 'Confirmed' state is used when a certificate is valid.\n* The 'Canceled' state is used when the key is not more used. You cant use this key again." index=True readonly=True args: [('draft', 'Draft'), ('confirmed', 'Confirmed'), ('cancel', 'Cancelled')], 'State'
Public methods (5)
  • action_cancel(self)
  • action_confirm(self)
  • action_to_draft(self)
  • get_certificate(self)
    Return Certificate object.
  • verify_crt(self)
    Verify if certificate is well formed

New fields (14)
  • certificate_ids One2many → afipws.certificate
    auto_join=True states={'cancel': [('readonly', True)]} args: 'afipws.certificate', 'alias_id', 'Certificates'
  • city Char
    readonly=True required=True states={'draft': [('readonly', False)]} args: 'City'
  • common_name Char
    default='AFIP WS' help='Just a name, you can leave it this way' readonly=True required=True size=64 states={'draft': [('readonly', False)]} args: 'Common Name'
  • company_cuit Char
    readonly=True size=16 states={'draft': [('readonly', False)]} args: 'Company CUIT'
  • company_id Many2one → res.company
    auto_join=True default=<expr> index=True readonly=True required=True states={'draft': [('readonly', False)]} args: 'res.company', 'Company'
  • country_id Many2one → res.country
    readonly=True required=True states={'draft': [('readonly', False)]} args: 'res.country', 'Country'
  • cuit Char
    compute='_compute_cuit' required=True args: 'CUIT'
  • department Char
    default='IT' readonly=True required=True states={'draft': [('readonly', False)]} args: 'Department'
  • key Text
    readonly=True states={'draft': [('readonly', False)]} args: 'Private Key'
  • service_provider_cuit Char
    readonly=True size=16 states={'draft': [('readonly', False)]} args: 'Service Provider CUIT'
  • service_type Selection
    default='in_house' readonly=True required=True states={'draft': [('readonly', False)]} args: [('in_house', 'En Casa'), ('outsourced', 'Subcontratado')], 'Service Type'
  • state Selection
    default='draft' help="* The 'Draft' state is used when a user is creating a new pair key. Warning: everybody can see the key.\n* The 'Confirmed' state is used when the key is completed with public or private key.\n* The 'Canceled' state is used when the key is not more used. You cant use this key again." index=True readonly=True args: [('draft', 'Borrador'), ('confirmed', 'Confirmado'), ('cancel', 'Cancelado')], 'Status'
  • state_id Many2one → res.country.state
    readonly=True states={'draft': [('readonly', False)]} args: 'res.country.state', 'State'
  • type Selection
    default='production' readonly=True required=True states={'draft': [('readonly', False)]} args: [('production', 'Producción'), ('homologation', 'Homologación')], 'Type'
Public methods (8)
  • action_cancel(self)
  • action_confirm(self)
  • action_create_certificate_request(self)
    Generates a certificate request to ask AFIP for the certificate
  • action_to_draft(self)
  • change_company_id(self)
    @api.onchange('company_id')
  • change_company_name(self)
    @api.onchange('company_id')
  • check_common_name_len(self)
    @api.constrains('common_name')
  • generate_key(self, key_length=2048)
    Generates a private key with pyafipws

New fields (10)
  • afip_login_url Char
    compute='_compute_afip_urls' args: 'AFIP Login URL'
  • afip_ws Selection
    required=True args: [('ws_sr_padron_a4', 'Servicio de Consulta de Padrón Alcance 4'), ('ws_sr_padron_a5', 'Servicio de Consulta de Padrón Alcance 5'), ('ws_sr_padron_a10', 'Servicio de Consulta de Padrón Alcance 10'), ('ws_sr_padron_a100', 'Servicio de Consulta de Padrón Alcance 100')], 'AFIP WS'
  • afip_ws_url Char
    compute='_compute_afip_urls' args: 'AFIP WS URL'
  • company_id Many2one → res.company
    auto_join=True index=True required=True args: 'res.company', 'Company'
  • expirationtime Datetime
    readonly=True args: 'Expiration Time'
  • generationtime Datetime
    readonly=True args: 'Generation Time'
  • sign Text
    readonly=True args: 'Sign'
  • token Text
    readonly=True args: 'Token'
  • type Selection
    required=True args: [('production', 'Producción'), ('homologation', 'Homologación')], 'Type'
  • uniqueid Char
    readonly=True args: 'Unique ID'
Public methods (4)
  • check_afip_ws(self, afip_ws)
  • connect(self)
    Method to be called
  • get_afip_login_url(self, environment_type)
    @api.model
  • get_afip_ws_url(self, afip_ws, environment_type)
    @api.model
    Function to be inherited on each module that add a new webservice

New fields (2)
  • certificate_file Binary
    required=True args: 'Upload Certificate'
  • certificate_id Many2one → afipws.certificate
    default=get_certificate ondelete='cascade' readonly=True required=True args: 'afipws.certificate'
Public methods (2)
  • action_confirm(self)
  • get_certificate(self)
    @api.model

New fields (3)
  • afip_ws_env_type Selection
    default='production' help='Environment is used to connect AFIP Web Services.\nProduction: This is the connection used in real world.\nHomologation: Use this environment to test AFIP Web Services.' string='AFIP WS Environment' args: [('homologation', 'Homologation'), ('production', 'Production')]
  • alias_ids One2many → afipws.certificate_alias
    auto_join=True args: 'afipws.certificate_alias', 'company_id', 'Aliases'
  • connection_ids One2many → afipws.connection
    auto_join=True args: 'afipws.connection', 'company_id', 'Connections'
Public methods (3)
  • authenticate(self, service, certificate, private_key, force=False, cache='', wsdl='', proxy='')
    @api.model
    Call AFIP Authentication webservice to get token & sign or error message
  • get_connection(self, afip_ws)
  • get_key_and_certificate(self, environment_type)
    Funcion que busca para el environment_type definido, una clave y un certificado en los siguientes lugares y segun estas prioridades: * en el conf del server de odoo * en registros de esta misma clase

New fields (1)
  • afip_ws_env_type Selection
    readonly=False related='company_id.afip_ws_env_type'
Public methods (0)

No public methods.