Skip to content

[FIX] website_payment_recurring_donations: Fix for whitelisting kwargs issue#141

Merged
ByteMeAsap merged 1 commit into
18.0from
18.0-fix-website_payment_recurring_donations
Apr 30, 2026
Merged

[FIX] website_payment_recurring_donations: Fix for whitelisting kwargs issue#141
ByteMeAsap merged 1 commit into
18.0from
18.0-fix-website_payment_recurring_donations

Conversation

@ByteMeAsap
Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI review requested due to automatic review settings April 30, 2026 16:56
@ByteMeAsap ByteMeAsap merged commit 6456780 into 18.0 Apr 30, 2026
3 of 5 checks passed
@ByteMeAsap ByteMeAsap deleted the 18.0-fix-website_payment_recurring_donations branch April 30, 2026 16:57
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the recurring donations portal flow to avoid issues caused by passing non-whitelisted values via **kwargs by moving donation-related data into the Odoo request context.

Changes:

  • Store donation_frequency in request.env.context for downstream transaction creation.
  • Move donation_partner_details propagation from kwargs to request.env.context.
  • Update _create_transaction to read partner details from context instead of kwargs.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +24 to 26
if request.env.user._is_public():
context.update({"donation_partner_details": kwargs["partner_details"]})
request.env.context = context
Copy link

Copilot AI Apr 30, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kwargs["partner_details"] can raise a KeyError on this public JSON route if the client omits partner_details. Also, storing the full partner_details dict in env.context is risky in Odoo because context is typically a hashable (frozen) mapping used in cache keys; a nested dict value can trigger TypeError: unhashable type: 'dict' in downstream ORM/cache usage. Prefer extracting/storing only the primitive fields needed later (e.g., email/country_id/name) or serializing to a string/tuple, and use kwargs.get(...) with a guard.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants