From a2161280f6abb021c73136ed74d2c22d1ca6fac3 Mon Sep 17 00:00:00 2001 From: rami-wafaie Date: Fri, 25 Aug 2017 12:47:25 +0200 Subject: [PATCH] base_country_state_translatable Module (#461) --- base_country_state_translatable/README.rst | 50 +++++++++++++++++++ base_country_state_translatable/__init__.py | 5 ++ .../__manifest__.py | 17 +++++++ .../models/__init__.py | 5 ++ .../models/res_country.py | 11 ++++ 5 files changed, 88 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/__manifest__.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..cb3e7a204 --- /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/175/10.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/__manifest__.py b/base_country_state_translatable/__manifest__.py new file mode 100644 index 000000000..c530e9e32 --- /dev/null +++ b/base_country_state_translatable/__manifest__.py @@ -0,0 +1,17 @@ +# -*- coding: utf-8 -*- +# © initOS GmbH 2017 +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +{ + "name": "Translate Country States", + "version": "10.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..29773f372 --- /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 odoo import fields, models + + +class CountryState(models.Model): + _inherit = 'res.country.state' + + name = fields.Char(translate=True)