diff --git a/partner_segmentation/__manifest__.py b/partner_segmentation/__manifest__.py index 12033c5d7..0b8ede7cb 100644 --- a/partner_segmentation/__manifest__.py +++ b/partner_segmentation/__manifest__.py @@ -44,6 +44,7 @@ ], "data": [ "security/ir.model.access.csv", + "data/partner_segmentation_links.xml", "data/partner_segmentation_data.xml", "data/partner_segmentation_survey.xml", "views/survey_view.xml", diff --git a/partner_segmentation/data/partner_segmentation_data.xml b/partner_segmentation/data/partner_segmentation_data.xml index ae06e9991..8ad670547 100644 --- a/partner_segmentation/data/partner_segmentation_data.xml +++ b/partner_segmentation/data/partner_segmentation_data.xml @@ -15,50 +15,19 @@ >Did you know? We guarantee that at least 80% of sponsorship donations - for gifts to your sponsored child and fund donations up to 100% - are invested in projects and programmes in the countries of the South. Thank you for the considerable impact you’ve already made.

Thank you for your precious support.

- -
-
-
Why not take a look at our latest updates?
- -
-
-
Take a look at Compassion’s finances
- -
-
-
+ Movement Mobilizers @@ -73,116 +42,25 @@ >We are thrilled about your determination to fight injustices. We are so happy to count you as part of the growing number of people who are joining us in the fight against extreme poverty. We commit to providing platforms where you can advocate for children in need and the fight against extreme poverty and inspire others to join you.

Thank you for your precious support.

- -
-
-
Join or create a project to raise help for the children in need
- TOGETHER -
-
-
Take a look at our latest updates
- -
-
-
Follow us on the social medias
-
- - -
-
- -
-
+ Compassionate Caregivers @@ -199,80 +77,23 @@ Thanks to our holistic approach to child development, we commit to a personal an >You can join us by making a spiritual impact in the lives of children in need through prayer and even get children in your surroundings involved in this endeavour.

Thank you for your precious support.

- -
-
-
Support one of our funds
- -
-
-
Get future generations involved in the fight against extreme poverty
- -
-
-
Take a look at our latest updates
- -
-
-
Watch our latest videos
- Compassion Videos -
-
-
+ Hands-On Helpers @@ -301,50 +122,19 @@ Thanks to our holistic approach to child development, we commit to a personal an

Thank you for your precious support.

- -
- -
-
Take a look at our latest updates
- -
-
-
+ Curious Novices @@ -360,103 +150,23 @@ Thanks to our holistic approach to child development, we commit to a personal an

You can engage with us in flexible and manifold ways.

Thank you for your precious support.

- -
-
-
Support one of our funds
- -
-
-
Why not take a look at our latest updates?
- -
-
-
Follow us on the social medias
-
- - -
-
+ diff --git a/partner_segmentation/data/partner_segmentation_links.xml b/partner_segmentation/data/partner_segmentation_links.xml new file mode 100644 index 000000000..094b0b8e5 --- /dev/null +++ b/partner_segmentation/data/partner_segmentation_links.xml @@ -0,0 +1,131 @@ + + + + Latest Updates (FR) + https://compassion.ch/news/ + + + + Latest Updates (DE) + https://compassion.ch/de/neues/ + + + + Latest Updates (IT) + https://compassion.ch/it/notizie/ + + + + + Finances (FR) + https://compassion.ch/finances/ + + + + Finances (DE) + https://compassion.ch/de/finanzen/ + + + + Finances (IT) + https://compassion.ch/it/finanze/ + + + + + Volunteering (FR) + https://compassion.ch/participer/ + + + + Volunteering (DE) + https://compassion.ch/de/sich-mehr-engagieren/ + + + + Volunteering (IT) + https://compassion.ch/it/participare/ + + + + + Support Funds (FR) + https://compassion.ch/donations/ + + + + Support Funds (DE) + https://compassion.ch/de/spenden/ + + + + Support Funds (IT) + https://compassion.ch/it/donare/ + + + + + Facebook (FR) + https://facebook.com/compassionsuisse/ + + + + Facebook (DE) + https://facebook.com/compassionschweiz/ + + + + Facebook (IT) + https://www.facebook.com/compassionsvizzera + + + + Instagram + https://www.instagram.com/compassionswiss/ + + + + Vimeo + https://vimeo.com/compassionswitzerland + + + + Watch Videos + https://vimeo.com/compassionswitzerland + + + + + TOGETHER Project + https://together.compassion.ch/homepage + + + + Step In My Shoes (FR) + https://compassion.ch/bienvenue-dans-mon-monde-philippines/ + + + + Step In My Shoes (DE) + https://compassion.ch/de/komm-mit/ + + + + Cool (DE) + https://compassion.ch/de/sonntagschulmaterial// + + + diff --git a/partner_segmentation/models/__init__.py b/partner_segmentation/models/__init__.py index c389bbda8..3818604fe 100644 --- a/partner_segmentation/models/__init__.py +++ b/partner_segmentation/models/__init__.py @@ -11,6 +11,7 @@ parter_segment_affinity, partner_compassion, partner_segment, + partner_segment_link, survey, survey_user_input, ) diff --git a/partner_segmentation/models/partner_segment.py b/partner_segmentation/models/partner_segment.py index 3a7c84f7b..864f04ed5 100644 --- a/partner_segmentation/models/partner_segment.py +++ b/partner_segmentation/models/partner_segment.py @@ -32,7 +32,14 @@ class ResPartnerSegment(models.Model): ) survey_result = fields.Html(translate=True, sanitize=False) - personalized_links = fields.Html(translate=True, sanitize=False) + + link_ids = fields.One2many( + "res.partner.segment.link", + "category_id", + string="Personalized Links", + help="Useful resources for partners in this segment", + ) + image = fields.Binary(help="segment illustration") primary_partners_ids = fields.One2many( diff --git a/partner_segmentation/models/partner_segment_link.py b/partner_segmentation/models/partner_segment_link.py new file mode 100644 index 000000000..a0eb92d42 --- /dev/null +++ b/partner_segmentation/models/partner_segment_link.py @@ -0,0 +1,45 @@ +############################################################################## +# +# Copyright (C) 2026 Compassion CH (http://www.compassion.ch) +# Releasing children from poverty in Jesus' name +# @author: Daniel Gergely +# +# The licence is in the file __manifest__.py +# +############################################################################## +from odoo import fields, models + + +class ResPartnerSegmentLink(models.Model): + """ + Model to store the + - URL + - Label + - Language + - Category + of a partner segmentation link, which then can be used to + provide useful links to the partners based on their segmentation + category and language. + """ + + _name = "res.partner.segment.link" + _description = "Partner Segmentation Link" + + url = fields.Char( + required=True, help="URL of the link to be provided to the partner" + ) + label = fields.Char( + required=True, help="Label of the link to be provided to the partner" + ) + language_id = fields.Many2one( + "res.lang", + string="Language", + help="Language of the link, used to provide the link to " + "the partner based on their language", + ) + category_id = fields.Many2one( + "res.partner.segment", + string="Category", + help="Segmentation category of the link, used to provide the " + "link to the partner based on their segmentation category", + ) diff --git a/partner_segmentation/security/ir.model.access.csv b/partner_segmentation/security/ir.model.access.csv index c5d2a3423..02cd1527d 100644 --- a/partner_segmentation/security/ir.model.access.csv +++ b/partner_segmentation/security/ir.model.access.csv @@ -4,3 +4,5 @@ full_access_partner_segmentation, Full access on partner segmentation,model_res_ read_access_partner_segmentation_affinity, Read access on partner segmentation affinity,model_res_partner_segment_affinity,base.group_user,1,0,0,0 read_access_partner_segmentation_affinity_portal, Read access on partner segmentation affinity,model_res_partner_segment_affinity,base.group_portal,1,0,0,0 full_access_partner_segmentation_affinity, Full access on partner segmentation affinity,model_res_partner_segment_affinity,base.group_system,1,1,1,1 +read_access_res_partner_segmentation_link, Read access on partner segmentation link,model_res_partner_segment_link,base.group_user,1,0,0,0 +full_access_partner_segmentation_link, Full access on partner segmentation link,model_res_partner_segment_link,base.group_system,1,1,1,1 diff --git a/partner_segmentation/views/partner_segmentation_view.xml b/partner_segmentation/views/partner_segmentation_view.xml index fde005b37..007f0d60b 100644 --- a/partner_segmentation/views/partner_segmentation_view.xml +++ b/partner_segmentation/views/partner_segmentation_view.xml @@ -22,7 +22,14 @@ - + + + + + + + +