erp5_core: add `getVariationCategoryItemList` to `InventoryListBrain`
Description of the problem
When viewing inventory report dialog as a regular user (without access to portal_simulation
), the following error occurs:
Error Type: Unauthorized
Error Value: You are not allowed to access 'getVariationCategoryItemList' in this context
This arises from the Resource_viewInventoryDialog
view, which tries to access getVariationCategoryItemList
.
Proposed solution
In order to fix it, I added getVariationCategoryItemList
to the list of getters in InventoryListBrain
, hence bypassing restriction on portal_simulation
, which is not accessible by regular user.
I am not sure this is what needs to be done, and do not know how it could have worked in the past if it had (seems to be, but unsure if prod had been patched manually).
Especially, I saw https://lab.nexedi.com/nexedi/erp5-nexedi/-/commit/e8bf128401fed5237f5d2b04c8e7b85ea066b62f by @yusei, which I do not understand and seems to have a name close to what I would like. The added method getVariationCategoryValueListDict
does not seems to be used anywhere, so would anyone be able to explain why it was introduced? And if it should be used instead of the one I am trying to fix?