Skip to content
Open
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
96 changes: 96 additions & 0 deletions partner_name_hide_parent/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
========================
Partner Name Hide Parent
========================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:aa7aab9dc950ddc10c08fffe7127f909b843192323543109763593292d3eeb00
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |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%2Fpartner--contact-lightgray.png?logo=github
:target: https://github.com/OCA/partner-contact/tree/17.0/partner_name_hide_parent
:alt: OCA/partner-contact
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/partner-contact-17-0/partner-contact-17-0-partner_name_hide_parent
: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/partner-contact&target_branch=17.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

This module does the following:

- Adds the ability to hide parent's name from the presentation of the
partners' names according to the settings of the partners.

The function provided by this module is needed when you have to set up a
child partner (e.g. a branch office of a company) as an 'individual' due
to how Odoo recognizes the commercial partner (i.e. if a child partner
is a 'company', the partner becomes the commercial partner itself), and
you do not want to show the parent's name in QWeb report or website
where the partner is referenced (if the child partner is an individual,
Odoo by default shows the parent's name preceding the child's name).

**Table of contents**

.. contents::
:local:

Usage
=====

For partners you wish to hide their parents' names in their name
presentation, open the partner form and select 'Hide Parent'.

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/partner-contact/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/partner-contact/issues/new?body=module:%20partner_name_hide_parent%0Aversion:%2017.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
-------

* Quartile Limited

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

- `Quartile Limited <https://www.quartile.co>`__
- `Binhex <https://www.binhex.cloud>`__

- Ariel Barreiros (arielbarreiros96)

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.

This module is part of the `OCA/partner-contact <https://github.com/OCA/partner-contact/tree/17.0/partner_name_hide_parent>`_ 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 partner_name_hide_parent/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
14 changes: 14 additions & 0 deletions partner_name_hide_parent/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Copyright 2020-2022 Quartile Limited
# Copyright 2025 Binhex
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
{
"name": "Partner Name Hide Parent",
"version": "17.0.1.0.0",
"author": "Quartile Limited,Odoo Community Association (OCA)",
"website": "https://github.com/OCA/partner-contact",
"category": "Extra Tools",
"license": "AGPL-3",
"depends": ["base"],
"data": ["views/res_partner_views.xml"],
"installable": True,
}
38 changes: 38 additions & 0 deletions partner_name_hide_parent/i18n/es.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * partner_name_hide_parent
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 15.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2024-05-08 18:34+0000\n"
"Last-Translator: Jaime Ruiz Maccione <[email protected]>\n"
"Language-Team: none\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"

#. module: partner_name_hide_parent
#: model:ir.model,name:partner_name_hide_parent.model_res_partner
msgid "Contact"
msgstr "Contacto"

#. module: partner_name_hide_parent
#: model:ir.model.fields,field_description:partner_name_hide_parent.field_res_partner__hide_parent
#: model:ir.model.fields,field_description:partner_name_hide_parent.field_res_users__hide_parent
msgid "Hide Parent"
msgstr "Ocultar Padre"

#. module: partner_name_hide_parent
#: model:ir.model.fields,help:partner_name_hide_parent.field_res_partner__hide_parent
#: model:ir.model.fields,help:partner_name_hide_parent.field_res_users__hide_parent
msgid ""
"If selected, the parent's name will not be included in the display name of "
"self."
msgstr ""
"Si esta seleccionado, el nombre del padre no será incluido en el nombre "
"mostrado del mismo."
36 changes: 36 additions & 0 deletions partner_name_hide_parent/i18n/ja.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * partner_name_hide_parent
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 15.0+e\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-09-13 05:49+0000\n"
"PO-Revision-Date: 2022-09-13 05:49+0000\n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"

#. module: partner_name_hide_parent
#: model:ir.model,name:partner_name_hide_parent.model_res_partner
msgid "Contact"
msgstr "連絡先"

#. module: partner_name_hide_parent
#: model:ir.model.fields,field_description:partner_name_hide_parent.field_res_partner__hide_parent
#: model:ir.model.fields,field_description:partner_name_hide_parent.field_res_users__hide_parent
msgid "Hide Parent"
msgstr "親を非表示"

#. module: partner_name_hide_parent
#: model:ir.model.fields,help:partner_name_hide_parent.field_res_partner__hide_parent
#: model:ir.model.fields,help:partner_name_hide_parent.field_res_users__hide_parent
msgid ""
"If selected, the parent's name will not be included in the display name of "
"self."
msgstr "選択された場合、自身の表示名に親の名称が含まれなくなります。"
33 changes: 33 additions & 0 deletions partner_name_hide_parent/i18n/partner_name_hide_parent.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * partner_name_hide_parent
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 15.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: partner_name_hide_parent
#: model:ir.model,name:partner_name_hide_parent.model_res_partner
msgid "Contact"
msgstr ""

#. module: partner_name_hide_parent
#: model:ir.model.fields,field_description:partner_name_hide_parent.field_res_partner__hide_parent
#: model:ir.model.fields,field_description:partner_name_hide_parent.field_res_users__hide_parent
msgid "Hide Parent"
msgstr ""

#. module: partner_name_hide_parent
#: model:ir.model.fields,help:partner_name_hide_parent.field_res_partner__hide_parent
#: model:ir.model.fields,help:partner_name_hide_parent.field_res_users__hide_parent
msgid ""
"If selected, the parent's name will not be included in the display name of "
"self."
msgstr ""
1 change: 1 addition & 0 deletions partner_name_hide_parent/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import res_partner
49 changes: 49 additions & 0 deletions partner_name_hide_parent/models/res_partner.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Copyright 2020-2022 Quartile Limited
# Copyright 2025 Binhex
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import api, fields, models


class ResPartner(models.Model):
_inherit = "res.partner"

hide_parent = fields.Boolean(
help="If selected, the parent's name will not be included in the "
"display name of self."
)

def _get_complete_name(self):
self.ensure_one()
complete_name = super()._get_complete_name()
if not self.hide_parent:
return complete_name

displayed_types = self._complete_name_displayed_types
type_description = dict(self._fields["type"]._description_selection(self.env))
name = self.name or ""
if self.company_name or self.parent_id:
if not name and self.type in displayed_types:
name = type_description.get(self.type, "")
return name.strip() or complete_name

# Just add "hide_parent" as a trigger.
@api.depends(
"complete_name",
"email",
"vat",
"state_id",
"country_id",
"commercial_company_name",
"hide_parent",
)
@api.depends_context(
"show_address",
"partner_show_db_id",
"address_inline",
"show_email",
"show_vat",
"lang",
)
def _compute_display_name(self):
return super()._compute_display_name()
3 changes: 3 additions & 0 deletions partner_name_hide_parent/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
3 changes: 3 additions & 0 deletions partner_name_hide_parent/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- [Quartile Limited](https://www.quartile.co)
- [Binhex](https://www.binhex.cloud)
- Ariel Barreiros (arielbarreiros96)
12 changes: 12 additions & 0 deletions partner_name_hide_parent/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
This module does the following:

- Adds the ability to hide parent's name from the presentation of the
partners' names according to the settings of the partners.

The function provided by this module is needed when you have to set up a
child partner (e.g. a branch office of a company) as an 'individual' due
to how Odoo recognizes the commercial partner (i.e. if a child partner
is a 'company', the partner becomes the commercial partner itself), and
you do not want to show the parent's name in QWeb report or website
where the partner is referenced (if the child partner is an individual,
Odoo by default shows the parent's name preceding the child's name).
2 changes: 2 additions & 0 deletions partner_name_hide_parent/readme/USAGE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
For partners you wish to hide their parents' names in their name
presentation, open the partner form and select 'Hide Parent'.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading