Skip to content

Commit

Permalink
[IMP] attachment_delete_restrict
Browse files Browse the repository at this point in the history
- Add _onchange_restrict_delete_attachment() to clear groups and users when restrict_delete_attachment is not set to custom or owner_custom.
  • Loading branch information
AungKoKoLin1997 committed Nov 1, 2023
1 parent 3c6802d commit f0c88d3
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions attachment_delete_restrict/models/ir_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,8 @@ class IrModel(models.Model):
help="The users selected here can delete the attachments related to this "
"model.",
)

def _onchange_restrict_delete_attachment(self):
if self.restrict_delete_attachment not in ["custom", "owner_custom"]:
self.delete_attachment_group_ids = False
self.delete_attachment_user_ids = False

Check warning on line 49 in attachment_delete_restrict/models/ir_model.py

View check run for this annotation

Codecov / codecov/patch

attachment_delete_restrict/models/ir_model.py#L48-L49

Added lines #L48 - L49 were not covered by tests

0 comments on commit f0c88d3

Please sign in to comment.