I have a custom module written in Odoo 15 and working normally, I tried to install it on Odoo 16 but when I try to install the app I get this error.
Field 'company_id' used in domain of field 'journal_ids' ([('company_id','=',company_id)]) is restricted to the group(s) base.group_multi_company.
View error context:
{
'-16\\odoo_erp_odoo_v16\\custom_addons\\views\\account_account_views.xml',
'line': 1,
'name': 'account.account.list.dim.inherited',
'view': ir.ui.view(4122,),
'view.model': 'account.account',
'view.parent': ir.ui.view(3904,),
'xmlid': 'view_account_list_dim_inherited'}
The above server error caused the following client error:
RPC_ERROR: Odoo Server Error
at makeErrorFromResponse (http://localhost:8069/web/assets/822-dca4335/web.assets_backend.min.js:985:163)
at XMLHttpRequest.<anonymous> (http://localhost:8069/web/assets/822-dca4335/web.assets_backend.min.js:993:13)
You've probably have a field definition for
journal_ids
in this particulary view extension with a domain usingcompany_id
.So just add
groups="base.group_multi_company"
to this field definition. I'm not really sure why Odoo is restricting it this since v16, but there is no harm in adding the group.