-
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
base: 14.0
Are you sure you want to change the base?
Changes from all commits
81009d1
7c7c489
4d3e696
b4f4afd
0b074f9
9079a70
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
| 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> | ||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,45 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ############################################################################## | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Copyright (C) 2026 Compassion CH (http://www.compassion.ch) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Danielgergely marked this conversation as resolved.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # 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): | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would go beyond just "links" and think broader with this object as a useful "segment resource" available for this segment of donors. Could you please update the model accordingly? For now we would only have links but why not including files later (documents), images or videos, etc?
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| """ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 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" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| _description = "Partner Segmentation Link" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 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", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+28
to
+39
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why not using translated fields instead of adding records for every language? Translations should be added in .po files This can greatly simplify the architecture in my opinion:
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 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", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a clear candidate for noupdate as we don't wan't to maintain the module data while the users could edit the links or the resources from the user interface.