From f12fe0eb194b93a64b60769327a627a6cff9c3ec Mon Sep 17 00:00:00 2001 From: rami-wafaie Date: Mon, 18 Sep 2017 09:46:48 +0200 Subject: [PATCH] [ADD] base_country_state_translatable --- base_country_state_translatable/README.rst | 50 +++++++++++++++++++ base_country_state_translatable/__init__.py | 5 ++ .../__openerp__.py | 16 ++++++ .../models/__init__.py | 5 ++ .../models/res_country.py | 11 ++++ 5 files changed, 87 insertions(+) create mode 100644 base_country_state_translatable/README.rst create mode 100644 base_country_state_translatable/__init__.py create mode 100644 base_country_state_translatable/__openerp__.py create mode 100644 base_country_state_translatable/models/__init__.py create mode 100644 base_country_state_translatable/models/res_country.py diff --git a/base_country_state_translatable/README.rst b/base_country_state_translatable/README.rst new file mode 100644 index 000000000..61f520faa --- /dev/null +++ b/base_country_state_translatable/README.rst @@ -0,0 +1,50 @@ +.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 + +======================== +Translate Country States +======================== + +This module allows to translate the country states names + +Usage +===== + +* Inherit this module in your l10n_xx_country_states Module and translate the states names + +.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas + :alt: Try me on Runbot + :target: https://runbot.odoo-community.org/runbot/134/9.0 + + +Bug Tracker +=========== + +Bugs are tracked on `GitHub Issues +`_. In case of trouble, please +check there if your issue has already been reported. If you spotted it first, +help us smashing it by providing a detailed and welcomed feedback. + +Credits +======= + +Contributors +------------ + +* Rami Alwafaie + +Maintainer +---------- + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +This module is maintained by the OCA. + +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. + +To contribute to this module, please visit https://odoo-community.org. diff --git a/base_country_state_translatable/__init__.py b/base_country_state_translatable/__init__.py new file mode 100644 index 000000000..7af4bb052 --- /dev/null +++ b/base_country_state_translatable/__init__.py @@ -0,0 +1,5 @@ +# -*- coding: utf-8 -*- +# © initOS GmbH 2017 +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from . import models diff --git a/base_country_state_translatable/__openerp__.py b/base_country_state_translatable/__openerp__.py new file mode 100644 index 000000000..40bfe581f --- /dev/null +++ b/base_country_state_translatable/__openerp__.py @@ -0,0 +1,16 @@ +# -*- coding: utf-8 -*- +# © initOS GmbH 2017 +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +{ + "name": "Translate Country States", + "version": "9.0.1.0.0", + "depends": ['base', ], + 'application': False, + 'author': 'initOS GmbH, Odoo Community Association (OCA)', + "category": "Localisation/Europe", + 'license': 'AGPL-3', + 'data': [], + 'installable': True, + 'auto_install': False, +} diff --git a/base_country_state_translatable/models/__init__.py b/base_country_state_translatable/models/__init__.py new file mode 100644 index 000000000..8bad4f313 --- /dev/null +++ b/base_country_state_translatable/models/__init__.py @@ -0,0 +1,5 @@ +# -*- coding: utf-8 -*- +# © initOS GmbH 2017 +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from . import res_country diff --git a/base_country_state_translatable/models/res_country.py b/base_country_state_translatable/models/res_country.py new file mode 100644 index 000000000..9b5816937 --- /dev/null +++ b/base_country_state_translatable/models/res_country.py @@ -0,0 +1,11 @@ +# -*- coding: utf-8 -*- +# © initOS GmbH 2017 +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from openerp import fields, models + + +class CountryState(models.Model): + _inherit = 'res.country.state' + + name = fields.Char(translate=True)