Commit Graph
21 Commits
Author SHA1 Message Date
Victor Feyens a3ded9043d [IMP] *: declare ir.rule in noupdate
ir.rule are default values but can be customized based on the
company's policy and needs.
This is typically a record that is in noupdate as should be
customization-friendly.
2020-03-20 16:21:25 +01:00
Victor Feyens 532c083cbb [IMP] *: remove global field definition in ir rules xml
It is a computed field, there is no need to manually set its value.
2020-03-20 16:15:40 +01:00
Thibault Delavallée 41b83e425b [FIX] slides: add mising rights for eLearning managers
Full rights were not granted on technical models for managers leading
to issues notably when archiving.

Followup of 90bf317c01

Task ID 2219806

closes odoo/odoo#47911

X-original-commit: c78553340008c1094bfc2c4dd554c5ad5f368fe9
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-03-18 12:39:11 +00:00
Martin Trigaux 65530dfd6a [ADD] *: add ir.model.access on all transient models
Following changes needing ir.model.access on transient models too.
Remove groups declaration on the action to move it to ir.model.access
when possible.
Rules are strict by default with no unlink access by default and high
priviledge asked. Adaptations may be needed later.
Write access is given as a wizard may need to be modified in case the
action triggers an error and the user has to correct a value

account*: use account.group_account_user for all transient by default
	  remove account.print.journal relic
stock*: use stock.group_stock_user by default
survey: survey user can send invitations
mail: allow any employee to execute wizards
      additional verifications are made to ensure they are executed
      only on the documents the user has access to you
      give portal access to mail.compose.message as portal still does
      some actions like posting messages on the forum
      add ir.rule to avoid reading somebody else messages
      increase the query count because of undeterminist count
crm: saleman for lead2opp, manager for massmailing
     partner manager for actions linked to partners
     avoid a write in test_lead_lost
sms: any employee can send sms
mrp: mrp user can execute wizards
     give unlink access as making write during do_produce operation
base_import: employees can import files
delivery: stock user can deliver
event_sale: sale user can configure the wizards
	    event user inherit from  sale rights
gamification: employee can give badge
google_service: resolve FIXME
hr: add specific rights
    manager can set a plan according to group on button
    anyone who can write on an employee can register a departure
hr_expense: set rights based on buttons
hr_holidays: an approver can make a summary report
hr_recruitment: recruiter can refuse a candidate
hr_timesheet: can use the wizard if can create a timesheet
l10n_eu_service: managers can create fiscal positions
mass_mailing: same group as on mass.mailing.list
membership: accountant can create invoice from membership
payment: accountant can create a link
	 as the source is an account.move
	 keep the payment.acquirer.onboarding.wizard to system user
	 only as it is called during company configuration
point_of_sale: PoS manager only can use wizards
	       never create closing_balance_confirm_wizard records
product_expiry: stock user has rights on stock.picking
product_margin: access from accounting menus
repair: same rules as for above models
sale: set ir.rule for self wizard only
      add rule from model introduced in payment to add salesman group
sale_crm: saleman can create a quotation from a lead
sale_coupon: any saleman can generate coupon
	     add self ir.rule
sale_product_configurator: salesman can select product variants
snailmail: employee can send letters
website: designers can write on website
website_crm_partner_assign: same rule as group on action
website_sale: sale ACL as for payment.acquirer.onboarding.wizard
website_slides: anyone can send invitation

base: base.language.*: allow employee (cf lang_install)
      change.password.user: can not read change password wizard of
      other users
      test.*: no access is needed

Courtesy of Damien Bouvy, William Andre and Antoine Prieëls for review
of acl
2020-02-04 17:54:18 +01:00
Patrick Hoste 1894dc5414 [IMP] website_slides: allow to download slide content and additional resources
PURPOSE

Currently eLearning lacks feature of having downloadable resources on
lessons. Indeed for example teachers would like to attach zip files or
other resources linked to a given lesson.

SPECIFICATIONS

You can now allow the user to download the slide content for pdf and image
slides. A new icon will be visible next to the fullscreen button on the pdf
viewer.

Course maintainers can also add additional resources to a slide which will be
available to download for the user.

Task ID 2066741
PR #39890

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-12-24 09:53:20 +00:00
mcm-odoo 90bf317c01 [REF] website_slides: define specific eLearning user groups
PURPOSE

Have user groups specific to eLearning to separate them from generic website
editors. Indeed this is a specific work area and require more than pure design
skills.

SPECIFICATIONS

Two user groups are added in this commit

  * group_website_slides_officer

    + can read any course/slide
    + can create a course (will be responsible)
    + can write on its courses
    + can upload slides to the courses he is responsible
    + can publish slides to the courses he is responsible
    - cannot unlink courses/slides (you should archive them)

    * implies group_website_publisher in order to see the top navbar in
      frontend with the publish toggle button and the new content button;

  * group_website_slides_manager: has full rights

    + can read any course/slide;
    + can create a course;
    + can add slide to any courses;
    + can publish any courses/slides;
    + can unlink any courses/slides;
    + has access to reporting menu entries;

Rights for other groups are untouched for courses / slides. As a reminder
we still support responsibles being outside of eLearning groups, for example
if an employee is a teacher that handles a course:

  * people in upload_group_ids of a channel can upload slides, even if they
    don't belong to any eLearning group;
  * people responsible of a course can upload and publish slides even if they
    don't belong to any eLearning group (done through controller as they
    don't have real rights on underlying models);

We choose to keep the survey rights separated from eLearning ones. Indeed
it is easy in odoo to update the imply_ids field of groups if necessary
to link survey / eLearning groups; default user template can also be updated
easily. Standard Odoo should therefore correctly separate those groups. The
only specific rights is that eLearning officers can read all surveys, allowing
to choose them for certification-based courses.

LINKS

Task ID 2062462
PR #39485

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-12-12 14:12:51 +00:00
qmo-odoo b180c66a80 [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
2019-08-08 08:29:34 +00:00
qmo-odoo b6f185b45d [FIX] website_slides: Remove read access on slide.answer
This commit removes the read access on slide.answer for all
users except website_publisher and admin

Task: #1947884
PR: #32083

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-05-06 06:24:38 +00:00
Thibault DelavalléeandAurélien Warnon 18f917fe3b [REF] website_slides: improve and make access options clearer
Purpose is to ensure more advanced use cases are still supported in new
elearning platform in addition to more public use cases. Fields controlling
access are now

 * enroll: who can enroll on course: public (everyone, simply click on join
   button), invite (added by already members) and payment (in bridge with
   website_sale, if SO with product is confirmed);
 * enroll_group_ids: automatically add members of those groups to the channel
   to ease having groups for a given subset of users;
 * visibility: who can see a channel and its slides: public (everyone, it means
   channel is visible on website for example), members (hidden for non members)
 * website_published on channels and slides; non publishers cannot see what
   is not published, whatever other parameters;
 * upload_group_ids: who can upload on a channel;
 * download_security on a slide is completely removed as it makes no sense
   for most slide types;

To ensure a better user experience responsible of a channel is added in its
members. People uploading a slide are now also allowed to read it to avoid
having inconsistency behavior between upload_group_ids and access rules.

Some tests are added.

This commit is linked to task ID 1942836 and PR #31239.

Co-Authored-By: Aurélien Warnon <awa@odoo.com>
Co-Authored-By: Thibault Delavallée <tde@odoo.com>
2019-02-19 16:52:07 +00:00
qmo-odoo c564ae6c87 [IMP] website_slides: Add elearning feature to slides
Purpose of this commit is to introduce a new way of displaying and managing
slides in eLearning module. Its purpose is to give a better experience to
users when going through a course. Notably a fullscreen mode allows to take
lessons one by one without going out of the elearning display. Integration
of all slide types eases taking the course step by step.

Quiz are introduced in this commit. Those are an addition to slides with
some question / answers (multiple choice). It allows customer to gain karma
and improves gamification. Certifications are still done using the survey
application. Quiz targets only small tests at the end of a given slide.

A new widget is added to display and control slide display in fullscreen
mode. Old display is still available for documentation channels or when
going out of fullscreen mode, to see details on comments / review / statistics
and have access to share options.

This commit is linked to task ID 1902304 and PR #29876. It closes the main
work on refactoring website slides into eLearning, with other tasks already
merged in current community [1][2][3][4][5].

[1] Task ID 1940360 landed at b2149bc7a2: certification inclusion
[2] Task ID 1936153 landed at 6c6179e57c: homepage inclusion
[3] Task ID 1937160 landed at 8b7605c9e5: selling courses
[4] Task ID 1922159 and 1940516 landed at 5fa651cb01 and 6a64c3ce82:
    new user profile and gamification of slides / forum
[5] Task ID 1938643 landed at 77b5673a0d: upload channel/slide
2019-02-19 13:11:15 +00:00
qmo-odoo 5aa645c89f [IMP] website_slides: add external links on slide
A slide can now have some external link. For instance, links to
the origin of the document (sources for scientifics papers, ...).
A new model is added to allow the user to provide several link
per slide. Those are display below the channel on website page.

Task-1938643
2019-02-12 11:22:59 +00:00
Thibault Delavallée cbc2de0eb6 [IMP] website_slides: add tags and tag groups on channel
Purpose is to be able to filter, search and categorize channels. Notably
with eLearning in mind there will be more channels as a channel will also be
used to hold lessons.

For that purpose we add a model of tag linked to channels. Those tags are
organized by groups in order to be able to display them using a menu or
a small hierarchy of tags. Displaying a tag group as a specific navigation
element is controlled by a specific field.

Those models will be used to display a new and improved home page for
channels / courses.

This commit is linked to task ID 1936153 and PR #30985.
2019-02-11 09:55:05 +00:00
Thibault Delavallée 6b46422a6b [REF] website_slides: update slide members relationship
This commit changes decorated many2many between slides and participants
recently introduced [1]. It was done between slide and users as people have to
login to have slide information.

Another many2many between channel and partners to store notably completion
and soon add statistics has been added [2]. It has been done between
channels and partners.

In this commit we choose to have the same relationship for slides, aka a link
between slides and partners. It allows to easily compute statistics and find
information based on partner_id.

Co-Authored-By: Quentin Mourrier <qmo@odoo.com>
Co-Authored-By: Thibault Delavallée <tde@odoo.com>

[1] See c273e89d55
[2] See 748b9072d6
2019-02-08 16:26:28 +00:00
David Beguin 723789b6b1 [FIX] website_slides: Fix clean ACLs and refactor access options commit
Fixes related to commit 748b9072d6

 * fix template still having an unnecessary t-else whereas the t-if has
   been removed;
 * move order by strategy on right class;
 * fix access rights on intermediate model between channels and partners. It
   should be accessible to website publisher as they will have so manage
   channel members;
 * fix some typos;

closes odoo/odoo#30949
2019-02-08 12:01:12 +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 748b9072d6 [IMP] website_slides: clean ACLs and refactor access options
Purpose of this commit is to clean access rights on slide models and give
less access to public / portal / internal users. Website publishers and
editors have rights to edit slides content and manage channels.

Another purpose is to clean and refactor access options on channels and slides.
Access to a given slide depends on the current user being a member of the
slide channel. A channel can be either public (joined easily) or on invitation
only (manual addition of members).

Slide can be flagged as preview, meaning they are accessible without any
concern about channel membership. It is used as teasing or free promotion
of a channel.

Publish flag is orthogonal. Non published slides are not visible to everyone
except website content editor. It allows to work and improve slides without
displaying them to members or public people.

Technically a new model is added to model membership on channels. It is
a decorated m2m between channels and partners; on this m2m the state of
membership is added. In a near future additional information will be stored
on this model, like completion of channel or certification information.

Other technical changes implied by this commit
 * visibility is simplified to either public or invite;
 * can_see and can_see_full are removed, as well as concept of 'partial'
   display of slides;
 * group_ids related to private access is removed;
 * a computed / searchable field is added to be able to efficiently find
   and search active members of a channel;

This commit is linked to task ID 1937411 and PR #30847.
2019-02-07 13:44:39 +00:00
Thibault Delavallée c273e89d55 [REF] website_slides: introduce slide / user relationship and use it for vote
Purpose of this commit is to store a relationship between slides and users.
Indeed starting from now we will track more user interaction with the slides
module.

In this commit we introduce a model that is used to populate and decorate
the relationship between slides and users, slide.users. From slides or users
point of view it behaves like a many2many. It can also be used to store
more information about the user interaction with the slide.

We use it here to store the user vote. Like and dislike are not static
counters anymore but computed fields based on user votes. It is implemented
as a tristate field.

As it is a technical model no access on slide.users is granted. Controllers
and methods grant access to the relationship in order to avoid information
lead and keep technical details private.

Future commits improving the eLearning use of slides will notably store
information about user having read the slide, taken a quizz or gaining
karma depending on some actions performed on the slide.

This commit is linked to task ID 1934488 and PR #30620 .
2019-01-29 09:24:48 +00:00
Christophe Simonis 6b3a80862c [MERGE] forward port branch saas-11 up to 503227838d 2017-03-06 13:23:38 +01:00
Goffin Simon 2971ffb70e [FIX] website_slides: Unpublished slides not visible
The rules "Channel: public: published only" and "Slide: public: published only"
must also be applied on portal user.

The portal user doesnt have to be allowed to create or write on slide.slide
records(introduced by 51be5bb).

opw:708499
2017-03-02 09:45:15 +01:00
Thibault Delavallée efd55ab8a5 [REF] various: rename openerp node to odoo in xml files 2016-08-10 15:48:10 +02:00
Mantavya Gajjar 51be5bbfb3 [ADD] website_slides: new website module to handle presentations, documents,
videos, infographics. Some kind of slideshare clone, to summarize.

Featuring :
- channel management: classify slides (presentations, videos, documents, ...)
and tune their access rights for visibility, uploading and downloading
- full branding new shiny website module !
- automatic fetch of youtube and google docs information based on URL
- statistics: views, likes, interfaced with messaging, ...
- embed mechanism to embed slides in other websites

Courtesy of RD India, notably Mantavya Gajjar, Ravi Gadhia,  Vijay Patel,
Pariket Trivedi
Courtesy of Use Merge Team, notably Jerome Maes and Richard Mathot
Let us not forget our usability testing teams that tested it quite a lot of time.

Special thanks to Martin Trigaux that did nothing.
2015-01-16 16:01:59 +01:00