This module adds the Code Officiel Géographique of INSEE on countries. All countries except France and DOM-TOMs (and some very particular territories) have this code.
+
This module is used by other modules of the French localization such as the DAS2 module.
Bugs are tracked on GitHub Issues.
+In case of trouble, please check there if your issue has already been reported.
+If you spotted it first, help us smashing it by providing a detailed and welcomed
+feedback.
+
Do not contact contributors directly about support or help with technical issues.
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-france project on GitHub.
+
+
diff --git a/l10n_fr_das2/README.rst b/l10n_fr_das2/README.rst
new file mode 100644
index 0000000000..84f1395489
--- /dev/null
+++ b/l10n_fr_das2/README.rst
@@ -0,0 +1,106 @@
+====
+DAS2
+====
+
+.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+ !! This file is generated by oca-gen-addon-readme !!
+ !! changes will be overwritten. !!
+ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+.. |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/10.0/l10n_fr_das2
+ :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-10-0/l10n-france-10-0-l10n_fr_das2
+ :alt: Translate me on Weblate
+.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
+ :target: https://runbot.odoo-community.org/runbot/121/10.0
+ :alt: Try me on Runbot
+
+|badge1| |badge2| |badge3| |badge4| |badge5|
+
+This module adds support for `DAS2 _`, which is an annual fiscal declaration also called *Déclaration d'honoraires*. It will allow you to auto-generate the lines of DAS2 from the accounting entries, check the result, manually update lines if needed and eventually generate a declaration file. This declaration file can be uploaded on the dedicated website `https://teletd.impots.gouv.fr/teletd/connexionEFI.do `_; that way, you won't have to manually type the declaration.
+
+The specifications of the file are available on `this page `_ (select *Salaires, honoraires et actionnariat salarié*).
+
+**Table of contents**
+
+.. contents::
+ :local:
+
+Configuration
+=============
+
+On the supplier form view, in the *Accounting* tab, you will see a section *DAS2*. For the suppliers that must be declared in DAS2, you must set:
+
+* the DAS2 Type,
+* the job for the DAS2 declaration,
+* their SIRET number (for French suppliers only),
+* their full address (street, zip code, city and country).
+
+On the company configuration form, the APE code, SIRET and address must be set.
+
+For the user responsible for the declaration, the phone number and email must be set on his related partner form (name, email and phone number are used in the DAS2 declaration file).
+
+Usage
+=====
+
+Go to the menu *Accounting > Reports > French Statements > DAS2* and create a new DAS2 report.
+
+Then click on the button *Generate Lines*. Check and edit the generated lines. You can get the details of the computation performed by Odoo in the *Note* fields of each line.
+
+You should also have a look in the chatter: you may have a message that warn you about suppliers that have expenses recorded in accounts such as 622100 Commissions et courtages sur achats, 622200 Commissions et courtages sur ventes, 622600 Honoraires, 622800 Rémunérations d'intermédiaires divers, 653000 Jetons de présence, 651600 Droits d'auteur et de reproduction and are not configured for DAS2.
+
+Once your declaration is OK, click on the button *Generate File* and download the generated file.
+
+Connect to `https://teletd.impots.gouv.fr/teletd/connexionEFI.do `_, select *Transmission par internet des fichiers TD/bilatéral* and type your login and password (the credentials are specific to this website; their are not the same as on *impots.gouv.fr*). Then follow the online declaration process and upload the file generated by Odoo.
+
+In the minutes following the upload of the file on the website of the administration, you will receive a first e-mail with a subject *ACCUSÉ DE DÉPÔT de 1er NIVEAU (Déclaration de salaires et/ou honoraires et/ou actionnariat salarié)*; it is just an acknowledgement, it doesn't mean that the file is valid.
+
+Then, on the next open day (in my experience), you will receive a second email with a subject *Déclaration annuelle DADS BILATERALE. Référence DGFIP: xxxx. Numéro d'envoi : xxx. VALIDE*, which means that the file was considered as valid. If the subject ends with *BLOQUANT*, then you should look for the detailed report in the attached PDF report.
+
+Bug Tracker
+===========
+
+Bugs are tracked on `GitHub Issues `_.
+In case of trouble, please check there if your issue has already been reported.
+If you spotted it first, help us smashing it by providing a detailed and welcomed
+`feedback `_.
+
+Do not contact contributors directly about support or help with technical issues.
+
+Credits
+=======
+
+Authors
+~~~~~~~
+
+* Akretion
+
+Contributors
+~~~~~~~~~~~~
+
+* Alexis de Lattre
+
+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-france `_ project on GitHub.
+
+You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
diff --git a/l10n_fr_das2/static/description/index.html b/l10n_fr_das2/static/description/index.html
new file mode 100644
index 0000000000..c62df0286b
--- /dev/null
+++ b/l10n_fr_das2/static/description/index.html
@@ -0,0 +1,444 @@
+
+
+
+
+
+
+DAS2
+
+
+
+
+
DAS2
+
+
+
+
This module adds support for DAS2 <https://www.impots.gouv.fr/portail/formulaire/das2/etat-des-honoraires-vacations-commissions-courtages-ristournes-et-jetons>_, which is an annual fiscal declaration also called Déclaration d’honoraires. It will allow you to auto-generate the lines of DAS2 from the accounting entries, check the result, manually update lines if needed and eventually generate a declaration file. This declaration file can be uploaded on the dedicated website https://teletd.impots.gouv.fr/teletd/connexionEFI.do; that way, you won’t have to manually type the declaration.
+
The specifications of the file are available on this page (select Salaires, honoraires et actionnariat salarié).
On the supplier form view, in the Accounting tab, you will see a section DAS2. For the suppliers that must be declared in DAS2, you must set:
+
+
the DAS2 Type,
+
the job for the DAS2 declaration,
+
their SIRET number (for French suppliers only),
+
their full address (street, zip code, city and country).
+
+
On the company configuration form, the APE code, SIRET and address must be set.
+
For the user responsible for the declaration, the phone number and email must be set on his related partner form (name, email and phone number are used in the DAS2 declaration file).
Go to the menu Accounting > Reports > French Statements > DAS2 and create a new DAS2 report.
+
Then click on the button Generate Lines. Check and edit the generated lines. You can get the details of the computation performed by Odoo in the Note fields of each line.
+
You should also have a look in the chatter: you may have a message that warn you about suppliers that have expenses recorded in accounts such as 622100 Commissions et courtages sur achats, 622200 Commissions et courtages sur ventes, 622600 Honoraires, 622800 Rémunérations d’intermédiaires divers, 653000 Jetons de présence, 651600 Droits d’auteur et de reproduction and are not configured for DAS2.
+
Once your declaration is OK, click on the button Generate File and download the generated file.
+
Connect to https://teletd.impots.gouv.fr/teletd/connexionEFI.do, select Transmission par internet des fichiers TD/bilatéral and type your login and password (the credentials are specific to this website; their are not the same as on impots.gouv.fr). Then follow the online declaration process and upload the file generated by Odoo.
+
In the minutes following the upload of the file on the website of the administration, you will receive a first e-mail with a subject ACCUSÉ DE DÉPÔT de 1er NIVEAU (Déclaration de salaires et/ou honoraires et/ou actionnariat salarié); it is just an acknowledgement, it doesn’t mean that the file is valid.
+
Then, on the next open day (in my experience), you will receive a second email with a subject Déclaration annuelle DADS BILATERALE. Référence DGFIP: xxxx. Numéro d’envoi : xxx. VALIDE, which means that the file was considered as valid. If the subject ends with BLOQUANT, then you should look for the detailed report in the attached PDF report.
Bugs are tracked on GitHub Issues.
+In case of trouble, please check there if your issue has already been reported.
+If you spotted it first, help us smashing it by providing a detailed and welcomed
+feedback.
+
Do not contact contributors directly about support or help with technical issues.
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-france project on GitHub.
%s' % (partner.id, partner.display_name)
msg += ''
- self.message_post(msg)
+ self.message_post(body=msg)
@api.model
def _prepare_field(
@@ -312,7 +306,7 @@ def _prepare_address(self, partner):
if partner.country_id and partner.country_id.code not in FRANCE_CODES:
if not partner.country_id.fr_cog:
raise UserError(_(
- u"Missing Code Officiel Géographique on country '%s'.")
+ "Missing Code Officiel Géographique on country '%s'.")
% partner.country_id.display_name)
cog = self._prepare_field(
'COG', partner, partner.country_id.fr_cog, 5, True,
@@ -439,7 +433,7 @@ def _prepare_file(self):
'Administrative contact email', contact, contact.email, 60)
phone = contact.phone or contact.mobile
phone = phone.replace(' ', '').replace('.', '').replace(
- '-', '').replace(u'\u00A0', '')
+ '-', '').replace('\u00A0', '')
if phone.startswith('+33'):
phone = '0%s' % phone[3:]
contact_phone = self._prepare_field(
@@ -514,6 +508,7 @@ def generate_file(self):
'datas_fname': filename,
})
self.attachment_id = attach.id
+ self.message_post(body="DAS2 file generated.")
action = {
'type': 'ir.actions.act_window',
'name': _('DAS2 Export File'),
@@ -529,7 +524,8 @@ def generate_file(self):
pass
# The code below works and triggers an immediate download, but
- # the form view of DAS2 is frozen after that, we it's not usable in v10
+ # the form view of DAS2 is frozen after that, so it's not usable
+ # in v10/v12... maybe it's only designed to be used in a wizard
# action = {
# 'name': 'DAS2',
# 'type': 'ir.actions.act_url',
@@ -570,57 +566,62 @@ class L10nFrDas2Line(models.Model):
related='parent_id.company_id.currency_id', store=True, readonly=True,
string='Company Currency')
fee_amount = fields.Integer(
- string=u'Honoraires et vacations',
+ string='Honoraires et vacations',
states={'done': [('readonly', True)]})
commission_amount = fields.Integer(
- string=u'Commissions', states={'done': [('readonly', True)]})
+ string='Commissions', states={'done': [('readonly', True)]})
brokerage_amount = fields.Integer(
- string=u'Courtages', states={'done': [('readonly', True)]})
+ string='Courtages', states={'done': [('readonly', True)]})
discount_amount = fields.Integer(
- string=u'Ristournes', states={'done': [('readonly', True)]})
+ string='Ristournes', states={'done': [('readonly', True)]})
attendance_fee_amount = fields.Integer(
- string=u'Jetons de présence', states={'done': [('readonly', True)]})
+ string='Jetons de présence', states={'done': [('readonly', True)]})
copyright_royalties_amount = fields.Integer(
- string=u"Droits d'auteur", states={'done': [('readonly', True)]})
+ string="Droits d'auteur", states={'done': [('readonly', True)]})
licence_royalties_amount = fields.Integer(
- string=u"Droits d'inventeur", states={'done': [('readonly', True)]})
+ string="Droits d'inventeur", states={'done': [('readonly', True)]})
other_income_amount = fields.Integer(
- string=u'Autre rémunérations', states={'done': [('readonly', True)]})
+ string='Autre rémunérations', states={'done': [('readonly', True)]})
allowance_amount = fields.Integer(
- string=u'Indemnités et remboursements',
+ string='Indemnités et remboursements',
states={'done': [('readonly', True)]})
benefits_in_kind_amount = fields.Integer(
string='Avantages en nature', states={'done': [('readonly', True)]})
withholding_tax_amount = fields.Integer(
- string=u'Retenue à la source', states={'done': [('readonly', True)]})
+ string='Retenue à la source', states={'done': [('readonly', True)]})
total_amount = fields.Integer(
compute='_compute_total_amount', string='Total Amount',
store=True, readonly=True)
to_declare = fields.Boolean(
compute='_compute_total_amount', string='To Declare', readonly=True)
allowance_fixed = fields.Boolean(
- u'Allocation forfaitaire', states={'done': [('readonly', True)]})
+ 'Allocation forfaitaire', states={'done': [('readonly', True)]})
allowance_real = fields.Boolean(
- u'Sur frais réels', states={'done': [('readonly', True)]})
+ 'Sur frais réels', states={'done': [('readonly', True)]})
allowance_employer = fields.Boolean(
- u"Prise en charge directe par l'employeur",
+ "Prise en charge directe par l'employeur",
states={'done': [('readonly', True)]})
benefits_in_kind_food = fields.Boolean(
- u'Nourriture', states={'done': [('readonly', True)]})
+ 'Nourriture', states={'done': [('readonly', True)]})
benefits_in_kind_accomodation = fields.Boolean(
- u'Logement', states={'done': [('readonly', True)]})
+ 'Logement', states={'done': [('readonly', True)]})
benefits_in_kind_car = fields.Boolean(
- u'Voiture', states={'done': [('readonly', True)]})
+ 'Voiture', states={'done': [('readonly', True)]})
benefits_in_kind_other = fields.Boolean(
- u'Autres', states={'done': [('readonly', True)]})
+ 'Autres', states={'done': [('readonly', True)]})
benefits_in_kind_nict = fields.Boolean(
- u'Outils issus des NTIC', states={'done': [('readonly', True)]})
+ 'Outils issus des NTIC', states={'done': [('readonly', True)]})
state = fields.Selection(
related='parent_id.state', store=True, readonly=True)
note = fields.Text()
- job = fields.Char(string='Profession', size=30)
+ job = fields.Char(
+ string='Profession', size=30, states={'done': [('readonly', True)]})
_sql_constraints = [
+ (
+ 'partner_parent_unique',
+ 'unique(partner_id, parent_id)',
+ 'Same partner used on several lines!'),
(
'fee_amount_positive',
'CHECK(fee_amount >= 0)',
@@ -702,5 +703,8 @@ def check_siret(self):
@api.onchange('partner_id')
def partner_id_change(self):
- if self.partner_id and self.partner_id.siren and self.partner_id.nic:
- self.partner_siret = self.partner_id.siret
+ if self.partner_id:
+ if self.partner_id.siren and self.partner_id.nic:
+ self.partner_siret = self.partner_id.siret
+ if self.partner_id.fr_das2_job:
+ self.job = self.partner_id.fr_das2_job
diff --git a/l10n_fr_das2/models/partner.py b/l10n_fr_das2/models/partner.py
index 720c920a0a..47cd0efb0c 100644
--- a/l10n_fr_das2/models/partner.py
+++ b/l10n_fr_das2/models/partner.py
@@ -1,4 +1,3 @@
-# -*- coding: utf-8 -*-
# Copyright 2020 Akretion France (http://www.akretion.com/)
# @author: Alexis de Lattre
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
@@ -10,15 +9,15 @@ class ResPartner(models.Model):
_inherit = 'res.partner'
fr_das2_type = fields.Selection([
- ('fee', u'Honoraires et vacations'),
- ('commission', u'Commissions'),
- ('brokerage', u'Courtages'),
- ('discount', u'Ristournes'),
- ('attendance_fee', u'Jetons de présence'),
- ('copyright_royalties', u"Droits d'auteur"),
- ('licence_royalties', u"Droits d'inventeur"),
- ('other_income', u'Autre rémunérations'),
- ('allowance', u'Indemnités et remboursements'),
+ ('fee', 'Honoraires et vacations'),
+ ('commission', 'Commissions'),
+ ('brokerage', 'Courtages'),
+ ('discount', 'Ristournes'),
+ ('attendance_fee', 'Jetons de présence'),
+ ('copyright_royalties', "Droits d'auteur"),
+ ('licence_royalties', "Droits d'inventeur"),
+ ('other_income', 'Autre rémunérations'),
+ ('allowance', 'Indemnités et remboursements'),
], string='DAS2 Type', track_visibility='onchange')
fr_das2_job = fields.Char(
string='DAS2 Job', size=30,
diff --git a/l10n_fr_das2/views/account_config_settings.xml b/l10n_fr_das2/views/account_config_settings.xml
deleted file mode 100644
index d366aabbed..0000000000
--- a/l10n_fr_das2/views/account_config_settings.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
-
- chorus.account.config.settings.form
- account.config.settings
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/l10n_fr_das2/views/config_settings.xml b/l10n_fr_das2/views/config_settings.xml
new file mode 100644
index 0000000000..9f14c4f3ea
--- /dev/null
+++ b/l10n_fr_das2/views/config_settings.xml
@@ -0,0 +1,34 @@
+
+
+
+
+
+
+
+ das2.res.config.settings.form
+ res.config.settings
+
+
+
+
Intrastat
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
From 31287e682724c2a6d9be882739d38cba79d22e2d Mon Sep 17 00:00:00 2001
From: Alexis de Lattre
Date: Fri, 3 Apr 2020 11:18:53 +0200
Subject: [PATCH 15/57] Add missing _ on message string
---
l10n_fr_das2/models/l10n_fr_das2.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/l10n_fr_das2/models/l10n_fr_das2.py b/l10n_fr_das2/models/l10n_fr_das2.py
index bad909f5f4..0ae682186a 100644
--- a/l10n_fr_das2/models/l10n_fr_das2.py
+++ b/l10n_fr_das2/models/l10n_fr_das2.py
@@ -176,7 +176,7 @@ def generate_lines(self):
vals = self._prepare_line(partner, base_domain)
if vals:
lfdlo.create(vals)
- self.message_post(body="DAS2 lines generated.")
+ self.message_post(body=_("DAS2 lines generated."))
self.add_warning_in_chatter(das2_partners)
def _prepare_line(self, partner, base_domain):
@@ -508,7 +508,7 @@ def generate_file(self):
'datas_fname': filename,
})
self.attachment_id = attach.id
- self.message_post(body="DAS2 file generated.")
+ self.message_post(body=_("DAS2 file generated."))
action = {
'type': 'ir.actions.act_window',
'name': _('DAS2 Export File'),
From db1ccb18889de84d972a59e9609dcc481fc81bf9 Mon Sep 17 00:00:00 2001
From: Alexis de Lattre
Date: Fri, 3 Apr 2020 11:27:28 +0200
Subject: [PATCH 16/57] Fix double import of unidecode
---
l10n_fr_das2/models/l10n_fr_das2.py | 1 -
1 file changed, 1 deletion(-)
diff --git a/l10n_fr_das2/models/l10n_fr_das2.py b/l10n_fr_das2/models/l10n_fr_das2.py
index 0ae682186a..4c1fbf8104 100644
--- a/l10n_fr_das2/models/l10n_fr_das2.py
+++ b/l10n_fr_das2/models/l10n_fr_das2.py
@@ -7,7 +7,6 @@
from dateutil.relativedelta import relativedelta
from datetime import datetime
from odoo.addons.l10n_fr_siret.models.partner import _check_luhn
-from unidecode import unidecode
import base64
import logging
From 921e1f3e2aa722d7d1d5fbc5631f4aa61f662fee Mon Sep 17 00:00:00 2001
From: Alexis de Lattre
Date: Fri, 3 Apr 2020 13:06:52 +0200
Subject: [PATCH 17/57] Remove utf-8 coding in python file
---
l10n_fr_cog/models/__init__.py | 2 --
1 file changed, 2 deletions(-)
diff --git a/l10n_fr_cog/models/__init__.py b/l10n_fr_cog/models/__init__.py
index f2d611a89c..30b933141f 100644
--- a/l10n_fr_cog/models/__init__.py
+++ b/l10n_fr_cog/models/__init__.py
@@ -1,3 +1 @@
-# -*- coding: utf-8 -*-
-
from . import country
From d55ff71ecc7edf74fe66afa39ab6071b03eed564 Mon Sep 17 00:00:00 2001
From: OCA-git-bot
Date: Fri, 3 Apr 2020 12:52:17 +0000
Subject: [PATCH 18/57] [UPD] README.rst
---
l10n_fr_cog/README.rst | 10 +++++-----
l10n_fr_cog/static/description/index.html | 6 +++---
l10n_fr_das2/README.rst | 10 +++++-----
l10n_fr_das2/static/description/index.html | 6 +++---
4 files changed, 16 insertions(+), 16 deletions(-)
diff --git a/l10n_fr_cog/README.rst b/l10n_fr_cog/README.rst
index f980278133..4666060b41 100644
--- a/l10n_fr_cog/README.rst
+++ b/l10n_fr_cog/README.rst
@@ -14,13 +14,13 @@ Code Officiel Géographique
: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/10.0/l10n_fr_cog
+ :target: https://github.com/OCA/l10n-france/tree/12.0/l10n_fr_cog
: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-10-0/l10n-france-10-0-l10n_fr_cog
+ :target: https://translation.odoo-community.org/projects/l10n-france-12-0/l10n-france-12-0-l10n_fr_cog
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
- :target: https://runbot.odoo-community.org/runbot/121/10.0
+ :target: https://runbot.odoo-community.org/runbot/121/12.0
:alt: Try me on Runbot
|badge1| |badge2| |badge3| |badge4| |badge5|
@@ -40,7 +40,7 @@ Bug Tracker
Bugs are tracked on `GitHub Issues `_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and welcomed
-`feedback `_.
+`feedback `_.
Do not contact contributors directly about support or help with technical issues.
@@ -70,6 +70,6 @@ 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-france `_ project on GitHub.
+This module is part of the `OCA/l10n-france `_ project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
diff --git a/l10n_fr_cog/static/description/index.html b/l10n_fr_cog/static/description/index.html
index e615f3c7d9..4c6a68dcf7 100644
--- a/l10n_fr_cog/static/description/index.html
+++ b/l10n_fr_cog/static/description/index.html
@@ -367,7 +367,7 @@
Code Officiel Géographique
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
-
+
This module adds the Code Officiel Géographique of INSEE on countries. All countries except France and DOM-TOMs (and some very particular territories) have this code.
This module is used by other modules of the French localization such as the DAS2 module.
Bugs are tracked on GitHub Issues.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and welcomed
-feedback.
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-france project on GitHub.
+
This module is part of the OCA/l10n-france project on GitHub.
diff --git a/l10n_fr_das2/README.rst b/l10n_fr_das2/README.rst
index 84f1395489..f497668eb4 100644
--- a/l10n_fr_das2/README.rst
+++ b/l10n_fr_das2/README.rst
@@ -14,13 +14,13 @@ DAS2
: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/10.0/l10n_fr_das2
+ :target: https://github.com/OCA/l10n-france/tree/12.0/l10n_fr_das2
: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-10-0/l10n-france-10-0-l10n_fr_das2
+ :target: https://translation.odoo-community.org/projects/l10n-france-12-0/l10n-france-12-0-l10n_fr_das2
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
- :target: https://runbot.odoo-community.org/runbot/121/10.0
+ :target: https://runbot.odoo-community.org/runbot/121/12.0
:alt: Try me on Runbot
|badge1| |badge2| |badge3| |badge4| |badge5|
@@ -71,7 +71,7 @@ Bug Tracker
Bugs are tracked on `GitHub Issues `_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and welcomed
-`feedback `_.
+`feedback `_.
Do not contact contributors directly about support or help with technical issues.
@@ -101,6 +101,6 @@ 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-france `_ project on GitHub.
+This module is part of the `OCA/l10n-france `_ project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
diff --git a/l10n_fr_das2/static/description/index.html b/l10n_fr_das2/static/description/index.html
index c62df0286b..4f6def775e 100644
--- a/l10n_fr_das2/static/description/index.html
+++ b/l10n_fr_das2/static/description/index.html
@@ -367,7 +367,7 @@
DAS2
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
-
+
This module adds support for DAS2 <https://www.impots.gouv.fr/portail/formulaire/das2/etat-des-honoraires-vacations-commissions-courtages-ristournes-et-jetons>_, which is an annual fiscal declaration also called Déclaration d’honoraires. It will allow you to auto-generate the lines of DAS2 from the accounting entries, check the result, manually update lines if needed and eventually generate a declaration file. This declaration file can be uploaded on the dedicated website https://teletd.impots.gouv.fr/teletd/connexionEFI.do; that way, you won’t have to manually type the declaration.
The specifications of the file are available on this page (select Salaires, honoraires et actionnariat salarié).
Bugs are tracked on GitHub Issues.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and welcomed
-feedback.
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-france project on GitHub.
+
This module is part of the OCA/l10n-france project on GitHub.
The following partners are not configured for DAS2 but they have expenses in some accounts that indicate that maybe they should be configured for DAS2:
"
+msgstr ""
+
+#. module: l10n_fr_das2
+#: model_terms:ir.ui.view,arch_db:l10n_fr_das2.l10n_fr_das2_form
+msgid "Lines Fullscreen"
+msgstr ""
+
+#. module: l10n_fr_das2
+#: sql_constraint:l10n.fr.das2:0
+msgid "A DAS2 already exists for that year!"
+msgstr ""
+
+#. module: l10n_fr_das2
+#: code:addons/l10n_fr_das2/models/l10n_fr_das2.py:496
+#, python-format
+msgid "A special character in the DAS2 file is not in the latin1 table. Please locate this special character and replace it by a standard character and try again."
+msgstr ""
+
+#. module: l10n_fr_das2
+#: model:ir.model.fields,field_description:l10n_fr_das2.field_l10n_fr_das2__message_needaction
+msgid "Action Needed"
+msgstr ""
+
+#. module: l10n_fr_das2
+#: model:ir.model.fields,field_description:l10n_fr_das2.field_l10n_fr_das2__contact_id
+msgid "Administrative Contact"
+msgstr ""
+
+#. module: l10n_fr_das2
+#: model:ir.model.fields,field_description:l10n_fr_das2.field_l10n_fr_das2_line__allowance_fixed
+msgid "Allocation forfaitaire"
+msgstr ""
+
+#. module: l10n_fr_das2
+#: code:addons/l10n_fr_das2/models/l10n_fr_das2.py:488
+#, python-format
+msgid "An export file already exists. First, delete it via the attachments and then re-generate it."
+msgstr ""
+
+#. module: l10n_fr_das2
+#: model:ir.model.fields,field_description:l10n_fr_das2.field_l10n_fr_das2__message_attachment_count
+msgid "Attachment Count"
+msgstr ""
+
+#. module: l10n_fr_das2
+#: model:ir.model.fields,field_description:l10n_fr_das2.field_l10n_fr_das2_line__other_income_amount
+#: selection:res.partner,fr_das2_type:0
+msgid "Autre rémunérations"
+msgstr ""
+
+#. module: l10n_fr_das2
+#: model:ir.model.fields,field_description:l10n_fr_das2.field_l10n_fr_das2_line__benefits_in_kind_other
+msgid "Autres"
+msgstr ""
+
+#. module: l10n_fr_das2
+#: model:ir.model.fields,field_description:l10n_fr_das2.field_l10n_fr_das2_line__benefits_in_kind_amount
+msgid "Avantages en nature"
+msgstr ""
+
+#. module: l10n_fr_das2
+#: model_terms:ir.ui.view,arch_db:l10n_fr_das2.l10n_fr_das2_form
+msgid "Back to Draft"
+msgstr ""
+
+#. module: l10n_fr_das2
+#: code:addons/l10n_fr_das2/models/l10n_fr_das2.py:130
+#, python-format
+msgid "Cannot delete declaration %s in done state."
+msgstr ""
+
+#. module: l10n_fr_das2
+#: model:ir.model.fields,field_description:l10n_fr_das2.field_l10n_fr_das2_line__commission_amount
+#: selection:res.partner,fr_das2_type:0
+msgid "Commissions"
+msgstr ""
+
+#. module: l10n_fr_das2
+#: model:ir.model,name:l10n_fr_das2.model_res_company
+msgid "Companies"
+msgstr ""
+
+#. module: l10n_fr_das2
+#: model:ir.model.fields,field_description:l10n_fr_das2.field_l10n_fr_das2__company_id
+#: model:ir.model.fields,field_description:l10n_fr_das2.field_l10n_fr_das2_line__company_id
+msgid "Company"
+msgstr ""
+
+#. module: l10n_fr_das2
+#: code:addons/l10n_fr_das2/models/l10n_fr_das2.py:143
+#, python-format
+msgid "Company '%s' is configured in country '%s'. The DAS2 is only for France and it's oversea territories."
+msgstr ""
+
+#. module: l10n_fr_das2
+#: code:addons/l10n_fr_das2/models/l10n_fr_das2.py:149
+#, python-format
+msgid "Company '%s' is configured with currency '%s'. It should be EUR."
+msgstr ""
+
+#. module: l10n_fr_das2
+#: model:ir.model.fields,field_description:l10n_fr_das2.field_l10n_fr_das2__currency_id
+#: model:ir.model.fields,field_description:l10n_fr_das2.field_l10n_fr_das2_line__currency_id
+msgid "Company Currency"
+msgstr ""
+
+#. module: l10n_fr_das2
+#: model:ir.model,name:l10n_fr_das2.model_res_config_settings
+msgid "Config Settings"
+msgstr ""
+
+#. module: l10n_fr_das2
+#: model:ir.model,name:l10n_fr_das2.model_res_partner
+msgid "Contact"
+msgstr ""
+
+#. module: l10n_fr_das2
+#: model:ir.model.fields,help:l10n_fr_das2.field_l10n_fr_das2__contact_id
+msgid "Contact in the company for the fiscal administration: the name, email and phone number of this partner will be used in the file."
+msgstr ""
+
+#. module: l10n_fr_das2
+#: code:addons/l10n_fr_das2/models/l10n_fr_das2.py:140
+#, python-format
+msgid "Country not set on company '%s'."
+msgstr ""
+
+#. module: l10n_fr_das2
+#: model:ir.model.fields,field_description:l10n_fr_das2.field_l10n_fr_das2_line__brokerage_amount
+#: selection:res.partner,fr_das2_type:0
+msgid "Courtages"
+msgstr ""
+
+#. module: l10n_fr_das2
+#: model:ir.model.fields,field_description:l10n_fr_das2.field_l10n_fr_das2__create_uid
+#: model:ir.model.fields,field_description:l10n_fr_das2.field_l10n_fr_das2_line__create_uid
+msgid "Created by"
+msgstr ""
+
+#. module: l10n_fr_das2
+#: model:ir.model.fields,field_description:l10n_fr_das2.field_l10n_fr_das2__create_date
+#: model:ir.model.fields,field_description:l10n_fr_das2.field_l10n_fr_das2_line__create_date
+msgid "Created on"
+msgstr ""
+
+#. module: l10n_fr_das2
+#: model:ir.model.fields,field_description:l10n_fr_das2.field_l10n_fr_das2__dads_type
+msgid "DADS Type"
+msgstr ""
+
+#. module: l10n_fr_das2
+#: model:ir.actions.act_window,name:l10n_fr_das2.l10n_fr_das2_action
+#: model:ir.model,name:l10n_fr_das2.model_l10n_fr_das2
+#: model:ir.ui.menu,name:l10n_fr_das2.l10n_fr_das2_menu
+#: model_terms:ir.ui.view,arch_db:l10n_fr_das2.l10n_fr_das2_form
+#: model_terms:ir.ui.view,arch_db:l10n_fr_das2.l10n_fr_das2_tree
+#: model_terms:ir.ui.view,arch_db:l10n_fr_das2.view_partner_property_form
+#: model_terms:ir.ui.view,arch_db:l10n_fr_das2.view_res_partner_filter
+msgid "DAS2"
+msgstr ""
+
+#. module: l10n_fr_das2
+#: code:addons/l10n_fr_das2/models/l10n_fr_das2.py:513
+#, python-format
+msgid "DAS2 Export File"
+msgstr ""
+
+#. module: l10n_fr_das2
+#: model:ir.model.fields,field_description:l10n_fr_das2.field_res_partner__fr_das2_job
+#: model:ir.model.fields,field_description:l10n_fr_das2.field_res_users__fr_das2_job
+msgid "DAS2 Job"
+msgstr ""
+
+#. module: l10n_fr_das2
+#: model_terms:ir.ui.view,arch_db:l10n_fr_das2.l10n_fr_das2_line_form
+msgid "DAS2 Line"
+msgstr ""
+
+#. module: l10n_fr_das2
+#: model:ir.actions.act_window,name:l10n_fr_das2.l10n_fr_das2_line_action
+#: model_terms:ir.ui.view,arch_db:l10n_fr_das2.l10n_fr_das2_line_tree
+msgid "DAS2 Lines"
+msgstr ""
+
+#. module: l10n_fr_das2
+#: model:ir.model.fields,field_description:l10n_fr_das2.field_res_company__fr_das2_partner_declare_threshold
+#: model:ir.model.fields,field_description:l10n_fr_das2.field_res_config_settings__fr_das2_partner_declare_threshold
+msgid "DAS2 Partner Declaration Threshold"
+msgstr ""
+
+#. module: l10n_fr_das2
+#: model:ir.model.fields,field_description:l10n_fr_das2.field_l10n_fr_das2_line__parent_id
+msgid "DAS2 Report"
+msgstr ""
+
+#. module: l10n_fr_das2
+#: model:ir.model.fields,field_description:l10n_fr_das2.field_res_partner__fr_das2_type
+#: model:ir.model.fields,field_description:l10n_fr_das2.field_res_users__fr_das2_type
+msgid "DAS2 Type"
+msgstr ""
+
+#. module: l10n_fr_das2
+#: code:addons/l10n_fr_das2/models/l10n_fr_das2.py:510
+#, python-format
+msgid "DAS2 file generated."
+msgstr ""
+
+#. module: l10n_fr_das2
+#: model:ir.model,name:l10n_fr_das2.model_l10n_fr_das2_line
+msgid "DAS2 line"
+msgstr ""
+
+#. module: l10n_fr_das2
+#: code:addons/l10n_fr_das2/models/l10n_fr_das2.py:178
+#, python-format
+msgid "DAS2 lines generated."
+msgstr ""
+
+#. module: l10n_fr_das2
+#: model:ir.model.fields,field_description:l10n_fr_das2.field_l10n_fr_das2__display_name
+#: model:ir.model.fields,field_description:l10n_fr_das2.field_l10n_fr_das2_line__display_name
+msgid "Display Name"
+msgstr ""
+
+#. module: l10n_fr_das2
+#: model_terms:ir.ui.view,arch_db:l10n_fr_das2.l10n_fr_das2_form
+#: model_terms:ir.ui.view,arch_db:l10n_fr_das2.l10n_fr_das2_search
+#: selection:l10n.fr.das2,state:0
+msgid "Done"
+msgstr ""
+
+#. module: l10n_fr_das2
+#: model_terms:ir.ui.view,arch_db:l10n_fr_das2.l10n_fr_das2_search
+#: selection:l10n.fr.das2,state:0
+msgid "Draft"
+msgstr ""
+
+#. module: l10n_fr_das2
+#: model:ir.model.fields,field_description:l10n_fr_das2.field_l10n_fr_das2_line__copyright_royalties_amount
+#: selection:res.partner,fr_das2_type:0
+msgid "Droits d'auteur"
+msgstr ""
+
+#. module: l10n_fr_das2
+#: model:ir.model.fields,field_description:l10n_fr_das2.field_l10n_fr_das2_line__licence_royalties_amount
+#: selection:res.partner,fr_das2_type:0
+msgid "Droits d'inventeur"
+msgstr ""
+
+#. module: l10n_fr_das2
+#: code:addons/l10n_fr_das2/models/l10n_fr_das2.py:265
+#, python-format
+msgid "Failed to convert field '%s' (partner %s) to integer."
+msgstr ""
+
+#. module: l10n_fr_das2
+#: code:addons/l10n_fr_das2/models/l10n_fr_das2.py:270
+#, python-format
+msgid "Field %s (partner %s) has value %s: it is bigger than the maximum size (%d characters)"
+msgstr ""
+
+#. module: l10n_fr_das2
+#: model:ir.model.fields,field_description:l10n_fr_das2.field_l10n_fr_das2__attachment_id
+msgid "File Export"
+msgstr ""
+
+#. module: l10n_fr_das2
+#: model:ir.model.fields,field_description:l10n_fr_das2.field_l10n_fr_das2__message_follower_ids
+msgid "Followers"
+msgstr ""
+
+#. module: l10n_fr_das2
+#: model:ir.model.fields,field_description:l10n_fr_das2.field_l10n_fr_das2__message_channel_ids
+msgid "Followers (Channels)"
+msgstr ""
+
+#. module: l10n_fr_das2
+#: model:ir.model.fields,field_description:l10n_fr_das2.field_l10n_fr_das2__message_partner_ids
+msgid "Followers (Partners)"
+msgstr ""
+
+#. module: l10n_fr_das2
+#: model_terms:ir.ui.view,arch_db:l10n_fr_das2.l10n_fr_das2_form
+msgid "Generate File"
+msgstr ""
+
+#. module: l10n_fr_das2
+#: model_terms:ir.ui.view,arch_db:l10n_fr_das2.l10n_fr_das2_form
+msgid "Generate Lines"
+msgstr ""
+
+#. module: l10n_fr_das2
+#: model:ir.model.fields,field_description:l10n_fr_das2.field_l10n_fr_das2_line__fee_amount
+#: selection:res.partner,fr_das2_type:0
+msgid "Honoraires et vacations"
+msgstr ""
+
+#. module: l10n_fr_das2
+#: model:ir.model.fields,field_description:l10n_fr_das2.field_l10n_fr_das2__id
+#: model:ir.model.fields,field_description:l10n_fr_das2.field_l10n_fr_das2_line__id
+msgid "ID"
+msgstr ""
+
+#. module: l10n_fr_das2
+#: model:ir.model.fields,help:l10n_fr_das2.field_l10n_fr_das2__message_unread
+msgid "If checked new messages require your attention."
+msgstr ""
+
+#. module: l10n_fr_das2
+#: model:ir.model.fields,help:l10n_fr_das2.field_l10n_fr_das2__message_needaction
+msgid "If checked, new messages require your attention."
+msgstr ""
+
+#. module: l10n_fr_das2
+#: model:ir.model.fields,help:l10n_fr_das2.field_l10n_fr_das2__message_has_error
+msgid "If checked, some messages have a delivery error."
+msgstr ""
+
+#. module: l10n_fr_das2
+#: model:ir.model.fields,field_description:l10n_fr_das2.field_l10n_fr_das2_line__allowance_amount
+#: selection:res.partner,fr_das2_type:0
+msgid "Indemnités et remboursements"
+msgstr ""
+
+#. module: l10n_fr_das2
+#: model_terms:ir.ui.view,arch_db:l10n_fr_das2.view_account_config_settings
+msgid "Intrastat"
+msgstr ""
+
+#. module: l10n_fr_das2
+#: model:ir.model.fields,field_description:l10n_fr_das2.field_l10n_fr_das2__message_is_follower
+msgid "Is Follower"
+msgstr ""
+
+#. module: l10n_fr_das2
+#: model:ir.model.fields,field_description:l10n_fr_das2.field_l10n_fr_das2_line__attendance_fee_amount
+#: selection:res.partner,fr_das2_type:0
+msgid "Jetons de présence"
+msgstr ""
+
+#. module: l10n_fr_das2
+#: model_terms:ir.ui.view,arch_db:l10n_fr_das2.view_partner_property_form
+msgid "Job"
+msgstr ""
+
+#. module: l10n_fr_das2
+#: selection:l10n.fr.das2,dads_type:0
+msgid "La société ne verse pas de salaires"
+msgstr ""
+
+#. module: l10n_fr_das2
+#: selection:l10n.fr.das2,dads_type:0
+msgid "La société verse des salaires"
+msgstr ""
+
+#. module: l10n_fr_das2
+#: model:ir.model.fields,field_description:l10n_fr_das2.field_l10n_fr_das2____last_update
+#: model:ir.model.fields,field_description:l10n_fr_das2.field_l10n_fr_das2_line____last_update
+msgid "Last Modified on"
+msgstr ""
+
+#. module: l10n_fr_das2
+#: model:ir.model.fields,field_description:l10n_fr_das2.field_l10n_fr_das2__write_uid
+#: model:ir.model.fields,field_description:l10n_fr_das2.field_l10n_fr_das2_line__write_uid
+msgid "Last Updated by"
+msgstr ""
+
+#. module: l10n_fr_das2
+#: model:ir.model.fields,field_description:l10n_fr_das2.field_l10n_fr_das2__write_date
+#: model:ir.model.fields,field_description:l10n_fr_das2.field_l10n_fr_das2_line__write_date
+msgid "Last Updated on"
+msgstr ""
+
+#. module: l10n_fr_das2
+#: model:ir.model.fields,field_description:l10n_fr_das2.field_l10n_fr_das2__line_ids
+msgid "Lines"
+msgstr ""
+
+#. module: l10n_fr_das2
+#: model_terms:ir.ui.view,arch_db:l10n_fr_das2.l10n_fr_das2_form
+msgid "List view of lines"
+msgstr ""
+
+#. module: l10n_fr_das2
+#: model:ir.model.fields,field_description:l10n_fr_das2.field_l10n_fr_das2_line__benefits_in_kind_accomodation
+msgid "Logement"
+msgstr ""
+
+#. module: l10n_fr_das2
+#: model:ir.model.fields,field_description:l10n_fr_das2.field_l10n_fr_das2__message_main_attachment_id
+msgid "Main Attachment"
+msgstr ""
+
+#. module: l10n_fr_das2
+#: model:ir.model.fields,field_description:l10n_fr_das2.field_l10n_fr_das2__message_has_error
+msgid "Message Delivery error"
+msgstr ""
+
+#. module: l10n_fr_das2
+#: model:ir.model.fields,field_description:l10n_fr_das2.field_l10n_fr_das2__message_ids
+msgid "Messages"
+msgstr ""
+
+#. module: l10n_fr_das2
+#: code:addons/l10n_fr_das2/models/l10n_fr_das2.py:471
+#, python-format
+msgid "Missing APE on company '%s'."
+msgstr ""
+
+#. module: l10n_fr_das2
+#: code:addons/l10n_fr_das2/models/l10n_fr_das2.py:307
+#, python-format
+msgid "Missing Code Officiel Géographique on country '%s'."
+msgstr ""
+
+#. module: l10n_fr_das2
+#: code:addons/l10n_fr_das2/models/l10n_fr_das2.py:375
+#, python-format
+msgid "Missing SIRET for french partner %s."
+msgstr ""
+
+#. module: l10n_fr_das2
+#: code:addons/l10n_fr_das2/models/l10n_fr_das2.py:468
+#, python-format
+msgid "Missing SIRET on company '%s'."
+msgstr ""
+
+#. module: l10n_fr_das2
+#: code:addons/l10n_fr_das2/models/l10n_fr_das2.py:474
+#, python-format
+msgid "Missing Street on company '%s'"
+msgstr ""
+
+#. module: l10n_fr_das2
+#: code:addons/l10n_fr_das2/models/l10n_fr_das2.py:478
+#, python-format
+msgid "Missing administrative contact."
+msgstr ""
+
+#. module: l10n_fr_das2
+#: code:addons/l10n_fr_das2/models/l10n_fr_das2.py:303
+#, python-format
+msgid "Missing city on partner '%s'."
+msgstr ""
+
+#. module: l10n_fr_das2
+#: sql_constraint:l10n.fr.das2.line:0
+msgid "Negative amounts not allowed!"
+msgstr ""
+
+#. module: l10n_fr_das2
+#: model:ir.model.fields,field_description:l10n_fr_das2.field_l10n_fr_das2_line__note
+msgid "Note"
+msgstr ""
+
+#. module: l10n_fr_das2
+#: model_terms:ir.ui.view,arch_db:l10n_fr_das2.l10n_fr_das2_line_form
+msgid "Notes"
+msgstr ""
+
+#. module: l10n_fr_das2
+#: model:ir.model.fields,field_description:l10n_fr_das2.field_l10n_fr_das2_line__benefits_in_kind_food
+msgid "Nourriture"
+msgstr ""
+
+#. module: l10n_fr_das2
+#: model:ir.model.fields,field_description:l10n_fr_das2.field_l10n_fr_das2__message_needaction_counter
+msgid "Number of Actions"
+msgstr ""
+
+#. module: l10n_fr_das2
+#: model:ir.model.fields,field_description:l10n_fr_das2.field_l10n_fr_das2__message_has_error_counter
+msgid "Number of error"
+msgstr ""
+
+#. module: l10n_fr_das2
+#: model:ir.model.fields,help:l10n_fr_das2.field_l10n_fr_das2__message_needaction_counter
+msgid "Number of messages which requires an action"
+msgstr ""
+
+#. module: l10n_fr_das2
+#: model:ir.model.fields,help:l10n_fr_das2.field_l10n_fr_das2__message_has_error_counter
+msgid "Number of messages with delivery error"
+msgstr ""
+
+#. module: l10n_fr_das2
+#: model:ir.model.fields,help:l10n_fr_das2.field_l10n_fr_das2__message_unread_counter
+msgid "Number of unread messages"
+msgstr ""
+
+#. module: l10n_fr_das2
+#: code:addons/l10n_fr_das2/models/l10n_fr_das2.py:455
+#, python-format
+msgid "One of the lines has a length of %d. All lines should have a length of 672. Line: %s."
+msgstr ""
+
+#. module: l10n_fr_das2
+#: model:ir.model.fields,field_description:l10n_fr_das2.field_l10n_fr_das2_line__benefits_in_kind_nict
+msgid "Outils issus des NTIC"
+msgstr ""
+
+#. module: l10n_fr_das2
+#: model:ir.model.fields,field_description:l10n_fr_das2.field_l10n_fr_das2__partner_declare_threshold
+msgid "Partner Declaration Threshold"
+msgstr ""
+
+#. module: l10n_fr_das2
+#: model:ir.model.fields,field_description:l10n_fr_das2.field_l10n_fr_das2__payment_journal_ids
+msgid "Payment Journals"
+msgstr ""
+
+#. module: l10n_fr_das2
+#: code:addons/l10n_fr_das2/models/l10n_fr_das2.py:191
+#, python-format
+msgid "Payment dated %s in journal '%s': %.2f € (journal entry %s)"
+msgstr ""
+
+#. module: l10n_fr_das2
+#: model:ir.model.fields,field_description:l10n_fr_das2.field_l10n_fr_das2_line__allowance_employer
+msgid "Prise en charge directe par l'employeur"
+msgstr ""
+
+#. module: l10n_fr_das2
+#: model:ir.model.fields,field_description:l10n_fr_das2.field_l10n_fr_das2_line__job
+msgid "Profession"
+msgstr ""
+
+#. module: l10n_fr_das2
+#: model:ir.model.fields,field_description:l10n_fr_das2.field_l10n_fr_das2_line__withholding_tax_amount
+msgid "Retenue à la source"
+msgstr ""
+
+#. module: l10n_fr_das2
+#: model:ir.model.fields,field_description:l10n_fr_das2.field_l10n_fr_das2_line__discount_amount
+#: selection:res.partner,fr_das2_type:0
+msgid "Ristournes"
+msgstr ""
+
+#. module: l10n_fr_das2
+#: model:ir.model.fields,field_description:l10n_fr_das2.field_l10n_fr_das2_line__partner_siret
+msgid "SIRET"
+msgstr ""
+
+#. module: l10n_fr_das2
+#: code:addons/l10n_fr_das2/models/l10n_fr_das2.py:695
+#, python-format
+msgid "SIRET %s is invalid: it must have 14 digits."
+msgstr ""
+
+#. module: l10n_fr_das2
+#: code:addons/l10n_fr_das2/models/l10n_fr_das2.py:699
+#, python-format
+msgid "SIRET %s is invalid: the checksum is wrong."
+msgstr ""
+
+#. module: l10n_fr_das2
+#: sql_constraint:l10n.fr.das2.line:0
+msgid "Same partner used on several lines!"
+msgstr ""
+
+#. module: l10n_fr_das2
+#: model_terms:ir.ui.view,arch_db:l10n_fr_das2.l10n_fr_das2_search
+msgid "Search DAS2"
+msgstr ""
+
+#. module: l10n_fr_das2
+#: model_terms:ir.ui.view,arch_db:l10n_fr_das2.l10n_fr_das2_line_search
+msgid "Search DAS2 Lines"
+msgstr ""
+
+#. module: l10n_fr_das2
+#: model:ir.model.fields,field_description:l10n_fr_das2.field_l10n_fr_das2__state
+#: model:ir.model.fields,field_description:l10n_fr_das2.field_l10n_fr_das2_line__state
+msgid "State"
+msgstr ""
+
+#. module: l10n_fr_das2
+#: model:ir.model.fields,field_description:l10n_fr_das2.field_l10n_fr_das2_line__partner_id
+msgid "Supplier"
+msgstr ""
+
+#. module: l10n_fr_das2
+#: model:ir.model.fields,field_description:l10n_fr_das2.field_l10n_fr_das2_line__allowance_real
+msgid "Sur frais réels"
+msgstr ""
+
+#. module: l10n_fr_das2
+#: code:addons/l10n_fr_das2/models/l10n_fr_das2.py:466
+#, python-format
+msgid "The DAS2 has no lines."
+msgstr ""
+
+#. module: l10n_fr_das2
+#: code:addons/l10n_fr_das2/models/l10n_fr_das2.py:155
+#, python-format
+msgid "The DAS2 partner declaration threshold is not set on company '%s'."
+msgstr ""
+
+#. module: l10n_fr_das2
+#: sql_constraint:res.company:0
+msgid "The DAS2 partner declaration threshold must be positive!"
+msgstr ""
+
+#. module: l10n_fr_das2
+#: code:addons/l10n_fr_das2/models/l10n_fr_das2.py:480
+#, python-format
+msgid "The email is not set on the administrative contact partner '%s'."
+msgstr ""
+
+#. module: l10n_fr_das2
+#: code:addons/l10n_fr_das2/models/l10n_fr_das2.py:279
+#, python-format
+msgid "The field '%s' (partner %s) is empty or 0. It should have a non-null value."
+msgstr ""
+
+#. module: l10n_fr_das2
+#: code:addons/l10n_fr_das2/models/l10n_fr_das2.py:484
+#, python-format
+msgid "The phone number is not set on the administrative contact partner '%s'."
+msgstr ""
+
+#. module: l10n_fr_das2
+#: code:addons/l10n_fr_das2/models/l10n_fr_das2.py:164
+#, python-format
+msgid "There are no partners configured for DAS2."
+msgstr ""
+
+#. module: l10n_fr_das2
+#: model:ir.model.fields,field_description:l10n_fr_das2.field_l10n_fr_das2_line__to_declare
+#: model_terms:ir.ui.view,arch_db:l10n_fr_das2.l10n_fr_das2_line_search
+msgid "To Declare"
+msgstr ""
+
+#. module: l10n_fr_das2
+#: model:ir.model.fields,field_description:l10n_fr_das2.field_l10n_fr_das2_line__total_amount
+msgid "Total Amount"
+msgstr ""
+
+#. module: l10n_fr_das2
+#: model_terms:ir.ui.view,arch_db:l10n_fr_das2.view_partner_property_form
+msgid "Type"
+msgstr ""
+
+#. module: l10n_fr_das2
+#: model:ir.model.fields,field_description:l10n_fr_das2.field_l10n_fr_das2__message_unread
+msgid "Unread Messages"
+msgstr ""
+
+#. module: l10n_fr_das2
+#: model:ir.model.fields,field_description:l10n_fr_das2.field_l10n_fr_das2__message_unread_counter
+msgid "Unread Messages Counter"
+msgstr ""
+
+#. module: l10n_fr_das2
+#: model:ir.model.fields,help:l10n_fr_das2.field_res_partner__fr_das2_job
+#: model:ir.model.fields,help:l10n_fr_das2.field_res_users__fr_das2_job
+msgid "Used in the field 'Profession' of DAS2."
+msgstr ""
+
+#. module: l10n_fr_das2
+#: model:ir.model.fields,field_description:l10n_fr_das2.field_l10n_fr_das2_line__benefits_in_kind_car
+msgid "Voiture"
+msgstr ""
+
+#. module: l10n_fr_das2
+#: model:ir.model.fields,field_description:l10n_fr_das2.field_l10n_fr_das2__website_message_ids
+msgid "Website Messages"
+msgstr ""
+
+#. module: l10n_fr_das2
+#: model:ir.model.fields,help:l10n_fr_das2.field_l10n_fr_das2__website_message_ids
+msgid "Website communication history"
+msgstr ""
+
+#. module: l10n_fr_das2
+#: model:ir.model.fields,field_description:l10n_fr_das2.field_l10n_fr_das2__year
+msgid "Year"
+msgstr ""
+
From 3a5453e9bdf1e33f82ea897132d9bed27a921843 Mon Sep 17 00:00:00 2001
From: David Beal
Date: Tue, 21 Apr 2020 15:13:32 +0200
Subject: [PATCH 21/57] FIX l10n_fr_das2 E7901 rst error 'Duplicate explicit
target name
---
l10n_fr_das2/README.rst | 5 ++++-
l10n_fr_das2/readme/USAGE.rst | 5 ++++-
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/l10n_fr_das2/README.rst b/l10n_fr_das2/README.rst
index f497668eb4..f72cfd0fe2 100644
--- a/l10n_fr_das2/README.rst
+++ b/l10n_fr_das2/README.rst
@@ -51,6 +51,9 @@ For the user responsible for the declaration, the phone number and email must be
Usage
=====
+.. _DAS2_declaration: https://teletd.impots.gouv.fr/teletd/connexionEFI.do
+
+
Go to the menu *Accounting > Reports > French Statements > DAS2* and create a new DAS2 report.
Then click on the button *Generate Lines*. Check and edit the generated lines. You can get the details of the computation performed by Odoo in the *Note* fields of each line.
@@ -59,7 +62,7 @@ You should also have a look in the chatter: you may have a message that warn you
Once your declaration is OK, click on the button *Generate File* and download the generated file.
-Connect to `https://teletd.impots.gouv.fr/teletd/connexionEFI.do `_, select *Transmission par internet des fichiers TD/bilatéral* and type your login and password (the credentials are specific to this website; their are not the same as on *impots.gouv.fr*). Then follow the online declaration process and upload the file generated by Odoo.
+Connect to DAS2_declaration_, select *Transmission par internet des fichiers TD/bilatéral* and type your login and password (the credentials are specific to this website; their are not the same as on *impots.gouv.fr*). Then follow the online declaration process and upload the file generated by Odoo.
In the minutes following the upload of the file on the website of the administration, you will receive a first e-mail with a subject *ACCUSÉ DE DÉPÔT de 1er NIVEAU (Déclaration de salaires et/ou honoraires et/ou actionnariat salarié)*; it is just an acknowledgement, it doesn't mean that the file is valid.
diff --git a/l10n_fr_das2/readme/USAGE.rst b/l10n_fr_das2/readme/USAGE.rst
index c1cd60c1e0..5eb3d5429d 100644
--- a/l10n_fr_das2/readme/USAGE.rst
+++ b/l10n_fr_das2/readme/USAGE.rst
@@ -1,3 +1,6 @@
+.. _DAS2_declaration: https://teletd.impots.gouv.fr/teletd/connexionEFI.do
+
+
Go to the menu *Accounting > Reports > French Statements > DAS2* and create a new DAS2 report.
Then click on the button *Generate Lines*. Check and edit the generated lines. You can get the details of the computation performed by Odoo in the *Note* fields of each line.
@@ -6,7 +9,7 @@ You should also have a look in the chatter: you may have a message that warn you
Once your declaration is OK, click on the button *Generate File* and download the generated file.
-Connect to `https://teletd.impots.gouv.fr/teletd/connexionEFI.do `_, select *Transmission par internet des fichiers TD/bilatéral* and type your login and password (the credentials are specific to this website; their are not the same as on *impots.gouv.fr*). Then follow the online declaration process and upload the file generated by Odoo.
+Connect to DAS2_declaration_, select *Transmission par internet des fichiers TD/bilatéral* and type your login and password (the credentials are specific to this website; their are not the same as on *impots.gouv.fr*). Then follow the online declaration process and upload the file generated by Odoo.
In the minutes following the upload of the file on the website of the administration, you will receive a first e-mail with a subject *ACCUSÉ DE DÉPÔT de 1er NIVEAU (Déclaration de salaires et/ou honoraires et/ou actionnariat salarié)*; it is just an acknowledgement, it doesn't mean that the file is valid.
From 9c4ee1dead1e23ad2d92a3b56a02be0aed593e02 Mon Sep 17 00:00:00 2001
From: OCA-git-bot
Date: Wed, 22 Apr 2020 11:19:10 +0000
Subject: [PATCH 22/57] [UPD] README.rst
---
l10n_fr_das2/static/description/index.html | 30 +++++++++++-----------
1 file changed, 15 insertions(+), 15 deletions(-)
diff --git a/l10n_fr_das2/static/description/index.html b/l10n_fr_das2/static/description/index.html
index 4f6def775e..46a13a868f 100644
--- a/l10n_fr_das2/static/description/index.html
+++ b/l10n_fr_das2/static/description/index.html
@@ -373,19 +373,19 @@
For the user responsible for the declaration, the phone number and email must be set on his related partner form (name, email and phone number are used in the DAS2 declaration file).
Go to the menu Accounting > Reports > French Statements > DAS2 and create a new DAS2 report.
Then click on the button Generate Lines. Check and edit the generated lines. You can get the details of the computation performed by Odoo in the Note fields of each line.
You should also have a look in the chatter: you may have a message that warn you about suppliers that have expenses recorded in accounts such as 622100 Commissions et courtages sur achats, 622200 Commissions et courtages sur ventes, 622600 Honoraires, 622800 Rémunérations d’intermédiaires divers, 653000 Jetons de présence, 651600 Droits d’auteur et de reproduction and are not configured for DAS2.
Once your declaration is OK, click on the button Generate File and download the generated file.
-
Connect to https://teletd.impots.gouv.fr/teletd/connexionEFI.do, select Transmission par internet des fichiers TD/bilatéral and type your login and password (the credentials are specific to this website; their are not the same as on impots.gouv.fr). Then follow the online declaration process and upload the file generated by Odoo.
+
Connect to DAS2_declaration, select Transmission par internet des fichiers TD/bilatéral and type your login and password (the credentials are specific to this website; their are not the same as on impots.gouv.fr). Then follow the online declaration process and upload the file generated by Odoo.
In the minutes following the upload of the file on the website of the administration, you will receive a first e-mail with a subject ACCUSÉ DE DÉPÔT de 1er NIVEAU (Déclaration de salaires et/ou honoraires et/ou actionnariat salarié); it is just an acknowledgement, it doesn’t mean that the file is valid.
Then, on the next open day (in my experience), you will receive a second email with a subject Déclaration annuelle DADS BILATERALE. Référence DGFIP: xxxx. Numéro d’envoi : xxx. VALIDE, which means that the file was considered as valid. If the subject ends with BLOQUANT, then you should look for the detailed report in the attached PDF report.
Bugs are tracked on GitHub Issues.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and welcomed
@@ -415,21 +415,21 @@
OCA, or the Odoo Community Association, is a nonprofit organization whose
From 36c1308d70b1165daf877fce990520c228a73eb5 Mon Sep 17 00:00:00 2001
From: OCA-git-bot
Date: Wed, 22 Apr 2020 11:19:11 +0000
Subject: [PATCH 23/57] l10n_fr_das2 12.0.1.0.1
---
l10n_fr_das2/__manifest__.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/l10n_fr_das2/__manifest__.py b/l10n_fr_das2/__manifest__.py
index bd7ab3356e..15b800ad58 100644
--- a/l10n_fr_das2/__manifest__.py
+++ b/l10n_fr_das2/__manifest__.py
@@ -4,7 +4,7 @@
{
'name': 'DAS2',
- 'version': '12.0.1.0.0',
+ 'version': '12.0.1.0.1',
'category': 'Invoicing Management',
'license': 'AGPL-3',
'summary': 'DAS2 (France)',
From af889ec130d260d591c501d41bbcc98de2bea404 Mon Sep 17 00:00:00 2001
From: Alexis de Lattre
Date: Wed, 13 May 2020 22:46:02 +0200
Subject: [PATCH 24/57] l10n_fr_das2: FIX computation of total_amount on lines
---
l10n_fr_das2/models/l10n_fr_das2.py | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/l10n_fr_das2/models/l10n_fr_das2.py b/l10n_fr_das2/models/l10n_fr_das2.py
index 4c1fbf8104..79262702bb 100644
--- a/l10n_fr_das2/models/l10n_fr_das2.py
+++ b/l10n_fr_das2/models/l10n_fr_das2.py
@@ -677,15 +677,15 @@ class L10nFrDas2Line(models.Model):
'withholding_tax_amount')
def _compute_total_amount(self):
for line in self:
- amount_total = 0
+ total_amount = 0
for field_name in AMOUNT_FIELDS:
- amount_total += line[field_name]
+ total_amount += line[field_name]
to_declare = False
if line.parent_id:
- if amount_total >= line.parent_id.partner_declare_threshold:
+ if total_amount >= line.parent_id.partner_declare_threshold:
to_declare = True
line.to_declare = to_declare
- line.amount_total = amount_total
+ line.total_amount = total_amount
@api.constrains('partner_siret')
def check_siret(self):
From 4dc3678d76253c69f03689b5ac79815f966179b3 Mon Sep 17 00:00:00 2001
From: Alexis de Lattre
Date: Thu, 18 Feb 2021 22:23:34 +0100
Subject: [PATCH 25/57] [MIG] l10n_fr_das2 and l10n_fr_cog to v14
Add warning message at the top of DAS2 form (and not only in chatter)
Use python-stdnum to validate SIRET
---
l10n_fr_cog/__manifest__.py | 4 +-
l10n_fr_cog/data/country.xml | 2 +-
l10n_fr_cog/models/__init__.py | 2 +-
.../models/{country.py => res_country.py} | 2 +-
l10n_fr_cog/views/country.xml | 2 +-
l10n_fr_das2/__init__.py | 1 +
l10n_fr_das2/__manifest__.py | 10 +-
l10n_fr_das2/demo/demo.xml | 14 +--
l10n_fr_das2/models/__init__.py | 5 +-
l10n_fr_das2/models/l10n_fr_das2.py | 110 +++++++-----------
.../models/{company.py => res_company.py} | 2 +-
.../models/{partner.py => res_partner.py} | 4 +-
l10n_fr_das2/security/das2_security.xml | 4 +-
l10n_fr_das2/views/l10n_fr_das2.xml | 15 ++-
...g_settings.xml => res_config_settings.xml} | 8 +-
.../views/{partner.xml => res_partner.xml} | 5 +-
l10n_fr_das2/wizards/__init__.py | 1 +
.../res_config_settings.py} | 2 +-
18 files changed, 90 insertions(+), 103 deletions(-)
rename l10n_fr_cog/models/{country.py => res_country.py} (84%)
rename l10n_fr_das2/models/{company.py => res_company.py} (89%)
rename l10n_fr_das2/models/{partner.py => res_partner.py} (86%)
rename l10n_fr_das2/views/{config_settings.xml => res_config_settings.xml} (83%)
rename l10n_fr_das2/views/{partner.xml => res_partner.xml} (89%)
create mode 100644 l10n_fr_das2/wizards/__init__.py
rename l10n_fr_das2/{models/config_settings.py => wizards/res_config_settings.py} (85%)
diff --git a/l10n_fr_cog/__manifest__.py b/l10n_fr_cog/__manifest__.py
index 39e4fb6ef1..18a8eac9c4 100644
--- a/l10n_fr_cog/__manifest__.py
+++ b/l10n_fr_cog/__manifest__.py
@@ -1,11 +1,11 @@
-# Copyright 2020 Akretion France (http://www.akretion.com/)
+# Copyright 2020-2021 Akretion France (http://www.akretion.com/)
# @author: Alexis de Lattre
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
'name': 'Code Officiel Géographique',
'summary': 'Add Code Officiel Géographique (COG) on countries',
- 'version': '12.0.1.0.0',
+ 'version': '14.0.1.0.0',
'category': 'French Localization',
'author': "Akretion,Odoo Community Association (OCA)",
'website': 'https://github.com/OCA/l10n-france',
diff --git a/l10n_fr_cog/data/country.xml b/l10n_fr_cog/data/country.xml
index d0087682cd..7afb82fc7a 100644
--- a/l10n_fr_cog/data/country.xml
+++ b/l10n_fr_cog/data/country.xml
@@ -1,6 +1,6 @@
diff --git a/l10n_fr_cog/models/__init__.py b/l10n_fr_cog/models/__init__.py
index 30b933141f..11573766f2 100644
--- a/l10n_fr_cog/models/__init__.py
+++ b/l10n_fr_cog/models/__init__.py
@@ -1 +1 @@
-from . import country
+from . import res_country
diff --git a/l10n_fr_cog/models/country.py b/l10n_fr_cog/models/res_country.py
similarity index 84%
rename from l10n_fr_cog/models/country.py
rename to l10n_fr_cog/models/res_country.py
index 0dbd77de6f..d0eb7ac4c7 100644
--- a/l10n_fr_cog/models/country.py
+++ b/l10n_fr_cog/models/res_country.py
@@ -1,4 +1,4 @@
-# Copyright 2020 Akretion France (http://www.akretion.com/)
+# Copyright 2020-2021 Akretion France (http://www.akretion.com/)
# @author: Alexis de Lattre
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
diff --git a/l10n_fr_cog/views/country.xml b/l10n_fr_cog/views/country.xml
index 0373c47281..aad4efd4f5 100644
--- a/l10n_fr_cog/views/country.xml
+++ b/l10n_fr_cog/views/country.xml
@@ -1,6 +1,6 @@
diff --git a/l10n_fr_das2/__init__.py b/l10n_fr_das2/__init__.py
index 0650744f6b..aee8895e7a 100644
--- a/l10n_fr_das2/__init__.py
+++ b/l10n_fr_das2/__init__.py
@@ -1 +1,2 @@
from . import models
+from . import wizards
diff --git a/l10n_fr_das2/__manifest__.py b/l10n_fr_das2/__manifest__.py
index 15b800ad58..1dee664a7a 100644
--- a/l10n_fr_das2/__manifest__.py
+++ b/l10n_fr_das2/__manifest__.py
@@ -1,10 +1,10 @@
-# Copyright 2020 Akretion France (http://www.akretion.com/)
+# Copyright 2020-2021 Akretion France (http://www.akretion.com/)
# @author: Alexis de Lattre
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
'name': 'DAS2',
- 'version': '12.0.1.0.1',
+ 'version': '14.0.1.0.0',
'category': 'Invoicing Management',
'license': 'AGPL-3',
'summary': 'DAS2 (France)',
@@ -15,14 +15,14 @@
'l10n_fr_cog',
],
'external_dependencies': {
- 'python': ['unidecode'],
+ 'python': ['unidecode', 'python-stdnum'],
},
'data': [
'security/das2_security.xml',
'security/ir.model.access.csv',
'views/l10n_fr_das2.xml',
- 'views/partner.xml',
- 'views/config_settings.xml',
+ 'views/res_partner.xml',
+ 'views/res_config_settings.xml',
],
'demo': ['demo/demo.xml'],
'installable': True,
diff --git a/l10n_fr_das2/demo/demo.xml b/l10n_fr_das2/demo/demo.xml
index f30535e6d9..01c28dbd0b 100644
--- a/l10n_fr_das2/demo/demo.xml
+++ b/l10n_fr_das2/demo/demo.xml
@@ -1,6 +1,6 @@
@@ -22,8 +22,8 @@
Experts comptables du Rhône
-
-
+
+ 12 rue du chiffre69100Villeurbanne
@@ -37,8 +37,8 @@
Cabinet d'avocats Juridon
-
-
+
+ 42 rue du crime69100Villeurbanne
@@ -52,8 +52,8 @@
Cabinet CACtus
-
-
+
+ 42 rue de l'audit69100Villeurbanne
diff --git a/l10n_fr_das2/models/__init__.py b/l10n_fr_das2/models/__init__.py
index 36aac8dba7..cb3d3203f6 100644
--- a/l10n_fr_das2/models/__init__.py
+++ b/l10n_fr_das2/models/__init__.py
@@ -1,4 +1,3 @@
from . import l10n_fr_das2
-from . import partner
-from . import company
-from . import config_settings
+from . import res_partner
+from . import res_company
diff --git a/l10n_fr_das2/models/l10n_fr_das2.py b/l10n_fr_das2/models/l10n_fr_das2.py
index 79262702bb..83a0a1e405 100644
--- a/l10n_fr_das2/models/l10n_fr_das2.py
+++ b/l10n_fr_das2/models/l10n_fr_das2.py
@@ -1,12 +1,11 @@
-# Copyright 2020 Akretion France (http://www.akretion.com/)
+# Copyright 2020-2021 Akretion France (http://www.akretion.com/)
# @author: Alexis de Lattre
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import api, fields, models, _
from odoo.exceptions import UserError, ValidationError
-from dateutil.relativedelta import relativedelta
from datetime import datetime
-from odoo.addons.l10n_fr_siret.models.partner import _check_luhn
+from stdnum.fr.siret import is_valid
import base64
import logging
@@ -30,24 +29,24 @@
class L10nFrDas2(models.Model):
_name = 'l10n.fr.das2'
- _inherit = ['mail.thread']
+ _inherit = ['mail.thread', 'mail.activity.mixin']
_order = 'year desc'
_description = 'DAS2'
year = fields.Integer(
string='Year', required=True, states={'done': [('readonly', True)]},
- track_visibility='onchange',
+ tracking=True,
default=lambda self: self._default_year())
state = fields.Selection([
('draft', 'Draft'),
('done', 'Done'),
], default='draft', readonly=True, string='State',
- track_visibility='onchange')
+ tracking=True)
company_id = fields.Many2one(
'res.company', string='Company',
ondelete='cascade', required=True,
states={'done': [('readonly', True)]},
- default=lambda self: self.env['res.company']._company_default_get())
+ default=lambda self: self.env.company)
currency_id = fields.Many2one(
related='company_id.currency_id', readonly=True, store=True,
string='Company Currency')
@@ -55,6 +54,7 @@ class L10nFrDas2(models.Model):
'account.journal',
string='Payment Journals', required=True,
default=lambda self: self._default_payment_journals(),
+ domain="[('company_id', '=', company_id)]",
states={'done': [('readonly', True)]})
line_ids = fields.One2many(
'l10n.fr.das2.line', 'parent_id', string='Lines',
@@ -66,18 +66,25 @@ class L10nFrDas2(models.Model):
('1', "La société ne verse pas de salaires"),
], 'DADS Type', required=True,
states={'done': [('readonly', True)]},
- track_visibility='onchange',
+ tracking=True,
default=lambda self: self._default_dads_type())
# option for draft moves ?
contact_id = fields.Many2one(
'res.partner', string='Administrative Contact',
states={'done': [('readonly', True)]},
default=lambda self: self.env.user.partner_id.id,
- track_visibility='onchange',
+ tracking=True,
help='Contact in the company for the fiscal administration: the name, '
'email and phone number of this partner will be used in the file.')
attachment_id = fields.Many2one(
- 'ir.attachment', string='File Export', readonly=True)
+ 'ir.attachment', string='Attachment', readonly=True)
+ attachment_datas = fields.Binary(
+ related="attachment_id.datas", string="File Export")
+ attachment_name = fields.Char(
+ related="attachment_id.name", string="Filename")
+ # The only drawback of the warning_msg solution is that I didn't find a way
+ # to put a link to partners inside it
+ warning_msg = fields.Html(readonly=True)
_sql_constraints = [(
'year_company_uniq',
@@ -98,16 +105,15 @@ def _default_payment_journals(self):
res = []
pay_journals = self.env['account.journal'].search([
('type', 'in', ('bank', 'cash')),
- ('company_id', '=', self.env.user.company_id.id)])
+ ('company_id', '=', self.env.company.id)])
if pay_journals:
res = pay_journals.ids
return res
@api.model
def _default_year(self):
- today = datetime.today()
- prev_year = today - relativedelta(years=1)
- return prev_year.year
+ last_year = datetime.today().year - 1
+ return last_year
@api.depends('year')
def name_get(self):
@@ -117,11 +123,11 @@ def name_get(self):
return res
def done(self):
- self.state = 'done'
+ self.write({'state': 'done'})
return
def back2draft(self):
- self.state = 'draft'
+ self.write({'state': 'draft'})
return
def unlink(self):
@@ -130,7 +136,7 @@ def unlink(self):
raise UserError(_(
"Cannot delete declaration %s in done state.")
% rec.display_name)
- return super(L10nFrDas2, self).unlink()
+ return super().unlink()
def generate_lines(self):
self.ensure_one()
@@ -175,8 +181,7 @@ def generate_lines(self):
vals = self._prepare_line(partner, base_domain)
if vals:
lfdlo.create(vals)
- self.message_post(body=_("DAS2 lines generated."))
- self.add_warning_in_chatter(das2_partners)
+ self.generate_warning_msg(das2_partners)
def _prepare_line(self, partner, base_domain):
amlo = self.env['account.move.line']
@@ -209,7 +214,7 @@ def _prepare_line(self, partner, base_domain):
res['partner_siret'] = partner.siret
return res
- def add_warning_in_chatter(self, das2_partners):
+ def generate_warning_msg(self, das2_partners):
amlo = self.env['account.move.line']
aao = self.env['account.account']
ajo = self.env['account.journal']
@@ -238,17 +243,23 @@ def add_warning_in_chatter(self, das2_partners):
('account_id', 'in', das2_accounts.ids),
('balance', '!=', 0),
], ['partner_id'], ['partner_id'])
+ msg = False
+ msg_post = _("DAS2 lines generated. ")
if rg_res:
msg = _(
- "
The following partners are not configured for DAS2 but "
+ "The following partners are not configured for DAS2 but "
"they have expenses in some accounts that indicate "
- "that maybe they should be configured for DAS2:
")
+ "they should probably be configured for DAS2:
")
+ msg_post += msg
for rg_re in rg_res:
partner = rpo.browse(rg_re['partner_id'][0])
- msg += '