odoo/odoo#183036

Created by fw-bot
Merged at 19bb646fb610674950df9e76db6e20bfbec5b071

Statuses:

label
odoo-dev:saas-17.4-16.0-opw-3838427-show_correct_coupon_expiration_date_in_receipt-alhy-1EcD-fw
head
68fbdcead18444b848427352e9a2a3b5da7ac99e
merged
1 year ago by Ali Hassan Youssef (alhy)
odoo/odoo
16.0 #160633
saas-16.3 #161291
17.0 #170295
saas-17.2 #182838
saas-17.4 #183036
18.0 #183044
saas-18.1 #195662
saas-18.2
saas-18.3
saas-18.4
19.0
master #195674

[FW][FIX] pos_loyalty: show correct coupon expiration date in receipt

Steps to reproduce:

  • Install pos_loyalty module
  • Go to Point of Sale app > Products > Discount & Loyalty
  • Create a New program with:
    • Program Type: Next Order Coupons
    • Validity: Today's date for example
    • Conditional rule with a Minimum Purchase of 0.00
  • Start a new POS session. Add a product and click Payment.
  • Validate the order.
  • In the receipt shown, notice how the text show 'Valid until: no expiration' although a Validity date is defined!

Investigation:

  • In confirm_coupon_programs, coupon_create_vals lacks expiration_date https://github.com/odoo/odoo/blob/03856863a644fbc588edb6e63168a6c4e15d5d92/addons/pos_loyalty/models/pos_order.py#L72-L78
  • To add the expiration_date, date_to has to be in coupon_data but it's not included.
  • coupon_data comes from https://github.com/odoo/odoo/blob/03856863a644fbc588edb6e63168a6c4e15d5d92/addons/pos_loyalty/static/src/js/PaymentScreen.js#L78

opw-3838427

Forward-Port-Of: #182838
Forward-Port-Of: #160633