[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) <las@odoo.com>
Signed-off-by: Brice Bartoletti (bib) <bib@odoo.com>
This commit is contained in:
Brice bib Bartoletti
2024-04-20 01:36:05 +00:00
parent d1827082bd
commit 88f6d5dac9
2 changed files with 7 additions and 1 deletions
+5
View File
@@ -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')
+2 -1
View File
@@ -30,5 +30,6 @@
'web.assets_backend': [
'account_peppol/static/src/components/**/*',
],
}
},
'pre_init_hook': 'pre_init_hook',
}