diff --git a/partner_industry_parent/README.rst b/partner_industry_parent/README.rst new file mode 100644 index 000000000..c745d04c5 --- /dev/null +++ b/partner_industry_parent/README.rst @@ -0,0 +1,73 @@ +======================= +Partner Industry Parent +======================= + +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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/12.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-12-0/partner-contact-12-0-partner_industry_parent + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png + :target: https://runbot.odoo-community.org/runbot/134/12.0 + :alt: Try me on Runbot + +|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 `_. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us smashing it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +~~~~~~~ + +* ACSONE SA/NV + +Contributors +~~~~~~~~~~~~ + +* Souheil Bejaoui + +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 `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/partner_industry_parent/__init__.py b/partner_industry_parent/__init__.py new file mode 100644 index 000000000..0650744f6 --- /dev/null +++ b/partner_industry_parent/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/partner_industry_parent/__manifest__.py b/partner_industry_parent/__manifest__.py new file mode 100644 index 000000000..9185466fe --- /dev/null +++ b/partner_industry_parent/__manifest__.py @@ -0,0 +1,15 @@ +# Copyright 2019 ACSONE SA/NV +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +{ + 'name': 'Partner Industry Parent', + 'summary': """ + This module add a parent relation to the partner industry""", + 'version': '12.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': [], +} diff --git a/partner_industry_parent/models/__init__.py b/partner_industry_parent/models/__init__.py new file mode 100644 index 000000000..9b124581f --- /dev/null +++ b/partner_industry_parent/models/__init__.py @@ -0,0 +1 @@ +from . import res_partner_industry diff --git a/partner_industry_parent/models/res_partner_industry.py b/partner_industry_parent/models/res_partner_industry.py new file mode 100644 index 000000000..89b226cf4 --- /dev/null +++ b/partner_industry_parent/models/res_partner_industry.py @@ -0,0 +1,35 @@ +# Copyright 2019 ACSONE SA/NV +# License AGPL-3.0 or later (http://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( + 'Complete Name', compute='_compute_complete_name', store=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 = '%s / %s' % ( + industry.parent_id.complete_name, + industry.name, + ) + else: + industry.complete_name = industry.name diff --git a/partner_industry_parent/readme/CONTRIBUTORS.rst b/partner_industry_parent/readme/CONTRIBUTORS.rst new file mode 100644 index 000000000..50e6298db --- /dev/null +++ b/partner_industry_parent/readme/CONTRIBUTORS.rst @@ -0,0 +1 @@ +* Souheil Bejaoui diff --git a/partner_industry_parent/readme/DESCRIPTION.rst b/partner_industry_parent/readme/DESCRIPTION.rst new file mode 100644 index 000000000..66e0d01b5 --- /dev/null +++ b/partner_industry_parent/readme/DESCRIPTION.rst @@ -0,0 +1 @@ +This module add a parent relation to the partner industry diff --git a/partner_industry_parent/static/description/icon.png b/partner_industry_parent/static/description/icon.png new file mode 100644 index 000000000..3a0328b51 Binary files /dev/null and b/partner_industry_parent/static/description/icon.png differ diff --git a/partner_industry_parent/static/description/index.html b/partner_industry_parent/static/description/index.html new file mode 100644 index 000000000..d3b1886b0 --- /dev/null +++ b/partner_industry_parent/static/description/index.html @@ -0,0 +1,419 @@ + + + + + + +Partner Industry Parent + + + +
+

Partner Industry Parent

+ + +

Beta License: AGPL-3 OCA/partner-contact Translate me on Weblate Try me on Runbot

+

This module add a parent relation to the partner industry

+

Table of contents

+ +
+

Bug Tracker

+

Bugs are tracked on GitHub Issues. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us smashing it by providing a detailed and welcomed +feedback.

+

Do not contact contributors directly about support or help with technical issues.

+
+
+

Credits

+
+

Authors

+
    +
  • ACSONE SA/NV
  • +
+
+
+

Contributors

+ +
+
+

Maintainers

+

This module is maintained by the OCA.

+Odoo Community Association +

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 project on GitHub.

+

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

+
+
+
+ + diff --git a/partner_industry_parent/views/res_partner_industry.xml b/partner_industry_parent/views/res_partner_industry.xml new file mode 100644 index 000000000..d6ef330ec --- /dev/null +++ b/partner_industry_parent/views/res_partner_industry.xml @@ -0,0 +1,24 @@ + + + + + + Industry (in partner_industry_parent) + res.partner.industry + + + + + + + + + + + + + +