Skip to content

Commit

Permalink
[IMP] epa_lab_sample_management: block users to change the followers
Browse files Browse the repository at this point in the history
  • Loading branch information
WesleyOliveira98 committed Sep 5, 2024
1 parent 57feba9 commit 156aec2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
7 changes: 7 additions & 0 deletions epa_lab_sample_management/models/lab_sample.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,3 +204,10 @@ def _onchange_parameter_group_ids(self):
)
else:
self.parameter_ids = None

def message_subscribe(self, partner_ids=None, channel_ids=None):
if not self.user_has_groups(
"epa_lab_sample_management.group_lab_sample_manager"
):
raise ValidationError(_("Just administrators can change the followers."))
return super(LabSample, self).message_subscribe(partner_ids, channel_ids)
4 changes: 2 additions & 2 deletions epa_lab_sample_management/views/lab_sample.xml
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,8 @@
</notebook>
</sheet>
<div class="oe_chatter">
<field name="message_follower_ids" widget="mail_followers" />
<field name="message_ids" widget="mail_thread" />
<field name="message_follower_ids" />
<field name="message_ids" />
</div>
</form>
</field>
Expand Down

0 comments on commit 156aec2

Please sign in to comment.