Browse Source
Update base_location_nuts to 8.0.2.0.0.
Update base_location_nuts to 8.0.2.0.0.
This makes NUTS labels and levels to be stored in the res.country object. Now creating l10n submodules is a piece of cake! Relational fields now follow guidelines on naming. Old name attribute used for backwards compatibility wherever needed. Also some methods have been renamed, and refactored to be smarter. Most cases l10n modules will just need to fill the res.contry table, and regions and substates domains will work out of the box. In case you still need to overwrite any method, splitting in smaller methods makes it easier too. Oh! And no need for recursive dictionary updates. Return dict() to make it easier for submodules to add domains. Fix KeyError: 'substate_id_level'.pull/739/head
Jairo Llopis
9 years ago
committed by
Alexandre Díaz
9 changed files with 261 additions and 100 deletions
-
9base_location_nuts/README.rst
-
3base_location_nuts/__manifest__.py
-
145base_location_nuts/i18n/es.po
-
13base_location_nuts/models/__init__.py
-
29base_location_nuts/models/res_country.py
-
98base_location_nuts/models/res_partner.py
-
7base_location_nuts/models/res_partner_nuts.py
-
33base_location_nuts/views/res_country_view.xml
-
16base_location_nuts/views/res_partner_view.xml
@ -1,7 +1,10 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################## |
|||
# For copyright and license notices, see __openerp__.py file in root directory |
|||
############################################################################## |
|||
# © 2015 Antiun Ingeniería S.L. - Antonio Espinosa |
|||
# © 2015 Antiun Ingeniería S.L. - Jairo Llopis |
|||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). |
|||
|
|||
from . import res_partner_nuts |
|||
from . import res_partner |
|||
from . import ( |
|||
res_country, |
|||
res_partner_nuts, |
|||
res_partner, |
|||
) |
@ -0,0 +1,29 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# © 2015 Antiun Ingeniería S.L. - Jairo Llopis |
|||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). |
|||
|
|||
from openerp import models, fields |
|||
|
|||
|
|||
class ResCountry(models.Model): |
|||
"""Add labels corresponding to each country. |
|||
|
|||
These stay empty in this base module, and should be filled by l10n ones. |
|||
""" |
|||
_inherit = "res.country" |
|||
|
|||
state_label = fields.Char( |
|||
translate=True, |
|||
help="Label for the state NUTS category.") |
|||
substate_label = fields.Char( |
|||
translate=True, |
|||
help="Label for the substate NUTS category.") |
|||
region_label = fields.Char( |
|||
translate=True, |
|||
help="Label for the region NUTS category.") |
|||
state_level = fields.Integer( |
|||
help="Level for the state NUTS category.") |
|||
substate_level = fields.Integer( |
|||
help="Level for the substate NUTS category.") |
|||
region_level = fields.Integer( |
|||
help="Level for the region NUTS category.") |
@ -0,0 +1,33 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<!-- © 2015 Antiun Ingeniería S.L. - Jairo Llopis |
|||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). --> |
|||
|
|||
<openerp> |
|||
<data> |
|||
|
|||
<record id="view_country_form" model="ir.ui.view"> |
|||
<field name="name">NUTS fields</field> |
|||
<field name="model">res.country</field> |
|||
<field name="inherit_id" ref="base.view_country_form"/> |
|||
<field name="arch" type="xml"> |
|||
<xpath expr="/form"> |
|||
<group name="nuts" string="NUTS"> |
|||
<group> |
|||
<field name="state_label"/> |
|||
<field name="state_level"/> |
|||
</group> |
|||
<group> |
|||
<field name="substate_label"/> |
|||
<field name="substate_level"/> |
|||
</group> |
|||
<group> |
|||
<field name="region_label"/> |
|||
<field name="region_level"/> |
|||
</group> |
|||
</group> |
|||
</xpath> |
|||
</field> |
|||
</record> |
|||
|
|||
</data> |
|||
</openerp> |
Write
Preview
Loading…
Cancel
Save
Reference in new issue