[FIX] stock_account: no analytic info on COGS

- Create a FIFO product, Automated
- Make some stock
- Create a SO, add the product
- On the SO, add an analytic account
- Validate the picking, create the invoice
  => the analytic info are propagated to the invoice, as expected
- Validate the invoice

The analytic info is propagated on the COGS entries, in particular the
the output account, which is incorrect.

Lost forward-port of 24c7efc8fef63437ac28883b29ed84809234ed76

closes odoo/odoo#47995

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
This commit is contained in:
Nicolas Martinelli
2020-03-19 10:17:58 +00:00
parent e7ef57f687
commit 3590efa478
@@ -125,8 +125,6 @@ class AccountMove(models.Model):
'debit': balance < 0.0 and -balance or 0.0,
'credit': balance > 0.0 and balance or 0.0,
'account_id': debit_interim_account.id,
'analytic_account_id': line.analytic_account_id.id,
'analytic_tag_ids': [(6, 0, line.analytic_tag_ids.ids)],
'exclude_from_invoice_tab': True,
'is_anglo_saxon_line': True,
})