**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

addons/sale/models/sale.py
"""
        Compute the quantity invoiced. If case of a refund, the quantity invoiced is decreased. Note
        that this is the case only if the refund is generated from the SO and that is intentional: if
        a refund made would automatically decrease the invoiced quantity, then there is a risk of reinvoicing
        it automatically, which may not be wanted at all. That's why the refund has to be created from the SO
        """
        for line in self:
            qty_invoiced = 0.0
            for invoice_line in line.invoice_lines:
                if invoice_line.invoice_id.state != 'cancel':
                    if invoice_line.invoice_id.type == 'out_invoice':
                        qty_invoiced += invoice_line.uom_id._compute_quantity(invoice_line.quantity, line.product_uom)
                    elif invoice_line.invoice_id.type == 'out_refund':
                        qty_invoiced -= invoice_line.uom_id._compute_quantity(invoice_line.quantity, line.product_uom)
            line.qty_invoiced = qty_invoiced
    @api.depends('price_unit', 'discount')
    def _get_price_reduce(self):
        for line in self:
            line.price_reduce = line.price_unit * (1.0 - line.discount / 100.0)
    @api.depends('price_total', 'product_uom_qty')
    def _get_price_reduce_tax(self):