summaryrefslogtreecommitdiff
path: root/addons/mail/models/mail_activity.py
diff options
context:
space:
mode:
authorMartin Trigaux <mat@odoo.com>2020-02-14 11:22:15 +0100
committerMartin Trigaux <mat@odoo.com>2020-05-14 13:59:10 +0200
commitd9287caf9408bb4ff85ad734cbca08e44321e205 (patch)
tree0d3b7c5705e5172176a7d76bf9098e381190bf4b /addons/mail/models/mail_activity.py
parent56a8c9e4311d24c33b7ad08b8230e4be345a85b8 (diff)
[IMP] *: convert to private methods
render, render_template, load, activity_schedule_with_view, get_website_pages should all be private: It should not be possible to render an aribtrary template only with its name or id Still need to render some qweb views from js so the method render_template is kept public. This explains why the website editor still need read access on ir.ui.view as we want to allow any snippet to be rendered.
Diffstat (limited to 'addons/mail/models/mail_activity.py')
-rw-r--r--addons/mail/models/mail_activity.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/addons/mail/models/mail_activity.py b/addons/mail/models/mail_activity.py
index 827dcc5e33e..0822c3adb06 100644
--- a/addons/mail/models/mail_activity.py
+++ b/addons/mail/models/mail_activity.py
@@ -393,7 +393,7 @@ class MailActivity(models.Model):
body_template = body_template.with_context(lang=activity.user_id.lang)
activity = activity.with_context(lang=activity.user_id.lang)
model_description = self.env['ir.model']._get(activity.res_model).display_name
- body = body_template.render(
+ body = body_template._render(
dict(
activity=activity,
model_description=model_description,
@@ -798,7 +798,7 @@ class MailActivityMixin(models.AbstractModel):
activities |= self.env['mail.activity'].create(create_vals)
return activities
- def activity_schedule_with_view(self, act_type_xmlid='', date_deadline=None, summary='', views_or_xmlid='', render_context=None, **act_values):
+ def _activity_schedule_with_view(self, act_type_xmlid='', date_deadline=None, summary='', views_or_xmlid='', render_context=None, **act_values):
""" Helper method: Schedule an activity on each record of the current record set.
This method allow to the same mecanism as `activity_schedule`, but provide
2 additionnal parameters:
@@ -821,7 +821,7 @@ class MailActivityMixin(models.AbstractModel):
activities = self.env['mail.activity']
for record in self:
render_context['object'] = record
- note = views.render(render_context, engine='ir.qweb', minimal_qcontext=True)
+ note = views._render(render_context, engine='ir.qweb', minimal_qcontext=True)
activities |= record.activity_schedule(act_type_xmlid=act_type_xmlid, date_deadline=date_deadline, summary=summary, note=note, **act_values)
return activities