You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When you try to access the exchange records menus, a multi-company permissions error appears. If there are elements in the tree view whose model field contains record rules associated with multi-companies and the res_id field does not belong to the active companies, the error is displayed.
To Reproduce
Affected versions: I see the error in 15.0
Steps to reproduce the behavior:
Have a multi-company record Rule for a model.
Generate edi.exchange.record for the record rule model, with different companies.
Access the exchange menu without having all the active companies
Expected behavior
When accessing the menu, only the elements that belong to the active companies should be displayed.
Additional context
To avoid this problem I have tried two solutions, but neither of them seem correct to me:
Filter so that only the acces_rule is checked with the records of the active companies records = self.env[model].browse(rec_ids).with_user(self._uid).filtered(lambda x: x.sudo( ).company_id in self.env.companies.ids). This prevents the error from appearing but does not filter the elements that must be seen.
Create a company_id field from the res_id and model fields, [15.0][IMP] edi_oca: add company_id to edi_exchange_record #932 but I have had problems in a real environment since there may be the case in which the loading order of the modules means that a model does not yet exist when trying to access him.
The text was updated successfully, but these errors were encountered:
Module
edi_oca
Describe de bug
When you try to access the exchange records menus, a multi-company permissions error appears. If there are elements in the tree view whose
model
field contains record rules associated with multi-companies and theres_id
field does not belong to the active companies, the error is displayed.To Reproduce
Affected versions: I see the error in 15.0
Steps to reproduce the behavior:
Expected behavior
When accessing the menu, only the elements that belong to the active companies should be displayed.
Additional context
To avoid this problem I have tried two solutions, but neither of them seem correct to me:
records = self.env[model].browse(rec_ids).with_user(self._uid).filtered(lambda x: x.sudo( ).company_id in self.env.companies.ids)
. This prevents the error from appearing but does not filter the elements that must be seen.The text was updated successfully, but these errors were encountered: