Skip to content

Commit

Permalink
[T1450] - Implement: Success page now showed fot together website ins…
Browse files Browse the repository at this point in the history
…tead of resume.
  • Loading branch information
langjer authored and ecino committed Jul 4, 2024
1 parent ea3235e commit 5895ced
Show file tree
Hide file tree
Showing 16 changed files with 3,616 additions and 2,133 deletions.
3 changes: 2 additions & 1 deletion crowdfunding_compassion/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
# pylint: disable=C8101
{
"name": "Crowdfunding Compassion",
"version": "14.0.1.0.1",
"version": "14.0.1.0.2",
"author": "Compassion CH",
"license": "AGPL-3",
"website": "https://github.com/CompassionCH/compassion-website",
Expand All @@ -53,6 +53,7 @@
"data/action_rules.xml",
"data/queue_job.xml",
"data/form_data.xml",
"data/website_redirect.xml",
"views/account_invoice_line_view.xml",
"views/crowdfunding_participant_view.xml",
"views/crowdfunding_project_view.xml",
Expand Down
23 changes: 23 additions & 0 deletions crowdfunding_compassion/controllers/donation_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,3 +96,26 @@ def post_donation_form(self, project, participant, amount, **post):
is_anonymous=post.get("is_anonymous"),
)
return request.redirect("/shop/checkout?express=1")

@route(
"/together/donation/confirmation",
auth="public",
website=True,
sitemap=False,
type="http",
)
def crowdfunding_donation_validate(self, **post):
"""Method called after a payment attempt"""
sale_order_id = request.session.get("sale_last_order_id")
if sale_order_id:
order = request.env["sale.order"].sudo().browse(sale_order_id)
participant = order.mapped("order_line.participant_id")
return request.render(
"crowdfunding_compassion.donation_successful",
{
"order": order,
"participant": participant,
},
)
else:
return request.redirect("/projects")
12 changes: 12 additions & 0 deletions crowdfunding_compassion/data/website_redirect.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<odoo>
<record model="website.rewrite" id="donation_success_rewrite">
<field name="name">Donation Success</field>
<field name="url_from">/shop/confirmation</field>
<field name="url_to">/together/donation/confirmation</field>
<field
name="website_id"
ref="crowdfunding_compassion.crowdfunding_website"
/>
<field name="redirect_type">308</field>
</record>
</odoo>
Loading

0 comments on commit 5895ced

Please sign in to comment.