**Impacted versions:**
11.0

**Steps to reproduce:**

- Create a SO with two lines:
-  - _LIne1_: Product: product50, Ordered Quantity: 1.000, Unit Price: 50.0
-  - _Line2_: Product: product12, Ordered Quantity: 1.000, Unit Price: 12.0

- Confirm the SO
- Click on "Create Invoice" (choosing for example "Invoiceable lines")
- Validate the invoice
- Click on "Add Credit Note" (choosing for example "Create a draft credit note")
- Validate the Credit Note

- Go to Reporting->Sales and open the Pivot view
- Enable the following measures:
- - Amount Invoiced
- - Amount To Invoice

- Expand the rows by Product


**Current behavior:**

- Amount Invoiced for product12 is 50.0
- Amount Invoiced for product50 is 12.0


**Expected behavior:**

- Amount Invoiced for product12 is 0.0
- Amount Invoiced for product50 is 0.0

import uuid
from itertools import groupby
from datetime import datetime, timedelta
from werkzeug.urls import url_encode
from odoo import api, fields, models, _
from odoo.exceptions import UserError, AccessError
from odoo.osv import expression
from odoo.tools import float_is_zero, float_compare, DEFAULT_SERVER_DATETIME_FORMAT
from odoo.tools.misc import formatLang
from odoo.addons import decimal_precision as dp
class SaleOrder(models.Model):
    _name = "sale.order"
    _inherit = ['mail.thread', 'mail.activity.mixin', 'portal.mixin']
    _description = "Quotation"
    _order = 'date_order desc, id desc'
    @api.depends('order_line.price_total')
    def _amount_all(self):