**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
precision = self.env['decimal.precision'].precision_get('Product Unit of Measure')
            self.filtered(
                lambda r: r.state == 'sale' and float_compare(r.product_uom_qty, values['product_uom_qty'], precision_digits=precision) != 0)._update_line_quantity(values)
        
        protected_fields = self._get_protected_fields()
        if 'done' in self.mapped('order_id.state') and any(f in values.keys() for f in protected_fields):
            protected_fields_modified = list(set(protected_fields) & set(values.keys()))
            fields = self.env['ir.model.fields'].search([
                ('name', 'in', protected_fields_modified), ('model', '=', self._name)
            ])
            raise UserError(
                _('It is forbidden to modify the following fields in a locked order:\n%s')
                % '\n'.join(fields.mapped('field_description'))
            )
        result = super(SaleOrderLine, self).write(values)
        return result
    order_id = fields.Many2one('sale.order', string='Order Reference', required=True, ondelete='cascade', index=True, copy=False)
    name = fields.Text(string='Description', required=True)
    sequence = fields.Integer(string='Sequence', default=10)
    invoice_lines = fields.Many2many('account.invoice.line', 'sale_order_line_invoice_rel', 'order_line_id', 'invoice_line_id', string='Invoice Lines', copy=False)
    invoice_status = fields.Selection([
        ('upselling', 'Upselling Opportunity'),
        ('invoiced', 'Fully Invoiced'),
        ('to invoice', 'To Invoice'),
        ('no', 'Nothing to Invoice')
        ], string='Invoice Status', compute='_compute_invoice_status', store=True, readonly=True, default='no')
    price_unit = fields.Float('Unit Price', required=True, digits=dp.get_precision('Product Price'), default=0.0)
    price_subtotal = fields.Monetary(compute='_compute_amount', string='Subtotal', readonly=True, store=True)
    price_tax = fields.Float(compute='_compute_amount', string='Taxes', readonly=True, store=True)
    price_total = fields.Monetary(compute='_compute_amount', string='Total', readonly=True, store=True)