-
Notifications
You must be signed in to change notification settings - Fork 51
T3022 partner segmentation refactor #2081
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
Open
Danielgergely
wants to merge
6
commits into
14.0
Choose a base branch
from
T3022-partner-segmentation-refactor
base: 14.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
6 commits
Select commit
Hold shift + click to select a range
81009d1
[T3022] REFACTOR: new partner_segment_link model to replace hard code…
Danielgergely 7c7c489
[T3022] STYLE: pre-commit
Danielgergely 4d3e696
[T3022] FIX: GCA suggestions
Danielgergely b4f4afd
[T3022] FIX: corrected link languages and labels
Danielgergely 0b074f9
[T3022] FIX: Added separate partner_segmentation_links
Danielgergely 9079a70
[T3022] STYLE: pre-commit
Danielgergely 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 hidden or 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
450 changes: 80 additions & 370 deletions
450
partner_segmentation/data/partner_segmentation_data.xml
Large diffs are not rendered by default.
Oops, something went wrong.
131 changes: 131 additions & 0 deletions
131
partner_segmentation/data/partner_segmentation_links.xml
This file contains hidden or 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,131 @@ | ||
| <?xml version="1.0" encoding="utf-8" ?> | ||
| <odoo> | ||
| <record | ||
| id="segment_link_latest_updates_fr" | ||
| model="res.partner.segment.link" | ||
| > | ||
| <field name="label">Latest Updates (FR)</field> | ||
| <field name="url">https://compassion.ch/news/</field> | ||
| <field name="language_id" ref="base.lang_fr_CH" /> | ||
| </record> | ||
| <record | ||
| id="segment_link_latest_updates_de" | ||
| model="res.partner.segment.link" | ||
| > | ||
| <field name="label">Latest Updates (DE)</field> | ||
| <field name="url">https://compassion.ch/de/neues/</field> | ||
| <field name="language_id" ref="base.lang_de" /> | ||
| </record> | ||
| <record | ||
| id="segment_link_latest_updates_it" | ||
| model="res.partner.segment.link" | ||
| > | ||
| <field name="label">Latest Updates (IT)</field> | ||
| <field name="url">https://compassion.ch/it/notizie/</field> | ||
| <field name="language_id" ref="base.lang_it" /> | ||
| </record> | ||
|
|
||
| <record id="segment_link_finances_fr" model="res.partner.segment.link"> | ||
| <field name="label">Finances (FR)</field> | ||
| <field name="url">https://compassion.ch/finances/</field> | ||
| <field name="language_id" ref="base.lang_fr_CH" /> | ||
| </record> | ||
| <record id="segment_link_finances_de" model="res.partner.segment.link"> | ||
| <field name="label">Finances (DE)</field> | ||
| <field name="url">https://compassion.ch/de/finanzen/</field> | ||
| <field name="language_id" ref="base.lang_de" /> | ||
| </record> | ||
| <record id="segment_link_finances_it" model="res.partner.segment.link"> | ||
| <field name="label">Finances (IT)</field> | ||
| <field name="url">https://compassion.ch/it/finanze/</field> | ||
| <field name="language_id" ref="base.lang_it" /> | ||
| </record> | ||
|
|
||
| <record id="segment_link_volunteering_fr" model="res.partner.segment.link"> | ||
| <field name="label">Volunteering (FR)</field> | ||
| <field name="url">https://compassion.ch/participer/</field> | ||
| <field name="language_id" ref="base.lang_fr_CH" /> | ||
| </record> | ||
| <record id="segment_link_volunteering_de" model="res.partner.segment.link"> | ||
| <field name="label">Volunteering (DE)</field> | ||
| <field name="url">https://compassion.ch/de/sich-mehr-engagieren/</field> | ||
| <field name="language_id" ref="base.lang_de" /> | ||
| </record> | ||
| <record id="segment_link_volunteering_it" model="res.partner.segment.link"> | ||
| <field name="label">Volunteering (IT)</field> | ||
| <field name="url">https://compassion.ch/it/participare/</field> | ||
| <field name="language_id" ref="base.lang_it" /> | ||
| </record> | ||
|
|
||
| <record id="segment_link_support_funds_fr" model="res.partner.segment.link"> | ||
| <field name="label">Support Funds (FR)</field> | ||
| <field name="url">https://compassion.ch/donations/</field> | ||
| <field name="language_id" ref="base.lang_fr_CH" /> | ||
| </record> | ||
| <record id="segment_link_support_funds_de" model="res.partner.segment.link"> | ||
| <field name="label">Support Funds (DE)</field> | ||
| <field name="url">https://compassion.ch/de/spenden/</field> | ||
| <field name="language_id" ref="base.lang_de" /> | ||
| </record> | ||
| <record id="segment_link_support_funds_it" model="res.partner.segment.link"> | ||
| <field name="label">Support Funds (IT)</field> | ||
| <field name="url">https://compassion.ch/it/donare/</field> | ||
| <field name="language_id" ref="base.lang_it" /> | ||
| </record> | ||
|
|
||
| <record id="segment_link_facebook_fr" model="res.partner.segment.link"> | ||
| <field name="label">Facebook (FR)</field> | ||
| <field name="url">https://facebook.com/compassionsuisse/</field> | ||
| <field name="language_id" ref="base.lang_fr_CH" /> | ||
| </record> | ||
| <record id="segment_link_facebook_de" model="res.partner.segment.link"> | ||
| <field name="label">Facebook (DE)</field> | ||
| <field name="url">https://facebook.com/compassionschweiz/</field> | ||
| <field name="language_id" ref="base.lang_de" /> | ||
| </record> | ||
| <record id="segment_link_facebook_it" model="res.partner.segment.link"> | ||
| <field name="label">Facebook (IT)</field> | ||
| <field name="url">https://www.facebook.com/compassionsvizzera</field> | ||
| <field name="language_id" ref="base.lang_it" /> | ||
| </record> | ||
| <record id="segment_link_instagram" model="res.partner.segment.link"> | ||
| <field name="label">Instagram</field> | ||
| <field name="url">https://www.instagram.com/compassionswiss/</field> | ||
| <field name="language_id" ref="base.lang_en" /> | ||
| </record> | ||
| <record id="segment_link_vimeo" model="res.partner.segment.link"> | ||
| <field name="label">Vimeo</field> | ||
| <field name="url">https://vimeo.com/compassionswitzerland</field> | ||
| <field name="language_id" ref="base.lang_en" /> | ||
| </record> | ||
| <record id="segment_link_watch_videos" model="res.partner.segment.link"> | ||
| <field name="label">Watch Videos</field> | ||
| <field name="url">https://vimeo.com/compassionswitzerland</field> | ||
| <field name="language_id" ref="base.lang_en" /> | ||
| </record> | ||
|
|
||
| <record id="segment_link_together_project" model="res.partner.segment.link"> | ||
| <field name="label">TOGETHER Project</field> | ||
| <field name="url">https://together.compassion.ch/homepage</field> | ||
| <field name="language_id" ref="base.lang_en" /> | ||
| </record> | ||
| <record id="segment_link_sims_fr" model="res.partner.segment.link"> | ||
| <field name="label">Step In My Shoes (FR)</field> | ||
| <field | ||
| name="url" | ||
| >https://compassion.ch/bienvenue-dans-mon-monde-philippines/</field> | ||
| <field name="language_id" ref="base.lang_fr_CH" /> | ||
| </record> | ||
| <record id="segment_link_sims_de" model="res.partner.segment.link"> | ||
| <field name="label">Step In My Shoes (DE)</field> | ||
| <field name="url">https://compassion.ch/de/komm-mit/</field> | ||
| <field name="language_id" ref="base.lang_de" /> | ||
| </record> | ||
| <record id="segment_link_cool_de" model="res.partner.segment.link"> | ||
| <field name="label">Cool (DE)</field> | ||
| <field | ||
| name="url" | ||
| >https://compassion.ch/de/sonntagschulmaterial//</field> | ||
| <field name="language_id" ref="base.lang_de" /> | ||
| </record> | ||
| </odoo> |
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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,45 @@ | ||
| ############################################################################## | ||
| # | ||
| # Copyright (C) 2026 Compassion CH (http://www.compassion.ch) | ||
| # Releasing children from poverty in Jesus' name | ||
| # @author: Daniel Gergely <dgergely@compassion.ch> | ||
| # | ||
| # 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", | ||
| ) | ||
This file contains hidden or 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
This file contains hidden or 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
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.
Uh oh!
There was an error while loading. Please reload this page.