Skip to content

Commit

Permalink
Merge PR #511 into 17.0
Browse files Browse the repository at this point in the history
Signed-off-by alexis-via
  • Loading branch information
OCA-git-bot committed Jan 24, 2024
2 parents dff8fd8 + 1a757b5 commit 6bb14cc
Show file tree
Hide file tree
Showing 39 changed files with 11,315 additions and 0 deletions.
104 changes: 104 additions & 0 deletions l10n_fr_intrastat_service/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
===
DES
===

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:c08e716afb48f738a270af33bd39f5065b3c949f6fcae1366b8c6ff7930e1813
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |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--france-lightgray.png?logo=github
:target: https://github.com/OCA/l10n-france/tree/17.0/l10n_fr_intrastat_service
:alt: OCA/l10n-france
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/l10n-france-17-0/l10n-france-17-0-l10n_fr_intrastat_service
: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-france&target_branch=17.0
:alt: Try me on Runboat

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

This module adds support for the **Déclaration Européenne des Services**
(DES) for France.

The DES declaration has been introduced on January 1st 2010 in France.
All French companies must send this declaration each month to France's
Customs administration if they sell services without VAT to other EU
companies.

More information about the DES is available on this `official web
page <https://www.douane.gouv.fr/service-en-ligne/declaration-europeenne-de-services-des>`__.

**Table of contents**

.. contents::
:local:

Usage
=====

To use this module, you need to go to the menu Invoicing > Reports >
Intrastat > DES and create a new DES. Then, click on the button
*Generate lines from invoices* to automatically generate the lines of
DES. After checking the lines that have been automatically generated,
click on the button *Attach XML file* to create the XML file
corresponding to the DES. Eventually, connect to your account on
`pro.douane <https://pro.douane.gouv.fr/>`__ and upload the XML file.

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

Bugs are tracked on `GitHub Issues <https://github.com/OCA/l10n-france/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-france/issues/new?body=module:%20l10n_fr_intrastat_service%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
-------

* Akretion

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

- Alexis de Lattre <[email protected]>

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.

.. |maintainer-alexis-via| image:: https://github.com/alexis-via.png?size=40px
:target: https://github.com/alexis-via
:alt: alexis-via

Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-alexis-via|

This module is part of the `OCA/l10n-france <https://github.com/OCA/l10n-france/tree/17.0/l10n_fr_intrastat_service>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
2 changes: 2 additions & 0 deletions l10n_fr_intrastat_service/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from . import models
from . import report
26 changes: 26 additions & 0 deletions l10n_fr_intrastat_service/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Copyright 2010-2020 Akretion France (http://www.akretion.com)
# @author Alexis de Lattre <[email protected]>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

{
"name": "DES",
"version": "17.0.1.0.0",
"category": "Localisation/Report Intrastat",
"license": "AGPL-3",
"summary": "Module for Intrastat service reporting (DES) for France",
"author": "Akretion,Odoo Community Association (OCA)",
"maintainers": ["alexis-via"],
"website": "https://github.com/OCA/l10n-france",
"depends": ["intrastat_base", "report_xlsx_helper"],
"external_dependencies": {"python": ["stdnum"]},
"data": [
"security/ir.model.access.csv",
"report/report.xml",
"views/intrastat_service_view.xml",
"data/ir_cron.xml",
"data/mail_template.xml",
"security/intrastat_service_security.xml",
],
"installable": True,
"application": True,
}
133 changes: 133 additions & 0 deletions l10n_fr_intrastat_service/data/des.xsd
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
<xs:element name="fichier_des">
<xs:annotation>
<xs:documentation>fichier de déclarations de service</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element ref="declaration_des" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="declaration_des">
<xs:annotation>
<xs:documentation>declaration de services </xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element ref="num_des"/>
<xs:element ref="num_tvaFr"/>
<xs:element ref="mois_des"/>
<xs:element ref="an_des"/>
<xs:element ref="ligne_des" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="num_des">
<xs:annotation>
<xs:documentation>numéro de la DES </xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:restriction base="xs:positiveInteger">
<xs:minInclusive value="1"/>
<xs:maxInclusive value="999999"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="num_tvaFr">
<xs:annotation>
<xs:documentation>numéro TVA </xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:pattern value="[F-f][R-r][0-9A-Za-z]{2}[0-9]{9}"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="mois_des">
<xs:annotation>
<xs:documentation>mois de la DES</xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:length value="2"/>
<xs:enumeration value="01"/>
<xs:enumeration value="02"/>
<xs:enumeration value="03"/>
<xs:enumeration value="04"/>
<xs:enumeration value="05"/>
<xs:enumeration value="06"/>
<xs:enumeration value="07"/>
<xs:enumeration value="08"/>
<xs:enumeration value="09"/>
<xs:enumeration value="10"/>
<xs:enumeration value="11"/>
<xs:enumeration value="12"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="an_des">
<xs:annotation>
<xs:documentation>année de la DES</xs:documentation>
<xs:documentation/>
</xs:annotation>
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:pattern value="[2][0][1-9][0-9]"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="ligne_des">
<xs:complexType>
<xs:sequence>
<xs:element ref="numlin_des"/>
<xs:element ref="valeur"/>
<xs:element ref="partner_des"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="numlin_des">
<xs:annotation>
<xs:documentation>num de la ligne DES</xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:restriction base="xs:positiveInteger">
<xs:minInclusive value="1"/>
<xs:maxInclusive value="999999"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="valeur">
<xs:annotation>
<xs:documentation>valeur de la ligne de DES</xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:union>
<xs:simpleType>
<xs:restriction base="xs:negativeInteger">
<xs:maxInclusive value="-1"/>
<xs:minInclusive value="-9999999999"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType>
<xs:restriction base="xs:positiveInteger">
<xs:minInclusive value="1"/>
<xs:maxInclusive value="99999999999"/>
</xs:restriction>
</xs:simpleType>
</xs:union>
</xs:simpleType>
</xs:element>
<xs:element name="partner_des">
<xs:annotation>
<xs:documentation>partenaire</xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:minLength value="7"/>
<xs:maxLength value="14"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
</xs:schema>
22 changes: 22 additions & 0 deletions l10n_fr_intrastat_service/data/ir_cron.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8" ?>
<!--
Copyright 2013-2023 Akretion France (http://www.akretion.com/)
@author Alexis de Lattre <[email protected]>
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
-->
<odoo noupdate="1">
<!-- noupdate = 1 for the 'active' field -->
<record id="intrastat_service_cron" model="ir.cron">
<field name="name">DES Reminder</field>
<field name="active" eval="False" />
<field name="user_id" ref="base.user_root" />
<field name="interval_number">1</field>
<field name="interval_type">months</field>
<field name="numbercall">-1</field>
<!-- don't limit the number of calls -->
<field name="doall" eval="False" />
<field name="model_id" ref="model_l10n_fr_intrastat_service_declaration" />
<field name="state">code</field>
<field name="code">model._scheduler_reminder()</field>
</record>
</odoo>
73 changes: 73 additions & 0 deletions l10n_fr_intrastat_service/data/mail_template.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
<?xml version="1.0" encoding="utf-8" ?>
<!--
Copyright 2013-2023 Akretion France (http://www.akretion.com/)
@author Alexis de Lattre <[email protected]>
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
-->
<odoo>

<record id="intrastat_service_reminder_email_template" model="mail.template">
<field name="name">DES Reminder</field>
<field
name="model_id"
ref="l10n_fr_intrastat_service.model_l10n_fr_intrastat_service_declaration"
/>
<field name="auto_delete" eval="False" />
<field name="lang">{{object.company_id.partner_id.lang}}</field>
<field name="email_from">{{object.company_id.email}}</field>
<field name="email_to">{{object.company_id.intrastat_email_list}}</field>
<field
name="subject"
>DES {{object.year_month}} for {{object.company_id.name}}</field>
<field name="body_html" type="html">
<div style="margin: 0px; padding: 0px;">
<p
style="margin: 0px; padding: 0px; font-size: 12px; font-family: Arial, Helvetica, sans-serif"
>I would like to remind you that we are approaching the deadline for the DES declaration for month <t
t-out="object.year_month"
/>.<br /><br />

As there were no DES for that month in Odoo, a draft declaration has been generated automatically.<br
/><br />

<t t-if="ctx.get('exception')">
When trying to generate the DES lines, the following error was encountered:<br /><br />

<t t-out="ctx.get('error_msg')" /><br /><br />

You should solve this error, then go to the menu <em
>Invoicing &gt; Reporting &gt; Intrastat &gt; DES</em>, open the declaration of month <t
t-out="object.year_month"
/> and click on the button <em>Re-generate lines</em>.<br /><br
/>
</t>

<t t-else="">
<t t-if="object.num_decl_lines">
This draft DES contains <t
t-out="object.num_decl_lines"
/> line(s) and the total amount is <t
t-out="format_amount(object.total_amount, object.currency_id)"
/>.<br /><br />
</t>
<t t-else="">
This draft DES generated automatically by Odoo doesn't contain any line.<br /><br />
</t>

Go and check this declaration in the menu <em
>Invoicing &gt; Reporting &gt; Intrastat &gt; DES</em>.<br /><br
/>

</t>
</p>

<p
style="margin: 0px; padding: 0px; font-size: 10px; font-family: 'Courier New', Courier, Prestige, monospace"
>
-- <br />
Automatic e-mail sent by Odoo.
</p>
</div>
</field>
</record>
</odoo>
Loading

0 comments on commit 6bb14cc

Please sign in to comment.