New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FIX] event: access issue for event admin to event templates #117089
base: 15.0
Are you sure you want to change the base?
[FIX] event: access issue for event admin to event templates #117089
Conversation
422d22a
to
fe6b1e3
Compare
a58433a
to
cde3f8e
Compare
notification_model = self.notification_type.replace('_', '.') + '.template' | ||
model = self.env[notification_model] | ||
try: | ||
model.search_count([('model', '=', 'event.registration')]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nle-odoo if you agree this is better than hardcoded parts in previous PRs, will update on the newly raised PRs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks ok to me
this would have the same issue than the PR for event.mail, so we should see how #116469 (comment) ends before doing this.
1ae95dd
to
9fe3664
Compare
1. Install Events 2. Settings - Users - Ensure one has Admin:Settings, another Event:Administrator - Click gear icon to set password 3. Try the step 4 with admin settings vs event admin 4. Click on the Event app - [Configuration] - [Event Templates] - Communication tab - select any on Send column Issue: It works not for Event Admin to edit the tab Resolve by: Workaround to access ir.model Impacted version: 15.0 - master opw-3103199
9fe3664
to
b9b09d5
Compare
@@ -67,6 +69,19 @@ def _prepare_event_mail_values(self): | |||
'template_ref': '%s,%i' % (self.template_ref._name, self.template_ref.id) | |||
} | |||
|
|||
@api.onchange('notification_type') | |||
def set_template_ref_model(self): | |||
notification_model = self.template_model_id.model |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, tested this to work..do correct me if I'm wrong
Install Events
Settings - Users
Try the step 4 with admin settings vs event admin
Click on the Event app
Issue: It works not for Event Admin to edit the tab
Resolve by: Workaround to access ir.model
Impacted version: 15.0 - master
opw-3103199