From b91085e5cad4aa7d843fec937f08cf7b73049c7d Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Mon, 16 Mar 2020 15:24:30 +0000 Subject: [PATCH] [FIX] sale_coupon: validity duration of coupons - Create a Promotion Program with 'Applicability' set to 'Apply On Next Order' 'Promo Code Usage' set to 'Use a code', set a code (not required, only for easiness) - Create a SO, use the code and validate - In the Promotion Programs, open the coupon list The Expiration Date is set to tomorrow. The Expiration Date is not useful in this case, and it is computed only because the default value of `validity_duration` is 1. However, the user is not able to change it since `maximum_use_number` is used for programs instead. We set a default value to zero to avoid any confusing computation. opw-2210794 closes odoo/odoo#47779 X-original-commit: 44e71f9192d8711cbaeac0088db55c3ff26813a1 Signed-off-by: Nicolas Martinelli (nim) --- addons/sale_coupon/data/sale_coupon_demo.xml | 2 ++ addons/sale_coupon/views/sale_coupon_program_views.xml | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/addons/sale_coupon/data/sale_coupon_demo.xml b/addons/sale_coupon/data/sale_coupon_demo.xml index 6c4a68d04ab..8695172eab1 100644 --- a/addons/sale_coupon/data/sale_coupon_demo.xml +++ b/addons/sale_coupon/data/sale_coupon_demo.xml @@ -22,6 +22,7 @@ 10.0 promotion_program + 0 @@ -46,6 +47,7 @@ 3 [["name","ilike","large cabinet"]] + 0 diff --git a/addons/sale_coupon/views/sale_coupon_program_views.xml b/addons/sale_coupon/views/sale_coupon_program_views.xml index 1c6d1b8d184..0b3eb8d13b5 100644 --- a/addons/sale_coupon/views/sale_coupon_program_views.xml +++ b/addons/sale_coupon/views/sale_coupon_program_views.xml @@ -273,8 +273,8 @@ [('program_type', '=', 'promotion_program')] { 'default_program_type': 'promotion_program', - 'default_promo_code_usage': - 'no_code_needed', + 'default_promo_code_usage': 'no_code_needed', + 'default_validity_duration': 0, 'search_default_opened': 1 }