**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
self._action_confirm()
        if self.env['ir.config_parameter'].sudo().get_param('sale.auto_done_setting'):
            self.action_done()
        return True
    @api.multi
    def _create_analytic_account(self, prefix=None):
        for order in self:
            name = order.name
            if prefix:
                name = prefix + ": " + order.name
            analytic = self.env['account.analytic.account'].create({
                'name': name,
                'code': order.client_order_ref,
                'company_id': order.company_id.id,
                'partner_id': order.partner_id.id
            })
            order.analytic_account_id = analytic
    @api.multi
    def order_lines_layouted(self):
        """
        Returns this order lines classified by sale_layout_category and separated in
        pages according to the category pagebreaks. Used to render the report.
        """
        self.ensure_one()
        report_pages = [[]]
        for category, lines in groupby(self.order_line, lambda l: l.layout_category_id):