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
80 changes: 80 additions & 0 deletions partner_industry_parent/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
.. image:: https://odoo-community.org/readme-banner-image
:target: https://odoo-community.org/get-involved?utm_source=readme
:alt: Odoo Community Association

=======================
Partner Industry Parent
=======================

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

.. |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/license-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/19.0/partner_industry_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-19-0/partner-contact-19-0-partner_industry_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=19.0
:alt: Try me on Runboat

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

This module add a parent relation to the partner industry

**Table of contents**

.. contents::
:local:

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_industry_parent%0Aversion:%2019.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
-------

* ACSONE SA/NV

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

- Souheil Bejaoui <souheil.bejaoui@acsone.eu>

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/19.0/partner_industry_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_industry_parent/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
15 changes: 15 additions & 0 deletions partner_industry_parent/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Copyright 2019 ACSONE SA/NV
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

{
"name": "Partner Industry Parent",
"summary": """
This module add a parent relation to the partner industry""",
"version": "19.0.1.0.0",
"license": "AGPL-3",
"author": "ACSONE SA/NV,Odoo Community Association (OCA)",
"website": "https://github.com/OCA/partner-contact",
"depends": ["base"],
"data": ["views/res_partner_industry.xml"],
"demo": [],
}
42 changes: 42 additions & 0 deletions partner_industry_parent/i18n/it.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * partner_industry_parent
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 18.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2025-11-24 12:43+0000\n"
"Last-Translator: mymage <stefano.consolaro@mymage.it>\n"
"Language-Team: none\n"
"Language: it\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 5.10.4\n"

#. module: partner_industry_parent
#: model:ir.model.fields,field_description:partner_industry_parent.field_res_partner_industry__child_ids
msgid "Children"
msgstr "Figli"

#. module: partner_industry_parent
#: model:ir.model.fields,field_description:partner_industry_parent.field_res_partner_industry__complete_name
msgid "Complete Name"
msgstr "Nome completo"

#. module: partner_industry_parent
#: model:ir.model,name:partner_industry_parent.model_res_partner_industry
msgid "Industry"
msgstr "Settore"

#. module: partner_industry_parent
#: model:ir.model.fields,field_description:partner_industry_parent.field_res_partner_industry__parent_id
msgid "Parent"
msgstr "Padre"

#. module: partner_industry_parent
#: model:ir.model.fields,field_description:partner_industry_parent.field_res_partner_industry__parent_path
msgid "Parent Path"
msgstr "Percorso padre"
39 changes: 39 additions & 0 deletions partner_industry_parent/i18n/partner_industry_parent.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * partner_industry_parent
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 19.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_industry_parent
#: model:ir.model.fields,field_description:partner_industry_parent.field_res_partner_industry__child_ids
msgid "Children"
msgstr ""

#. module: partner_industry_parent
#: model:ir.model.fields,field_description:partner_industry_parent.field_res_partner_industry__complete_name
msgid "Complete Name"
msgstr ""

#. module: partner_industry_parent
#: model:ir.model,name:partner_industry_parent.model_res_partner_industry
msgid "Industry"
msgstr ""

#. module: partner_industry_parent
#: model:ir.model.fields,field_description:partner_industry_parent.field_res_partner_industry__parent_id
msgid "Parent"
msgstr ""

#. module: partner_industry_parent
#: model:ir.model.fields,field_description:partner_industry_parent.field_res_partner_industry__parent_path
msgid "Parent Path"
msgstr ""
1 change: 1 addition & 0 deletions partner_industry_parent/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import res_partner_industry
33 changes: 33 additions & 0 deletions partner_industry_parent/models/res_partner_industry.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Copyright 2019 ACSONE SA/NV
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import api, fields, models


class ResPartnerIndustry(models.Model):
_inherit = "res.partner.industry"
_parent_name = "parent_id"
_parent_store = True
_rec_name = "complete_name"
_order = "complete_name"

complete_name = fields.Char(
compute="_compute_complete_name", store=True, recursive=True
)
parent_path = fields.Char(index=True)
parent_id = fields.Many2one(comodel_name="res.partner.industry")
child_ids = fields.One2many(
comodel_name="res.partner.industry",
inverse_name="parent_id",
string="Children Industry",
)

@api.depends("name", "parent_id.complete_name")
def _compute_complete_name(self):
for industry in self:
if industry.parent_id:
industry.complete_name = (
f"{industry.parent_id.complete_name} / {industry.name}"
)
else:
industry.complete_name = industry.name
3 changes: 3 additions & 0 deletions partner_industry_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"
1 change: 1 addition & 0 deletions partner_industry_parent/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Souheil Bejaoui \<<souheil.bejaoui@acsone.eu>\>
1 change: 1 addition & 0 deletions partner_industry_parent/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This module add a parent relation to the partner industry
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading