-
-
Notifications
You must be signed in to change notification settings - Fork 868
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
[FIX] [16.0] partner_industry_secondary: Add an option to display Child Industries first on it's name #1958
base: 16.0
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -84,6 +84,7 @@ Contributors | |
* Jordi Ballester Alomar <[email protected]> | ||
* Miquel Raïch <[email protected]> | ||
* Cristina Martin R. | ||
* Eduardo de Miguel `Moduon <https://www.moduon.team/>`_ | ||
|
||
Maintainers | ||
~~~~~~~~~~~ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,21 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * partner_sector | ||
# * partner_industry_secondary | ||
# | ||
# Translators: | ||
# OCA Transbot <[email protected]>, 2017 | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 10.0\n" | ||
"Project-Id-Version: Odoo Server 16.0\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"POT-Creation-Date: 2017-12-26 15:33+0000\n" | ||
"PO-Revision-Date: 2023-10-12 13:38+0000\n" | ||
"Last-Translator: Ivorra78 <[email protected]>\n" | ||
"Language-Team: Spanish (https://www.transifex.com/oca/teams/23907/es/)\n" | ||
"POT-Creation-Date: 2025-01-13 12:12+0000\n" | ||
"PO-Revision-Date: 2025-01-13 13:13+0100\n" | ||
"Last-Translator: \n" | ||
"Language-Team: \n" | ||
"Language: es\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" | ||
"Content-Transfer-Encoding: 8bit\n" | ||
"Plural-Forms: nplurals=2; plural=(n != 1);\n" | ||
"X-Generator: Poedit 3.4.4\n" | ||
|
||
#. module: partner_industry_secondary | ||
#: model:ir.model.fields,field_description:partner_industry_secondary.field_res_partner_industry__child_ids | ||
|
@@ -27,13 +25,24 @@ msgstr "Hijos" | |
#. module: partner_industry_secondary | ||
#: model:ir.model,name:partner_industry_secondary.model_res_config_settings | ||
msgid "Config Settings" | ||
msgstr "Configura los ajustes" | ||
msgstr "Ajustes de configuración" | ||
|
||
#. module: partner_industry_secondary | ||
#: model:ir.model,name:partner_industry_secondary.model_res_partner | ||
msgid "Contact" | ||
msgstr "Contacto" | ||
|
||
#. module: partner_industry_secondary | ||
#: model:ir.model.fields,field_description:partner_industry_secondary.field_res_config_settings__display_last_child_first | ||
#: model_terms:ir.ui.view,arch_db:partner_industry_secondary.res_config_settings_view_form | ||
msgid "Display Child Industries first" | ||
msgstr "Mostrar Industrias Hijas primero" | ||
|
||
#. module: partner_industry_secondary | ||
#: model_terms:ir.ui.view,arch_db:partner_industry_secondary.res_config_settings_view_form | ||
msgid "Display like: Child (Dad < Grampa < Ancestor)" | ||
msgstr "Display like Child (Dad < Grampa < Ancestor)" | ||
|
||
#. module: partner_industry_secondary | ||
#: model_terms:ir.ui.view,arch_db:partner_industry_secondary.res_config_settings_view_form | ||
msgid "Enable industries for individuals" | ||
|
@@ -61,7 +70,7 @@ msgstr "Sector" | |
#: model:ir.model.fields,field_description:partner_industry_secondary.field_res_partner__industry_id | ||
#: model:ir.model.fields,field_description:partner_industry_secondary.field_res_users__industry_id | ||
msgid "Main Industry" | ||
msgstr "Sector principal" | ||
msgstr "Sector" | ||
|
||
#. module: partner_industry_secondary | ||
#: model:ir.model.fields,field_description:partner_industry_secondary.field_res_partner_industry__name | ||
|
@@ -94,6 +103,15 @@ msgstr "Sector" | |
msgid "Set if you want to be able to use industries for individuals also." | ||
msgstr "Establezca si desea poder usar sectores para individuos también." | ||
|
||
#. module: partner_industry_secondary | ||
#: model:ir.model.fields,help:partner_industry_secondary.field_res_config_settings__display_last_child_first | ||
msgid "" | ||
"Set if you want to show the last child industries first when searching for industries.\n" | ||
"Child (Dad < Grampa < Ancestor)" | ||
msgstr "" | ||
"Márcalo si quieres mostrar la última industria hija primero cuando busques por industrias.\n" | ||
"Hija (Padre < Abuelo < Ancestro)" | ||
|
||
#. module: partner_industry_secondary | ||
#: model:ir.model.fields,field_description:partner_industry_secondary.field_res_partner__show_partner_industry_for_person | ||
#: model:ir.model.fields,field_description:partner_industry_secondary.field_res_users__show_partner_industry_for_person | ||
|
@@ -105,54 +123,10 @@ msgstr "Mostrar socio Industria Para persona" | |
#: code:addons/partner_industry_secondary/models/res_partner.py:0 | ||
#, python-format | ||
msgid "The main industry must be different from the secondary industries." | ||
msgstr "" | ||
"La industria principal debe ser diferente de las industrias secundarias." | ||
msgstr "La industria principal debe ser diferente de las industrias secundarias." | ||
|
||
#. module: partner_industry_secondary | ||
#: model:ir.model.fields,field_description:partner_industry_secondary.field_res_config_settings__group_use_partner_industry_for_person | ||
#: model:res.groups,name:partner_industry_secondary.group_use_partner_industry_for_person | ||
msgid "Use industry for individuals" | ||
msgstr "Use el sector para individuos" | ||
|
||
#, python-format | ||
#~ msgid "Error! You cannot create recursive industries." | ||
#~ msgstr "Error!. No puede crear sectores recursivos." | ||
|
||
#~ msgid "Industry for individual" | ||
#~ msgstr "Sector para personas" | ||
|
||
#~ msgid "Partner Industries" | ||
#~ msgstr "Sectores de la empresa" | ||
|
||
#~ msgid "Parent Right" | ||
#~ msgstr "Padre derecha" | ||
|
||
#~ msgid "Created by" | ||
#~ msgstr "Creado por" | ||
|
||
#~ msgid "Created on" | ||
#~ msgstr "Creado en" | ||
|
||
#~ msgid "Display Name" | ||
#~ msgstr "Nombre mostrado" | ||
|
||
#~ msgid "ID" | ||
#~ msgstr "ID" | ||
|
||
#~ msgid "Last Modified on" | ||
#~ msgstr "Última modificación el" | ||
|
||
#~ msgid "Last Updated by" | ||
#~ msgstr "Última actualización por" | ||
|
||
#~ msgid "Last Updated on" | ||
#~ msgstr "Última actualización en" | ||
|
||
#~ msgid "Main Sector" | ||
#~ msgstr "Sector principal" | ||
|
||
#~ msgid "Partner" | ||
#~ msgstr "Empresa" | ||
|
||
#~ msgid "Sectors" | ||
#~ msgstr "Sectores" |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -3,6 +3,7 @@ | |||||
# Copyright 2016 Tecnativa S.L. - Pedro M. Baeza | ||||||
# Copyright 2018 Eficent Business and IT Consulting Services, S.L. | ||||||
# Copyright 2019 Tecnativa - Cristina Martin R. | ||||||
# Copyright 2025 Moduon - Eduardo de Miguel | ||||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). | ||||||
|
||||||
from odoo import _, api, exceptions, fields, models | ||||||
|
@@ -28,11 +29,25 @@ def get_names(cat): | |||||
"""Return the list [cat.name, cat.parent_id.name, ...]""" | ||||||
res = [] | ||||||
while cat: | ||||||
res.insert(0, cat.name) | ||||||
res.append(cat.name) | ||||||
cat = cat.parent_id | ||||||
return res | ||||||
|
||||||
return [(cat.id, " / ".join(get_names(cat))) for cat in self] | ||||||
if ( | ||||||
self.env["ir.config_parameter"] | ||||||
.sudo() | ||||||
.get_param("partner_industry_secondary.display_last_child_first") | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. thought: don't you believe the "children first" format would be a better default value? cc @rafaelbn |
||||||
): | ||||||
# Display last child first | ||||||
result = [] | ||||||
for cat in self: | ||||||
cat_name, *parent_cats = get_names(cat) | ||||||
if parent_cats: | ||||||
cat_name = f"{cat_name} ({' < '.join(parent_cats)})" | ||||||
result.append((cat.id, cat_name)) | ||||||
return result | ||||||
# Default display (Ancestor / Grandpa / Dad / Child) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. suggestion: just for the sake of uniformity
Suggested change
|
||||||
return [(cat.id, " / ".join(get_names(cat)[::-1])) for cat in self] | ||||||
|
||||||
@api.constrains("name", "parent_id") | ||||||
def _check_uniq_name(self): | ||||||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -7,3 +7,4 @@ | |||||
* Jordi Ballester Alomar <[email protected]> | ||||||
* Miquel Raïch <[email protected]> | ||||||
* Cristina Martin R. | ||||||
* Eduardo de Miguel `Moduon <https://www.moduon.team/>`_ | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think the official template suggest to put the company within parenthesis:
Suggested change
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,10 +8,11 @@ | |
|
||
/* | ||
:Author: David Goodger ([email protected]) | ||
:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $ | ||
:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z 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. | ||
|
@@ -274,7 +275,7 @@ | |
margin-left: 2em ; | ||
margin-right: 2em } | ||
|
||
pre.code .ln { color: grey; } /* line numbers */ | ||
pre.code .ln { color: gray; } /* 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 } | ||
|
@@ -300,7 +301,7 @@ | |
span.pre { | ||
white-space: pre } | ||
|
||
span.problematic { | ||
span.problematic, pre.problematic { | ||
color: red } | ||
|
||
span.section-subtitle { | ||
|
@@ -431,12 +432,15 @@ <h2><a class="toc-backref" href="#toc-entry-6">Contributors</a></h2> | |
<li>Jordi Ballester Alomar <<a class="reference external" href="mailto:jordi.ballester@eficent.com">jordi.ballester@eficent.com</a>></li> | ||
<li>Miquel Raïch <<a class="reference external" href="mailto:miquel.raich@eficent.com">miquel.raich@eficent.com</a>></li> | ||
<li>Cristina Martin R.</li> | ||
<li>Eduardo de Miguel <a class="reference external" href="https://www.moduon.team/">Moduon</a></li> | ||
</ul> | ||
</div> | ||
<div class="section" id="maintainers"> | ||
<h2><a class="toc-backref" href="#toc-entry-7">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> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
issue: this affects display, not search AFAICS. Besides, let's be a bit more formal here 😁