Ethan Vincent
a11bca1810
[FIX] sale_loyalty: skip paid calc if ewallet type
...
**Current behavior:**
Creating an ewallet loyalty program and removing the default
value for `trigger_product_ids` without adding another in its
place will result in any ewallet created using that program to
not have its balance deducted after being used in a sale order.
**Expected behavior:**
The default product should not be required here, nor should any
product, seeing as there is no `required` constraint on this
field nor any related ones.
**Steps to reproduce:**
1. Create an ewallet loyalty program and remove the Top-up
ewallet product
2. Create an ewallet, give it some balance, and use it in an
order
3. Check the balance of the wallet to see the erroneous behavior
**Cause of the issue:**
In the _program_check_compute_points() method of `sale.order` in
`sale_loyalty`, the conditional block:
`if not products_per_rule.get(rule):
continue`
will normally prevent rules belonging to ewallet program types
from going further in the method because they have the default
ewallet top-up product in their domain. When the continue is not
reached, they will reach this line:
`amount_paid = sum(max(0, line.price_total) for
line in order_lines if line.product_id in rule_products)`
which will end up offsetting the actual subtraction of a SOLs
`points_cost` from an ewallet `loyalty.card`'s balance.
**Fix:**
Add another check prior to the calculation of order points which
prevents ewallet coupons without any top-up products from
reaching the problematic code. If an ewallet program doesn't
have any `trigger_product_ids`, it shouldn't ever need to
perform such calculations.
opw-3756134
closes odoo/odoo#159957
X-original-commit: 695b3a687a3d160451339a675aab8986682389eb
Signed-off-by: Vincent Ethan <etvi@odoo.com >
2024-04-05 07:20:46 +00:00
..
2024-04-05 04:49:17 +00:00
2024-03-24 00:12:07 +01:00
2024-03-31 21:12:53 +00:00
2024-03-31 00:09:16 +01:00
2024-03-31 00:09:16 +01:00
2024-03-31 00:09:16 +01:00
2024-03-31 00:09:16 +01:00
2024-03-17 00:11:43 +01:00
2024-03-31 00:09:16 +01:00
2024-03-31 00:09:16 +01:00
2024-02-06 18:49:02 +00:00
2024-04-04 17:02:58 +00:00
2024-03-31 00:09:16 +01:00
2024-03-24 00:12:07 +01:00
2024-03-17 00:11:43 +01:00
2024-03-26 08:20:22 +00:00
2024-02-12 20:24:09 +00:00
2024-03-31 00:09:16 +01:00
2024-03-31 00:09:16 +01:00
2024-03-31 00:09:16 +01:00
2024-03-24 00:12:07 +01:00
2024-03-24 00:12:07 +01:00
2024-03-31 00:09:16 +01:00
2024-03-24 00:12:07 +01:00
2024-03-10 00:13:03 +01:00
2024-03-31 00:09:16 +01:00
2024-03-24 00:12:07 +01:00
2024-03-31 00:09:16 +01:00
2024-03-31 00:09:16 +01:00
2024-03-24 00:12:07 +01:00
2024-03-31 00:09:16 +01:00
2024-03-31 00:09:16 +01:00
2024-03-24 00:12:07 +01:00
2024-03-31 00:09:16 +01:00
2024-03-24 00:12:07 +01:00
2024-04-04 09:52:48 +00:00
2024-03-24 00:12:07 +01:00
2024-03-27 17:45:00 +00:00
2024-04-03 14:29:14 +00:00
2024-03-24 00:12:07 +01:00
2024-03-24 00:12:07 +01:00
2024-03-31 00:09:16 +01:00
2024-03-31 00:09:16 +01:00
2024-03-31 00:09:16 +01:00
2024-03-24 00:12:07 +01:00
2024-03-24 00:12:07 +01:00
2024-02-06 18:49:02 +00:00
2024-03-24 00:12:07 +01:00
2024-03-31 00:09:16 +01:00
2024-03-31 00:09:16 +01:00
2024-03-31 00:09:16 +01:00
2024-03-31 00:09:16 +01:00
2024-03-31 00:09:16 +01:00
2024-03-31 00:09:16 +01:00
2024-03-31 00:09:16 +01:00
2024-03-31 00:09:16 +01:00
2024-02-06 18:49:02 +00:00
2024-03-31 00:09:16 +01:00
2024-03-24 00:12:07 +01:00
2024-03-31 00:09:16 +01:00
2024-03-24 00:12:07 +01:00
2024-03-24 00:12:07 +01:00
2024-03-17 00:11:43 +01:00
2024-04-04 11:48:12 +00:00
2024-03-31 00:09:16 +01:00
2024-03-31 00:09:16 +01:00
2024-04-02 10:23:00 +00:00
2024-03-31 00:09:16 +01:00
2024-03-31 00:09:16 +01:00
2024-04-02 15:40:29 +00:00
2024-03-31 00:09:16 +01:00
2024-03-24 00:12:07 +01:00
2024-04-02 15:40:26 +00:00
2024-03-31 00:09:16 +01:00
2024-04-02 15:40:23 +00:00
2024-03-10 00:13:03 +01:00
2024-02-06 18:49:02 +00:00
2024-03-10 00:13:03 +01:00
2024-03-31 00:09:16 +01:00
2024-03-31 00:09:16 +01:00
2024-04-03 16:27:10 +00:00
2024-03-31 00:09:16 +01:00
2024-04-02 15:40:28 +00:00
2024-03-31 00:09:16 +01:00
2024-03-31 00:09:16 +01:00
2024-03-31 00:09:16 +01:00
2024-03-31 00:09:16 +01:00
2024-03-31 00:09:16 +01:00
2024-03-31 00:09:16 +01:00
2024-04-02 12:09:33 +00:00
2024-03-31 00:09:16 +01:00
2024-03-17 00:11:43 +01:00
2024-03-28 12:19:09 +00:00
2024-03-18 08:45:37 +00:00
2024-03-24 00:12:07 +01:00
2024-02-06 18:49:02 +00:00
2024-03-21 11:11:40 +00:00
2024-04-03 16:27:10 +00:00
2024-03-10 00:13:03 +01:00
2024-03-21 18:35:46 +00:00
2024-02-29 20:40:36 +00:00
2024-03-07 11:40:25 +00:00
2024-02-29 10:34:16 +00:00
2024-02-29 20:40:36 +00:00
2024-02-29 20:40:36 +00:00
2024-03-01 12:10:26 +00:00
2024-01-18 20:16:02 +00:00
2024-02-29 20:40:36 +00:00
2024-01-16 09:55:24 +00:00
2024-02-29 20:40:36 +00:00
2024-03-22 03:11:48 +00:00
2024-01-16 09:55:24 +00:00
2024-03-21 11:11:41 +00:00
2024-03-29 10:44:21 +00:00
2024-03-21 23:03:07 +00:00
2024-03-22 07:00:44 +00:00
2024-02-23 13:10:03 +00:00
2024-02-23 13:10:03 +00:00
2024-02-28 08:15:23 +00:00
2024-03-13 09:14:14 +00:00
2024-02-23 13:10:03 +00:00
2024-02-29 20:40:36 +00:00
2024-02-05 12:20:56 +00:00
2024-02-19 12:27:48 +00:00
2024-01-16 09:55:24 +00:00
2024-03-26 13:35:53 +00:00
2024-03-29 18:09:41 +00:00
2024-02-03 02:06:43 +00:00
2024-03-26 22:20:21 +00:00
2024-04-03 20:38:20 +00:00
2024-03-26 09:54:22 +00:00
2024-02-13 20:52:18 +00:00
2024-02-13 20:52:18 +00:00
2024-03-27 09:12:49 +00:00
2024-02-07 18:34:22 +00:00
2024-03-07 15:12:17 +00:00
2024-03-08 11:17:48 +00:00
2024-02-23 13:09:53 +00:00
2024-03-07 05:07:08 +00:00
2024-02-29 20:40:36 +00:00
2024-01-16 09:55:24 +00:00
2024-03-04 08:11:59 +00:00
2024-02-29 20:40:36 +00:00
2024-03-18 05:04:11 +00:00
2024-02-29 19:00:43 +00:00
2024-02-16 02:01:35 +00:00
2024-03-04 08:11:57 +00:00
2024-03-14 15:43:44 +00:00
2024-03-29 18:09:45 +00:00
2024-03-22 09:44:38 +00:00
2024-03-29 18:09:45 +00:00
2024-03-11 15:03:07 +00:00
2024-03-13 14:03:10 +00:00
2024-02-02 10:50:51 +00:00
2024-03-15 18:42:49 +00:00
2024-01-16 09:55:24 +00:00
2024-03-31 00:33:23 +00:00
2024-01-16 09:55:24 +00:00
2024-02-29 20:40:36 +00:00
2024-04-02 12:09:28 +00:00
2024-03-14 08:06:26 +00:00
2024-02-22 09:06:12 +00:00
2024-02-29 20:40:36 +00:00
2024-02-29 20:40:36 +00:00
2024-03-06 14:30:37 +00:00
2024-03-11 16:37:32 +00:00
2024-04-04 08:18:55 +00:00
2024-01-26 09:13:03 +00:00
2024-02-16 08:58:21 +00:00
2024-03-15 17:30:00 +00:00
2024-02-28 19:49:05 +00:00
2024-03-11 10:17:46 +00:00
2024-02-29 20:40:36 +00:00
2024-03-29 07:53:02 +00:00
2024-03-22 14:47:57 +00:00
2024-02-29 20:40:36 +00:00
2024-02-29 20:40:36 +00:00
2024-03-21 23:03:07 +00:00
2024-01-16 09:55:24 +00:00
2024-01-16 09:55:24 +00:00
2024-01-26 21:07:50 +00:00
2024-03-13 14:03:11 +00:00
2024-02-29 20:40:36 +00:00
2024-01-20 05:31:55 +00:00
2024-01-16 09:55:24 +00:00
2024-03-06 14:30:35 +00:00
2024-03-24 00:12:07 +01:00
2024-04-03 07:19:48 +00:00
2024-03-31 00:09:16 +01:00
2024-04-02 17:04:49 +00:00
2024-03-24 00:12:07 +01:00
2024-03-11 16:37:34 +00:00
2024-03-31 00:09:16 +01:00
2024-03-24 00:12:07 +01:00
2024-03-31 00:09:16 +01:00
2024-03-31 00:09:16 +01:00
2024-03-24 00:12:07 +01:00
2024-03-24 00:12:07 +01:00
2024-03-31 00:09:16 +01:00
2024-02-06 18:49:02 +00:00
2024-03-31 00:09:16 +01:00
2024-02-06 18:49:02 +00:00
2024-03-24 00:12:07 +01:00
2024-03-24 00:12:07 +01:00
2024-03-24 00:12:07 +01:00
2024-03-31 00:09:16 +01:00
2024-03-31 00:09:16 +01:00
2024-03-31 00:09:16 +01:00
2024-03-15 06:12:46 +00:00
2024-03-24 00:12:07 +01:00
2024-03-31 00:09:16 +01:00
2024-04-04 06:52:39 +00:00
2024-03-24 00:12:07 +01:00
2024-03-10 00:13:03 +01:00
2024-03-10 00:13:03 +01:00
2024-02-06 18:49:02 +00:00
2024-03-24 00:12:07 +01:00
2024-03-31 00:09:16 +01:00
2024-03-31 00:09:16 +01:00
2024-03-17 00:11:43 +01:00
2024-03-31 00:09:16 +01:00
2024-03-24 00:12:07 +01:00
2024-04-04 09:52:50 +00:00
2024-03-31 00:09:16 +01:00
2024-03-31 00:09:16 +01:00
2024-03-10 00:13:03 +01:00
2024-03-10 00:13:03 +01:00
2024-03-31 00:09:16 +01:00
2024-03-10 00:13:03 +01:00
2024-03-24 00:12:07 +01:00
2024-03-31 00:09:16 +01:00
2024-03-31 00:09:16 +01:00
2024-03-31 00:09:16 +01:00
2024-03-17 00:11:43 +01:00
2024-03-31 00:09:16 +01:00
2024-03-31 00:09:16 +01:00
2024-03-31 00:09:16 +01:00
2024-03-31 00:09:16 +01:00
2024-03-31 00:09:16 +01:00
2024-03-10 00:13:03 +01:00
2024-03-31 00:09:16 +01:00
2024-03-31 00:09:16 +01:00
2024-03-28 19:51:00 +00:00
2024-04-03 07:19:49 +00:00
2024-03-31 00:09:16 +01:00
2024-04-03 16:27:10 +00:00
2024-03-17 00:11:43 +01:00
2024-03-17 00:11:43 +01:00
2024-03-17 00:11:43 +01:00
2024-03-17 00:11:43 +01:00
2024-03-27 14:09:50 +00:00
2024-03-24 00:12:07 +01:00
2024-02-06 18:49:02 +00:00
2024-03-24 00:12:07 +01:00
2024-03-17 00:11:43 +01:00
2024-03-17 00:11:43 +01:00
2024-03-07 08:25:54 +00:00
2024-03-31 00:09:16 +01:00
2024-03-10 00:13:03 +01:00
2024-02-06 18:49:02 +00:00
2024-03-24 00:12:07 +01:00
2024-02-06 18:49:02 +00:00
2024-02-06 18:49:02 +00:00
2024-03-17 00:11:43 +01:00
2024-03-31 00:09:16 +01:00
2024-02-06 18:49:02 +00:00
2024-02-06 18:49:02 +00:00
2024-03-24 00:12:07 +01:00
2024-02-06 18:49:02 +00:00
2024-03-17 00:11:43 +01:00
2024-03-17 00:11:43 +01:00
2024-03-24 00:12:07 +01:00
2024-03-24 00:12:07 +01:00
2024-04-02 07:20:24 +00:00
2024-03-31 00:09:16 +01:00
2024-03-24 00:12:07 +01:00
2024-03-24 00:12:07 +01:00
2024-04-03 20:38:21 +00:00
2024-03-31 00:09:16 +01:00
2024-04-05 06:03:46 +00:00
2024-03-12 16:59:03 +00:00
2024-03-24 00:12:07 +01:00
2024-03-24 00:12:07 +01:00
2024-03-10 00:13:03 +01:00
2024-03-22 14:47:54 +00:00
2024-03-12 16:59:03 +00:00
2024-03-10 00:13:03 +01:00
2024-03-24 00:12:07 +01:00
2024-03-31 00:09:16 +01:00
2024-04-03 16:27:10 +00:00
2024-03-28 14:16:50 +00:00
2024-03-10 00:13:03 +01:00
2024-03-31 00:09:16 +01:00
2024-02-06 18:49:02 +00:00
2024-03-17 00:11:43 +01:00
2024-04-02 10:23:02 +00:00
2024-03-31 00:09:16 +01:00
2024-03-31 00:09:16 +01:00
2024-03-29 12:38:11 +00:00
2024-04-04 18:39:19 +00:00
2024-03-24 00:12:07 +01:00
2024-03-31 00:09:16 +01:00
2024-03-10 00:13:03 +01:00
2024-04-05 07:20:46 +00:00
2024-03-28 18:06:45 +00:00
2024-03-31 00:09:16 +01:00
2024-03-10 00:13:03 +01:00
2024-03-24 00:12:07 +01:00
2024-01-20 09:33:37 +00:00
2024-03-31 00:09:16 +01:00
2024-03-24 00:12:07 +01:00
2024-03-31 00:09:16 +01:00
2024-03-26 09:54:30 +00:00
2024-03-10 00:13:03 +01:00
2024-03-24 00:12:07 +01:00
2024-02-06 18:49:02 +00:00
2024-02-06 18:49:02 +00:00
2024-03-24 00:12:07 +01:00
2024-02-27 17:40:50 +00:00
2024-03-31 00:09:16 +01:00
2024-02-06 18:49:02 +00:00
2024-03-31 00:09:16 +01:00
2024-03-31 00:09:16 +01:00
2024-03-31 00:09:16 +01:00
2024-03-31 00:09:16 +01:00
2024-03-17 00:11:43 +01:00
2024-04-03 05:53:52 +00:00
2024-03-31 00:09:16 +01:00
2024-03-31 00:09:16 +01:00
2024-03-24 00:12:07 +01:00
2024-03-31 00:09:16 +01:00
2024-03-24 00:12:07 +01:00
2024-03-24 00:12:07 +01:00
2024-03-17 00:11:43 +01:00
2024-03-24 00:12:07 +01:00
2024-03-24 00:12:07 +01:00
2024-03-24 00:12:07 +01:00
2024-03-24 00:12:07 +01:00
2024-03-17 00:11:43 +01:00
2024-03-24 00:12:07 +01:00
2024-03-31 00:09:16 +01:00
2024-03-31 00:09:16 +01:00
2024-04-03 16:27:10 +00:00
2024-03-31 00:09:16 +01:00
2024-03-31 00:09:16 +01:00
2024-03-31 00:09:16 +01:00
2024-03-25 17:50:06 +00:00
2024-03-24 00:12:07 +01:00
2024-03-24 00:12:07 +01:00
2024-03-24 00:12:07 +01:00
2024-04-04 09:52:46 +00:00
2024-03-22 11:20:04 +00:00
2024-03-28 12:19:04 +00:00
2024-03-13 09:14:09 +00:00
2024-04-04 17:02:58 +00:00
2024-03-25 17:50:06 +00:00
2024-03-29 10:44:19 +00:00
2024-01-15 06:46:08 +00:00
2024-03-29 12:38:11 +00:00
2024-02-19 15:02:20 +00:00
2024-03-29 09:12:17 +00:00
2024-02-26 21:22:46 +00:00
2024-01-22 19:00:58 +00:00
2024-03-31 00:09:16 +01:00
2024-03-31 00:09:16 +01:00
2024-03-24 00:12:07 +01:00
2024-04-04 09:52:49 +00:00
2024-04-03 14:29:08 +00:00
2024-03-24 00:12:07 +01:00
2024-03-24 00:12:07 +01:00
2024-03-29 09:12:17 +00:00
2024-04-02 15:40:27 +00:00
2024-04-03 16:27:10 +00:00
2024-03-24 00:12:07 +01:00
2024-03-24 00:12:07 +01:00
2024-03-31 00:09:16 +01:00
2024-03-24 00:12:07 +01:00
2024-03-31 00:09:16 +01:00
2024-02-06 18:49:02 +00:00
2024-03-21 11:11:37 +00:00
2024-03-31 00:09:16 +01:00
2024-03-31 00:09:16 +01:00
2024-03-31 00:09:16 +01:00
2024-03-31 00:09:16 +01:00
2024-03-31 00:09:16 +01:00
2024-03-17 00:11:43 +01:00
2024-03-31 00:09:16 +01:00
2024-03-31 00:09:16 +01:00
2024-03-31 00:09:16 +01:00
2024-03-21 19:54:27 +00:00
2024-03-31 00:09:16 +01:00
2024-03-31 00:09:16 +01:00
2024-03-21 19:54:27 +00:00
2024-02-06 18:49:02 +00:00
2024-03-31 00:09:16 +01:00
2024-03-10 00:13:03 +01:00
2024-03-27 14:09:47 +00:00
2024-03-31 00:09:16 +01:00
2024-03-31 00:09:16 +01:00
2024-03-10 00:13:03 +01:00
2024-04-03 14:29:13 +00:00
2024-03-17 00:11:43 +01:00
2024-03-17 00:11:43 +01:00
2024-03-18 07:04:10 +00:00
2024-03-17 00:11:43 +01:00
2024-03-31 00:09:16 +01:00
2024-03-17 00:11:43 +01:00
2024-04-03 17:48:47 +00:00
2024-03-10 00:13:03 +01:00
2024-03-31 00:09:16 +01:00
2024-04-04 08:18:56 +00:00
2024-03-10 00:13:03 +01:00
2024-03-28 10:19:45 +00:00
2024-02-06 18:49:02 +00:00
2024-03-28 18:06:43 +00:00
2024-03-31 00:09:16 +01:00
2024-03-31 00:09:16 +01:00
2024-03-24 00:12:07 +01:00
2024-03-31 00:09:16 +01:00
2024-03-24 00:12:07 +01:00
2024-03-17 00:11:43 +01:00
2024-03-24 00:12:07 +01:00
2024-03-31 00:09:16 +01:00
2024-03-24 00:12:07 +01:00
2024-03-31 00:09:16 +01:00
2024-03-24 00:12:07 +01:00
2024-03-24 00:12:07 +01:00