[FIX] website_slides: fix some small model-related issues

* improve is_preview field string and help. 'Always visible' was not really
   clear and self speaking. A help string is added to describe what this field
   implies;
 * fix slide.channel invite button for 'invite' enroll mode. While renaming
   the "visibility" field to "enroll", a check was missed for the slide.channel
   invite feature. This commit fixes it by properly checking for enroll instead
   of visibility;

Commit linked to task ID 1942852 and PR #31394.

Co-Authored-By: David Beguin <dbe@odoo.com>
Co-Authored-By: Aurélien Warnon <awa@odoo.com>
This commit is contained in:
David Beguin
2019-02-26 16:05:45 +00:00
committed by Thibault Delavallée
co-authored by Aurélien Warnon
parent 70add1c212
commit 362271f35a
2 changed files with 2 additions and 2 deletions
@@ -338,7 +338,7 @@ class Channel(models.Model):
def action_channel_invite(self):
self.ensure_one()
if self.visibility != 'invite':
if self.enroll != 'invite':
raise UserError(_("You cannot send invitations for channels that are not set as 'invite'."))
template = self.env.ref('website_slides.mail_template_slide_channel_invite', raise_if_not_found=False)
+1 -1
View File
@@ -105,7 +105,7 @@ class Slide(models.Model):
category_id = fields.Many2one('slide.category', string="Category", domain="[('channel_id', '=', channel_id)]")
tag_ids = fields.Many2many('slide.tag', 'rel_slide_tag', 'slide_id', 'tag_id', string='Tags')
access_token = fields.Char("Security Token", copy=False, default=_default_access_token)
is_preview = fields.Boolean('Always visible', default=False)
is_preview = fields.Boolean('Is Preview', default=False, help="The course is accessible by anyone : the users don't need to join the channel to access the content of the course.")
completion_time = fields.Float('# Hours', default=1, digits=(10, 4))
# subscribers
partner_ids = fields.Many2many('res.partner', 'slide_slide_partner', 'slide_id', 'partner_id',