Ivan Rasputin 1040be1010 [FIX] website_sale_loyalty: fix dictionary updating
After recent refactoring [1], sentry caught [2] `KeyError` on adding a record to
`res[coupon]` in `_get_claimable_and_showable_rewards` method.

Dictionary `res` may not have `coupon` and hence it leads to the error

https://github.com/odoo/odoo/blob/31b8151736b3382cca5601cd652b1d5482790af9/addons/website_sale_loyalty/models/sale_order.py#L198-L205

https://github.com/odoo/odoo/blob/31b8151736b3382cca5601cd652b1d5482790af9/addons/sale_loyalty/models/sale_order.py#L595

Fix it by checking `coupon in res` first.

[1]: https://github.com/odoo/odoo/commit/6525d5fba40c77ef9ed4445b8b9573550a1e2442

[2]: https://online.sentry.io/issues/4235487414

closes odoo/odoo#124616

X-original-commit: 57a00cae57116869f33e7267ad5ee84bd7600593
Signed-off-by: Ivan Elizaryev (iel) <iel@odoo.com>
2023-06-12 14:04:10 +02:00
2023-06-10 16:50:55 +02:00
…
…
…
…

Build Status Tech Doc Help Nightly Builds

Odoo

Odoo is a suite of web based open source business apps.

The main Odoo Apps include an Open Source CRM, Website Builder, eCommerce, Warehouse Management, Project Management, Billing & Accounting, Point of Sale, Human Resources, Marketing, Manufacturing, ...

Odoo Apps can be used as stand-alone applications, but they also integrate seamlessly so you get a full-featured Open Source ERP when you install several Apps.

Getting started with Odoo

For a standard installation please follow the Setup instructions from the documentation.

To learn the software, we recommend the Odoo eLearning, or Scale-up, the business game. Developers can start with the developer tutorials

S
Description
No description provided
Readme LGPL-3.0
3.4 GiB
Languages
Python 49.6%
JavaScript 47.8%
SCSS 2%
CSS 0.3%
HTML 0.2%