-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1403 from CompassionCH/devel
Stabilization 1.6
- Loading branch information
Showing
32 changed files
with
1,366 additions
and
215 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 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 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 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
24 changes: 24 additions & 0 deletions
24
mass_mailing_switzerland/views/account_analytic_line_view.xml
This file contains 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,24 @@ | ||
<?xml version="1.0"?> | ||
<odoo> | ||
|
||
<!-- Analytic Line Tree View --> | ||
<record model="ir.ui.view" id="view_analytic_line_tree_utm"> | ||
<field name="name">account.analytic.line.utm.tree</field> | ||
<field name="model">account.analytic.line</field> | ||
<field name="arch" type="xml"> | ||
<tree> | ||
<field name="name" /> | ||
<field name="account_id"/> | ||
<field name="general_account_id"/> | ||
<field name="amount" sum="Total amount"/> | ||
<field name="partner_id" /> | ||
<field name="user_id" /> | ||
<field name="product_id" /> | ||
<field name="unit_amount"/> | ||
<field name="state"/> | ||
<field name="date" /> | ||
</tree> | ||
</field> | ||
</record> | ||
|
||
</odoo> |
This file contains 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 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 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
51 changes: 51 additions & 0 deletions
51
partner_communication_switzerland/controllers/onboarding.py
This file contains 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,51 @@ | ||
############################################################################## | ||
# | ||
# Copyright (C) 2021 Compassion CH (http://www.compassion.ch) | ||
# Releasing children from poverty in Jesus' name | ||
# @author: Jonathan Guerne <[email protected]> | ||
# | ||
# The licence is in the file __manifest__.py | ||
# | ||
############################################################################## | ||
import logging | ||
|
||
from odoo import http, _ | ||
from odoo.http import request, Controller | ||
|
||
from odoo.addons.cms_form.controllers.main import FormControllerMixin | ||
|
||
_logger = logging.getLogger(__name__) | ||
|
||
|
||
class OnboardingController(Controller, FormControllerMixin): | ||
|
||
@http.route( | ||
[ | ||
"/onboarding/<string:onboarding_type>/unsubscribe/<string:onboarding_hash>" | ||
], | ||
type="http", auth="public", methods=["GET", "POST"], website=True, | ||
sitemap=False) | ||
def onboarding_unsubscribe(self, onboarding_type, onboarding_hash, confirm_opt_out=False, **kwargs): | ||
|
||
if onboarding_type == "new_donors": | ||
return self._new_donors_onboarding_unsubscribe(onboarding_hash, confirm_opt_out) | ||
else: | ||
return http.request.render("website.404") | ||
|
||
def _new_donors_onboarding_unsubscribe(self, onboarding_hash, confirm_opt_out): | ||
partner = request.env["res.partner"].sudo().search( | ||
[("onboarding_new_donor_hash", "=", onboarding_hash)] | ||
) | ||
|
||
if not partner: | ||
return http.request.render("website.404") | ||
|
||
if not confirm_opt_out: | ||
return request.render( | ||
"partner_communication_switzerland.new_donors_onboarding_unsubscribe_template" | ||
) | ||
|
||
partner.opt_out = True | ||
|
||
return request.render( | ||
"partner_communication_switzerland.confirmation_onboarding_unsubscribe_template") |
Oops, something went wrong.