diff --git a/product_english_name/README.rst b/product_english_name/README.rst new file mode 100644 index 00000000000..d2466f5822e --- /dev/null +++ b/product_english_name/README.rst @@ -0,0 +1,98 @@ +==================== +Product English Name +==================== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:17d91efa55e70a938b2e736c967f64178caa9b4ff2d73d4f585be5e5e8ad1806 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Alpha-red.png + :target: https://odoo-community.org/page/development-status + :alt: Alpha +.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fproduct--attribute-lightgray.png?logo=github + :target: https://github.com/OCA/product-attribute/tree/16.0/product_english_name + :alt: OCA/product-attribute +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/product-attribute-16-0/product-attribute-16-0-product_english_name + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png + :target: https://runboat.odoo-community.org/builds?repo=OCA/product-attribute&target_branch=16.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module display product name in english near name in user language + +.. figure:: https://raw.githubusercontent.com/OCA/product-attribute/16.0/product_english_name/static/description/screen_french.png + :alt: Display product name in english near name in user language + + +.. figure:: https://raw.githubusercontent.com/OCA/product-attribute/16.0/product_english_name/static/description/screen_english.png + +.. IMPORTANT:: + This is an alpha version, the data model and design can change at any time without warning. + Only for development or testing purpose, do not use in production. + `More details on development status `_ + +**Table of contents** + +.. contents:: + :local: + +Configuration +============= + +- active another language than english and set it to your user. +- add your user to 'Show english name' group. +- browse your products in form view. + + +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 to smash it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +~~~~~~~ + +* Akretion + +Maintainers +~~~~~~~~~~~ + +This module is maintained by the OCA. + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +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. + +.. |maintainer-bealdav| image:: https://github.com/bealdav.png?size=40px + :target: https://github.com/bealdav + :alt: bealdav + +Current `maintainer `__: + +|maintainer-bealdav| + +This module is part of the `OCA/product-attribute `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/product_english_name/__init__.py b/product_english_name/__init__.py new file mode 100644 index 00000000000..0650744f6bc --- /dev/null +++ b/product_english_name/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/product_english_name/__manifest__.py b/product_english_name/__manifest__.py new file mode 100644 index 00000000000..927be597bb2 --- /dev/null +++ b/product_english_name/__manifest__.py @@ -0,0 +1,19 @@ +# Copyright 2024 Akretion +{ + "name": "Product English Name", + "summary": """Display product name in english """, + "version": "16.0.1.0.0", + "license": "AGPL-3", + "development_status": "Alpha", + "category": "Product", + "author": "Akretion, (OCA) Odoo Community Association", + "website": "https://github.com/OCA/product-attribute", + "depends": [ + "product", + ], + "maintainers": ['bealdav'], + "data": [ + "views/product_template.xml", + "security/groups.xml", + ], +} diff --git a/product_english_name/models/__init__.py b/product_english_name/models/__init__.py new file mode 100644 index 00000000000..e8fa8f6bf1e --- /dev/null +++ b/product_english_name/models/__init__.py @@ -0,0 +1 @@ +from . import product_template diff --git a/product_english_name/models/product_template.py b/product_english_name/models/product_template.py new file mode 100644 index 00000000000..e813b78180a --- /dev/null +++ b/product_english_name/models/product_template.py @@ -0,0 +1,16 @@ +from odoo import fields, models + + +class ProductTemplate(models.Model): + _inherit="product.template" + + english_name = fields.Char(compute="_compute_english_name") + + def _compute_english_name(self): + lang = self.env.context.get("lang", "") + english_us = self.env.ref("base.lang_en") + for rec in self: + if lang == "en_US": + rec.english_name = "" + else: + rec.english_name = rec.with_context(lang=english_us.id).name diff --git a/product_english_name/readme/CONFIGURE.rst b/product_english_name/readme/CONFIGURE.rst new file mode 100644 index 00000000000..001b68803aa --- /dev/null +++ b/product_english_name/readme/CONFIGURE.rst @@ -0,0 +1,4 @@ +- active another language than english and set it to your user. +- add your user to 'Show english name' group. +- browse your products in form view. + \ No newline at end of file diff --git a/product_english_name/readme/DESCRIPTION.rst b/product_english_name/readme/DESCRIPTION.rst new file mode 100644 index 00000000000..1cc1c8e4bbb --- /dev/null +++ b/product_english_name/readme/DESCRIPTION.rst @@ -0,0 +1,7 @@ +This module display product name in english near name in user language + +.. figure:: ../static/description/screen_french.png + :alt: Display product name in english near name in user language + + +.. figure:: ../static/description/screen_english.png diff --git a/product_english_name/security/groups.xml b/product_english_name/security/groups.xml new file mode 100644 index 00000000000..573950a8f44 --- /dev/null +++ b/product_english_name/security/groups.xml @@ -0,0 +1,8 @@ + + + + Show english name + + + + diff --git a/product_english_name/static/description/index.html b/product_english_name/static/description/index.html new file mode 100644 index 00000000000..44c74d11c2a --- /dev/null +++ b/product_english_name/static/description/index.html @@ -0,0 +1,436 @@ + + + + + +Product English Name + + + +
+

Product English Name

+ + +

Alpha License: AGPL-3 OCA/product-attribute Translate me on Weblate Try me on Runboat

+

This module display product name in english near name in user language

+
+Display product name in english near name in user language +
+
+https://raw.githubusercontent.com/OCA/product-attribute/16.0/product_english_name/static/description/screen_english.png +
+
+

Important

+

This is an alpha version, the data model and design can change at any time without warning. +Only for development or testing purpose, do not use in production. +More details on development status

+
+

Table of contents

+ +
+

Configuration

+
    +
  • active another language than english and set it to your user.
  • +
  • add your user to ‘Show english name’ group.
  • +
  • browse your products in form view.
  • +
+
+
+

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 to smash it by providing a detailed and welcomed +feedback.

+

Do not contact contributors directly about support or help with technical issues.

+
+
+

Credits

+
+

Authors

+
    +
  • Akretion
  • +
+
+
+

Maintainers

+

This module is maintained by the OCA.

+Odoo Community Association +

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.

+

Current maintainer:

+

bealdav

+

This module is part of the OCA/product-attribute project on GitHub.

+

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

+
+
+
+ + diff --git a/product_english_name/static/description/screen_english.png b/product_english_name/static/description/screen_english.png new file mode 100644 index 00000000000..6769221ead6 Binary files /dev/null and b/product_english_name/static/description/screen_english.png differ diff --git a/product_english_name/static/description/screen_french.png b/product_english_name/static/description/screen_french.png new file mode 100644 index 00000000000..3a168af1c9d Binary files /dev/null and b/product_english_name/static/description/screen_french.png differ diff --git a/product_english_name/views/product_template.xml b/product_english_name/views/product_template.xml new file mode 100644 index 00000000000..5a7b8525b93 --- /dev/null +++ b/product_english_name/views/product_template.xml @@ -0,0 +1,15 @@ + + + + product.template + + + +
+ +
+
+
+
+ +
diff --git a/setup/product_english_name/odoo/addons/product_english_name b/setup/product_english_name/odoo/addons/product_english_name new file mode 120000 index 00000000000..7a939f1f91f --- /dev/null +++ b/setup/product_english_name/odoo/addons/product_english_name @@ -0,0 +1 @@ +../../../../product_english_name \ No newline at end of file diff --git a/setup/product_english_name/setup.py b/setup/product_english_name/setup.py new file mode 100644 index 00000000000..28c57bb6403 --- /dev/null +++ b/setup/product_english_name/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +)