[17.0][FIX] sale_fixed_discount: fix portal template
#3945
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes portal template incorrect rendering of discounted unit prices.
SO lines info
From the SO form view's

order_linetree view (using quantity as sequence to ease comparison w/ the template reports below):NB: the fact that the "Disc. %" on the second line is 0 even though the "Discount (Fixed)" is 0.10 is not an error: since field
discountis computed but not readonly, there are cases in which fielddiscountcould be assigned a value which is different than the one assigned by thecomputemethod (for example, when importing the SO through the Odoo file importer).Portal report before the fix
🔴 line 1: the discounted unit price is 1.00 instead of 0.90 (10% applied on 1.00)
🔴 line 2: the discounted unit price is not shown at all
🟢 line 3: the discounted unit price is shown correctly (3.00 w/ 0.30 or 10% discount = 2.70)
🟢 line 4: no discount applied
Portal report after the fix
🟢 line 1: the discounted unit price is shown correctly (1.00 w/ 10% discount = 0.90)
🟢 line 2: the discounted unit price is shown correctly (2.00 w/ 0.10 discount = 1.90)
🟢 line 3: the discounted unit price is shown correctly (3.00 w/ 0.30 or 10% discount = 2.70)
🟢 line 4: no discount applied