Skip to content

Commit

Permalink
[FIX] mis_builder: use compute_sudo on field source_aml_model_id to p…
Browse files Browse the repository at this point in the history
…revent errors due to missing permissions.

The field source_aml_model_id refers to the ir.model, which is a technical in nature, and users should not
have naturally permission to read them directly.
  • Loading branch information
JordiBForgeFlow committed Feb 7, 2024
1 parent d62e51f commit a3cf25a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions mis_builder/models/mis_report_instance.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,7 @@ def _compute_dates(self):
("field_id.model_id.model", "!=", "account.move.line"),
],
compute="_compute_source_aml_model_id",
compute_sudo=True,
store=True,
readonly=False,
help="A 'move line like' model, ie having at least debit, credit, "
Expand Down
2 changes: 2 additions & 0 deletions mis_builder/readme/newsfragments/596.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
The field source_aml_model_id refers to the ir.model, which is a technical in nature, and users should not have naturally permission to read them directly.
With this fix, every time that the field is read, it will be done using compute_sudo, which means that the user permissions are not considered.

0 comments on commit a3cf25a

Please sign in to comment.