From 6cdbc8c43afb560ee4fa1c9486aba0d919b8ed51 Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Tue, 3 Mar 2020 14:37:22 +0000 Subject: [PATCH] [FIX] account: default group_id - Set a product category to automated - Create an Analytic Default for a product with the automated category - Create an SO with said product. - Confirm SO and try to validate the delivery order Get an error (Model Analytic Line (account.analytic.line), Restriction: account_analytic_line_group_id_fkey) opw-2204771 closes odoo/odoo#46763 Signed-off-by: Nicolas Martinelli (nim) --- addons/account/models/account_move.py | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/account/models/account_move.py b/addons/account/models/account_move.py index 871b946a872af..17e7c774931af 100644 --- a/addons/account/models/account_move.py +++ b/addons/account/models/account_move.py @@ -3876,6 +3876,7 @@ def _prepare_analytic_line(self): 'name': default_name, 'date': move_line.date, 'account_id': move_line.analytic_account_id.id, + 'group_id': move_line.analytic_account_id.group_id.id, 'tag_ids': [(6, 0, move_line._get_analytic_tag_ids())], 'unit_amount': move_line.quantity, 'product_id': move_line.product_id and move_line.product_id.id or False,