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

[17.0][MIG] l10n_es_intrastat_report #3663

Merged
merged 44 commits into from
Nov 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
6d875f3
add intrastat module
luc-demeyer Aug 1, 2017
c63fe71
[11.0][ADD] l10n_es_intrastat_product_declaration
danielduqma May 28, 2019
678a716
[MIG] l10n_es_intrastat_product: Migration to 12.0
Mar 6, 2020
c7b73fb
[MIG+IMP+FIX] l10n_es_intrastat_report: Finish migration to 12 + seve…
pedrobaeza May 26, 2020
39af32e
[FIX] l10n_es_intrastat_report: Allow invoices with no linked purchases
pedrobaeza Jun 30, 2020
7985186
[IMP] l10n_es_intrastat_report: black, isort, prettier
joao-p-marques Feb 2, 2021
bae92fb
[MIG] l10n_es_intrastat_report: Migration to 13.0
joao-p-marques Feb 4, 2021
110d187
[FIX] l10n_es_intrastat_report: Update multi-company rules
joao-p-marques Feb 19, 2021
a0ca149
[MIG] l10n_es_intrastat_report: Migration to 14.0
joao-p-marques Mar 8, 2021
f841ff0
[FIX] l10n_es_intrastat_report: Fix tests
pedrobaeza Apr 23, 2021
b7574ae
[FIX] l10n_es_intrastat_report: additional check if company's country…
dosipchuk May 24, 2021
4edd5ac
l10n_es_intrastat_report 14.0.1.0.1
OCA-git-bot May 25, 2021
959e3b3
[IMP] l10n_es_intrastat_report: Update intrastat transaction data acc…
victoralmau Sep 7, 2021
7426ead
l10n_es_intrastat_report 14.0.1.1.0
OCA-git-bot Oct 21, 2021
94e109e
[IMP] l10n_es_intrastat_report: adaptacion para la nueva presentacion…
ValentinVinagre Dec 28, 2021
fea1898
[FIX] l10n_es_intrastat_report: Change the link to the codes.
victoralmau Feb 17, 2022
f37639f
l10n_es_intrastat_report 14.0.2.0.1
OCA-git-bot Feb 18, 2022
bf7d479
[IMP] l10n_es_intrastat_report: Add to notes when missing partner_vat…
victoralmau Feb 8, 2022
2d23316
l10n_es_intrastat_report 14.0.2.1.0
OCA-git-bot Feb 23, 2022
219ecdf
[FIX] l10n_es_intrastat_report: Test at post-install
pedrobaeza Apr 22, 2022
ca84fd9
[FIX] l10n_es_intrastat_report: Change the link to the codes.
victoralmau Feb 17, 2022
a6af3ed
[IMP] l10n_es_intrastat_report: Add to notes when missing partner_vat…
victoralmau Feb 8, 2022
e74a2a5
[IMP] l10n_es_intrastat_report: 2022 NC codes
pedrobaeza Apr 8, 2022
d20c49d
[MIG] l10n_es_intrastat_report 15.0
flachica May 25, 2022
29e9a53
[FIX] l10n_es_intrastat_report: Set the correct country code in csv f…
victoralmau Nov 14, 2022
3712f32
l10n_es_intrastat_report 15.0.1.0.1
OCA-git-bot Nov 15, 2022
4124352
[FIX] l10n_es_intrastat_report: Search archived records when importin…
victoralmau Feb 17, 2023
bdc9453
[IMP] l10n_es_intrastat_report: 2023 NC codes
victoralmau Feb 13, 2023
9cf99cd
l10n_es_intrastat_report 15.0.2.0.0
OCA-git-bot Feb 21, 2023
f98d672
[IMP] l10n_es_intrastat_report: Improve tests to test an invoice with…
victoralmau Dec 12, 2022
756a849
l10n_es_intrastat_report 15.0.2.0.1
OCA-git-bot Feb 24, 2023
87bde80
[MIG] l10n_es_intrastat_report: Migration to 16.0
RabbitJon-S73 Jun 20, 2023
09c9989
[UPD] Update l10n_es_intrastat_report.pot
Oct 2, 2023
d25c357
[IMP] l10n_es_intrastat_report: Set the fiscal position "Régimen Intr…
victoralmau Oct 9, 2023
f065f38
[FIX] l10n_es_intrastat_report: Change fp_intra_private to b2c (type …
victoralmau Oct 17, 2023
182e881
[UPD] Update l10n_es_intrastat_report.pot
Oct 27, 2023
a611426
[UPD] Update l10n_es_intrastat_report.pot
Nov 10, 2023
4e86e43
[FIX] l10n_es_intrastat_report: Move methods to the correct class + I…
victoralmau Nov 9, 2023
ef3b731
[FIX] l10n_es_intrastat_report: Remove transactions, the data is alre…
victoralmau Nov 9, 2023
c797860
[UPD] Update l10n_es_intrastat_report.pot
Nov 13, 2023
e9dd36f
[FIX] l10n_es_intrastat_report: Do not display missing VAT number err…
aritzolea Nov 27, 2023
204c03a
[FIX] l10n_es_intrastat_report: Adapt to changes on confirmation
aritzolea Mar 18, 2024
0a6c39d
[IMP] l10n_es_intrastat_report: pre-commit auto fixes
Josep-s73 Jul 8, 2024
e325148
[17.0][MIG] l10n_es_intrastat_report
Josep-s73 Jul 16, 2024
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
205 changes: 205 additions & 0 deletions l10n_es_intrastat_report/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,205 @@
=======================================
Intrastat Product Declaration for Spain
=======================================

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

.. |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/licence-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/17.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-17-0/l10n-spain-17-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=17.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 2023. 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:%2017.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 <[email protected]>
- Luc De Meyer, Noviat <[email protected]>
- Daniel Duque <[email protected]>
- `Tecnativa <https://www.tecnativa.com>`__:

- Manuel Calero
- Pedro M. Baeza
- João Marques
- Víctor Martínez

- `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/17.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 <[email protected]>
# Copyright 2009-2017 Noviat.
# Copyright 2019 - FactorLibre - Daniel Duque <[email protected]>
# 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": "17.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 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>
18 changes: 18 additions & 0 deletions l10n_es_intrastat_report/hooks.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Copyright 2020 ACSONE SA/NV
# 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
"""
items = env["ir.model.data"].search(
[
("model", "=", "account.fiscal.position"),
("name", "like", "%_fp_intra%"),
("module", "=", "l10n_es"),
]
)
env["account.fiscal.position"].browse(items.mapped("res_id")).write(
{"intrastat": "b2b", "vat_required": True}
)
Loading
Loading