summaryrefslogtreecommitdiff
path: root/addons/website_slides/security/website_slides_security.xml
diff options
context:
space:
mode:
authorqmo-odoo <qmo@odoo.com>2019-05-13 11:09:31 +0000
committerThibault Delavallée <tde@odoo.com>2019-08-08 08:29:34 +0000
commitb180c66a80ae3ae34716f8524a990c9e9d2c1aa7 (patch)
tree3ec67ec0b6b5b7eef55482ce2e0c793496a00931 /addons/website_slides/security/website_slides_security.xml
parent5f4c7c5afae3a58f1925c3645af0a005d4fa6e1c (diff)
[REF] website_slides: replace slide.category by slide with is_category flag
PURPOSE Like already done for sale order, invoice of survey, purpose of this commit is to remove category model and replace by a flagged line (slide). It allows to easily reorder slides in an embedded list view. SPECIFICATIONS Instead of having a fully fledged slide.category model, slide.slide will serve that purpose with a is_category flag. This will allow to drag and drop slides and sections in the channel form view. This change had an impact on the way slides were added/sorted on the front-end. In fact, whenever a slide is added from the front-end, a resequencing of all the slides in the course has to be triggered. Category of a slide is now a computed field based on the sequence. Order of slides is based on sequence, with categories splitting the slide list based on is_category flag. In this commit tests are added. Some cleaning in tests is also performed to speedup a bit tests (savepointcase) and some cleaning / renaming to ease their understanding. Future commit will add JS necessary to manage slides in the section list view. LINKS TaskID: 1978731 PR: #33255
Diffstat (limited to 'addons/website_slides/security/website_slides_security.xml')
-rw-r--r--addons/website_slides/security/website_slides_security.xml4
1 files changed, 2 insertions, 2 deletions
diff --git a/addons/website_slides/security/website_slides_security.xml b/addons/website_slides/security/website_slides_security.xml
index e5ab59748d0..aeb16d43c1d 100644
--- a/addons/website_slides/security/website_slides_security.xml
+++ b/addons/website_slides/security/website_slides_security.xml
@@ -32,12 +32,12 @@
</record>
<record id="rule_slide_slide_not_website" model="ir.rule">
- <field name="name">Slide: public/portal/user: restricted to published or uploaded by user, and either channel member or public channel &amp; previewable</field>
+ <field name="name">Slide: public/portal/user: restricted to published or uploaded by user, and either channel member or public channel &amp; (category or previewable)</field>
<field name="model_id" ref="model_slide_slide"/>
<field name="groups" eval="[(4, ref('base.group_public')), (4, ref('base.group_portal')), (4, ref('base.group_user'))]"/>
<field name="domain_force">['&amp;',
'|',
- '&amp;', ('channel_id.visibility', '=', 'public'), ('is_preview', '=', True),
+ '&amp;', ('channel_id.visibility', '=', 'public'), '|', ('is_category','=', True), ('is_preview', '=', True),
('channel_id.partner_ids', '=', user.partner_id.id),
'&amp;', ('channel_id.website_published', '=', True), '|', ('user_id', '=', user.id), ('website_published', '=', True)]</field>
</record>