Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
69af606
Add module l10n_fr_department_oversea
alexis-via Jul 25, 2016
174c55a
Remove debug print
alexis-via Jul 25, 2016
5e38127
PEP8 fix
alexis-via Jul 25, 2016
a2c622a
Make modules uninstallable
pedrobaeza Oct 6, 2016
bd60945
Rename manifest files
pedrobaeza Oct 6, 2016
1f374e0
Port l10n_fr_department, l10n_fr_department_oversea and l10n_fr_state…
alexis-via Oct 6, 2016
e01c801
l10n_fr_department_oversea: migrate to 11.0
Apr 23, 2018
21fe952
Update l10n_fr_department_oversea.pot
oca-travis Jun 23, 2018
365daa9
[MIG] l10n_fr_department, l10n_fr_department_oversea, l10n_fr_state f…
alexis-via Oct 5, 2018
fa6a083
l10n_fr_department_oversea: update version number to v12
alexis-via Oct 22, 2018
34be203
[UPD] README.rst
OCA-git-bot Nov 7, 2018
93d9237
[UPD] Update l10n_fr_department_oversea.pot
oca-travis Nov 7, 2018
3426090
[ADD] icon.png
OCA-git-bot Apr 3, 2019
bb6187a
[UPD] README.rst
OCA-git-bot Jul 29, 2019
b3cd2d5
[MIG] l10n_fr_department_oversea: migration 12.0 to 13.0
zuher83 Feb 15, 2020
12f5c22
[UPD] README.rst
OCA-git-bot Jun 7, 2020
bb07be1
[MIG] l10n_fr_department* and l10n_fr_state to v14
alexis-via Oct 9, 2020
2dddee7
[UPD] README.rst
OCA-git-bot Oct 15, 2020
945546e
[UPD] Update l10n_fr_department_oversea.pot
oca-travis Aug 10, 2021
9fbdda4
Restore tests and remove Alpha status
alexis-via Sep 1, 2021
d0d5ba8
[UPD] README.rst
OCA-git-bot Sep 2, 2021
b77e6fa
l10n_fr_department_oversea 14.0.1.0.1
OCA-git-bot Sep 2, 2021
8f508b1
[MIG] l10n_fr_department and l10n_fr_department_oversea from v14 to v15
alexis-via Jan 2, 2022
f3774a6
[UPD] Update l10n_fr_department_oversea.pot
Jan 28, 2022
de13839
[UPD] README.rst
OCA-git-bot Jan 28, 2022
19281b0
[MIG] l10n_fr_department and l10n_fr_department_oversea to v16
alexis-via Dec 26, 2022
2238f9f
[UPD] Update l10n_fr_department_oversea.pot
Dec 30, 2022
798c2b6
[UPD] README.rst
OCA-git-bot Dec 30, 2022
c9a7e9c
[UPD] README.rst
OCA-git-bot Sep 3, 2023
9aaac7a
l10n_fr_state + l10n_fr_department*: pre-commit auto fixes
alexis-via Dec 29, 2023
530466e
[MIG] l10n_fr_state and l10n_fr_department* to v17
alexis-via Dec 29, 2023
c0dde09
[UPD] Update l10n_fr_department_oversea.pot
Jan 19, 2024
035e344
[BOT] post-merge updates
OCA-git-bot Jan 19, 2024
31826e6
[IMP] l10n_fr_department_oversea: pre-commit auto fixes
alexis-via Nov 26, 2024
1cec28d
[IMP] l10n_fr_department_oversea: improve variable name
alexis-via Nov 26, 2024
5f54d45
[UPD] Update l10n_fr_department_oversea.pot
Dec 27, 2024
11dcb0a
[BOT] post-merge updates
OCA-git-bot Dec 27, 2024
a3a3e2b
[MIG] l10n_fr_department_oversea: mig 18 -> 19
alexis-via Dec 24, 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
91 changes: 91 additions & 0 deletions l10n_fr_department_oversea/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
.. image:: https://odoo-community.org/readme-banner-image
:target: https://odoo-community.org/get-involved?utm_source=readme
:alt: Odoo Community Association

=================================
French Overseas Departments (DOM)
=================================

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

.. |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_department_oversea
: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_department_oversea
: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 adds the 5 French overseas States (Régions) and Departments
(Départements) in the *res_country_state* and *res_country_department*
tables.

**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_department_oversea%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 <alexis.delattre@akretion.com>
- Danh Vo <https://github.com/danhvophuong>

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_department_oversea>`_ 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_department_oversea/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from .pre_init_hook import create_fr_oversea_state_xmlid
from .post_install import set_oversea_department_on_partner
23 changes: 23 additions & 0 deletions l10n_fr_department_oversea/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Copyright 2016-2022 Akretion France (http://www.akretion.com/)
# @author: Alexis de Lattre <alexis.delattre@akretion.com>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

{
"name": "French Overseas Departments (DOM)",
"summary": "Populate Database with overseas French "
"Departments (Départements d'outre-mer)",
"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_department"],
"data": [
"data/res_country_state.xml",
"data/res_country_department.xml",
],
"pre_init_hook": "create_fr_oversea_state_xmlid",
"post_init_hook": "set_oversea_department_on_partner",
"installable": True,
}
32 changes: 32 additions & 0 deletions l10n_fr_department_oversea/data/res_country_department.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<!--
Copyright 2016-2022 Akretion France (http://www.akretion.com/)
@author: Alexis de Lattre <alexis.delattre@akretion.com>
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
-->
<odoo noupdate="1">
<record id="res_country_department_guadeloupe" model="res.country.department">
<field name="name">Guadeloupe</field>
<field name="code">971</field>
<field name="state_id" ref="res_country_state_guadeloupe" />
</record>
<record id="res_country_department_martinique" model="res.country.department">
<field name="name">Martinique</field>
<field name="code">972</field>
<field name="state_id" ref="res_country_state_martinique" />
</record>
<record id="res_country_department_guyane" model="res.country.department">
<field name="name">Guyane</field>
<field name="code">973</field>
<field name="state_id" ref="res_country_state_guyane" />
</record>
<record id="res_country_department_reunion" model="res.country.department">
<field name="name">La Réunion</field>
<field name="code">974</field>
<field name="state_id" ref="res_country_state_reunion" />
</record>
<record id="res_country_department_mayotte" model="res.country.department">
<field name="name">Mayotte</field>
<field name="code">976</field>
<field name="state_id" ref="res_country_state_mayotte" />
</record>
</odoo>
32 changes: 32 additions & 0 deletions l10n_fr_department_oversea/data/res_country_state.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<!--
Copyright 2016-2022 Akretion France (http://www.akretion.com/)
@author: Alexis de Lattre <alexis.delattre@akretion.com>
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
-->
<odoo noupdate="1">
<record id="res_country_state_guadeloupe" model="res.country.state">
<field name="code">GP</field>
<field name="country_id" ref="base.gp" />
<field name="name">Guadeloupe</field>
</record>
<record id="res_country_state_martinique" model="res.country.state">
<field name="code">MQ</field>
<field name="country_id" ref="base.mq" />
<field name="name">Martinique</field>
</record>
<record id="res_country_state_guyane" model="res.country.state">
<field name="code">GF</field>
<field name="country_id" ref="base.gf" />
<field name="name">Guyane</field>
</record>
<record id="res_country_state_reunion" model="res.country.state">
<field name="code">RE</field>
<field name="country_id" ref="base.re" />
<field name="name">La Réunion</field>
</record>
<record id="res_country_state_mayotte" model="res.country.state">
<field name="code">YT</field>
<field name="country_id" ref="base.yt" />
<field name="name">Mayotte</field>
</record>
</odoo>
13 changes: 13 additions & 0 deletions l10n_fr_department_oversea/i18n/l10n_fr_department_oversea.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
#
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"
26 changes: 26 additions & 0 deletions l10n_fr_department_oversea/post_install.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Copyright 2016-2022 Akretion France (http://www.akretion.com/)
# @author: Alexis de Lattre <alexis.delattre@akretion.com>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).


def set_oversea_department_on_partner(env):
"""This post_install script is required because, when the module
is installed, Odoo creates the column in the DB and compute the field
and THEN it loads the file data/res_country_department.xml...
So, when it computes the field on module installation, the
departments are not available in the DB, so the country_department_id field
on res.partner stays null. This post_install script fixes this."""
fr_dom_countries = env["res.country"].search(
[("code", "in", ("FR", "GP", "MQ", "GF", "RE", "YT"))]
)
partners = (
env["res.partner"]
.with_context(active_test=False)
.search(
[
("country_id", "in", fr_dom_countries.ids),
("country_department_id", "=", False),
]
)
)
partners._compute_country_department()
20 changes: 20 additions & 0 deletions l10n_fr_department_oversea/pre_init_hook.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Copyright 2017-2022 Akretion France
# @author: Alexis de Lattre <alexis.delattre@akretion.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from odoo.addons.l10n_fr_state.pre_init_hook import generic_create_state_xmlid

# This code is designed to avoid a problem in the following scenario:
# On a new database, the administrator executes these steps in this order:
# 1) installs base_address_extended_geonames_import and run the geonames import wizard
# for one of the French DOMs
# -> it creates the corresponding French regions (without xmlid)
# 2) installs l10n_fr_department_oversea
# -> it tries to create the res.country.state, but it fails due to the unicity
# constraint unique(country_id, code) of res.country.state.


def create_fr_oversea_state_xmlid(env):
generic_create_state_xmlid(
env, "l10n_fr_department_oversea", "data/res_country_state.xml"
)
3 changes: 3 additions & 0 deletions l10n_fr_department_oversea/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
2 changes: 2 additions & 0 deletions l10n_fr_department_oversea/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Alexis de Lattre \<<alexis.delattre@akretion.com>\>
- Danh Vo \<<https://github.com/danhvophuong>\>
3 changes: 3 additions & 0 deletions l10n_fr_department_oversea/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
This module adds the 5 French overseas States (Régions) and Departments
(Départements) in the *res_country_state* and *res_country_department*
tables.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading