summaryrefslogtreecommitdiff
path: root/addons/website_slides/models/slide_slide.py
AgeCommit message (Collapse)Author
2021-05-12[FIX] slides: Verifying the returned value of re.search before accessing the ↵Julien Banken
capture groups. The `search` function of the `re` package can return `None` if the provided string does not match with the provided pattern (https://docs.python.org/3/library/re.html#re.Pattern.search). On the `_parse_youtube_document` function of the `slide.slide` model, we are directly accessing the capture groups from the returned value of the `search` function without checking that the returned value is actually a 'match' object. As a result, an exception can be throw if there is no match as, in that case, the `search` function will return `None` and the `group` function will not be defined on `None`. To avoid throwing an exception, we will check that the returned value of the `search` function is not `None` before accessing the capture groups via the `group` function. LINKS Task id: 2525007 closes odoo/odoo#70743 X-original-commit: 575a524474fe8866cc71b3befc6bbbde8d73075e Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-05-04[FIX] website_slides: correctly shows 0 XP on completed unpublished quizPhilémon van Helden
In 13.0 and above, when looking at a quiz that was completed while not published, it would incorrectly show 2 XP awarded, when 0 XP should be awarded. With this commit, we show instead the correct 0 XP awarded. opw-2480343 closes odoo/odoo#70333 X-original-commit: 26f047633b919bd8f2a260305bfd80e15bf259b6 Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2021-01-06[FIX] mail: send notification mail with right access link when using mail.threadAchraf (abz)
PURPOSE Notification may be sent using a generic mail.thread record, notably when sending user notifications. In that case links to view document are incorrect. HOW TO REPRODUCE Issue - Install "Approvals" - Submit new approval with you as "Request Owner" - Click on "View Approval Request" in your mailbox The link redirects to a 505 error Cause The model is not the correct one and the res_id is undefined Solution Specify the model and the res_id to _notify_get_action_link when creating the link with kwargs SPECIFICATIONS Propagate message value through various notification sub methods. That way we can rely on them if model seems void. Also limit values given as URL parameters to some white listed values. LINKS opw-2358846 Task ID-2379766 Followup of odoo/odoo#60998 Followup of odoo/odoo#61545 Closes odoo/odoo#63292 Closes odoo/enterprise#15585 closes odoo/odoo#64170 X-original-commit: 2b6d2b71f6c60bcf64db440473c88d1dc335acbf Related: odoo/enterprise#15588 Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com> Co-authored-by: Achraf Ben Azzouz <abz@odoo.com> Co-authored-by: Thibault Delavallée <tde@odoo.com>
2020-11-27[FIX] website_slides: fix quiz karma wonAnh Thao Pham (pta)
- Install website_slides - Connect with an user (i.e. Mitchell Admin) - Go to Website and open a Course quiz for the first time (i.e. "Test Yourself" from "Basics of Furniture Creation" Course) - Answer correctly The number of won karma is the one from the last attempt reward and is not saved in user's total xp. When submitting the quiz, quiz_attempts_count is incremented via a SQL query, but its value is not updated in cache directly. When the karma gain is computed from the attempts count, the value used is the old one in cache. opw-2389969 closes odoo/odoo#62421 Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2020-11-17[FIX] website_slides: embed YouTube videos without cookiesJairo Llopis
Due to recent legal changes in EU, you cannot install tracking cookies in a user's browser without explicit consent. Before this patch, Odoo embedded youtube videos were violating that law (AFAIK & IANAL). With this simple patch, you benefit from YouTube's offering to embed videos without cookies. The UI remains the same, but no tracking is done. @Tecnativa TT26153 closes odoo/odoo#61824 X-original-commit: a1a1169f28233b69cd70d01621d605b36517ac73 Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-10-29[FIX] *: correct typos and bad EnglishMartin Trigaux
Courtesy of translators Reexport .pot of modified modules closes odoo/odoo#61002 Related: odoo/enterprise#14485 Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2020-09-28[FIX] tools.sql, website_*: increment counter with skip lockJeremy Kersten
*blog, forum, slides Based on https://github.com/odoo/odoo/pull/48552#discussion_r440061218 suggestion Add a new method 'increment_skip_lock' in tools.sql to allow to easily increment a specific field of 1 if the record is not locked. The method return boolean if at least 1 record has been incremented. closes odoo/odoo#58534 Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2020-08-26[FIX] website_{slides,forum}: enable slide content and forum creationDharmraj Jhala
Since a recent refactoring[1] is merged, few compute methods are being called at record creation, and throws traceback because of newID. This commit fixes the traceback by improving the compute methods and thus enable users to create records of slide contents and forums. Note - compute fields should be assigned a value, and so we update the recordset with default values while creation. See below PR for more information. [1] - https://github.com/odoo/odoo/pull/55995 Task - 2325605 closes odoo/odoo#56573 Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2020-08-31[IMP] various: improve code style and performance by improve ``all()`` usageVictor Feyens
PURPOSE Clean code. Be more performance oriented. SPECIFICATIONS Improvements applied in this commit * not all() --> any(not) for earlier returns; * all([generator]) --> all(generator) to avoid unnecessary list casting. This code construct is better managed by all; This commit will probably not have a big performance effect on standard production databases. However each performance and cleaning improvement is welcomed. LINKS Task ID-2328619 closes odoo/odoo#56060 Related: odoo/enterprise#12486 Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-08-12[IMP] website_slides: improve archive managementDidier
PURPOSE Archiving a course should also archive its content, and unpublish it as it should not be accessible from outside. Improve archive / publish management between a course and its slides. SPECIFICATIONS Show the content of an archived course having archived slides. When slides and course are archived its content should still be displayed. This is done using an active test in context of field. Propagate channel archive to content. Also unpublish archived slides. LINKS Continuity/IMP of task-2170708 Task-2225598 closes odoo/odoo#52233 Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-07-09[FIX] website_slides: use email_from on new content notifNicolas Martinelli
- Seta a value for the `ir.config_parameter` `mail.catchall.domain` - Enroll user A to a course - Add new content to the course - Publish it => an email is sent to the users enrolled - Reply to the email The reply is considered as a review of the course. It is not intended that users reply to such email; they are 'one-way' notifications. A solution is to be able to set the `reply_to` field on the mail template. This way, it's possible to set it to a `noreply` value. opw-2290521 closes odoo/odoo#54281 X-original-commit: 7ffc300e7c857bf743d7ab25631f9ee02419dea1 Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-07-02[FIX] website_slides: slide sortingNicolas Martinelli
Ensure deterministic sorting for slides with the same sequence. opw-2283154 closes odoo/odoo#54008 X-original-commit: 46bd51dc5f7b674409beac2557cbd19ec001944b Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-06-19[FIX] website_slides: fix youtube URL params ignoredjvm-odoo
Issue - Install website slides - Create a slide with document url = a youtube video URL with params like ?rel=0 - Check it on the website with debugger The iframe url doesn't have ?rel=0 Cause We only take the video ID and pass it to a predefined string. We add light theme params too. Solution Split the given url in order to get the params and pass it to the predefined string. OPW-2275928 closes odoo/odoo#53334 X-original-commit: 5e8fcd3391525192f462cc44acd84d3badb4f132 Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2020-06-19[FIX] *: correct support of multi records in methodsVictor Feyens
Wrong usage of self in for loops makes some apparently multi-friendly methods not work correctly when called with a recordset of len > 1. This commit replaces those references by the correct unique record reference which should be used at this iteration of the loop, avoiding potential exceptions or wrong behavior in the concerned methods. closes odoo/odoo#53320 Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2020-06-18[IMP] *: replace to new _() syntaxMartin Trigaux
Using a few regex like \((_\(.*%s.*)(\) % )([\w\[\]][\w .\[\]\(\)'"]*)\) ($1, $3)) Old syntax is still compatible but starts the migration to the new syntax that catches error.
2020-06-12[FIX] website_slides: better reorder after category deletionThibault Delavallée
Currently deleting a category with slides is not supported as it should be voided before being unlinked. This commit allows to unlink a category by moving all its slides in uncategorized section. This require a small reordering of sequences as category computation is based on sequence of slides in a given channel. Task ID 2276559 Prepares Task ID 2093671 PR #52917 Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-04-24[IMP] website_slides: allow user to download slides pdf by defaultPatrick Hoste
PURPOSE To align on the v13.0 enable the 'Allow Download' option by default. SPECIFICATION Change the default value of slide_resource_downloadable from False to True. LINKS Task ID : 2225802 PR : #49951 closes odoo/odoo#50164 X-original-commit: 44bfb8c73f9abc563ce764411610f45e5bdf18b1 Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-04-03[IMP] website_slides: implement archive cascade behavior in toggle_activeThibault Delavallée
Purpose of this commit is to make use of toggle_active to implement business behavior linked to active field being changed. In this commit we move the business specific code from write to toggle_active. When archiving a channel its slides are archived. In this commit we also track active field for courses and slides, allowing to see flag changes in chatter. Task ID 2170708 Community PR odoo/odoo#46563
2020-03-31[IMP] base, *: allow html fields not to sanitize formsfja-odoo
* = event, website_event_track, website_sale, website_hr_recruitment, website_livechat, website_sale, website_slides The option to sanitize or not the forms was not available, this will allow better flexibility on whether forms should be sanitized or not on an HTML field. Also we use this new param to allow forms to be added on some already existing html fields where forms where sanitized out. task-2209554 closes odoo/odoo#47318 Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2020-03-25[FIX] website_slides: fix undeletable question answerjvm-odoo
Issue - Go on Runbot V13 - eLearning - In a course, try to delete a question You can't Cause The linked answer is not deleted If you want to delete the answer you should add an extra menu Solution Add ondelete='cascade' on answer's question_id Prevent course deletion if there are attendees OPW-2210096 closes odoo/odoo#48372 X-original-commit: 799ee72facbca7a7eaf348938ed312a6d723854e Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-03-24[REF] mail: clean code about rendering in mail_templateThibault Delavallée
PURPOSE Clean and rename code about language management and template rendering in mail template model. SPECIFICATIONS Clean method naming and try to make code easier to understand and call. Also add and/or clean docstrings of rendering methods. Notably * ``_classify_per_lang``: for each lang-contextualized template, give the list of record ids; * ``_render_template``: now working only on a valid list of IDs instead of allowing both int / list and having a return type depending on the input type. It allows to simplify code and delegate some processing to callers; Introduce new API method * ``_render_lang``: for each record id return the lang matching it; * ``_render_field``: render a field of mail.template, on given set of record ids. Usage: template._render_field('body_html', records.ids). Language computation is available for this method; Remove the "multi mode" support of rendering that either returned a rendered value, either a dict based on given ids. Now all methods always work in batch and caller have to fetch the correct result if necessary. LINKS Task ID 1963529 Community PR odoo/odoo#32397
2020-02-24[FIX] website_slides: reset public views when duplicatingSwapnesh Shah
Followup on 82ce815a8c4c978b3372282d88559282d32d4b07 . When content (`slide.slide`) is duplicated, public_views should not be copied. Indeed it gives a new slide and it makes no sense to keep the old slide statistics. closes odoo/odoo#46084 X-original-commit: a2f5f8b552b48483ce5fdf0be04da7c27b326f2e Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-12-24[IMP] website_slides: allow to download slide content and additional resourcesPatrick Hoste
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-20[IMP] website_slides: improve error message when google API key is invalidDebauche Stéphane
Currently when there is an issue with the google API key, a generic message is send to the user, with the error details embedded in it in an ugly way. Now a message is displayed: "Your Google API key is invalid, please update it into your settings. Settings > Website > Features > API Key". This is done by parsing the JSON google sends back after request and determining if the error is linked to the API key. Task #2082857 closes odoo/odoo#40547 Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-12-18[IMP] website_slides: rename string for quiz attemptsJérémy Hennecart
When exporting fields, the reward attempts fields were split from each other. By grouping them, it allows easier management from user as all rewards fields are now grouped in the export wizard. Additionaly, they are also grouped in the dropdown for custom filter. task-2155189 closes odoo/odoo#42103 Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-12-12[FIX] website_slides: fix slide.slide statistics compute methodAurélien Warnon
The slide.slide and slide.channel "_compute_slides_statistics" methods do not always assign a default value for the "total_slides" field. This can cause some CacheMiss and seem related to nondeterministic errors on the runbot. Task#2123711 Runbot build error ID 247 closes odoo/odoo#41942 X-original-commit: c240d04ed0518897f76b315cd354ea6606aea645 Signed-off-by: awa-odoo <awa-odoo@users.noreply.github.com>
2019-12-12[REF] website_slides: define specific eLearning user groupsmcm-odoo
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-02[REF] mail, various: rename subtype parameter of message_post to subtype_xmlidThibault Delavallée
PURPOSE Clean posting process and improve mail.message definition and comprehension. SPECIFICATIONS In order to be more explicit subtype parameter is renamed to subtype_xmlid. It therefore clearly indicates it should be a valid subtype Xml ID. Support of ill formatted Xml IDs is removed because there is no reason to try to add some random prefix. Give something that exists or go to hell, punk ! LINKS Task ID 2071556 PR #38692
2019-11-29[REF] mail, various: improve mail creation calls, notably author and email ↵Thibault Delavallée
from default computation Purpose of this commit is to correctly compute author_id and email_from in mail_message and mail_mail as they depends from each other. Moreover it is a good idea in various flows to specify email and author when giving creation values to avoid default computation that is not always guaranteed to be accurate notably when involving super user. Mail message creation could lead to desynchronized values between author and email_from. This is improved with this commit by correctly inheriting from default_get and computing both of them at the same time instead of having two default values. Indeed they depend on each other. Same thing is done for mail composer. Mail Thread offers a tool method to find email_from / author_id based on having one of those values or current user and it is called whenever necessary. Some calls to mail template send_mail are also cleaned. Task ID 1853147 PR #32243
2019-11-29[IMP] mail: add computed fields for company emailsThibault Delavallée
Purpose of this commit is to give a way to access to company email and catchall with formatting. Those will be used in various automated emails. Indeed currently several templates use either ``company_id.partner_id.email``, ``company_id.email``, or even don't provide fallback values. With this commit from a company record people will be able to use * a correctly formatted catchall: ``"My Company Name" <catchall_alias@catchall_domain>`` * an email_formatted field like partner email_formatted that is either its partner-related email_formatted value, or formatted catchall if its partner is not correctly configured; Various calls to mail creation are updated accordingly. Task ID 1853147 PR #32243
2019-11-25[FIX] website_slides: fix slide.slide statistics compute method triggersAurélien Warnon
The slide.slide "_compute_slides_statistics" method is missing the 'slide_ids.sequence' trigger. It should be specified for cases when one of the slide_ids changes category (determined by the sequence). This can cause some CacheMiss and seem related to nondeterministic errors on the runbot. PR #40705 Task#2123711 Runbot build error ID 247 closes odoo/odoo#40867 X-original-commit: 1994f544694051a767ecda88a12dee5c5579add2 Signed-off-by: awa-odoo <awa-odoo@users.noreply.github.com>
2019-11-20[IMP] website_slides: indicate new content on courses to userslaa
Purpose of this commit is to help users knowing there is new content in a course by adding a visual insight. It is done through a new content arrow displayed in courses homepage. Regarding the file "website_slides_templates_homepage.xml", the choice to incorporate the t-call attribute into a 't' balise was necessary to display the customize option (part front) associated with the model course_card. Side dish usability improvements raised during development * display completed courses as last instead of first in "my courses"; * do not show promote strategy field for training courses as it has no use, only for documentation courses; TASK ID 2025186 Closes PR #36703 Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-11-20[MOV] website_slides: keep files well organizedThibault Delavallée
Oversight of 9b38bcec1269f0e72606e774f5e1f5f4a78baa89 PR #36703
2019-11-14[FIX] website_slides: default values for all compute fields.Victor Feyens
closes odoo/odoo#40263 X-original-commit: 2cab75b41763fed0b86d919e005d9a65cd3b85ac Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-10-11[FIX] website_slides: Do not copy Members on duplicatefw-bot
closes odoo/odoo#38447 X-original-commit: ef34fc7b900d9da46354a49f3f283531d29d3978 Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-10-03[FIX] website_slides: Add fetch timeoutfw-bot
This makes you actually able to install the module with demo data and unplugged from network. Otherwise, it's impossible. closes odoo/odoo#37903 Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-10-02[IMP] website, website_*: improve edit in backend featureRomain Derie
*base, website_blog, website_event, website_forum, website_slides With this commit: 1. It is now possible to add the 'Edit in backend' entry in the frontend navbar for any desired model, not only the ones which have the published mixin. It will simply redirect to the main_object form view. This commit add it to Forum and Blog. 2. When clicking on 'Edit in backend', it is now possible to land on another module than Website. That's especially useful for events and slides which are not directly related to the website module as they have their own module. 3. Remove the custom Edit in backend from the forum homepage (fa-cog). Opportunity was also taken to remove the 'edit welcome message'. It will now be editable through the editor (welcome message will appear in edit mode). Thus we got rid of the custom edit welcome message controller and views. Closes #36325
2019-10-02[IMP] mail: enforce kw args for message_{post/notify/log}Stéphane Bidoul (ACSONE)
Since there are message_post overrides using the form `def message_post(self, **kwargs)` in some modules, this method is intended to be invoked with keyword arguments only. This commit enforces this behavior. Calls such as `message_post("body")` will fail regardless of which addon is installed, forcing users to use `message_post(body="body")`. It also fixes a message_post override in hr, and applies the same mechanism to message_notify, and _message_log. closes odoo/odoo#33306 Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-09-12[IMP] gamification, *: remove KarmaErrorfja-odoo
* = stock, test_website, web, website_forum, website_slides, base Replace KarmaError with AccessError and remove the related override made on crash_manager and ir_http. task-2069890 closes odoo/odoo#36655 Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-09-13[FIX] website_slides: still another fix of computed fieldsLucas Lefevre
This commit fixes 2 issues coming from the recent ORM changes: records are new records in onchange and compute methods must assign a value for all records. In an onchange method, self.ids is a list of integer (real records) whereas self.id is a NewId (virtual record) Here a result dict was built using the reals ids as keys but later NewIds are used as keys. Solution is to use record._origin to access the real record. Moreover, the two dicts `result` and `type_stats` are the same. Assigning one into the other is useless. Task 2067872 (eLearning internal testing) PR #36756
2019-09-11[IMP] website_slides: improve slides backend viewsmcm-odoo
This commit improves a bit the existing backend views of the elearning app (notably propagating content and course labeling instead of slide and channel) and adds a pivot view for model slide.slide. FP feedback Task 2066646
2019-09-03[IMP] website_slides_{*}: improve backend UI, views and user actionsMichaël Mattiello
Purpose of this commit is to perform a back2basics on eLearning backend views. It helps users in their daily use of eLearning and improve UI. Containing * channel kanban view tweaking; * channel form view: some spacing and renaming improvements. Also set advanced field (new content email, share template) as group no one; * slide kanban view tweaking; * removed sections from kanban and list view for contents; * contents form view: various improvements, with notably * removed field website_url; * set publishded date is now readonly, tracked and in group_no_one as it is automatically set when publishing the lesson, and people should not update it manually; * removed the sum "Content" and replaced it by a stat button * reword quiz constraint error messages; * rating views improvements: * revamped the kanban view of rating that were a bit broken; * added a pivot view in Reporting/Reviews; * updated graph view in Reporting/Reviews; This commit also provides some usability fixes * prevent sending email if new content is category; * email: Prevent displaying an image if there is no image; LINKS Task 2049640 (website slides back2basics and fiximp) Task 2058595 (eLearning v13 testing)
2019-08-30[FIX] website_slides: always initialize computed fieldsThibault Delavallée
Creating channels and slides in backend was leading to warnings and/or crashes because of computed fields not being always updated. With new computed fields coming from 9920f20e4c7753bc17bea71dea3a90f7de687196 this cannot be done anymore. Task ID 2058595 PR #36281
2019-08-28[FIX] website_slides{_*}: fix completion computation, notably with ↵Thibault Delavallée
certifications PURPOSE Test frontend and UI tools of eLearning. SPECIFICATIONS Since 9920f20e4c7753bc17bea71dea3a90f7de687196 course completion when finishing a certification survey is broken. Indeed channel completion is not correctly recomputed. A certification course can therefore never be completed and awarded. This commit fixes that and correctly update channel completion based on survey. In this commit we also rename some methods * _compute_completion: renamed to _recompute_completion to avoid naming issue with computed field convention; * _post_completion_hook is not unnecessary as code in hr_skill can be done after calling super of _recompute_completion; * _completed_callback is renamed to _set_completed_callback to be coherent with slides naming; LINKS Task ID 1937768
2019-08-22[IMP] website_slides: improve and fix email templatesmcm-odoo
This commit improves the email that the members get when a new content is published on the course and prevents the template to crash on preview. task-1985511
2019-08-20[IMP] models: ORM speedupRaphael Collet
This branch is the combination of several optimizations in the ORM: * store field values once in the cache: the cache reflects more faithfully the database, only fields that explicitly depend on the context have an extra indirection in the cache; * delay recomputations by default: use method `recompute` to explicitly flush out pending recomputations; * delay updates in method `write`: updates are stored in a data structure that can be flushed efficiently to the database with method `flush` (which also flush out recomputations); * make method `modified` take advantage of inverse fields to inverse dependencies; * filter records by evaluating a domain on records in Python; * a computed field with `readonly=False` behaves like a normal field with an onchange method; * computed fields are computed in superuser mode by default. Work done by Toufik Ben Jaa, Raphael Collet, Denis Ledoux and Fabien Pinckaers. closes odoo/odoo#35659 Signed-off-by: Denis Ledoux <beledouxdenis@users.noreply.github.com>
2019-08-12[REF] website_slides: remove index_content field from slide.slideAurélien Warnon
The 'index_content' field was only filled when uploading from the frontend. That would lead to inconsistent results when creating/updating 'presentation' slides from the slide.slide form view. The field was also not cleaned if the slide content changed. As it's usage was not very clear (only on a 'search', and not very intuitive), we simply removed the field.
2019-08-12[REF] website_slides: improve duration computation of a slide/courseAurélien Warnon
The completion time of a slide now has default values for slides of type * video (duration of the YouTube video); * PDF (number of pages * 5 minutes); This computation is done when uploading a slide in frontend or by an onchange in backend. Field can still be given / modified by elearning people as result may not be reliable (pdf parsing is not accurate, and/or you may estimate time differently from strict page-based computation). The course will sum up all durations of its (active) slides. Display has been changed from "x minutes" to "x hours y minutes". Task ID 2007294
2019-08-08[IMP] website_slides: improve slide.slide (lesson) code and viewqmo-odoo
PURPOSE Improve daily use of slide, especially in backend. SPECIFICATIONS Make slide type editable in backend, notably at create. This commit makes it possible for the user to manually define the type of the slide. Slightly clean slide code about slide data. LINKS Task 1978731 PR #33255
2019-08-08[REF] website_slides: revamp channel form viewqmo-odoo
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 This commit completely reworks the slide.channel form view * improve the content management from the form itself by adding a tree view with the possibility of drag and dropping slides from category to category. This tree view has buttons to quickly add content or certification. It also allow to add a category (slide with flag is_category) without opening a modal; * reorder tabs and fields, improve some labels; * add a custom float field widget to display ratings as stars; * add stat button for partners who completed/certified ;the course * add stat button that redirects to the forum posts; * add stat button that redirects to the channel reviews; LINKS Task 1978731 PR #33255