Skip to content

Commit ac090ac

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

12 files changed

Lines changed: 626 additions & 0 deletions

File tree

partner_parent_tag/README.rst

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
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+
- `Sygel <https://www.sygel.es>`__:
57+
58+
- Valentin Vinagre
59+
- Manuel Regidor
60+
- Ángel Rivas
61+
62+
Maintainers
63+
-----------
64+
65+
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.
66+
67+
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"],
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: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
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 odoo import api, models
5+
6+
7+
class ResPartner(models.Model):
8+
_inherit = "res.partner"
9+
10+
@api.model_create_multi
11+
def create(self, vals_list):
12+
records = super().create(vals_list)
13+
for record in records:
14+
parent_categories = record.parent_id.category_id
15+
if parent_categories:
16+
record.category_id = [(4, cat.id) for cat in parent_categories]
17+
return records

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: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
- [Sygel](https://www.sygel.es):
2+
- Valentin Vinagre
3+
- Manuel Regidor
4+
- Ángel Rivas
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)