From 0e4642db8fa3aead509f3b9ef1d94a8f668762b7 Mon Sep 17 00:00:00 2001 From: Goffin Simon Date: Wed, 21 Oct 2020 10:33:39 +0000 Subject: [PATCH] [FIX] account: Auto-complete with analytic account Steps to reproduce the bug: - Create a vendor bill VB1 with one line L1 - Set an analytic account AA on L1 - Post VB1 - Create a new vendor bill VB2 - Set VB1 on the field Auto-complete Bug: The created line L2 on VB2 had no analytic account PS: In 12.0, the analytic account was kept when using Auto-complete field opw:2359432 closes odoo/odoo#60962 X-original-commit: 5f46c50442dbe42bc534718719a6b19ee087eab0 Signed-off-by: Simon Goffin (sig) Signed-off-by: Laurent Smet Co-authored-by: smetl --- addons/account/models/account_move.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/account/models/account_move.py b/addons/account/models/account_move.py index b83c05acb9b..559d06e6d1d 100644 --- a/addons/account/models/account_move.py +++ b/addons/account/models/account_move.py @@ -2925,9 +2925,9 @@ class AccountMoveLine(models.Model): # ==== Analytic fields ==== analytic_line_ids = fields.One2many('account.analytic.line', 'move_id', string='Analytic lines') analytic_account_id = fields.Many2one('account.analytic.account', string='Analytic Account', - index=True, compute="_compute_analytic_account", store=True, readonly=False, check_company=True) + index=True, compute="_compute_analytic_account", store=True, readonly=False, check_company=True, copy=True) analytic_tag_ids = fields.Many2many('account.analytic.tag', string='Analytic Tags', - compute="_compute_analytic_account", store=True, readonly=False, check_company=True) + compute="_compute_analytic_account", store=True, readonly=False, check_company=True, copy=True) # ==== Onchange / display purpose fields ==== recompute_tax_line = fields.Boolean(store=False, readonly=True,