Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[18.0][MIG] product english name: Migration to 18.0 #1749

Draft
wants to merge 2 commits into
base: 18.0
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
112 changes: 112 additions & 0 deletions product_english_name/README.rst
Original file line number Diff line number Diff line change
@@ -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 <https://odoo-community.org/page/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 <https://github.com/OCA/product-attribute/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 <https://github.com/OCA/product-attribute/issues/new?body=module:%20product_english_name%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

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

Credits
=======

Authors
-------

* Akretion

Contributors
------------

- Akretion:

- David BEAL <[email protected]>

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 <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-bealdav|

This module is part of the `OCA/product-attribute <https://github.com/OCA/product-attribute/tree/18.0/product_english_name>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
1 change: 1 addition & 0 deletions product_english_name/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
20 changes: 20 additions & 0 deletions product_english_name/__manifest__.py
Original file line number Diff line number Diff line change
@@ -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": "18.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",
],
}
30 changes: 30 additions & 0 deletions product_english_name/i18n/product_english_name.pot
Original file line number Diff line number Diff line change
@@ -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 ""
1 change: 1 addition & 0 deletions product_english_name/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import product_template
16 changes: 16 additions & 0 deletions product_english_name/models/product_template.py
Original file line number Diff line number Diff line change
@@ -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")

Check warning on line 11 in product_english_name/models/product_template.py

View check run for this annotation

Codecov / codecov/patch

product_english_name/models/product_template.py#L10-L11

Added lines #L10 - L11 were not covered by tests
for rec in self:
if lang == "en_US":
rec.english_name = ""

Check warning on line 14 in product_english_name/models/product_template.py

View check run for this annotation

Codecov / codecov/patch

product_english_name/models/product_template.py#L14

Added line #L14 was not covered by tests
else:
rec.english_name = rec.with_context(lang=english_us.id).name

Check warning on line 16 in product_english_name/models/product_template.py

View check run for this annotation

Codecov / codecov/patch

product_english_name/models/product_template.py#L16

Added line #L16 was not covered by tests
3 changes: 3 additions & 0 deletions product_english_name/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
4 changes: 4 additions & 0 deletions product_english_name/readme/CONFIGURE.md
Original file line number Diff line number Diff line change
@@ -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.
2 changes: 2 additions & 0 deletions product_english_name/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Akretion:
- David BEAL \<<[email protected]>\>
11 changes: 11 additions & 0 deletions product_english_name/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -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)
6 changes: 6 additions & 0 deletions product_english_name/security/groups.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<odoo>
<record id="show_english_name" model="res.groups">
<field name="name">Show English name</field>
<field name="category_id" ref="base.module_category_extra" />
</record>
</odoo>
Binary file added product_english_name/static/description/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading