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.pull/233/head
Jairo Llopis
9 years ago
10 changed files with 246 additions and 293 deletions
-
11base_location_nuts/README.rst
-
3base_location_nuts/__openerp__.py
-
214base_location_nuts/i18n/base_location_nuts.pot
-
113base_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
-
18base_location_nuts/views/res_partner_view.xml
@ -1,214 +0,0 @@ |
|||
# Translation of Odoo Server. |
|||
# This file contains the translation of the following modules: |
|||
# * base_location_nuts |
|||
# |
|||
msgid "" |
|||
msgstr "" |
|||
"Project-Id-Version: Odoo Server 8.0\n" |
|||
"Report-Msgid-Bugs-To: \n" |
|||
"POT-Creation-Date: 2015-06-11 15:26+0000\n" |
|||
"PO-Revision-Date: 2015-06-11 15:26+0000\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: base_location_nuts |
|||
#: view:nuts.import:base_location_nuts.nuts_import_form |
|||
msgid "Cancel" |
|||
msgstr "" |
|||
|
|||
#. module: base_location_nuts |
|||
#: field:res.partner.nuts,children:0 |
|||
msgid "Children" |
|||
msgstr "" |
|||
|
|||
#. module: base_location_nuts |
|||
#: field:res.partner.nuts,code:0 |
|||
msgid "Code" |
|||
msgstr "" |
|||
|
|||
#. module: base_location_nuts |
|||
#: view:res.partner.nuts:base_location_nuts.view_res_partner_nuts_filter |
|||
#: field:res.partner.nuts,country_id:0 |
|||
msgid "Country" |
|||
msgstr "" |
|||
|
|||
#. module: base_location_nuts |
|||
#: field:nuts.import,create_uid:0 |
|||
#: field:res.partner.nuts,create_uid:0 |
|||
msgid "Created by" |
|||
msgstr "" |
|||
|
|||
#. module: base_location_nuts |
|||
#: field:nuts.import,create_date:0 |
|||
#: field:res.partner.nuts,create_date:0 |
|||
msgid "Created on" |
|||
msgstr "" |
|||
|
|||
#. module: base_location_nuts |
|||
#: code:addons/base_location_nuts/wizard/nuts_import.py:149 |
|||
#, python-format |
|||
msgid "Downloaded file is not a valid XML file" |
|||
msgstr "" |
|||
|
|||
#. module: base_location_nuts |
|||
#: code:addons/base_location_nuts/wizard/nuts_import.py:141 |
|||
#, python-format |
|||
msgid "Got an error %d when trying to download the file %s." |
|||
msgstr "" |
|||
|
|||
#. module: base_location_nuts |
|||
#: code:addons/base_location_nuts/wizard/nuts_import.py:137 |
|||
#, python-format |
|||
msgid "Got an error when trying to download the file: %s." |
|||
msgstr "" |
|||
|
|||
#. module: base_location_nuts |
|||
#: view:res.partner.nuts:base_location_nuts.view_res_partner_nuts_filter |
|||
msgid "Group By" |
|||
msgstr "" |
|||
|
|||
#. module: base_location_nuts |
|||
#: field:nuts.import,id:0 |
|||
#: field:res.partner.nuts,id:0 |
|||
msgid "ID" |
|||
msgstr "" |
|||
|
|||
#. module: base_location_nuts |
|||
#: view:nuts.import:base_location_nuts.nuts_import_form |
|||
msgid "Import" |
|||
msgstr "" |
|||
|
|||
#. module: base_location_nuts |
|||
#: model:ir.ui.menu,name:base_location_nuts.nuts_import_menu |
|||
msgid "Import NUTS 2013" |
|||
msgstr "" |
|||
|
|||
#. module: base_location_nuts |
|||
#: model:ir.actions.act_window,name:base_location_nuts.nuts_import_action |
|||
#: view:nuts.import:base_location_nuts.nuts_import_form |
|||
msgid "Import NUTS 2013 from RAMON" |
|||
msgstr "" |
|||
|
|||
#. module: base_location_nuts |
|||
#: model:ir.model,name:base_location_nuts.model_nuts_import |
|||
msgid "Import NUTS items from European RAMON service" |
|||
msgstr "" |
|||
|
|||
#. module: base_location_nuts |
|||
#: field:nuts.import,write_uid:0 |
|||
#: field:res.partner.nuts,write_uid:0 |
|||
msgid "Last Updated by" |
|||
msgstr "" |
|||
|
|||
#. module: base_location_nuts |
|||
#: field:nuts.import,write_date:0 |
|||
#: field:res.partner.nuts,write_date:0 |
|||
msgid "Last Updated on" |
|||
msgstr "" |
|||
|
|||
#. module: base_location_nuts |
|||
#: view:res.partner.nuts:base_location_nuts.view_res_partner_nuts_filter |
|||
#: field:res.partner.nuts,level:0 |
|||
msgid "Level" |
|||
msgstr "" |
|||
|
|||
#. module: base_location_nuts |
|||
#: model:ir.model,name:base_location_nuts.model_res_partner_nuts |
|||
#: view:res.partner.nuts:base_location_nuts.res_partner_nuts_form |
|||
msgid "NUTS Item" |
|||
msgstr "" |
|||
|
|||
#. module: base_location_nuts |
|||
#: model:ir.actions.act_window,name:base_location_nuts.res_partner_nuts_action |
|||
#: model:ir.ui.menu,name:base_location_nuts.res_partner_nuts_menu |
|||
#: view:res.partner.nuts:base_location_nuts.res_partner_nuts_tree |
|||
msgid "NUTS Items" |
|||
msgstr "" |
|||
|
|||
#. module: base_location_nuts |
|||
#: field:res.partner.nuts,name:0 |
|||
msgid "Name" |
|||
msgstr "" |
|||
|
|||
#. module: base_location_nuts |
|||
#: field:res.partner.nuts,parent_left:0 |
|||
msgid "Parent Left" |
|||
msgstr "" |
|||
|
|||
#. module: base_location_nuts |
|||
#: field:res.partner.nuts,parent_right:0 |
|||
msgid "Parent Right" |
|||
msgstr "" |
|||
|
|||
#. module: base_location_nuts |
|||
#: field:res.partner.nuts,parent_id:0 |
|||
msgid "Parent id" |
|||
msgstr "" |
|||
|
|||
#. module: base_location_nuts |
|||
#: model:ir.model,name:base_location_nuts.model_res_partner |
|||
msgid "Partner" |
|||
msgstr "" |
|||
|
|||
#. module: base_location_nuts |
|||
#: code:addons/base_location_nuts/models/res_partner.py:53 |
|||
#: view:res.partner:base_location_nuts.view_res_partner_filter_nuts |
|||
#: field:res.partner,region:0 |
|||
#, python-format |
|||
msgid "Region" |
|||
msgstr "" |
|||
|
|||
#. module: base_location_nuts |
|||
#: view:res.partner:base_location_nuts.view_res_partner_filter_nuts |
|||
msgid "Salesperson" |
|||
msgstr "" |
|||
|
|||
#. module: base_location_nuts |
|||
#: view:res.partner.nuts:base_location_nuts.view_res_partner_nuts_filter |
|||
msgid "Search NUTS" |
|||
msgstr "" |
|||
|
|||
#. module: base_location_nuts |
|||
#: field:res.partner.nuts,state_id:0 |
|||
msgid "State" |
|||
msgstr "" |
|||
|
|||
#. module: base_location_nuts |
|||
#: code:addons/base_location_nuts/models/res_partner.py:54 |
|||
#: view:res.partner:base_location_nuts.view_res_partner_filter_nuts |
|||
#: field:res.partner,substate:0 |
|||
#, python-format |
|||
msgid "Substate" |
|||
msgstr "" |
|||
|
|||
#. module: base_location_nuts |
|||
#: view:nuts.import:base_location_nuts.nuts_import_form |
|||
msgid "This wizard will download the lastest version of\n" |
|||
" NUTS 2013 from Europe RAMON metadata service.\n" |
|||
" Updating or creating new NUTS entries if not\n" |
|||
" found already in the system, and DELETING MISSING\n" |
|||
" ENTRIES from new downloaded file." |
|||
msgstr "" |
|||
|
|||
#. module: base_location_nuts |
|||
#: code:addons/base_location_nuts/wizard/nuts_import.py:116 |
|||
#, python-format |
|||
msgid "Value not found for mandatory field %s" |
|||
msgstr "" |
|||
|
|||
#. module: base_location_nuts |
|||
#: model:ir.actions.todo,note:base_location_nuts.config_wizard_nuts |
|||
msgid "You can import NUTS from RAMON european service." |
|||
msgstr "" |
|||
|
|||
#. module: base_location_nuts |
|||
#: model:ir.actions.act_window,help:base_location_nuts.res_partner_nuts_action |
|||
msgid "You must click at import wizard to populate NUTS items\n" |
|||
" in Odoo database in:\n" |
|||
" Sales > Configuration > Address Book > Localization > Import NUTS 2013" |
|||
msgstr "" |
|||
|
@ -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