-
-
Notifications
You must be signed in to change notification settings - Fork 837
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
[MIG][16.0] partner_industry_parent #1835
Open
len-foss
wants to merge
15
commits into
OCA:16.0
Choose a base branch
from
lambdao-dev:16.0-mig-partner_industry_parent
base: 16.0
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
fd0027b
[ADD] - Add partner_industry_parent module
sbejaoui 81f153a
[FIX] - Fix gnu link
sbejaoui 6c052b8
[IMP] - Add unit tests
sbejaoui b867bf5
[IMP] - Add complete name to the form view
sbejaoui 0dc4a26
[UPD] Update partner_industry_parent.pot
oca-travis 268ab68
[UPD] README.rst
OCA-git-bot ec273c8
partner_industry_parent 12.0.2.0.0
OCA-git-bot a9060cf
[MIG] partner_industry_parent: Migration to 15.0
yankinmax 9341ae2
[UPD] Update partner_industry_parent.pot
1ed9164
[UPD] README.rst
OCA-git-bot 5c7392e
Added translation using Weblate (Spanish)
Ivorra78 fb838fe
Translated using Weblate (Spanish)
Ivorra78 b35018a
[IMP] partner_industry_parent: pre-commit execution
len-foss 0dab4f4
[MIG] partner_industry_parent: Migration to 16.0
len-foss 09eab4e
[IMP] parent_industry_parent: unaccent parent_path
len-foss File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
======================= | ||
Partner Industry Parent | ||
======================= | ||
|
||
.. | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
!! This file is generated by oca-gen-addon-readme !! | ||
!! changes will be overwritten. !! | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
!! source digest: sha256:533942a290cb3171f2406a071fee77638b4f37cd103aa372a18bee93d19281cb | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
|
||
.. |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/15.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-15-0/partner-contact-15-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=15.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:%2015.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/15.0/partner_industry_parent>`_ project on GitHub. | ||
|
||
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import models |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# 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": "16.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_views.xml", | ||
"views/res_partner_industry_views.xml", | ||
], | ||
"demo": [], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * partner_industry_parent | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 15.0\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"PO-Revision-Date: 2023-10-09 07:40+0000\n" | ||
"Last-Translator: Ivorra78 <informatica@totmaterial.es>\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_industry_parent | ||
#: model:ir.model.fields,field_description:partner_industry_parent.field_res_partner_industry__partner_count | ||
msgid "# Partners" | ||
msgstr "# Socios" | ||
|
||
#. module: partner_industry_parent | ||
#: model_terms:ir.ui.view,arch_db:partner_industry_parent.partner_industry_parent_form | ||
msgid "<span class=\"o_stat_text\"> Partners</span>" | ||
msgstr "<span class=\"o_stat_text\"> Socios</span>" | ||
|
||
#. module: partner_industry_parent | ||
#: model:ir.model.fields,field_description:partner_industry_parent.field_res_partner_industry__child_ids | ||
msgid "Children" | ||
msgstr "Niños" | ||
|
||
#. module: partner_industry_parent | ||
#: model:ir.model.fields,field_description:partner_industry_parent.field_res_partner_industry__complete_name | ||
msgid "Complete Name" | ||
msgstr "Nombre completo" | ||
|
||
#. module: partner_industry_parent | ||
#: model:ir.model,name:partner_industry_parent.model_res_partner | ||
msgid "Contact" | ||
msgstr "Contacto" | ||
|
||
#. module: partner_industry_parent | ||
#: model_terms:ir.actions.act_window,help:partner_industry_parent.action_partners_all | ||
msgid "Create a new partner" | ||
msgstr "Crear un nuevo socio" | ||
|
||
#. module: partner_industry_parent | ||
#: model:ir.model,name:partner_industry_parent.model_res_partner_industry | ||
#: model_terms:ir.ui.view,arch_db:partner_industry_parent.partner_industry_parent_form | ||
#: model_terms:ir.ui.view,arch_db:partner_industry_parent.view_res_partner_filter | ||
msgid "Industry" | ||
msgstr "Industria" | ||
|
||
#. module: partner_industry_parent | ||
#: model:ir.model.fields,field_description:partner_industry_parent.field_res_partner_industry__parent_id | ||
msgid "Parent" | ||
msgstr "Parental" | ||
|
||
#. module: partner_industry_parent | ||
#: model:ir.model.fields,field_description:partner_industry_parent.field_res_partner_industry__parent_path | ||
msgid "Parent Path" | ||
msgstr "Ruta parental" | ||
|
||
#. module: partner_industry_parent | ||
#: model:ir.actions.act_window,name:partner_industry_parent.action_partners_all | ||
msgid "Partners" | ||
msgstr "Socios" | ||
|
||
#. module: partner_industry_parent | ||
#: code:addons/partner_industry_parent/models/res_partner.py:0 | ||
#, python-format | ||
msgid "Partners: %(industry)s" | ||
msgstr "Socios: %(industry)s" | ||
|
||
#. module: partner_industry_parent | ||
#: model:ir.model.fields,help:partner_industry_parent.field_res_partner_industry__partner_count | ||
msgid "" | ||
"The number of partners under this industry (Does not consider the children " | ||
"categories)" | ||
msgstr "" | ||
"Número de socios de este sector (No tiene en cuenta las categorías de niños)" | ||
|
||
#. module: partner_industry_parent | ||
#: code:addons/partner_industry_parent/models/res_partner_industry.py:0 | ||
#, python-format | ||
msgid "You cannot create recursive categories." | ||
msgstr "No puede crear categorías recursivas." | ||
|
||
#. module: partner_industry_parent | ||
#: model_terms:ir.ui.view,arch_db:partner_industry_parent.partner_industry_parent_form | ||
msgid "e.g. Health and care" | ||
msgstr "p. ej. Sanidad y asistencia" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * partner_industry_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_industry_parent | ||
#: model:ir.model.fields,field_description:partner_industry_parent.field_res_partner_industry__partner_count | ||
msgid "# Partners" | ||
msgstr "" | ||
|
||
#. module: partner_industry_parent | ||
#: model_terms:ir.ui.view,arch_db:partner_industry_parent.partner_industry_parent_form | ||
msgid "<span class=\"o_stat_text\"> Partners</span>" | ||
msgstr "" | ||
|
||
#. 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 | ||
msgid "Contact" | ||
msgstr "" | ||
|
||
#. module: partner_industry_parent | ||
#: model_terms:ir.actions.act_window,help:partner_industry_parent.action_partners_all | ||
msgid "Create a new partner" | ||
msgstr "" | ||
|
||
#. module: partner_industry_parent | ||
#: model:ir.model,name:partner_industry_parent.model_res_partner_industry | ||
#: model_terms:ir.ui.view,arch_db:partner_industry_parent.partner_industry_parent_form | ||
#: model_terms:ir.ui.view,arch_db:partner_industry_parent.view_res_partner_filter | ||
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 "" | ||
|
||
#. module: partner_industry_parent | ||
#: model:ir.actions.act_window,name:partner_industry_parent.action_partners_all | ||
msgid "Partners" | ||
msgstr "" | ||
|
||
#. module: partner_industry_parent | ||
#: code:addons/partner_industry_parent/models/res_partner.py:0 | ||
#, python-format | ||
msgid "Partners: %(industry)s" | ||
msgstr "" | ||
|
||
#. module: partner_industry_parent | ||
#: model:ir.model.fields,help:partner_industry_parent.field_res_partner_industry__partner_count | ||
msgid "" | ||
"The number of partners under this industry (Does not consider the children " | ||
"categories)" | ||
msgstr "" | ||
|
||
#. module: partner_industry_parent | ||
#: code:addons/partner_industry_parent/models/res_partner_industry.py:0 | ||
#, python-format | ||
msgid "You cannot create recursive categories." | ||
msgstr "" | ||
|
||
#. module: partner_industry_parent | ||
#: model_terms:ir.ui.view,arch_db:partner_industry_parent.partner_industry_parent_form | ||
msgid "e.g. Health and care" | ||
msgstr "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
from . import res_partner_industry | ||
from . import res_partner |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
# Copyright 2023 Camptocamp SA | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
from odoo import SUPERUSER_ID, _, api, models | ||
|
||
|
||
class Partner(models.Model): | ||
_inherit = "res.partner" | ||
|
||
@api.model | ||
def _search( | ||
self, | ||
args, | ||
offset=0, | ||
limit=None, | ||
order=None, | ||
count=False, | ||
access_rights_uid=None, | ||
): | ||
if self._context.get("search_default_industry_id"): | ||
args.append( | ||
( | ||
"industry_id", | ||
"child_of", | ||
self._context["search_default_industry_id"], | ||
) | ||
) | ||
return super()._search( | ||
args, | ||
offset=offset, | ||
limit=limit, | ||
order=order, | ||
count=count, | ||
access_rights_uid=access_rights_uid, | ||
) | ||
|
||
@api.model | ||
def view_header_get(self, view_id, view_type): | ||
if self._context.get("industry_id"): | ||
return _( | ||
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. Is this right? I don't really know translations but I thought the rule was |
||
"Partners: %(industry)s", | ||
industry=self.env["res.partner.industry"] | ||
.browse(self.env.context["industry_id"]) | ||
.name, | ||
) | ||
return super().view_header_get(view_id, view_type) | ||
|
||
def _read_group_industry_id(self, industries, domain, order): | ||
industry_ids = self.env.context.get("default_industry_id") | ||
if not industry_ids and self.env.context.get("group_expand"): | ||
industry_ids = industries._search( | ||
[], order=order, access_rights_uid=SUPERUSER_ID | ||
) | ||
return industries.browse(industry_ids) | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
This is just a minor point, I know you didn't write yourself, and purely opinion. I much prefer these overrides where only args is amended to use the idiom
It is loads shorter, more resistant to api changes, and cleaner for people to read as they know only args is being affected.
Then super()