From 88f6d5dac9c0fffd54db6cbc400377c11f40fcba Mon Sep 17 00:00:00 2001 From: Brice bib Bartoletti Date: Wed, 17 Apr 2024 14:43:49 +0000 Subject: [PATCH] [FIX] account_peppol: installation crash The aim of this commit is to allow user to install `account_peppol` without facing a traceback. Context: The commit cffd0e9dd91376dd7fe4613f4fd94e659daaeef0 introduced a check based on a field introduced in the view by another module it depends on. The problem is that ticking the peppol checkbox install the `account_peppol` module but doesn't trigger an update of the `account_edi_ubl_cii` module. Before the commit: Impossible to installing `account_peppol`. After the commit: Installing `account_peppol` will update the view `account_edi_ubl_cii.account_move_send_form` if the field added by commit cffd0e9dd91376dd7fe4613f4fd94e659daaeef0 can't be found. opw-3874304 closes odoo/odoo#162677 X-original-commit: 465491d017ecf1c6efb26d3252471f17f4e9d856 Signed-off-by: Laurent Smet (las) Signed-off-by: Brice Bartoletti (bib) --- addons/account_peppol/__init__.py | 5 +++++ addons/account_peppol/__manifest__.py | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/addons/account_peppol/__init__.py b/addons/account_peppol/__init__.py index 7d05ac17566..9e975e8396d 100644 --- a/addons/account_peppol/__init__.py +++ b/addons/account_peppol/__init__.py @@ -4,3 +4,8 @@ from . import models from . import wizard from . import tools + +def pre_init_hook(env): + view = env.ref("account_edi_ubl_cii.account_move_send_form") + if "ubl_partner_warning" not in view.arch: + view.reset_arch(mode='hard') diff --git a/addons/account_peppol/__manifest__.py b/addons/account_peppol/__manifest__.py index 179307d1786..b05633dd9f0 100644 --- a/addons/account_peppol/__manifest__.py +++ b/addons/account_peppol/__manifest__.py @@ -30,5 +30,6 @@ 'web.assets_backend': [ 'account_peppol/static/src/components/**/*', ], - } + }, + 'pre_init_hook': 'pre_init_hook', }