Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
7690572
Add module l10n_fr_account_tax_unece
alexis-via Feb 24, 2017
5beb21f
l10n_fr_account_tax_unece: adapt default FR tax config to Factur-X specs
alexis-via Jul 28, 2017
15cd1f8
l10n_fr_account_tax_unece: Update following a change in the Factur-X …
alexis-via Sep 6, 2017
cea0a01
l10n_fr_account_tax_unece: also update tax templates
alexis-via Oct 15, 2017
7ca0a2f
Update l10n_fr_account_tax_unece.pot
oca-travis Jun 22, 2018
cac989a
l10n_fr_account_tax_unece: post_install now match on XMLID instead of…
alexis-via Oct 3, 2018
7e6d71a
l10n_fr_account_tax_unece from 10 to 12
alexis-via Feb 20, 2019
1546822
README.rst
OCA-git-bot Feb 27, 2019
9b3fb02
icon.png
OCA-git-bot Apr 3, 2019
6402643
README.rst
OCA-git-bot Jul 29, 2019
a405365
Update l10n_fr_account_tax_unece.pot
oca-travis Jul 29, 2019
fcad650
FIX non compliant code with oca rules
bealdav Feb 18, 2020
a58ca81
[MIG] l10n_fr_account_tax_unece from v12 to v13
alexis-via Feb 27, 2020
92afb07
pre-commit on l10n_fr_account_tax_unece
alexis-via Apr 26, 2020
977139c
[UPD] README.rst
OCA-git-bot May 5, 2020
38b3025
[FIX] l10n_fr_account_tax_unece: adapt to changes in l10n_fr (officia…
alexis-via Oct 25, 2020
67eb2be
[MIG] l10n_fr_account_tax_unece to v14
alexis-via Oct 25, 2020
b686499
[UPD] README.rst
OCA-git-bot Feb 26, 2021
80a4459
[REF] Fix pre-commit ignoring modules
legalsylvain Aug 10, 2021
b0ba674
[UPD] README.rst
OCA-git-bot Aug 10, 2021
05c8b5c
l10n_fr_account_tax_unece 14.0.1.0.1
OCA-git-bot Aug 10, 2021
f63e698
Restore tests and remove Alpha status
alexis-via Sep 1, 2021
da9471a
[UPD] Update l10n_fr_account_tax_unece.pot
oca-travis Sep 2, 2021
0f35b5d
[UPD] README.rst
OCA-git-bot Sep 2, 2021
9a9296d
l10n_fr_account_tax_unece 14.0.1.0.2
OCA-git-bot Sep 2, 2021
c2101ca
[MIG] l10n_fr_account_tax_unece from v14 to v15
alexis-via Dec 6, 2021
9a9e5d9
[UPD] Update l10n_fr_account_tax_unece.pot
Jan 28, 2022
57aa719
[UPD] README.rst
OCA-git-bot Jan 28, 2022
9a4d461
l10n_fr_account_tax_unece: update to latest l10n_fr
alexis-via Dec 3, 2022
2556297
l10n_fr_account_tax_unece 15.0.1.1.0
OCA-git-bot Dec 3, 2022
3d23667
[MIG] l10n_fr_account_tax_unece to v16
alexis-via Dec 26, 2022
8f074b1
[UPD] Update l10n_fr_account_tax_unece.pot
Dec 30, 2022
b9e767b
[UPD] README.rst
OCA-git-bot Dec 30, 2022
109feff
[UPD] README.rst
OCA-git-bot Sep 3, 2023
5b85f60
[IMP] l10n_fr_account_tax_unece: pre-commit auto fixes
alexis-via Mar 2, 2024
d765224
[MIG] l10n_fr_account_tax_unece: migrate to v17
alexis-via Mar 2, 2024
8fac50e
[UPD] Update l10n_fr_account_tax_unece.pot
Mar 6, 2024
8369415
[BOT] post-merge updates
OCA-git-bot Mar 6, 2024
ea7c9cc
Added translation using Weblate (Spanish)
Ivorra78 Mar 20, 2024
753798a
Translated using Weblate (Spanish)
Ivorra78 Mar 20, 2024
05aea23
[IMP] l10n_fr_account_tax_unece: pre-commit auto fixes
alexis-via Dec 19, 2024
0085bc6
[MIG] l10n_fr_account_tax_unece: migrate to v18
alexis-via Dec 19, 2024
f88f582
[UPD] Update l10n_fr_account_tax_unece.pot
Jan 2, 2025
9b20360
[BOT] post-merge updates
OCA-git-bot Jan 2, 2025
0820e0e
[MIG] l10n_fr_account_tax_unece: mig from 18 to 19
alexis-via Dec 22, 2025
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
89 changes: 89 additions & 0 deletions l10n_fr_account_tax_unece/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
.. image:: https://odoo-community.org/readme-banner-image
:target: https://odoo-community.org/get-involved?utm_source=readme
:alt: Odoo Community Association

=========================
L10n FR Account Tax UNECE
=========================

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

.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/license-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fl10n--france-lightgray.png?logo=github
:target: https://github.com/OCA/l10n-france/tree/19.0/l10n_fr_account_tax_unece
: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-19-0/l10n-france-19-0-l10n_fr_account_tax_unece
: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=19.0
:alt: Try me on Runboat

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

This module will auto-configure the parameters *UNECE Tax Type* and
*UNECE Tax Category* on taxes defined in the *l10n_fr* module.

**Table of contents**

.. contents::
:local:

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_account_tax_unece%0Aversion:%2019.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

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

Credits
=======

Authors
-------

* 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/19.0/l10n_fr_account_tax_unece>`_ 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_account_tax_unece/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from . import models
from .post_install import set_unece_on_taxes
18 changes: 18 additions & 0 deletions l10n_fr_account_tax_unece/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Copyright 2017-2022 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": "L10n FR Account Tax UNECE",
"summary": "Auto-configure UNECE params on French taxes",
"version": "19.0.1.0.0",
"category": "French Localization",
"author": "Akretion,Odoo Community Association (OCA)",
"maintainers": ["alexis-via"],
"website": "https://github.com/OCA/l10n-france",
"license": "AGPL-3",
"depends": ["l10n_fr_account", "account_tax_unece"],
"post_init_hook": "set_unece_on_taxes",
"installable": True,
"auto_installable": True,
}
22 changes: 22 additions & 0 deletions l10n_fr_account_tax_unece/i18n/es.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * l10n_fr_account_tax_unece
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 17.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2024-03-20 19:33+0000\n"
"Last-Translator: Ivorra78 <[email protected]>\n"
"Language-Team: none\n"
"Language: es\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 4.17\n"

#. module: l10n_fr_account_tax_unece
#: model:ir.model,name:l10n_fr_account_tax_unece.model_account_chart_template
msgid "Account Chart Template"
msgstr "Plantilla del Plan Contable"
19 changes: 19 additions & 0 deletions l10n_fr_account_tax_unece/i18n/l10n_fr_account_tax_unece.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * l10n_fr_account_tax_unece
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 18.0\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"

#. module: l10n_fr_account_tax_unece
#: model:ir.model,name:l10n_fr_account_tax_unece.model_account_chart_template
msgid "Account Chart Template"
msgstr ""
1 change: 1 addition & 0 deletions l10n_fr_account_tax_unece/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import account_chart_template
41 changes: 41 additions & 0 deletions l10n_fr_account_tax_unece/models/account_chart_template.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Copyright 2024 Akretion France (http://www.akretion.com/)
# @author: Alexis de Lattre <[email protected]>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import models

from odoo.addons.account.models.chart_template import template


class AccountChartTemplate(models.AbstractModel):
_inherit = "account.chart.template"

def _fr_account_tax_unece_data(self):
xmlid2id = {
"type_vat": self.env.ref("account_tax_unece.tax_type_vat").id,
"categ_s": self.env.ref("account_tax_unece.tax_categ_s").id,
"categ_k": self.env.ref("account_tax_unece.tax_categ_k").id,
"categ_g": self.env.ref("account_tax_unece.tax_categ_g").id,
"categ_e": self.env.ref("account_tax_unece.tax_categ_e").id,
}
res = {}
tax_data = self._parse_csv("fr", "account.tax")
for tax_xmlid in tax_data.keys():
res[tax_xmlid] = {
"unece_type_id": xmlid2id["type_vat"],
}
if "_intra_" in tax_xmlid:
res[tax_xmlid]["unece_categ_id"] = xmlid2id["categ_k"]
elif "_export" in tax_xmlid or "_import" in tax_xmlid:
res[tax_xmlid]["unece_categ_id"] = xmlid2id["categ_g"]
elif "_imm_" in tax_xmlid or "_fuel" in tax_xmlid:
res[tax_xmlid]["unece_categ_id"] = False
elif tax_xmlid.endswith(("_good_0", "_service_0")):
res[tax_xmlid]["unece_categ_id"] = xmlid2id["categ_e"]
else:
res[tax_xmlid]["unece_categ_id"] = xmlid2id["categ_s"]
return res

@template("fr", "account.tax")
def _get_fr_account_tax(self):
return self._fr_account_tax_unece_data()
44 changes: 44 additions & 0 deletions l10n_fr_account_tax_unece/post_install.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Copyright 2016-2022 Akretion France (http://www.akretion.com/)
# @author: Alexis de Lattre <[email protected]>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

import logging

logger = logging.getLogger(__name__)


def set_unece_on_taxes(env):
data = env["account.chart.template"]._fr_account_tax_unece_data()
logger.debug("set_unece_on_taxes data=%s", data)
companies = env["res.company"].search([])
for company in companies:
# country_id is NOT a stored field on res.company
if company.country_id and company.country_id != env.ref("base.fr"):
continue
logger.debug(
"set_unece_on_taxes working on company %s ID %d",
company.display_name,
company.id,
)
taxes = (
env["account.tax"]
.with_context(active_test=False)
.search([("company_id", "=", company.id)])
)
for tax in taxes:
xmlid_obj = env["ir.model.data"].search(
[
("model", "=", "account.tax"),
("module", "=", "account"),
("res_id", "=", tax.id),
],
limit=1,
)
if xmlid_obj and xmlid_obj.name and len(xmlid_obj.name.split("_", 1)) == 2:
# Remove the 'companyID_' prefix from XMLID of tax
vals = data.get(xmlid_obj.name.split("_", 1)[1])
if vals:
logger.debug(
"set_unece_on_taxes writing vals=%s on tax ID %d", vals, tax.id
)
tax.write(vals)
3 changes: 3 additions & 0 deletions l10n_fr_account_tax_unece/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
1 change: 1 addition & 0 deletions l10n_fr_account_tax_unece/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Alexis de Lattre \<<[email protected]>\>
2 changes: 2 additions & 0 deletions l10n_fr_account_tax_unece/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
This module will auto-configure the parameters *UNECE Tax Type* and
*UNECE Tax Category* on taxes defined in the *l10n_fr* module.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading