Files
odoo_source/addons/website_payment
Benjamin Vray 6f44b78954 [FIX] website_payment: fix "Donation" snippet "Pre-Filled Options"
Steps to Reproduce :

- Install eCommerce.
- Drag and drop the "Donation" snippet.
- Click on the prices in the snippet.
- Toggle the "Pre-Filled Options" option.
- => There is a traceback.

This bug is due to the fact that since commit [1], all templates have
been added to the OWL app. With OWL, a t-foreach in a template can no
longer loop over a 0 number and causes an error if we try to. This is
what happens here, as toggling off the "Pre-filled Options" option sets
the donationAmounts to 0, which is then used in a loop in the templates.

This commit fixes this by replacing the number by an empty array, so the
loop cannot fail.

[1]: https://github.com/odoo/odoo/commit/4703e4a2efa9213979307e4d3dedeedc61ad0fc3

task-3859207

closes odoo/odoo#161431

Signed-off-by: Soukéina Bojabza (sobo) <sobo@odoo.com>
2024-04-16 12:24:48 +00:00
..
…