Skip to content

Commit 73c218e

Browse files
committed
[T-7573][ADD] partner_parent_tag
1 parent 4ddc711 commit 73c218e

12 files changed

Lines changed: 598 additions & 0 deletions

File tree

partner_parent_tag/README.rst

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
==================
2+
Partner Parent Tag
3+
==================
4+
5+
..
6+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
7+
!! This file is generated by oca-gen-addon-readme !!
8+
!! changes will be overwritten. !!
9+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
10+
!! source digest: sha256:83f1f89f4a3fe86cfc62446e3be0ecd332969b2f0c67e8a5ff0df5207799015b
11+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
12+
13+
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
14+
:target: https://odoo-community.org/page/development-status
15+
:alt: Beta
16+
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
17+
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
18+
:alt: License: AGPL-3
19+
.. |badge3| image:: https://img.shields.io/badge/github-sygel--technology%2Fsy--partner--contact-lightgray.png?logo=github
20+
:target: https://github.com/sygel-technology/sy-partner-contact/tree/17.0/partner_parent_tag
21+
:alt: sygel-technology/sy-partner-contact
22+
23+
|badge1| |badge2| |badge3|
24+
25+
This module automatically inherits tags from a parent contact to a child
26+
contact when the child is created. If the parent is changed later, the
27+
child’s tags remain unchanged. The addon only copies tags during the
28+
contact creation process.
29+
30+
**Table of contents**
31+
32+
.. contents::
33+
:local:
34+
35+
Bug Tracker
36+
===========
37+
38+
Bugs are tracked on `GitHub Issues <https://github.com/sygel-technology/sy-partner-contact/issues>`_.
39+
In case of trouble, please check there if your issue has already been reported.
40+
If you spotted it first, help us to smash it by providing a detailed and welcomed
41+
`feedback <https://github.com/sygel-technology/sy-partner-contact/issues/new?body=module:%20partner_parent_tag%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
42+
43+
Do not contact contributors directly about support or help with technical issues.
44+
45+
Credits
46+
=======
47+
48+
Authors
49+
-------
50+
51+
* Sygel
52+
53+
Contributors
54+
------------
55+
56+
- Ángel Rivas angel.rivas@sygel.es
57+
58+
Maintainers
59+
-----------
60+
61+
This module is part of the `sygel-technology/sy-partner-contact <https://github.com/sygel-technology/sy-partner-contact/tree/17.0/partner_parent_tag>`_ project on GitHub.
62+
63+
You are welcome to contribute.

partner_parent_tag/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Copyright 2025 Ángel Rivas <angel.rivas@sygel.es>
2+
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
3+
4+
from . import models

partner_parent_tag/__manifest__.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Copyright 2025 Ángel Rivas <angel.rivas@sygel.es>
2+
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
3+
{
4+
"name": "Partner Parent Tag",
5+
"summary": "Inherit tags from parent partner",
6+
"version": "17.0.1.0.0",
7+
"category": "Contacts",
8+
"website": "https://github.com/sygel-technology/sy-partner-contact",
9+
"author": "Sygel, Odoo Community Association (OCA)",
10+
"license": "AGPL-3",
11+
"application": False,
12+
"installable": True,
13+
"depends": ["base", "contacts"],
14+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Copyright 2025 Ángel Rivas <angel.rivas@sygel.es>
2+
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
3+
4+
from . import res_partner
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Copyright 2024 Alberto Martínez <alberto.martinez@sygel.es>
2+
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
3+
4+
from odoo import api, models
5+
6+
7+
class ResPartner(models.Model):
8+
_inherit = "res.partner"
9+
10+
11+
@api.model
12+
def create(self, vals):
13+
partner = super().create(vals)
14+
if "parent_id" in vals and vals["parent_id"]:
15+
partner._inherit_tags_from_parent()
16+
17+
return partner
18+
19+
def _inherit_tags_from_parent(self):
20+
if self.parent_id:
21+
self.category_id = [(6, 0, self.parent_id.category_id.ids)]

partner_parent_tag/pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[build-system]
2+
requires = ["whool"]
3+
build-backend = "whool.buildapi"
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
- Ángel Rivas <angel.rivas@sygel.es>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
This module automatically inherits tags from a parent contact to a child contact when the child is created. If the parent is changed later, the child’s tags remain unchanged. The addon only copies tags during the contact creation process.
35 KB
Loading

0 commit comments

Comments
 (0)