diff --git a/product_english_name/README.rst b/product_english_name/README.rst new file mode 100644 index 00000000000..762deb7dc02 --- /dev/null +++ b/product_english_name/README.rst @@ -0,0 +1,112 @@ +==================== +Product English Name +==================== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:16bdc46011022d0d4f0cdd575a1dca6e470c2296faf57b12ffcd2303f6a04593 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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/18.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-18-0/product-attribute-18-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=18.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module displays the product name in English near the products name +in user's language. + +Use case: The Product name is very important information at least if you +buy products in a foreign country. It often occurs that in an odoo +instance the product names don't match with their translations. This +module can help to detect those translation errors. + +|image1| + +|image2| + +.. |image1| image:: https://raw.githubusercontent.com/OCA/product-attribute/18.0/product_english_name/static/description/screen_french.png +.. |image2| image:: https://raw.githubusercontent.com/OCA/product-attribute/18.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 +============= + +- activate another language than English and set it as your user + language. +- add your user to 'Show english name' group. +- browse your products in a 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 + +Contributors +------------ + +- Akretion: + + - David BEAL + +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..81c1e3a5ede --- /dev/null +++ b/product_english_name/__manifest__.py @@ -0,0 +1,20 @@ +# Copyright 2024 Akretion +{ + "name": "Product English Name", + "summary": """Display the product name in English besides the product name + in the users language.""", + "version": "16.0.1.0.0", + "license": "AGPL-3", + "development_status": "Alpha", + "category": "Product", + "author": "Akretion, Odoo Community Association (OCA)", + "website": "https://github.com/OCA/product-attribute", + "depends": [ + "product", + ], + "maintainers": ["bealdav"], + "data": [ + "security/groups.xml", + "views/product_template.xml", + ], +} diff --git a/product_english_name/i18n/product_english_name.pot b/product_english_name/i18n/product_english_name.pot new file mode 100644 index 00000000000..409259ed6c0 --- /dev/null +++ b/product_english_name/i18n/product_english_name.pot @@ -0,0 +1,30 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * product_english_name +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \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: product_english_name +#: model:ir.model.fields,field_description:product_english_name.field_product_product__english_name +#: model:ir.model.fields,field_description:product_english_name.field_product_template__english_name +msgid "English Name" +msgstr "" + +#. module: product_english_name +#: model:ir.model,name:product_english_name.model_product_template +msgid "Product" +msgstr "" + +#. module: product_english_name +#: model:res.groups,name:product_english_name.show_english_name +msgid "Show English name" +msgstr "" 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..9d0511b9048 --- /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/pyproject.toml b/product_english_name/pyproject.toml new file mode 100644 index 00000000000..4231d0cccb3 --- /dev/null +++ b/product_english_name/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/product_english_name/readme/CONFIGURE.md b/product_english_name/readme/CONFIGURE.md new file mode 100644 index 00000000000..aa308eead65 --- /dev/null +++ b/product_english_name/readme/CONFIGURE.md @@ -0,0 +1,4 @@ +- activate another language than English and set it as your user + language. +- add your user to 'Show english name' group. +- browse your products in a form view. diff --git a/product_english_name/readme/CONTRIBUTORS.md b/product_english_name/readme/CONTRIBUTORS.md new file mode 100644 index 00000000000..651bbf409bd --- /dev/null +++ b/product_english_name/readme/CONTRIBUTORS.md @@ -0,0 +1,2 @@ +- Akretion: + - David BEAL \<\> diff --git a/product_english_name/readme/DESCRIPTION.md b/product_english_name/readme/DESCRIPTION.md new file mode 100644 index 00000000000..dde53a29cfc --- /dev/null +++ b/product_english_name/readme/DESCRIPTION.md @@ -0,0 +1,11 @@ +This module displays the product name in English near the products name +in user's language. + +Use case: The Product name is very important information at least if you +buy products in a foreign country. It often occurs that in an odoo +instance the product names don't match with their translations. This +module can help to detect those translation errors. + +![](../static/description/screen_french.png) + +![](../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..531f919ca68 --- /dev/null +++ b/product_english_name/security/groups.xml @@ -0,0 +1,8 @@ + + + + Show English name + + + + diff --git a/product_english_name/static/description/icon.png b/product_english_name/static/description/icon.png new file mode 100644 index 00000000000..3a0328b516c Binary files /dev/null and b/product_english_name/static/description/icon.png differ diff --git a/product_english_name/static/description/index.html b/product_english_name/static/description/index.html new file mode 100644 index 00000000000..22f3937f64f --- /dev/null +++ b/product_english_name/static/description/index.html @@ -0,0 +1,451 @@ + + + + + +Product English Name + + + +
+

Product English Name

+ + +

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

+

This module displays the product name in English near the products name +in user’s language.

+

Use case: The Product name is very important information at least if you +buy products in a foreign country. It often occurs that in an odoo +instance the product names don’t match with their translations. This +module can help to detect those translation errors.

+

image1

+

image2

+
+

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

+
    +
  • activate another language than English and set it as your user +language.
  • +
  • add your user to ‘Show english name’ group.
  • +
  • browse your products in a 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
  • +
+
+
+

Contributors

+ +
+
+

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..66ca6d30976 --- /dev/null +++ b/product_english_name/views/product_template.xml @@ -0,0 +1,16 @@ + + + + product.template + 20 + + + +
+ +
+
+
+
+ +