Repository
OCA/l10n-spain · module folder · Try on Runboat
Module version
Category
Accounting & Finance
Folder size
1.82 MB
License
AGPL-3
Application
No
Auto-installable
No
Website
https://github.com/OCA/l10n-spain
Last tracking update
2026-08-11 17:30:51
Authors
Odoo Community Association (OCA), Pexego, Acysos S.L., AvanzOSC, Tecnativa
Maintainers
Odoo Community Association (OCA), Pexego, Acysos S.L., AvanzOSC, Tecnativa
Committers
Pedro M. Baeza, Víctor Martínez, Emilio Pascual, Weblate, OCA-git-bot, Oihane Crucelaegui, oca-ci, Angel Rivas, Pablo Cortés, skanndar, Oscarbol09
Odoo dependencies
OCA/account-financial-reporting:
OCA/server-ux:
odoo/odoo:
- web
- bus
- uom
Python dependencies
unidecode
System dependencies
None
Required by
l10n_es_account_asset, l10n_es_aeat_mod111, l10n_es_aeat_mod115, l10n_es_aeat_mod123, l10n_es_aeat_mod130, l10n_es_aeat_mod190, l10n_es_aeat_mod216, l10n_es_aeat_mod296, l10n_es_aeat_mod303, l10n_es_aeat_mod347, l10n_es_aeat_mod349, l10n_es_aeat_partner_check, l10n_es_aeat_sii_oca, l10n_es_facturae, l10n_es_intrastat_report, l10n_es_vat_book
Description
Módulo base para declaraciones de la AEAT, que incluye:

- Campos base para todo los modelos AEAT.
- Vista base para todos los modelos.
- Crea una secuencia automática para los registros diferenciando por
  modelo.
- Exportación del BOE. Define una exportación básica, con los diferentes
  registros del fichero.
- Generación del registro del declarante con los campos genéricos de los
  modelos.
- Motor de exportación paramétrica basado en una configuración que puede
  ser introducida por datos XML o por interfaz.
- Visor de archivos BOE asociados a la configuración de exportación.
- Motor de cálculo de importes por impuestos.
- Generador del asiento de regularización con cargo a un proveedor
  "Agencia Estatal de Administración Tributaria" creado al efecto.
- Certificado para las declaraciones de la AEAT
- Webservice AEAT SOAP

Code Analysis

Views touched (28)
XML IDNameModelTypeStatus
account_tax_view_form account.tax form Inherits account.view_tax_form
account_tax_view_tree account.tax tree Inherits account.view_tax_tree
aeat_model_export_config_form aeat.model.export.config.form aeat.model.export.config form New
aeat_model_export_config_line_form aeat.model.export.config.line.form aeat.model.export.config.line form New
aeat_model_export_config_line_tree aeat.model.export.config.line.tree aeat.model.export.config.line list New
aeat_model_export_config_search aeat.model.export.config search New
aeat_model_export_config_tree aeat.model.export.config.tree aeat.model.export.config list New
aeat_tax_agency_form_view aeat.tax.agency.form aeat.tax.agency form New
aeat_tax_agency_tree_view aeat.tax.agency.tree aeat.tax.agency list New
l10n_es_aeat_certificate_form_view l10n.es.aeat.certificate.form l10n.es.aeat.certificate form New
l10n_es_aeat_certificate_password_wizard_view l10n.es.aeat.certificate.password.wizard l10n.es.aeat.certificate.password form New
l10n_es_aeat_map_tax_form l10n.es.aeat.map.tax form New
l10n_es_aeat_map_tax_line_form l10n.es.aeat.map.tax.line form New
l10n_es_aeat_map_tax_line_tree l10n.es.aeat.map.tax.line list New
l10n_es_aeat_map_tax_tree l10n.es.aeat.map.tax list New
l10n_es_certificate_tree_view l10n.es.aeat.certificate.tree l10n.es.aeat.certificate list New
view_account_journal_form account.journal form Inherits account.view_account_journal_form
view_company_aeat_form res.company.aeat.form res.company form Inherits base.view_company_form
view_l10n_es_aeat_report_form l10n_es.aeat.report.form l10n.es.aeat.report form New
view_l10n_es_aeat_report_search AEAT Model (search) l10n.es.aeat.report search New
view_l10n_es_aeat_report_tree l10n_es.aeat.report.tree l10n.es.aeat.report list New
view_l10n_es_aeat_tax_line_form l10n.es.aeat.tax.line.form l10n.es.aeat.tax.line form New
view_l10n_es_aeat_tax_line_tree l10n.es.aeat.tax.line.tree l10n.es.aeat.tax.line list New
view_move_form account.move form Inherits account.view_move_form
view_move_line_tree account.move.line tree Inherits account.view_move_line_tree
view_partner_form res.partner form Inherits account.view_partner_property_form
wizard_aeat_export Export AEAT BOE file l10n.es.aeat.report.export_to_boe form New
wizard_compare_boe_file Compare BOE file wizard l10n.es.aeat.report.compare_boe_file form New
HTTP endpoints (0)

No HTTP endpoints found for this module.

Models touched (26)

New fields (1)
  • aeat_active Boolean
    copy=False default=True help='Enable AEAT communication for this fiscal position?' string='AEAT Active'
Public methods (0)

No public methods.

New fields (2)
  • tax_agency_id Many2one → aeat.tax.agency
    comodel_name='aeat.tax.agency' copy=False help='You can select a tax agency other than the one defined in the company,so you can pay taxes at different agencies.' string='Tax Agency'
  • thirdparty_invoice Boolean
    copy=False string='Third-party invoice'
Public methods (0)

No public methods.

New fields (2)
  • thirdparty_invoice Boolean
    compute='_compute_thirdparty_invoice' copy=False readonly=False store=True string='Third-party invoice'
  • thirdparty_number Char
    copy=False help='Número de la factura emitida por un tercero.' index=True string='Third-party number'
Public methods (0)

No public methods.

New fields (0)

No new fields.

Public methods (0)

No public methods.

New fields (1)
  • aeat_equivalent_tax_id Many2one → account.tax
    comodel_name='account.tax' help='This field is for manually created taxes in order to allow to map them for AEAT reports' string='Equivalent Tax (for AEAT mapping purposes)'
Public methods (3)
  • copy_data(self, default=None)
  • create(self, vals_list)
    @api.model_create_multi
    Invalidate company cache that links templates with taxes as there are potential new taxes that can match.
  • unlink(self)
    Invalidate company cache that links templates with taxes for not returning a potential invalid tax that has been unlinked.

New fields (5)
  • aeat_content_sent Text
    copy=False readonly=True string='AEAT last content sent'
  • aeat_header_sent Text
    copy=False readonly=True string='AEAT last header sent'
  • aeat_send_error Text
    copy=False readonly=True string='AEAT Send Error'
  • aeat_send_failed Boolean
    copy=False help='Indicates that the last attempt to communicate this document to the SII has failed. See SII return for details' string='SII send failed'
  • aeat_state Selection
    copy=False default='not_sent' help='Indicates the state of this document in relation with the presentation at the AEAT' readonly=True selection=AEAT_STATES string='AEAT send state'
Public methods (0)

No public methods.

New fields (7)
  • active Boolean
    default=True
  • config_line_ids One2many → aeat.model.export.config.line
    comodel_name='aeat.model.export.config.line' inverse_name='export_config_id' string='Lines'
  • date_end Date
    string='Ending date'
  • date_start Date
    string='Starting date'
  • model_id Many2one → ir.model
    comodel_name='ir.model' string='Odoo model'
  • model_number Char
    size=3
  • name Char
Public methods (0)

No public methods.

New fields (21)
  • alignment Selection
    compute='_compute_alignment' readonly=False selection=[('left', 'Left'), ('right', 'Right')] store=True
  • apply_sign Boolean
    compute='_compute_apply_sign' readonly=False store=True
  • bool_no Char
    default=' ' size=1 string='Value for no'
  • bool_yes Char
    default='X' size=1 string='Value for yes'
  • conditional Boolean
    compute='_compute_conditional' store=True
  • conditional_expression Char
    help='If set, this expression will be used to evaluate if this line should be added'
  • decimal_size Integer
    compute='_compute_decimal_size' readonly=False store=True string='Number of char for decimals'
  • export_config_id Many2one → aeat.model.export.config
    comodel_name='aeat.model.export.config' ondelete='cascade' required=True string='Config parent'
  • export_type Selection
    default='string' required=True selection=[('string', 'Alphanumeric'), ('alphabetic', 'Alphabetic'), ('float', 'Number with decimals'), ('integer', 'Number without decimals'), ('boolean', 'Boolean'), ('subconfig', 'Sub-configuration')] string='Export field type'
  • expression Char
  • fixed_value Char
  • name Char
    required=True
  • negative_sign Char
    default='N' size=1 string='Negative sign character'
  • position Integer
    compute='_compute_position'
  • positive_sign Char
    default='0' size=1 string='Positive sign character'
  • repeat Boolean
    compute='_compute_repeat' store=True
  • repeat_expression Char
    help='If set, this expression will be used for getting the list of elements to iterate on'
  • sequence Integer
  • size Integer
    string='Field size'
  • subconfig_id Many2one → aeat.model.export.config
    comodel_name='aeat.model.export.config' string='Sub-configuration'
  • value Char
    compute='_compute_value' store=True
Public methods (0)

No public methods.

New fields (1)
  • name Char
    required=True
Public methods (0)

No public methods.

New fields (0)

No new fields.

Public methods (3)
  • aeat_cancel_now(self)
  • aeat_do_now(self)
  • aeat_reschedule_sudo(self)

New fields (13)
  • company_id Many2one → res.company
    comodel_name='res.company' default=<expr> required=True string='Company'
  • date_end Date
    string='End Date'
  • date_start Date
    string='Start Date'
  • file Binary
    required=True
  • folder Char
    required=True string='Folder Name'
  • name Char
  • private_key Char
    readonly=True
  • public_key Char
    readonly=True
  • public_key_data Text
    readonly=True store=False
  • public_key_file Binary
    attachment=False compute='_compute_public_key' groups='l10n_es_aeat.group_account_aeat' readonly=True store=False
  • public_key_filename Char
    compute='_compute_public_key' groups='l10n_es_aeat.group_account_aeat' readonly=True store=False
  • show_public_key Boolean
    store=False
  • state Selection
    default='draft' selection=[('draft', 'Draft'), ('active', 'Active')]
Public methods (5)
  • action_active(self)
  • get_certificates(self, company=False)
  • get_public_key_pem(self)
  • load_password_wizard(self)
  • onchange_public_key_data(self)
    @api.onchange('show_public_key')

New fields (1)
  • password Char
    required=True
Public methods (1)
  • get_keys(self)

New fields (6)
  • date_from Date
    string='From Date'
  • date_from_search Date
    compute='_compute_date_from_search' store=True
  • date_to Date
    string='To Date'
  • date_to_search Date
    compute='_compute_date_to_search' store=True
  • map_line_ids One2many → l10n.es.aeat.map.tax.line
    comodel_name='l10n.es.aeat.map.tax.line' inverse_name='map_parent_id' required=True string='Map lines'
  • model Integer
    required=True string='AEAT Model'
Public methods (0)

No public methods.

New fields (11)
  • account_xmlid_ids Many2many → l10n.es.aeat.map.tax.line.account
    comodel_name='l10n.es.aeat.map.tax.line.account' string='Account Template'
  • exigible_type Selection
    default='yes' required=True selection=[('yes', 'Only exigible amounts'), ('no', 'Only non-exigible amounts'), ('both', 'Both exigible and non-exigible amounts')] string='Exigibility'
  • field_number Integer
    required=True
  • field_type Selection
    default='amount' required=True selection=[('base', 'Base'), ('amount', 'Amount'), ('both', 'Both')]
  • inverse Boolean
    default=False string='Inverse summarize sign'
  • map_parent_id Many2one → l10n.es.aeat.map.tax
    comodel_name='l10n.es.aeat.map.tax' required=True
  • move_type Selection
    default='all' required=True selection=[('all', 'All'), ('regular', 'Regular'), ('refund', 'Refund')] string='Operation type'
  • name Char
    required=True
  • sum_type Selection
    default='both' required=True selection=[('credit', 'Credit'), ('debit', 'Debit'), ('both', 'Both (Credit - Debit)')] string='Summarize type'
  • tax_xmlid_ids Many2many → l10n.es.aeat.map.tax.line.tax
    comodel_name='l10n.es.aeat.map.tax.line.tax' string='Taxes templates'
  • to_regularize Boolean
Public methods (2)
  • get_accounts_for_company(self, company)
    Obtain the accounts corresponding to the line according the given company.
  • get_taxes_for_company(self, company)
    Obtain the taxes corresponding to this line according the given company.

New fields (1)
  • name Char
Public methods (0)

No public methods.

New fields (1)
  • name Char
Public methods (0)

No public methods.

New fields (27)
  • allow_posting Boolean
    compute='_compute_allow_posting'
  • calculation_date Datetime
  • company_id Many2one → res.company
    comodel_name='res.company' default=<expr> required=True string='Company'
  • company_vat Char
    required=True size=9 string='VAT number'
  • contact_email Char
    size=50
  • contact_name Char
    help='Must have name and surname.' readonly=True required=True size=40 string='Full Name'
  • contact_phone Char
    required=True size=9 string='Phone'
  • counterpart_account_id Many2one → account.account
    comodel_name='account.account' help='This account will be the counterpart for all the journal items that are regularized when posting the report.' string='Counterpart account'
  • currency_id Many2one → res.currency
    comodel_name='res.currency' readonly=True related='company_id.currency_id' string='Currency'
  • date_end Date
    compute='_compute_dates' required=True store=True string='Ending date'
  • date_start Date
    compute='_compute_dates' required=True store=True string='Starting date'
  • error_count Integer
    compute='_compute_error_count'
  • export_config_id Many2one → aeat.model.export.config
    comodel_name='aeat.model.export.config' compute='_compute_export_config_id' domain=<expr> readonly=False store=True string='Export config'
  • journal_id Many2one → account.journal
    comodel_name='account.journal' default=<expr> domain="[('type', '=', 'general'), ('company_id', '=', company_id)]" help='Journal in which post the move.' string='Journal'
  • move_id Many2one → account.move
    comodel_name='account.move' domain=[('type', '=', 'entry')] readonly=True string='Account entry'
  • name Char
    copy=False size=13 string='Report identifier'
  • number Char
    default=<expr> readonly=True required=True size=3 string='Model number'
  • partner_bank_id Many2one → res.partner.bank
    comodel_name='res.partner.bank' domain="[('acc_type', '=', 'iban'), ('partner_id', '=', partner_id)]" help='Company bank account used for the presentation' string='Bank account'
  • partner_id Many2one → res.partner
    comodel_name='res.partner' readonly=True related='company_id.partner_id' string='Partner'
  • period_type Selection
    default=<expr> required=True selection='get_period_type_selection'
  • previous_number Char
    size=13 string='Previous declaration number'
  • representative_vat Char
    compute='_compute_representative_vat' help='Legal Representative VAT number.' readonly=False size=9 store=True string='L.R. VAT number'
  • state Selection
    default='draft' readonly=True selection=[('draft', 'Draft'), ('calculated', 'Processed'), ('done', 'Done'), ('posted', 'Posted'), ('cancelled', 'Cancelled')] tracking=True
  • statement_type Selection
    default='N' required=True selection=[('N', 'Normal'), ('C', 'Complementary'), ('S', 'Substitutive')]
  • support_type Selection
    default='T' required=True selection=[('C', 'DVD'), ('T', 'Telematics')]
  • tax_agency_ids Many2many → aeat.tax.agency
    string='Tax Agency' args: 'aeat.tax.agency'
  • year Integer
    default=<expr> required=True
Public methods (14)
  • button_calculate(self)
  • button_cancel(self)
    Set report status to cancelled.
  • button_confirm(self)
    Set report status to done.
  • button_open_move(self)
  • button_post(self)
    Create any possible account move entry and set state to posted.
  • button_recalculate(self)
  • button_recover(self)
    Set report status to draft and reset calculation date.
  • button_unpost(self)
    Remove created account move entry and set state to cancelled.
  • calculate(self)
    To be overrided by inherit models
  • create(self, vals_list)
    @api.model_create_multi
  • get_html(self)
    @api.model
    Render dynamic view from ir.action.client
  • get_period_type_selection(self)
  • onchange_company_id(self)
    @api.onchange('company_id')
    Load some company data (the VAT number) when company changes.
  • unlink(self)

New fields (3)
  • data Binary
    required=True string='File'
  • line_ids One2many → l10n.es.aeat.report.compare_boe_file.line
    comodel_name='l10n.es.aeat.report.compare_boe_file.line' inverse_name='wizard_id' string='Lines'
  • state Selection
    default='open' selection=[('open', 'open'), ('compare', 'compare')]
Public methods (1)
  • button_compare_file(self)
    Method that compares a file against a BOE export config. @return: Action dictionary for showing comparison.

New fields (6)
  • content Char
  • content_float Float
    compute='_compute_content_float' string='Amount'
  • export_line_id Many2one → aeat.model.export.config.line
    comodel_name='aeat.model.export.config.line' ondelete='cascade' readonly=True required=True string='Export line'
  • name Char
    readonly=True related='export_line_id.name' string='Name'
  • sequence Integer
    readonly=True related='export_line_id.sequence' string='Sequence'
  • wizard_id Many2one → l10n.es.aeat.report.compare_boe_file
    comodel_name='l10n.es.aeat.report.compare_boe_file' ondelete='cascade' readonly=True required=True string='Wizard'
Public methods (0)

No public methods.

New fields (3)
  • data Binary
    readonly=True string='File'
  • name Char
    readonly=True string='File name'
  • state Selection
    default='open' selection=[('open', 'open'), ('get', 'get')]
Public methods (2)
  • action_get_file(self)
    Action that exports the data into a BOE formatted text file. @return: Action dictionary for showing exported file.
  • action_get_file_from_config(self, report)

New fields (2)
  • tax_line_ids One2many → l10n.es.aeat.tax.line
    bypass_search_access=True comodel_name='l10n.es.aeat.tax.line' domain=<expr> inverse_name='res_id' readonly=True string='Tax lines'
  • valued_tax_line_ids One2many → l10n.es.aeat.tax.line
    bypass_search_access=True comodel_name='l10n.es.aeat.tax.line' domain=<expr> inverse_name='res_id' readonly=True string='Valued tax lines'
Public methods (3)
  • calculate(self)
  • create_regularization_move(self)
  • unlink(self)

New fields (0)

No new fields.

Public methods (4)
  • connect_soap(self, wsdl, model)
  • connect_wsdl(self, service, wsdl, port_name, model)
  • get_test_mode(self, port_name, model)
  • send_soap(self, service, wsdl, port_name, model, operation, *args)

New fields (8)
  • amount Float
    digits='Account'
  • field_number Integer
    readonly=True related='map_line_id.field_number' store=True string='Field number'
  • map_line_id Many2one → l10n.es.aeat.map.tax.line
    comodel_name='l10n.es.aeat.map.tax.line' ondelete='cascade' required=True string='Map line'
  • model Char
    index=True readonly=True required=True string='Model name'
  • move_line_ids Many2many → account.move.line
    comodel_name='account.move.line' string='Journal items'
  • name Char
    readonly=True related='map_line_id.name' store=True string='Name'
  • res_id Integer
    index=True required=True string='Resource ID'
  • to_regularize Boolean
    readonly=True related='map_line_id.to_regularize'
Public methods (1)
  • get_calculated_move_lines(self)

New fields (2)
  • representative_vat Char
    help='Legal Representative VAT number for all the AEAT reports of this company.' size=9 string='L.R. VAT number'
  • tax_agency_id Many2one → aeat.tax.agency
    string='Tax Agency' args: 'aeat.tax.agency'
Public methods (1)
  • create(self, vals_list)
    @api.model_create_multi
    Create immediately all the AEAT sequences when creating company.

New fields (5)
  • aeat_anonymous_cash_customer Boolean
    help='Check this for anonymous cash customer. AEAT communication' string='AEAT - Anonymous customer'
  • aeat_identification Char
    help='Identification for AEAT purposes'
  • aeat_identification_type Selection
    help="Used to specify an identification type to send to AEAT. Normally for sending national and export invoices to AEAT where the customer country is not Spain, it would calculate an identification type of 04 if the VAT field is filled and 06 if it was not. This field is to specify types of 03 through 05, in the event that the customer doesn't identify with a foreign VAT and instead with their passport or residential certificate. If there is no value it will work as before." selection=[('03', 'Passport'), ('05', 'Residential certificate'), ('06', 'Another document')] string='AEAT Identification type'
  • aeat_sending_enabled Boolean
    compute='_compute_aeat_sending_enabled'
  • aeat_simplified_invoice Boolean
    help='Checking this mark, invoices done to this partner will be sent to AEAT as simplified invoices.' string='Simplified invoices in AEAT?'
Public methods (0)

No public methods.

New fields (1)
  • acc_type Selection
    store=True
Public methods (0)

No public methods.

Loading…

Loading…

Loading…

Loading…

Loading…

Loading…

Loading…

Loading…

Loading…

Loading…

Loading…

Loading…

Loading…