From 80ac152feb8e154d477178252560dbe34f9d46b1 Mon Sep 17 00:00:00 2001 From: Laurent Smet Date: Fri, 27 Jan 2023 09:50:20 +0000 Subject: [PATCH] [IMP] account: Rename context key skip_sync_invoice => skip_invoice_line_sync The skip_invoice_sync context key already exists on account.move. The context key must be different on account.move.line but skip_sync_invoice is very confusing. closes odoo/odoo#111555 X-original-commit: 7dcd5495772d6032233f071c8fa25c81be0530ec Related: odoo/enterprise#36570 Signed-off-by: Laurent Smet Signed-off-by: John Laterre (jol) --- addons/account/models/account_move_line.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/account/models/account_move_line.py b/addons/account/models/account_move_line.py index 0a6fe00d8ec..d1dd5717dc5 100644 --- a/addons/account/models/account_move_line.py +++ b/addons/account/models/account_move_line.py @@ -1328,7 +1328,7 @@ class AccountMoveLine(models.Model): @contextmanager def _sync_invoice(self, container): - if container['records'].env.context.get('skip_sync_invoice'): + if container['records'].env.context.get('skip_invoice_line_sync'): yield return # avoid infinite recursion @@ -1341,7 +1341,7 @@ class AccountMoveLine(models.Model): 'price_subtotal': line.currency_id.round(line.price_subtotal), 'move_type': line.move_id.move_type, } for line in container['records'].with_context( - skip_sync_invoice=True, + skip_invoice_line_sync=True, ).filtered(lambda l: l.move_id.is_invoice(True)) }