Skip to content

Commit

Permalink
[IMP] Display the attribute of the variable with a single value
Browse files Browse the repository at this point in the history
  • Loading branch information
david-s73 committed Dec 9, 2024
1 parent 4a6a459 commit 62a3651
Show file tree
Hide file tree
Showing 7 changed files with 84 additions and 24 deletions.
41 changes: 31 additions & 10 deletions product_variant_attribute_name_manager/i18n/es.po
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,16 @@
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Project-Id-Version: Odoo Server 17.0+e\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2023-12-29 11:34+0000\n"
"Last-Translator: Ivorra78 <informatica@totmaterial.es>\n"
"Language-Team: none\n"
"Language: es\n"
"POT-Creation-Date: 2024-07-24 08:18+0000\n"
"PO-Revision-Date: 2024-07-24 08:18+0000\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: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 4.17\n"
"Plural-Forms: \n"

#. module: product_variant_attribute_name_manager
#: model:ir.model.fields,help:product_variant_attribute_name_manager.field_product_template_attribute_line__sequence
Expand All @@ -41,6 +40,13 @@ msgstr "No Mostrar Atributos de Variante en Variante de Producto"
msgid "Display Single Variant Attributes on Product Variant"
msgstr "Mostrar Atributos de Variante Única en Variante de Producto"

#. module: product_variant_attribute_name_manager
#: model:ir.model.fields,field_description:product_variant_attribute_name_manager.field_product_attribute__single_variant_attribute
msgid ""
"Display the attribute value of the variant when the variant has only one "
"value"
msgstr "Mostrar el valor del atributo de la variante cuando ésta sólo tiene un valor"

#. module: product_variant_attribute_name_manager
#: model:ir.model.fields,help:product_variant_attribute_name_manager.field_product_attribute__short_name
msgid "Displayed as the variant attribute name."
Expand Down Expand Up @@ -71,20 +77,30 @@ msgstr ""
"Si está marcada, mostrará el valor del atributo variante en el nombre del "
"producto."

#. module: product_variant_attribute_name_manager
#: model:ir.model.fields,help:product_variant_attribute_name_manager.field_product_attribute__single_variant_attribute
msgid "If checked, it will display variants that have only one variant."
msgstr "Si está marcada, mostrará las variantes que sólo tengan una variante."

#. module: product_variant_attribute_name_manager
#: model:ir.model,name:product_variant_attribute_name_manager.model_product_attribute
msgid "Product Attribute"
msgstr "Atributo de Producto"
msgstr "Atributo de producto"

#. module: product_variant_attribute_name_manager
#: model:ir.model,name:product_variant_attribute_name_manager.model_product_template_attribute_line
msgid "Product Template Attribute Line"
msgstr "Plantilla de Línea de Atributo de Producto"
msgstr "Línea de atributo de la plantilla de producto"

#. module: product_variant_attribute_name_manager
#: model:ir.model,name:product_variant_attribute_name_manager.model_product_template_attribute_value
msgid "Product Template Attribute Value"
msgstr "Plantilla de Valor del Atributo del Producto"
msgstr "Valor de Atributo del Modelo de Producto"

#. module: product_variant_attribute_name_manager
#: model:ir.model,name:product_variant_attribute_name_manager.model_product_product
msgid "Product Variant"
msgstr "Producto"

#. module: product_variant_attribute_name_manager
#: model:ir.model.fields,field_description:product_variant_attribute_name_manager.field_product_template_attribute_line__sequence
Expand All @@ -95,3 +111,8 @@ msgstr "Secuencia"
#: model:ir.model.fields,field_description:product_variant_attribute_name_manager.field_product_attribute__short_name
msgid "Short Name"
msgstr "Nombre Corto"

#. module: product_variant_attribute_name_manager
#: model:ir.model.fields,field_description:product_variant_attribute_name_manager.field_product_product__product_template_variant_value_ids
msgid "Variant Values"
msgstr "Valores de las variantes"
35 changes: 28 additions & 7 deletions product_variant_attribute_name_manager/i18n/it.po
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,16 @@
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Project-Id-Version: Odoo Server 17.0+e\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2023-11-27 14:36+0000\n"
"Last-Translator: mymage <stefano.consolaro@mymage.it>\n"
"Language-Team: none\n"
"Language: it\n"
"POT-Creation-Date: 2024-07-24 08:20+0000\n"
"PO-Revision-Date: 2024-07-24 08:20+0000\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: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 4.17\n"
"Plural-Forms: \n"

#. module: product_variant_attribute_name_manager
#: model:ir.model.fields,help:product_variant_attribute_name_manager.field_product_template_attribute_line__sequence
Expand All @@ -41,6 +40,13 @@ msgstr "Mostra attributi non della variante nella variante prodotto"
msgid "Display Single Variant Attributes on Product Variant"
msgstr "Mostra attributi con singolo valore nella variante prodotto"

#. module: product_variant_attribute_name_manager
#: model:ir.model.fields,field_description:product_variant_attribute_name_manager.field_product_attribute__single_variant_attribute
msgid ""
"Display the attribute value of the variant when the variant has only one "
"value"
msgstr "Visualizzare il valore dell'attributo della variante quando la variante ha un solo valore"

#. module: product_variant_attribute_name_manager
#: model:ir.model.fields,help:product_variant_attribute_name_manager.field_product_attribute__short_name
msgid "Displayed as the variant attribute name."
Expand Down Expand Up @@ -70,6 +76,11 @@ msgstr ""
"Se selezionata, visualizzerà il valore dell'attributo variante nel nome "
"prodotto."

#. module: product_variant_attribute_name_manager
#: model:ir.model.fields,help:product_variant_attribute_name_manager.field_product_attribute__single_variant_attribute
msgid "If checked, it will display variants that have only one variant."
msgstr "Se è selezionata, verranno visualizzate le varianti che hanno una sola variante."

#. module: product_variant_attribute_name_manager
#: model:ir.model,name:product_variant_attribute_name_manager.model_product_attribute
msgid "Product Attribute"
Expand All @@ -85,6 +96,11 @@ msgstr "Riga attributo modello prodotto"
msgid "Product Template Attribute Value"
msgstr "Valore attributo modello prodotto"

#. module: product_variant_attribute_name_manager
#: model:ir.model,name:product_variant_attribute_name_manager.model_product_product
msgid "Product Variant"
msgstr "Variante prodotto"

#. module: product_variant_attribute_name_manager
#: model:ir.model.fields,field_description:product_variant_attribute_name_manager.field_product_template_attribute_line__sequence
msgid "Sequence"
Expand All @@ -94,3 +110,8 @@ msgstr "Sequenza"
#: model:ir.model.fields,field_description:product_variant_attribute_name_manager.field_product_attribute__short_name
msgid "Short Name"
msgstr "Nome corto"

#. module: product_variant_attribute_name_manager
#: model:ir.model.fields,field_description:product_variant_attribute_name_manager.field_product_product__product_template_variant_value_ids
msgid "Variant Values"
msgstr "Valori variante"
1 change: 1 addition & 0 deletions product_variant_attribute_name_manager/models/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
from . import product_attribute
from . import product_product
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ class ProductAttribute(models.Model):
help="If checked, it will display the single variant attribute.",
)

single_variant_attribute = fields.Boolean(
"Display the attribute value of the variant when the variant "
"has only one value",
help="If checked, it will display variants that have only one variant.",
)


class ProductTemplateAttributeLine(models.Model):
_inherit = "product.template.attribute.line"
Expand Down
13 changes: 13 additions & 0 deletions product_variant_attribute_name_manager/models/product_product.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
from odoo import fields, models


class ProductProduct(models.Model):
_inherit = "product.product"

product_template_variant_value_ids = fields.Many2many(
domain=[
"|",
("attribute_line_id.value_count", ">", 1),
("attribute_line_id.attribute_id.single_variant_attribute", "=", True),
]
)
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,10 @@

/*
:Author: David Goodger (goodger@python.org)
:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $
:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $
:Copyright: This stylesheet has been placed in the public domain.

Default cascading style sheet for the HTML output of Docutils.
Despite the name, some widely supported CSS2 features are used.

See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to
customize this style sheet.
Expand Down Expand Up @@ -275,7 +274,7 @@
margin-left: 2em ;
margin-right: 2em }

pre.code .ln { color: gray; } /* line numbers */
pre.code .ln { color: grey; } /* line numbers */
pre.code, code { background-color: #eeeeee }
pre.code .comment, code .comment { color: #5C6576 }
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
Expand All @@ -301,7 +300,7 @@
span.pre {
white-space: pre }

span.problematic, pre.problematic {
span.problematic {
color: red }

span.section-subtitle {
Expand Down Expand Up @@ -422,9 +421,7 @@ <h2><a class="toc-backref" href="#toc-entry-4">Contributors</a></h2>
<div class="section" id="maintainers">
<h2><a class="toc-backref" href="#toc-entry-5">Maintainers</a></h2>
<p>This module is maintained by the OCA.</p>
<a class="reference external image-reference" href="https://odoo-community.org">
<img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" />
</a>
<a class="reference external image-reference" href="https://odoo-community.org"><img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /></a>
<p>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.</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
invisible="create_variant != 'no_variant'"
/>
<field name="display_single_variant_attribute" />
<field name="single_variant_attribute" />
</group>
</group>
</field>
Expand Down

0 comments on commit 62a3651

Please sign in to comment.