From 904868b3659665839399d183423ea7a2478f696d Mon Sep 17 00:00:00 2001 From: "Aung Ko Ko Lin (Quartile)" <45355704+AungKoKoLin1997@users.noreply.github.com> Date: Fri, 19 Jan 2024 12:26:56 +0630 Subject: [PATCH] [4214][11.0][ADD] product_name_translate_false #368 --- product_name_translate_false/__init__.py | 1 + product_name_translate_false/__manifest__.py | 12 ++++++++++++ product_name_translate_false/models/__init__.py | 1 + .../models/product_template.py | 10 ++++++++++ product_name_translate_false/readme/DESCRIPTION.rst | 2 ++ 5 files changed, 26 insertions(+) create mode 100644 product_name_translate_false/__init__.py create mode 100644 product_name_translate_false/__manifest__.py create mode 100644 product_name_translate_false/models/__init__.py create mode 100644 product_name_translate_false/models/product_template.py create mode 100644 product_name_translate_false/readme/DESCRIPTION.rst diff --git a/product_name_translate_false/__init__.py b/product_name_translate_false/__init__.py new file mode 100644 index 00000000..0650744f --- /dev/null +++ b/product_name_translate_false/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/product_name_translate_false/__manifest__.py b/product_name_translate_false/__manifest__.py new file mode 100644 index 00000000..760a2408 --- /dev/null +++ b/product_name_translate_false/__manifest__.py @@ -0,0 +1,12 @@ +# Copyright 2024 Quartile Limited +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). +{ + "name": "Product Name Translate False", + "version": "11.0.1.0.0", + "author": "Quartile Limited", + "website": "https://www.quartile.co", + "category": "Product", + "license": "AGPL-3", + "depends": ["product"], + "installable": True, +} diff --git a/product_name_translate_false/models/__init__.py b/product_name_translate_false/models/__init__.py new file mode 100644 index 00000000..e8fa8f6b --- /dev/null +++ b/product_name_translate_false/models/__init__.py @@ -0,0 +1 @@ +from . import product_template diff --git a/product_name_translate_false/models/product_template.py b/product_name_translate_false/models/product_template.py new file mode 100644 index 00000000..6d493a2d --- /dev/null +++ b/product_name_translate_false/models/product_template.py @@ -0,0 +1,10 @@ +# Copyright 2024 Quartile Limited +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from odoo import fields, models + + +class ProductTemplate(models.Model): + _inherit = "product.template" + + name = fields.Char(translate=False) diff --git a/product_name_translate_false/readme/DESCRIPTION.rst b/product_name_translate_false/readme/DESCRIPTION.rst new file mode 100644 index 00000000..4c4d9907 --- /dev/null +++ b/product_name_translate_false/readme/DESCRIPTION.rst @@ -0,0 +1,2 @@ +This module disables the product name field translation, as a workaround for the performance issue +described in https://github.com/odoo/odoo/issues/18679.