Order discount do not take into account the discount on order lines so
the discount amount will be wrong
Steps to reproduce:
1. Install Point of Sale
2. Go to Settings > Point of Sale > Pricing and enable Coupons &
Promotions
3. Go to Point of Sale > Products > Promotion Programs and edit program
'Code for 10% on orders'
4. Change the Promo Code Usage to 'Automatically Applied'
5. Open a new session in Point of Sale 'Shop'
6. Add a product (e.g. Acoustic Bloc Screens, the discount is applied
with value 29.50$)
7. Apply a discount of 20% on the product, the discount value doesn't
change (it should be 23.60$)
Solution:
When computing the amount to discount, take into consideration the
discount already applied on the order line
opw-2883724
closesodoo/odoo#94791
X-original-commit: afb3e5516e43e831bec1fd6b6bc3aaa18fe3fde2
Signed-off-by: Guillaume Merlin (megu) <megu@odoo.com>