Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion my_compassion/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
# pylint: disable=C8101
{
"name": "MyCompassion - Sponsor portal website",
"version": "18.0.1.0.26",
"version": "18.0.1.0.27",
"category": "Website",
"author": "Compassion CH",
"license": "AGPL-3",
Expand Down
2 changes: 1 addition & 1 deletion my_compassion/i18n/it.po
Original file line number Diff line number Diff line change
Expand Up @@ -1871,7 +1871,7 @@ msgstr "Bambina"
#: model_terms:ir.ui.view,arch_db:my_compassion.my2_gifts_page
#: model_terms:ir.ui.view,arch_db:my_compassion.my2_nav_items
msgid "Give"
msgstr "Dona"
msgstr "Dare"

#. module: my_compassion
#: model_terms:ir.ui.view,arch_db:my_compassion.my2_child_timeline_page
Expand Down
Empty file.
44 changes: 44 additions & 0 deletions my_compassion/migrations/18.0.1.0.27/post-migration.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
##############################################################################
#
# Copyright (C) 2026 Compassion CH (http://www.compassion.ch)
#
# The licence is in the file __manifest__.py
#
##############################################################################
"""Post-migration to 18.0.1.0.27 of my_compassion.

Re-activate the MyCompassion website's copy-on-write override of
``website_sale.template_header_default`` (T3410). That view injects the
cart/gift link into the *desktop* header; the base view and the "Compassion
Suisse" website's own copy are active, but the MyCompassion website (id
``my_compassion.my2_website``) has its own copy-on-write record stuck
``active=False``, so the gift icon my2_header_menu.xml re-styles
(``custom_header_cart_link_redirect``) only ever renders on the *mobile*
header (``website_sale.template_header_mobile`` has no such override) and is
missing entirely on desktop.
"""

from odoo import SUPERUSER_ID, api


def migrate(cr, version):
if not version:
return

env = api.Environment(cr, SUPERUSER_ID, {})
website = env.ref("my_compassion.my2_website", raise_if_not_found=False)
if not website:
return
view = (
env["ir.ui.view"]
.with_context(active_test=False)
.search(
[
("key", "=", "website_sale.template_header_default"),
("website_id", "=", website.id),
],
limit=1,
)
)
if view and not view.active:
view.active = True
4 changes: 2 additions & 2 deletions my_compassion/static/src/css/child_profile_timeline.css
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@
-ms-transform: translateX(-50%);
transform: translateX(-50%);
}
.container {
.cd-timeline .container {
padding-left: 0px;
padding-right: 36px;
padding-right: 0px;
}
}
@media (min-width: 640px) {
Expand Down
10 changes: 10 additions & 0 deletions my_compassion/static/src/css/global.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
/* This stylesheet is applied everywhere in MyCompassion */

header .navbar-nav .nav-link.my2-nav-link {
padding-bottom: 0px;
font-size: 14px;
color: var(--mid-grey);
}

header .navbar-nav .nav-link.my2-gift-link {
padding-bottom: 8px;
}

/* CSS Variables */
:root {
--compassion-blue: #005eb8;
Expand Down
52 changes: 46 additions & 6 deletions my_compassion/views/my2_header_menu.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,43 @@
<template id="my2_nav_items" name="MyCompassion Menu Items">
<t t-set="partner" t-value="request.env.user.partner_id" />
<li class="nav-item">
<a class="nav-link" href="/my2/dashboard">Home</a>
<a class="nav-link my2-nav-link" href="/my2/dashboard">Home</a>
</li>
<t t-if="partner.is_sponsor">
<li class="nav-item">
<a class="nav-link" href="/my2/children">My sponsorships</a>
<a class="nav-link my2-nav-link" href="/my2/children">My sponsorships</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/my2/children/letters">Letters</a>
<a class="nav-link my2-nav-link" href="/my2/children/letters">Letters</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/my2/children/letters/new">Write a letter</a>
<a
class="nav-link my2-nav-link"
href="/my2/children/letters/new"
>Write a letter</a>
</li>
</t>
<li class="nav-item">
<a class="nav-link" href="/my2/gifts">Give</a>
<a class="nav-link my2-nav-link" href="/my2/gifts">Give</a>
</li>
<t t-if="partner.is_donor">
<li class="nav-item">
<a class="nav-link" href="/my2/donations">My donations</a>
<a class="nav-link my2-nav-link" href="/my2/donations">My donations</a>
</li>
</t>
<!-- Always last, so it sits on the far right regardless of which
conditional items above it are shown -->
<t t-call="website_sale.header_cart_link">
<t t-set="show_gift_basket_icon" t-value="True" />
<t t-set="_icon" t-value="True" />
<t t-set="_item_class" t-value="'nav-item'" />
<t
t-set="_link_class"
t-value="'nav-link my2-gift-link d-flex align-items-center text-reset h-100'"
/>
<t t-set="_icon_wrap_class" t-value="'d-flex align-items-center h-100'" />
<t t-set="_badge_class" t-value="'rounded-1 ms-1'" />
</t>
</template>
<template
id="my_compassion_dynamic_menu"
Expand Down Expand Up @@ -58,6 +74,27 @@
<xpath expr="//t[@t-set='show_cart']" position="attributes">
<attribute name="t-value">request.session.uid</attribute>
</xpath>
<!-- t-nocache only carries through the caller values it explicitly lists
(see the t-nocache-* attributes below); a new one must be declared
here too or it silently reads as undefined inside this fragment. -->
<xpath expr="//t[@t-nocache]" position="attributes">
<attribute
name="t-nocache-show_gift_basket_icon"
>show_gift_basket_icon</attribute>
</xpath>
<!-- On the MyCompassion website only, the gift basket icon renders next
to the "Give" menu item (see my2_nav_items) instead of at whichever
spot each stock header layout auto-injects
website_sale.header_cart_link (icon cluster on desktop, top bar on
mobile); every other website keeps the standard cart link. -->
<xpath
expr="//li[contains(@t-attf-class, 'o_wsale_my_cart')]"
position="attributes"
>
<attribute
name="t-if"
>show_gift_basket_icon or website != request.env.ref('my_compassion.my2_website', raise_if_not_found=False)</attribute>
</xpath>
<!-- Modify the behavior of the base Odoo cart for custom redirection and design -->
<xpath expr="//a[@href='/shop/cart']" position="attributes">
<attribute name="href">/my2/gift-package</attribute>
Expand All @@ -74,6 +111,9 @@
<attribute
name="t-attf-class"
>my_cart_quantity badge bg-primary #{_badge_class} #{'d-none' if (website_sale_cart_quantity == 0) else ''}</attribute>
<attribute
name="style"
>padding: 0.28rem 0.4rem 0.22rem; display: inline-flex; align-items: center; justify-content: center; position: static;</attribute>
</xpath>
</template>
<template
Expand Down
2 changes: 1 addition & 1 deletion my_compassion_native/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# pylint: disable=C8101
{
"name": "MyCompassion - Native App",
"version": "18.0.1.0.2",
"version": "18.0.1.0.3",
"category": "Website",
"author": "Compassion CH",
"license": "AGPL-3",
Expand Down
Empty file.
28 changes: 28 additions & 0 deletions my_compassion_native/migrations/18.0.1.0.3/post-migration.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
##############################################################################
#
# Copyright (C) 2026 Compassion CH (http://www.compassion.ch)
#
# The licence is in the file __manifest__.py
#
##############################################################################
"""Post-migration to 18.0.1.0.3 of my_compassion_native.

Opt the MyCompassion website into the mobile-web app shell
(``my2_bottom_nav_on_web``). The field defaults to False so the bottom-tab-bar
shell stays native-app-only until a country opts in (see its help text); CH
(T3410 QA) expects it on for the MyCompassion website's mobile browser
experience, where it is currently off, so mobile visitors get the regular
website header/footer instead of the intended app-style bottom nav.
"""

from odoo import SUPERUSER_ID, api


def migrate(cr, version):
if not version:
return

env = api.Environment(cr, SUPERUSER_ID, {})
website = env.ref("my_compassion.my2_website", raise_if_not_found=False)
if website and not website.my2_bottom_nav_on_web:
website.my2_bottom_nav_on_web = True
2 changes: 1 addition & 1 deletion theme_compassion_2025/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"summary": "Compassion Theme 2025",
"website": "https://github.com/CompassionCH/compassion-website",
"sequence": 260,
"version": "18.0.1.0.6",
"version": "18.0.1.0.9",
"author": "Compassion Switzerland",
"depends": ["website", "website_sale"],
"external_dependencies": {"python": ["python-slugify"]},
Expand Down
Empty file.
29 changes: 29 additions & 0 deletions theme_compassion_2025/migrations/18.0.1.0.7/post-migration.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
##############################################################################
#
# Copyright (C) 2026 Compassion CH (http://www.compassion.ch)
#
# The licence is in the file __manifest__.py
#
##############################################################################
"""Post-migration to 18.0.1.0.7 of theme_compassion_2025.

Re-activate ``website.option_header_brand_logo``. This stock Odoo view
replaces the header's empty brand placeholder (``#o_fake_navbar_brand``) with
the actual ``<img>`` logo; it ships ``active="True"`` but is stored
``active=False`` with no per-website override on this instance, so no website
(MyCompassion included) renders a logo at all. Nothing in this codebase
injects a logo through any other mechanism, so this is a straight restore of
the shipped default, not a per-website customization.
"""

from odoo import SUPERUSER_ID, api


def migrate(cr, version):
if not version:
return

env = api.Environment(cr, SUPERUSER_ID, {})
view = env.ref("website.option_header_brand_logo", raise_if_not_found=False)
if view and not view.active:
view.active = True
Empty file.
42 changes: 42 additions & 0 deletions theme_compassion_2025/migrations/18.0.1.0.8/post-migration.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
##############################################################################
#
# Copyright (C) 2026 Compassion CH (http://www.compassion.ch)
#
# The licence is in the file __manifest__.py
#
##############################################################################
"""Post-migration to 18.0.1.0.8 of theme_compassion_2025.

Seed the new translatable ``website.footer_address``/``footer_phone`` fields
(T3410) for every website running this theme, with the real per-language
office contact info confirmed on the live compassion.ch production site:
French-speaking Switzerland is served from Yverdon-les-Bains, German- and
Italian-speaking Switzerland share the Bern office (with a slightly
different phone extension per language).
"""

from odoo import SUPERUSER_ID, api

# (lang, address, phone)
FOOTER_CONTACT_BY_LANG = [
("fr_CH", "Rue Galilée 3, 1400 Yverdon-les-Bains", "+41 (0)24 434 21 24"),
("de_DE", "Parkterrasse 10, 3012 Bern", "+41 (0)31 552 21 21"),
("it_IT", "Parkterrasse 10, 3012 Bern", "+41 (0)31 552 21 24"),
]


def migrate(cr, version):
if not version:
return

env = api.Environment(cr, SUPERUSER_ID, {})
theme = env["ir.module.module"].search(
[("name", "=", "theme_compassion_2025")], limit=1
)
if not theme:
return
websites = env["website"].search([("theme_id", "=", theme.id)])
for lang, address, phone in FOOTER_CONTACT_BY_LANG:
websites.with_context(lang=lang).write(
{"footer_address": address, "footer_phone": phone}
)
Empty file.
39 changes: 39 additions & 0 deletions theme_compassion_2025/migrations/18.0.1.0.9/post-migration.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
##############################################################################
#
# Copyright (C) 2026 Compassion CH (http://www.compassion.ch)
#
# The licence is in the file __manifest__.py
#
##############################################################################
"""Post-migration to 18.0.1.0.9 of theme_compassion_2025.

Seed the newly-translatable ``website.privacy_policy_url`` field with the
real per-language policy page confirmed on the live compassion.ch production
site, for every website running this theme. The field already held the
French URL as a plain (untranslated) value; this adds the German and Italian
equivalents alongside it.
"""

from odoo import SUPERUSER_ID, api

# (lang, privacy policy url)
PRIVACY_URL_BY_LANG = [
("fr_CH", "https://compassion.ch/protection-des-donnees/"),
("de_DE", "https://compassion.ch/de/datenschutz/"),
("it_IT", "https://compassion.ch/it/privacy-e-termini/"),
]


def migrate(cr, version):
if not version:
return

env = api.Environment(cr, SUPERUSER_ID, {})
theme = env["ir.module.module"].search(
[("name", "=", "theme_compassion_2025")], limit=1
)
if not theme:
return
websites = env["website"].search([("theme_id", "=", theme.id)])
for lang, url in PRIVACY_URL_BY_LANG:
websites.with_context(lang=lang).write({"privacy_policy_url": url})
17 changes: 16 additions & 1 deletion theme_compassion_2025/models/website.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,20 @@ class Website(models.Model):
social_vimeo = fields.Char("Vimeo Account")
privacy_policy_url = fields.Char(
"Privacy Policy URL",
help="Target of the Policies link in the website footer.",
translate=True,
help="Target of the Policies link in the website footer, for the "
"current language.",
)
footer_address = fields.Char(
"Footer Address",
translate=True,
help="Address shown in the website footer for the current language. "
"Falls back to the company's address when not set for a language.",
)
footer_phone = fields.Char(
"Footer Phone",
translate=True,
help="Phone number shown in the website footer for the current "
"language. Falls back to the company's phone when not set for a "
"language.",
)
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@
<span
t-attf-class="btn__icon text-#{icon_left_color} language-selector__icon language-selector__icon_left"
>
<i t-att-class="icon_left" />
<i t-att-class="icon_left" style="font-size: 0.8em;" />
</span>
</t>
<span t-if="label" t-att-id="label_id">
<span t-if="label" t-att-id="label_id" style="margin-top: 5px;">
<t t-esc="label" />
</span>
<t t-if="icon_right">
Expand Down
Loading
Loading