Commit Graph
8 Commits
Author SHA1 Message Date
Aurélien Warnon 3c88e75c86 [FIX] website_slides: handle publishing rights of channel/slide
Purpose
=======

Handle publishing of the slide.slide/slide.channel accordingly to the new
'can_publish' field in the website published mixin.
2019-02-19 07:08:03 +00:00
Thibault Delavallée 752a3a5169 [FIX] website_slides: improve can upload / publish computation
New rules are

 * on channel type documentation: can upload like before (employee or upload
   groups specified); can publish like before (can upload and publisher)
 * on channel type training: can upload like before (employee or upload
   groups specified); can publish restricted to channel responsible

Tests are added.

This commit is a sub-part of task ID 1902304 (main eLearning task).

closes odoo/odoo#31082
2019-02-13 18:20:05 +00:00
Thibault Delavallée 370c525d77 [FIX] website_slides: fix computation of members
Members is better computed using a sudo to avoid every access rights issues.
Moreover trigger is updated so that cache is correctly invalidated and
recomputed. Having the trigger on the relational model correctly triggers
the recompute when calling main API methods to add a channel member.

This commit is a sub-part of task ID 1902304 (main eLearning task).
2019-02-13 18:20:05 +00:00
Aurélien Warnon 82ce815a8c [REF] website_slides: rework slide's public and embedded views
Purpose
=======

A slide's 'Embedded views' are reworked as 'Public views' to simplify
the model and be more compliant with the new 'is_preview' field.

The rule is now the following:

A slide is a preview or the view is done as public user (once per session)
-> increment public_views

A slide is viewed as a logged in user that has access to the content
-> increment slide_views
Technically slide_views is a compute of the slide_slide_partner count.

Tests are also added to ensure it is effectively working.

This commit is a sub-part of task ID 1940360 (eLearning integration with
survey) and task ID 1902304 (main eLearning task).
2019-02-13 18:20:05 +00:00
Thibault Delavallée 7ee22f1219 [IMP] website_slides: improve and add statistics computation
Purpose of this commit is to add some statistics computation on slide.channel
model. We want notably to have a count of views and votes (likes and dislikes)
on channels. Completion is also computed.

Purpose is to be able to search and order channels based on those statistics.
Having stored computed fields for some statistics help achieving that purpose.

Tests are added.

This commit is linked to task ID 1936153 and PR #30985.
2019-02-11 09:55:12 +00:00
Thibault DelavalléeandAurélien Warnon 8d310d1a88 [FIX] website_slides: improve methods to add members on channel
To avoid security issues or exploits, public method to add a member on a
channel allows to add only itself, under given restrictions, like being
a channel maintainer to add self on a private channel.

A private method allow to subscribe other people. It will be used notably
to allow publishers to invite other people.

Co-Authored-By: Aurélien Warnon <awa@odoo.com>
Co-Authored-By: Thibault Delavallée <tde@odoo.com>
2019-02-08 16:26:39 +00:00
Aurélien Warnon c4c067509e [REM] website_slides: remove the 'state' field of slide.channel.partner
Purpose
=======

The 'state' field for a member of a channel did not imply anything functionally
so we decided to remove it. It allows to remove an unnecessary computed fields.
ACLs are updated accordingly.

If needed, we will soon be able to check partner_ids that have ordered but
not paid a channel / course product by searching the related 'sale.order' model
for such products.
2019-02-08 11:33:09 +00:00
Thibault Delavallée b91add891c [IMP] website_slides: add tests
Currently website_slides module lacks tests. This commit adds base for tests
and add some tests related to recently cleaned access rules and rights.

Future commits will gradually add more tests to the module as it evolves
towards a more broad and up-to-date application.

This commit is linked to task ID 1937411 and PR #30847.
2019-02-07 13:45:57 +00:00