-
-
Notifications
You must be signed in to change notification settings - Fork 113
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MIG]l10n_fr_department_oversea: migrate to 11.0
- Loading branch information
1 parent
3f64143
commit 48469f8
Showing
8 changed files
with
87 additions
and
110 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
from .post_install import set_oversea_department_on_partner |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
69 changes: 31 additions & 38 deletions
69
l10n_fr_department_oversea/data/res_country_department.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,35 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!-- | ||
© 2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>) | ||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
--> | ||
<odoo> | ||
<data 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> | ||
|
||
|
||
</data> | ||
<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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,35 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!-- | ||
© 2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>) | ||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
--> | ||
<odoo> | ||
<data 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> | ||
|
||
|
||
</data> | ||
<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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
from . import test_department_oversea |
25 changes: 11 additions & 14 deletions
25
l10n_fr_department_oversea/tests/test_department_oversea.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,33 @@ | ||
# -*- coding: utf-8 -*- | ||
# © 2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>) | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). | ||
|
||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). | ||
from odoo.tests.common import TransactionCase | ||
|
||
|
||
class TestFrDepartmentOversea(TransactionCase): | ||
|
||
def test_fr_department_oversea(self): | ||
rpo = self.env['res.partner'] | ||
partner1 = rpo.create({ | ||
'name': u'Monsieur Payet', | ||
'street': u'11 rue du Stade', | ||
'street2': u'Montgaillard', | ||
'name': 'Monsieur Payet', | ||
'street': '11 rue du Stade', | ||
'street2': 'Montgaillard', | ||
'zip': '97400', | ||
'city': u'Saint Denis', | ||
'city': 'Saint Denis', | ||
'country_id': self.env.ref('base.re').id, | ||
}) | ||
self.assertEquals( | ||
self.assertEqual( | ||
partner1.department_id, | ||
self.env.ref( | ||
'l10n_fr_department_oversea.res_country_department_reunion')) | ||
# I also want it to work if you select France as country | ||
partner2 = rpo.create({ | ||
'name': u'Monsieur Hoarau', | ||
'street': u'13 rue du Stade', | ||
'street2': u'Montgaillard', | ||
'name': 'Monsieur Hoarau', | ||
'street': '13 rue du Stade', | ||
'street2': 'Montgaillard', | ||
'zip': '97400', | ||
'city': u'Saint Denis', | ||
'city': 'Saint Denis', | ||
'country_id': self.env.ref('base.fr').id, | ||
}) | ||
self.assertEquals( | ||
self.assertEqual( | ||
partner2.department_id, | ||
self.env.ref( | ||
'l10n_fr_department_oversea.res_country_department_reunion')) |