Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
a5d59b1
add intrastat module
luc-demeyer Aug 1, 2017
f8bd26d
[11.0][ADD] l10n_es_intrastat_product_declaration
danielduqma May 28, 2019
403d516
[MIG] l10n_es_intrastat_product: Migration to 12.0
Mar 6, 2020
23312fe
[MIG+IMP+FIX] l10n_es_intrastat_report: Finish migration to 12 + seve…
pedrobaeza May 26, 2020
093f8ca
[FIX] l10n_es_intrastat_report: Allow invoices with no linked purchases
pedrobaeza Jun 30, 2020
df2c1a2
[IMP] l10n_es_intrastat_report: black, isort, prettier
joao-p-marques Feb 2, 2021
edf1e97
[MIG] l10n_es_intrastat_report: Migration to 13.0
joao-p-marques Feb 4, 2021
89fc6c6
[FIX] l10n_es_intrastat_report: Update multi-company rules
joao-p-marques Feb 19, 2021
77bd83d
[MIG] l10n_es_intrastat_report: Migration to 14.0
joao-p-marques Mar 8, 2021
46eb49a
[FIX] l10n_es_intrastat_report: Fix tests
pedrobaeza Apr 23, 2021
012697f
[FIX] l10n_es_intrastat_report: additional check if company's country…
dosipchuk May 24, 2021
c813b81
l10n_es_intrastat_report 14.0.1.0.1
OCA-git-bot May 25, 2021
6ca6ca7
[IMP] l10n_es_intrastat_report: Update intrastat transaction data acc…
victoralmau Sep 7, 2021
44d7c03
l10n_es_intrastat_report 14.0.1.1.0
OCA-git-bot Oct 21, 2021
4fe2506
[IMP] l10n_es_intrastat_report: adaptacion para la nueva presentacion…
ValentinVinagre Dec 28, 2021
6fd456f
[FIX] l10n_es_intrastat_report: Change the link to the codes.
victoralmau Feb 17, 2022
7111a6c
l10n_es_intrastat_report 14.0.2.0.1
OCA-git-bot Feb 18, 2022
74e6216
[IMP] l10n_es_intrastat_report: Add to notes when missing partner_vat…
victoralmau Feb 8, 2022
a726eb9
l10n_es_intrastat_report 14.0.2.1.0
OCA-git-bot Feb 23, 2022
8cb5b03
[FIX] l10n_es_intrastat_report: Test at post-install
pedrobaeza Apr 22, 2022
6af5c84
[FIX] l10n_es_intrastat_report: Change the link to the codes.
victoralmau Feb 17, 2022
6de2dd6
[IMP] l10n_es_intrastat_report: Add to notes when missing partner_vat…
victoralmau Feb 8, 2022
6814b7a
[IMP] l10n_es_intrastat_report: 2022 NC codes
pedrobaeza Apr 8, 2022
4209f77
[MIG] l10n_es_intrastat_report 15.0
flachica May 25, 2022
b1d23cc
[FIX] l10n_es_intrastat_report: Set the correct country code in csv f…
victoralmau Nov 14, 2022
b60f72c
l10n_es_intrastat_report 15.0.1.0.1
OCA-git-bot Nov 15, 2022
538ba59
[FIX] l10n_es_intrastat_report: Search archived records when importin…
victoralmau Feb 17, 2023
bdc336d
[IMP] l10n_es_intrastat_report: 2023 NC codes
victoralmau Feb 13, 2023
c354dbd
l10n_es_intrastat_report 15.0.2.0.0
OCA-git-bot Feb 21, 2023
42ecd77
[IMP] l10n_es_intrastat_report: Improve tests to test an invoice with…
victoralmau Dec 12, 2022
a316184
l10n_es_intrastat_report 15.0.2.0.1
OCA-git-bot Feb 24, 2023
39e39d8
[MIG] l10n_es_intrastat_report: Migration to 16.0
RabbitJon-S73 Jun 20, 2023
8c40506
[UPD] Update l10n_es_intrastat_report.pot
Oct 2, 2023
d3db283
[IMP] l10n_es_intrastat_report: Set the fiscal position "Régimen Intr…
victoralmau Oct 9, 2023
b5cc2ac
[FIX] l10n_es_intrastat_report: Change fp_intra_private to b2c (type …
victoralmau Oct 17, 2023
8fc9fdd
[UPD] Update l10n_es_intrastat_report.pot
Oct 27, 2023
50da501
[UPD] Update l10n_es_intrastat_report.pot
Nov 10, 2023
969c860
[FIX] l10n_es_intrastat_report: Move methods to the correct class + I…
victoralmau Nov 9, 2023
9c2e371
[FIX] l10n_es_intrastat_report: Remove transactions, the data is alre…
victoralmau Nov 9, 2023
1094af5
[UPD] Update l10n_es_intrastat_report.pot
Nov 13, 2023
5cb9076
[FIX] l10n_es_intrastat_report: Do not display missing VAT number err…
aritzolea Nov 27, 2023
6b9e408
[FIX] l10n_es_intrastat_report: Adapt to changes on confirmation
aritzolea Mar 18, 2024
008d483
[IMP] l10n_es_intrastat_report: pre-commit auto fixes
Josep-s73 Jul 8, 2024
ada2a91
[17.0][MIG] l10n_es_intrastat_report
Josep-s73 Jul 16, 2024
57e6e71
[FIX] l10n_es_intrastat_report: Define the appropriate fiscal positio…
victoralmau Aug 1, 2025
c9b9c5a
[FIX] l10n_es_intrastat_report: Define the appropriate data in post_i…
victoralmau Aug 20, 2025
82395a7
[IMP] l10n_es_intrastat_report: pre-commit auto-fixes
LauraCForgeFlow Apr 17, 2025
3879dde
[MIG] l10n_es_intrastat_report: Migration to 18.0
LauraCForgeFlow Apr 17, 2025
345808e
[UPD] Update l10n_es_intrastat_report.pot
Aug 20, 2025
5f71551
[BOT] post-merge updates
OCA-git-bot Aug 20, 2025
c569424
[FIX] l10n_es_intrastat_report: Updated template name
luisDIXMIT Oct 9, 2025
9c99f30
[BOT] post-merge updates
OCA-git-bot Oct 10, 2025
3f49115
[FIX] l10n_es_intrastat_report: Incompatibility with other intrastat
juancarlosonate-tecnativa Apr 2, 2025
fd46a12
[FIX] l10n_es_intrastat_report: views extension mode
LauraCForgeFlow Nov 6, 2025
1fa8ae6
[UPD] Update l10n_es_intrastat_report.pot
Mar 9, 2026
ae685ae
[BOT] post-merge updates
OCA-git-bot Mar 9, 2026
4dcd285
Update translation files
weblate Mar 9, 2026
01c9189
[IMP] l10n_es_intrastat_report: Remove unnecessary code
victoralmau Mar 18, 2026
2cc6af9
[UPD] Update l10n_es_intrastat_report.pot
Mar 25, 2026
197a08b
[BOT] post-merge updates
OCA-git-bot Mar 25, 2026
88fd018
Update translation files
weblate Mar 25, 2026
cde0285
[FIX] l10n_es_intrastat_report: Fix tests (related to the default val…
victoralmau Mar 27, 2026
b22894a
[BOT] post-merge updates
OCA-git-bot Mar 27, 2026
024787e
Translated using Weblate (Spanish)
Ed-Spain Apr 13, 2026
ae889aa
Translated using Weblate (Spanish)
Ed-Spain Apr 16, 2026
76b817c
[IMP] l10n_es_intrastat_report: pre-commit auto fixes
miguelvazquez1 May 5, 2026
2e07824
[MIG] l10n_es_intrastat_report: Migration to 19.0
miguelvazquez1 May 6, 2026
9f854d9
[IMP] l10n_es_intrastat_report: 2026 NC codes
miguelvazquez1 May 6, 2026
bc81c04
[DON'T MERGE] test-requirements.txt
miguelvazquez1 May 6, 2026
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
210 changes: 210 additions & 0 deletions l10n_es_intrastat_report/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,210 @@
.. image:: https://odoo-community.org/readme-banner-image
:target: https://odoo-community.org/get-involved?utm_source=readme
:alt: Odoo Community Association

=======================================
Intrastat Product Declaration for Spain
=======================================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:b08da9bc9f3d3f0105866cd1b2da42a7a3b57bf7720869cb8a7f235fa86d29ba
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/license-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fl10n--spain-lightgray.png?logo=github
:target: https://github.com/OCA/l10n-spain/tree/19.0/l10n_es_intrastat_report
:alt: OCA/l10n-spain
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/l10n-spain-19-0/l10n-spain-19-0-l10n_es_intrastat_report
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/l10n-spain&target_branch=19.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

This module implements the Spanish Intrastat reporting.

The report can be reviewed and corrected where needed before the
creation of the csv file for the declaration.

**Table of contents**

.. contents::
:local:

Installation
============

WARNING: This module conflicts with the Intrastat modules from the
official enterprise addons. If you have already installed these modules,
you should uninstall them before installing this module.

You need to add HS product codes for your company through the
installation wizard. It's automatically launched if installing the
module from the UI.

If any other installation method is used, you can go to *Settings >
Technical > Actions > Configuration Wizards* on developer mode, and
launch there the wizard called "Import Spanish Product HS Codes"

The included codes are for 2026. Please check possible updates for this
codes in:

https://sede.agenciatributaria.gob.es/Sede/estadisticas/estadisticas-comercio-exterior/nomenclatura-combinada-ano.html

This wizard also sets a sane default Intrastat transaction type for each
kind of invoice at company level, but it can be changed later.

Configuration
=============

This module adds the following configuration parameters:

- Company

- Arrivals : Exempt, Standard or Extended
- Dispatches : Exempt, Standard or Extended
- Default Intrastat Transaction
- Default Intrastat Transport Mode (Extended Declaration)
- Default Intrastat Incoterm (Extended Declaration)

- Warehouse

- Intrastat State to cope with warehouses in different states

The configuration of the Intrastat State on a Warehouse, requires a
login belonging to the "Spanish Intrastat Product Declaration"
security group.

- Intrastat Codes, Supplementary Units, Transaction Types, Transport
Modes, States

Cf. menu *Invoicing / Configuration / Miscellaneous / Intrastat
Configuration*

- Product

You can define a default Intrastat Code on the Product or the Product
Category.

Usage
=====

1. Go to *Invocing > Reporting > Intrastat > Spanish Intrastat Product
Declaration*.

2. Create a new record.

3. Select or input following data:

- Year
- Month
- Type: for selecting if arrivals or dispatches.
- Reporting level: standard or extended.
- Action:

- if "Nihil", no recomputation is possible and the report is
considered empty.
- if "Replace", everything is recomputed.
- if "Append", only new lines are added.

4. Click on "Generate Lines from invoices" for populating transaction
lines.

You can review them on "Transactions" page of the report.

5. Click on "Generate Declaration Lines" for populating the lines that
summarize transactions and will be the source for the exports.

You can review them on "Declaration Lines" page.

6. Click on "Generate CSV Declaration Line" for getting the CSV for
declaring the report in AEAT.

7. Click on "Excel Export" for having the information in a spreadsheet.

Known issues / Roadmap
======================

- The current version of the Intrastat reporting module is only based on
invoices. Since associated stock moves are not taken into
consideration, it is possible that manual corrections are required,
e.g.

- Product movements without invoices are not included in the current
version of this module and must be added manually to the report
lines before generating the declaration.

- The current version of the Intrastat reporting module does not perform
a cross-check with the VAT declaration.
- Add tests.

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/l10n-spain/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/l10n-spain/issues/new?body=module:%20l10n_es_intrastat_report%0Aversion:%2019.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Credits
=======

Authors
-------

* FactorLibre
* Noviat
* Tecnativa

Contributors
------------

- Ismael Calvo, FactorLibre <ismael.calvo@factorlibre.com>
- Luc De Meyer, Noviat <info@noviat.com>
- Daniel Duque <daniel.duque@factorlibre.com>
- `Tecnativa <https://www.tecnativa.com>`__:

- Manuel Calero
- Pedro M. Baeza
- João Marques
- Víctor Martínez
- Juan Carlos Oñate

- `Sygel <https://www.sygel.es>`__:

- Harald Panten
- Valentin Vinagre

- `GreenIce <https://www.greenice.com>`__:

- Fernando La Chica

Maintainers
-----------

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

This module is part of the `OCA/l10n-spain <https://github.com/OCA/l10n-spain/tree/19.0/l10n_es_intrastat_report>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
5 changes: 5 additions & 0 deletions l10n_es_intrastat_report/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from . import models
from . import wizards
from . import report
from .hooks import post_init_hook
27 changes: 27 additions & 0 deletions l10n_es_intrastat_report/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Copyright 2016 - FactorLibre - Ismael Calvo <ismael.calvo@factorlibre.com>
# Copyright 2009-2017 Noviat.
# Copyright 2019 - FactorLibre - Daniel Duque <daniel.duque@factorlibre.com>
# Copyright 2020 - Tecnativa - Manuel Calero
# Copyright 2020 - Tecnativa - Pedro M. Baeza
# Copyright 2021 Tecnativa - João Marques
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

{
"name": "Intrastat Product Declaration for Spain",
"version": "19.0.1.0.0",
"category": "Intrastat",
"license": "AGPL-3",
"summary": "Spanish Intrastat Product Declaration",
"author": "FactorLibre,Noviat,Tecnativa,Odoo Community Association (OCA)",
"website": "https://github.com/OCA/l10n-spain",
"depends": ["intrastat_product", "l10n_es_aeat"],
"conflicts": ["report_intrastat"],
"data": [
"security/ir.model.access.csv",
"data/intrastat_transaction.xml",
"views/l10n_es_intrastat_product.xml",
"wizards/l10n_es_intrastat_code_import.xml",
],
"post_init_hook": "post_init_hook",
"installable": True,
}
Binary file not shown.
Binary file added l10n_es_intrastat_report/data/Estruc_NC2023.xlsx
Binary file not shown.
Binary file added l10n_es_intrastat_report/data/NC_20.xls
Binary file not shown.
82 changes: 82 additions & 0 deletions l10n_es_intrastat_report/data/intrastat_transaction.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo noupdate="1">
<record id="intrastat_transaction_13" model="intrastat.transaction">
<field name="code">13</field>
<field
name="description"
>Transacciones que supongan un traspaso de propiedad real o previsto de residentes a no residentes a cambio de una compensación financiera o de otro tipo: Trueque (compensación en especie).</field>
<field name="company_id" eval="False" />
<field name="active" eval="False" />
</record>
<record id="intrastat_transaction_14" model="intrastat.transaction">
<field name="code">14</field>
<field
name="description"
>Transacciones que supongan un traspaso de propiedad real o previsto de residentes a no residentes a cambio de una compensación financiera o de otro tipo: Arrendamiento financiero (alquiler - compra).</field>
<field name="company_id" eval="False" />
<field name="active" eval="False" />
</record>
<record id="intrastat_transaction_19" model="intrastat.transaction">
<field name="code">19</field>
<field
name="description"
>Transacciones que supongan un traspaso de propiedad real o previsto de residentes a no residentes a cambio de una compensación financiera o de otro tipo: Otras.</field>
<field name="company_id" eval="False" />
<field name="active" eval="False" />
</record>
<record id="intrastat_transaction_29" model="intrastat.transaction">
<field name="code">29</field>
<field
name="description"
>Devolución y sustitución gratuita de mercancías después del registro de la transacción original: Otras.</field>
<field name="company_id" eval="False" />
<field name="active" eval="False" />
</record>
<record id="intrastat_transaction_44" model="intrastat.transaction">
<field name="code">44</field>
<field
name="description"
>Operaciones con vistas a un perfeccionamiento bajo contrato (no se traspasa la propiedad al contratista): Reparación o mantenimiento a título gratuito.</field>
<field name="company_id" eval="False" />
<field name="active" eval="False" />
</record>
<record id="intrastat_transaction_45" model="intrastat.transaction">
<field name="code">45</field>
<field
name="description"
>Operaciones con vistas a un perfeccionamiento bajo contrato (no se traspasa la propiedad al contratista): Reparación o mantenimiento a título oneroso.</field>
<field name="company_id" eval="False" />
<field name="active" eval="False" />
</record>
<record id="intrastat_transaction_54" model="intrastat.transaction">
<field name="code">54</field>
<field
name="description"
>Operaciones posteriores al perfeccionamiento bajo contrato (no se traspasa la propiedad al contratista): Reparación o mantenimiento a título gratuito.</field>
<field name="company_id" eval="False" />
<field name="active" eval="False" />
</record>
<record id="intrastat_transaction_55" model="intrastat.transaction">
<field name="code">55</field>
<field
name="description"
>Operaciones posteriores al perfeccionamiento bajo contrato (no se traspasa la propiedad al contratista): Reparación o mantenimiento a título oneroso.</field>
<field name="company_id" eval="False" />
<field name="active" eval="False" />
</record>
<record id="intrastat_transaction_60" model="intrastat.transaction">
<field name="code">60</field>
<field
name="description"
>Transacciones particulares registradas para fines nacionales, como reparaciones.</field>
<field name="company_id" eval="False" />
</record>
<record id="intrastat_transaction_70" model="intrastat.transaction">
<field name="code">70</field>
<field
name="description"
>Operaciones en el marco de programas comunes de defensa u otros programas intergubernamentales de producción conjunta.</field>
<field name="company_id" eval="False" />
<field name="active" eval="False" />
</record>
</odoo>
36 changes: 36 additions & 0 deletions l10n_es_intrastat_report/hooks.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Copyright 2020 ACSONE SA/NV
# Copyright 2025 Tecnativa - Víctor Martínez
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).


def post_init_hook(env):
"""Set the intrastat field of the private fiscal position records.
This is necessary for the intrastat report generation
"""
b2b_items = env["ir.model.data"].search(
[
("model", "=", "account.fiscal.position"),
("name", "like", "%_fp_intra"),
("module", "=", "account"),
]
)
b2c_items = env["ir.model.data"].search(
[
("model", "=", "account.fiscal.position"),
("name", "like", "%_fp_intra_private"),
("module", "=", "account"),
]
)
# Avoid modifying fiscal positions created with accounting plans other than l10n_es
env["account.fiscal.position"].search(
[
("id", "in", b2b_items.mapped("res_id")),
("company_id.chart_template", "like", "es_%"),
]
).write({"intrastat": "b2b", "vat_required": True})
env["account.fiscal.position"].search(
[
("id", "in", b2c_items.mapped("res_id")),
("company_id.chart_template", "like", "es_%"),
]
).write({"intrastat": "b2c", "vat_required": False})
Loading
Loading