Commit Graph
1344 Commits
Author SHA1 Message Date
Yannick Tivisse 7b714a3bc7 [IMP] various: Update list views with new widgets
Purpose
=======

The following task implemented new widgets/features in the listview for better UI.
https://www.odoo.com/web#id=2195254&action=327&model=project.task&view_type=form&cids=1&menu_id=4720

The goal of the current task is to use those to upgrade our listviews

Specification
=============

Below are change requests on various listviews.

Remove decoration-bf="message_needaction==True" from every listview in every module.

PRODUCT - stock.view_stock_product_template_tree (product template)

remove all decorations from <tree>
set the following decorations on 'virtual_available' and 'qty_available'
decoration-danger="virtual_available&lt;0"
decoration-warning="virtual_available==0"
also set decoration-bf on 'virtual_available'
apply the same modifications on stock.view_stock_product_tree for product variants

SUBSCRIPTION - sale_subscription.sale_subscription_view_list

remove all decorations from <tree>
'stage_id' field
set <field name="stage_id" widget="badge" decoration-info="stage_category == 'draft'" decoration-success="stage_category == 'progress'"/>
'recurring_next_date' field
set <field name="recurring_next_date" string="Next Invoice" widget="remaining_days" attrs="{'invisible': [('stage_category', '!=', 'progress')]}"/>
set decoration-bf on 'code' and 'recurring_total_incl'
move 'percentage_satisfaction' before 'recurring_total_incl'
set widget="many2one_avatar_user" on 'user_id'
add <field name="activity_ids" widget="list_activity"/> after 'user_id'

ELEARNING - website_slides.slide_channel_view_tree

set widget="many2one_avatar_user" on 'user_id'
'enroll' field
set <field name="enroll" widget="badge" decoration-success="enroll == 'public'" decoration-info="enroll == 'invite'" decoration-warning="enroll == 'payment'"/>

POS - point_of_sale.view_pos_order_tree

remove all decorations from <tree>
'state' field
make visible and move it at the end of the view
set <field name="state" widget="badge" decoration-info="state == 'draft'" decoration-success="state not in ('draft','cancel')"/>
set decoration-bf on 'name'

APPRAISAL - hr_appraisal.view_hr_appraisal_tree

'state' field
set <field name="state" widget="badge" decoration-info="state in ('new','pending')" decoration-success="state == 'done'"/>
'date_close' field
set <field name="date_close" widget="remaining_days" attrs="{'invisible': ['|',('state','=','done'),('state','=','cancel')]}"/>

PAYMENT - account.view_account_payment_tree

remove all decorations from <tree>
'state' field
set <field name="state" widget="badge" decoration-info="state == 'draft'" decoration-success="state == 'posted'"/>
move 'company_id' before 'amount'

CONTRACT - hr_contract.hr_contract_view_tree

remove all decorations from <tree>
'state' field
set <field name="state" widget="badge" decoration-info="state == 'draft'" decoration-warning="state == 'close'" decoration-success="state == 'open'"/>
set widget="many2one_avatar_employee" on 'employee_id'

PAYSLIPS - hr_payroll.view_hr_payslip_tree

remove all decorations from <tree>
'state' field
set <field name="state" widget="badge" decoration-info="state == 'draft'" decoration-warning="state == 'verify'" decoration-success="state in ('done','paid')"/>
set decoration-bf on 'number' and 'net_wage'
move 'company_id' before 'basic_wage'
set widget="many2one_avatar_employee" on 'employee_id'

SURVEY - survey.survey_tree

'state' field
set <field name="state" widget="badge" decoration-info="state == 'draft'" decoration-success="state == 'open'"/>

APPLICATION - hr_recruitment.crm_case_tree_view_job

set widget="date' on 'create_date'
set widget="priority' on 'priority'
set widget="many2one_avatar_user" on 'user_id'

TIME OFF - hr_holidays.hr_leave_view_tree

remove all decorations from <tree>
'state' field
set <field name="state" widget="badge" decoration-info="state == 'draft'" decoration-warning="state in ('confirm','validate1')" decoration-success="state == 'validate'"/>
apply the same changes in hr_holidays.hr_leave_allocation_view_tree

closes odoo/odoo#51305

Taskid: 2256589
Related: odoo/enterprise#10614
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-05-15 08:24:05 +00:00
Patrick Hoste 59265847aa [REF] website_slides: move from onchange / default to stored editable computed field
PURPOSE

Try to move from onchange / default_get to stored editable computed fields.
Behavior should be the same (computed or set by user), with support of
create / write / onchange field update without additional code.

SPECIFICATIONS

Update classic fields updated in some cases by onchange and/or default methods
by fields with store=True, readonly=False. It means their value comes either
from manual user input, either from trigger based computation.

Remove onchange and default_get when possible, leading to an unique computation
method and clearing fields definition.

Also clean some fields definition inconsistencies, notably required fields
that should instead be correctly computed or default that have no real meaning.

SPECIFICATIONS: WIZARD CLEANING

Remove email_from and author_id fieles defined on invite wizard. Those are
not used in this wizard (not available in view) and default value is to use
current user. We can simplify this wizard model by removing them.

LINKS

Task ID : 2229048
PR : #49040

Related: odoo/upgrade#1198
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-05-18 08:11:58 +00:00
Martin Trigaux d9287caf94 [IMP] *: convert to private methods
render, render_template, load, activity_schedule_with_view,
get_website_pages should all be private:
It should not be possible to render an aribtrary template only with
its name or id

Still need to render some qweb views from js so the method
render_template is kept public.
This explains why the website editor still need read access on
ir.ui.view as we want to allow any snippet to be rendered.
2020-05-14 13:59:10 +02:00
Vishnu Thuletiya 9a830432db [IMP] various: Use the new avatar widget in kanban view
The purpose of task is to update the 'user/employee avatar' to the new
widget in all the kanban view across all modules.
The below new widget are introduced for avatar:
 - many2one_avatar_user (for user_id fields)
 - many2one_avatar_employee (for employee_id fields)
which displays the avatar (i.e. picture) of a user/employee in front
of his name and clicking on the avatar will open a chatbox to message
that specific user/employee.

So in this commit, For each kanban view with a user or employee avatar,
replaced it by the field with the new 'many2one_avatar' widget.

TaskID: 2244928
Related Enterprise PR: https://github.com/odoo/enterprise/pull/10420

closes odoo/odoo#50789

Closes: #50789
Related: odoo/enterprise#10420
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-05-13 12:37:48 +00:00
Benjamin Frantzen (bfr) e4a4ffb974 [IMP] customer ratings flow improvements
- Rename the 'Use Rating on Project' feature into 'Customer Ratings'
- Rename the 'Set Email Template to Stages' link to 'Set a Rating Email Template on Stages'
- Add an optional list view for the Stages menu
- display warning if the rating_template_id field is set and if one of the selected project_ids doesn't have the rating_status field set to true
- Project form view revamp
- rename the '% on tasks' stat button into 'Customer Satisfaction'
- Remove the 'no option' for the rating frequency field because it is required
- project form : Add a 'Go to Website' stat button
- Project dashboard: remove the 'Customer Ratings' menu item in more
- Ratings page: the 'Last 30 days' filter include ratings from today
- remove the Appointment / Helpdesk Customer Satisfaction / Live Support menu items

TASK ID : 1251
2020-05-08 12:17:20 +00:00
Thibault Delavallée 513c6d18df [FIX] website_slides: allow portal users to udpate their review
Followup of 86c80d341846894c435b1c8f61ef946b06e72ec7 : currently portal users face an access issue
if they change attachments in their review. This commit fixes that by sudo-ing
access to the attachment as other access is already granted.

Task ID 2214795

closes odoo/odoo#50815

X-original-commit: 90152abef30e043d36f8a8aabfe18c46e807973f
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-05-07 09:03:24 +00:00
Thibault Delavallée d0a855985f [FIX] website_slides: allow portal users to read their own reviews with attachment
Followup of 86c80d341846894c435b1c8f61ef946b06e72ec7 : currently portal users face an access issue
if they try to read their full review with attachments. This commit fixes that
by sudo-ing access to the attachment as other access is already granted.

Task ID 2214795

X-original-commit: ad7cd4bd38fdb0d92b22bb979637bb5623621378
2020-05-07 09:03:24 +00:00
Aaron Bohy 900d162809 [IMP] *: update list views
This commit adapts several views to make them use newly defined
widgets, the new decoration-xxx mechanism on fields, and to adapt
them to the new design of buttons.

Part of task 2195254
2020-05-05 10:05:12 +00:00
DramixDw 9b9829416b [IMP] website: simplify website menu
Some apps, once installed, automatically create a menuitem in website.
What complexify the UI and create useless menu withtout plusvalue.

It is not because you install livechat to make support online, that you want
a link in your menu to show stats e.g.

Now we remove the default menu created, and help user to find it when he create
a link. The autocomplete suggest most of the main App's controllers

task-2189613

closes odoo/odoo#49081

Related: odoo/enterprise#9733
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2020-05-01 07:59:07 +00:00
DramixDw 52c23e01e3 [REM] website,*: remove About us page and references
Remove the default about us page because it could be easily recreated and
doesn't add a lot of value to the website.

task-2189613
2020-05-01 07:58:11 +00:00
jerome hanke (jhk) ffe119d03e [FIX] website_slides: leaving a course unsubs from the related channel
Steps to reproduce:
- install eLearning
- go to the website > courses > enroll in any course > leave the course

Previous behavior:
you are not unsubscribed from the slide channel and still receive mail
notifications

Current behavior:
you are unsubscribed from the channel when you leave the course

opw-2244716

closes odoo/odoo#50404

X-original-commit: cb262738a20fad3e5114e9df21b77f499347745e
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: mightyjol <jhk-odoo@users.noreply.github.com>
2020-04-29 14:53:28 +00:00
Lucas Lefèvre 45170ceeb5 [IMP] various: Hide default user image for unassigned records
Impacted modules: account_analytic_default, crm, event,
hr_recruitment, maintenance, mass_mailing, project,
purchase_requisition, stock_picking_batch, website_slides

The default image displayed when the record is unassigned is
confusing, so we are removing it.

FP request
Task 2234524

closes odoo/odoo#49333

Related: odoo/enterprise#9834
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-04-28 13:16:29 +00:00
fja-odoo 11c60739e4 [IMP] website, *: warn user about outdated blocks
* = mass_mailing, web_editor, website_crm, website_event, website_form,
website_forum, website_hr_recruitment, website_mail_channel,
website_mass_mailing, website_sale, website_slides

When an outdated snippet's option are activated we display a warning
in the left panel that inform the user about the potential
malfunctions.

To do so the snippet's template key is added to the snippet as
data-snippet.
If a snippet is "t-call" inside another snippet, it will need to use
t-snippet-call instead of t-call to have the key on himself.

Those unique keys are used on snippet selection to retrieve the
snippet's version in the left panel and compare it with the currently
selected snippet's version. Versions are describe with data-vcss,
data-vjs and data-vxml. If a snippet's key is not in the left panel we
consider that snippet as outdated.

Added some tests to ensure that t-snippet and t-snippet-call really have
their template key as data-snippet

Adapted the views to the data-snippet changes adding
data-snippet="tmpl_key".

Part of: https://github.com/odoo/odoo/pull/44569
task-2189669

closes odoo/odoo#50254

X-original-commit: 28a6cd49b6e87b75c2e70771e241c41778bf9e87
Related: odoo/enterprise#10236
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-04-27 16:36:31 +00:00
Patrick Hoste 03e62ac8ad [IMP] website_slides: publish content when publishing slide
Purpose of this commit is to avoid de-synchronization where content could
be unpublished whereas slide was published.

Task ID 2239840

closes odoo/odoo#49908

X-original-commit: d0f4a3e85eab63e335766a823185fd6ada6e07b4
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-04-22 06:46:46 +00:00
Patrick Hoste ec2b38dd1f [IMP] website_slides: allow user to download slides pdf by default
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-24 14:51:49 +00:00
Martin Trigaux 2d00263127 [I18N] *: export saas-13.3 translations
closes odoo/odoo#50031

X-original-commit: 15a7a9f9d71a0b9c46d7caf2f4fbf09a5a4c63fe
Related: odoo/enterprise#10140
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2020-04-23 07:13:48 +00:00
David Beguin dd53c515c8 [IMP] website_slides: force duration to be positive in upload slide widget
To avoid user to set a negative duration on slide they upload using the
upload widget, a min=0 has been added to the duration input of that widget.

Task ID 1981399
PR #43577
2020-04-16 10:26:32 +00:00
David Beguin e52489bf99 [IMP] website_slides: lint and clean slide upload widget and controller code
This commit prepares the next ones from same PR and only clean the code of
slide upload widget + website_slides controller.

Task ID 1981399
PR #43577
2020-04-16 10:26:32 +00:00
David Beguin 45f7463e7a [IMP] website_(profile, slides): use badge level image as default badge image
Before this commit, if no image was set on the badge, no image was shown when
displaying the badge.

After this commit, if a badge level is set on the badge and no image is set,
the badge level image will be used for the badge.

This fix / improvement is applied twice

  * when displaying an user profile, its received badges;
  * when displaying current user achievements in eLearning;

Task ID 1981399
PR #43577
2020-04-16 10:26:32 +00:00
Thibault Delavallée d998c29ae8 [FIX] website_slides: fix upload without category
This commits fixes 6d9b367a79d09d3d7a9dde890ca651aa09b93987 that fixed 0a980d4be6300fbc888dcc9daf760a48c1b0ec32 that fixed dc9fa6e2166ad803c91ca4f3e3e17b8065eeee82 .
Amazing.
2020-04-16 10:26:32 +00:00
Nasreddin (bon) 4fd97c2573 [FIX] website_slides: Fix course publisher tour test
There was 2 problems that caused the Publisher tour to fail:

1. The pointer on the main menu was pointing to a link
containg "New Course" as text instead of "Course".

2. After selecting a picture (by clicking on it), the picture is
automatically added and so no need to click on add button; had to
remove this extra step.

Task ID 2228922

closes odoo/odoo#49390

X-original-commit: b2f2c5e4ecfd6bf39ce0b2b724827202629231f1
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-04-10 11:04:56 +00:00
Andrea Grazioso (agr-odoo) 30988c932b [FIX] website_slides: correctly upload PDF in course
With website_slides installed go to website, select a course in which
the user is enrolled, try to upload a pdf

Traceback will occur because the category recordset is needed but the id
is passed to _resequence_slides

opw-2229756

closes odoo/odoo#49198

X-original-commit: 6d9b367a79d09d3d7a9dde890ca651aa09b93987
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-04-08 09:20:30 +00:00
Julien Castiaux ab4000fb3c [REF] base: Remove deprecated exceptions and osv
TL;DR: remember `osv` and `except_orm` ? You can forget about them.

* Deprecated `except_orm` dropped.
* `UserError` elevated as super type of all user-related
  errors.
* Unused `DeferredException` dropped.
* Unused `QWebException` dropped (real one is in `qweb.py`).
* `MailDeliveryException` made a python exception.
* `name` legacy exception attribute made an alias of the python standard
  `args[0]` attribute and deprecated.
* `value` legacy exception attribute dropped.
* `exception_type` RPC error response key dropped.
* Deprecated `osv` module dropped.
* `--osv-memory-age-limit` cli option made an alias of
  `--transient-age-limit` and deprecated.

The `odoo.exceptions.Warning` have long been a deprecated alias to
`UserError`. It is going to be removed in a future version but first we
explicitly deprecate it with a warning.

The `odoo.exceptions.DeferredException` was a very old internal
exception, it has been removed without deprecation notice as it is never
raised.

The `odoo.exceptions.except_orm` has been a deprecated exception type
with deprecation warning for 5 years, it has been removed in favor of
UserError which becomes the super class of all user-related errors.

The `odoo.base.models.ir_mail_server.MailDeliveryException` was
inheriting `except_orm`. As it is not related to a user error but is
more of a problem an admin much take care of, the exception has been
made a Python error.

The `exception_type` JSON key in RPC error responses was holding an
hardcoded value derived from the exception type. Its usage has been
dropped in favor of the `name` JSON key that holds the precise exception
name. Again as it was hardly used in the source code (beside the crash
manager) it has been dropped without deprecation warning.

Since we are here trying to clean odoo custom exceptions, we are also
deprecating the `name` exception attribute in favor of the more standard
`args[0]` attribute.

The `name` (along with `value`) were two attributes used to raise
`except_orm` exceptions before the introduction of `UserError`,
`AccessError` and related exceptions. The `name` attribute, at the time,
was holding the exception type/title. Nowadays it contains the error
message. The `value` attribute, at the time, was holding the error
message. Nowadays it is no more used.

The `osv` module contains very old deprecated aliases. There is no
simple way to log a deprecation warning for osv, osv_memory and
osv_abstract but as they have not been in use for ages, they have been
removed too. To be consistent, the `--osv-memory-age-limit` cli option
has been made a deprecated alias to the `--transient-age-limit`.

closes odoo/odoo#45723

Task: 2187728
Related: odoo/enterprise#9162
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2020-04-08 08:41:17 +00:00
Lavish Chhatwani a0348ba3bf [FIX] website_slides: fix right panel alignment issue
There is an alignment issue while browsing courses page in Leaderboard and
Latest achievements panel.

In this commit we simply fix it with no-gutters to have all items aligned
properly.

TaskID - 2227683

closes odoo/odoo#49125

X-original-commit: 84270b8f542313235a35fc0449600a8ff5dc8785
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-04-07 10:21:55 +00:00
Thibault Delavallée d73a92505c [IMP] website_slides: implement archive cascade behavior in toggle_active
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-04-03 12:59:29 +00:00
fja-odoo 388c222c6c [IMP] base, *: allow html fields not to sanitize forms
* = 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-31 14:22:43 +00:00
Adrian Torres 1daf8eb127 [FIX] *: set ondelete policy of required Selection fields
With this commit, Selection fields with `required=True` which are
extended via `selection_add` are given proper ondelete policies to
ensure the cleanup of records containing these extended options during
uninstall of the extending module.

This commit also cleans up leftover uninstall hooks that were being used
to handle the same set of problems prior to the ondelete mechanism being
implemented for Selection fields.

closes odoo/odoo#46325

Related: odoo/enterprise#9117
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2020-03-30 13:42:04 +00:00
Jorge Pinna Puissant 0cf423db8b [FIX] website_slides: immediately add content to new course
- Create a new course;
- Add content line;
- save.

Before this commit, Odoo raises an invalid field error on 'Course' which
is empty. If you try to select the newly created course, it is missing
in the list.

Now, the course is removed from the view when creating a new content
from a course. But it stays if the content is created directly from the
content menu.

opw-2210360

closes odoo/odoo#48534

X-original-commit: f0b616348f11e00aae8c9b30df4c0ed922041b26
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
2020-03-27 16:29:07 +00:00
Quentin Mourier 1a8c0694c8 [FIX] website_slides: fix empty section flag display in frontend
Before this commit, empty sections were not flagged correctly whenever a slide
got archived or dragged to another section. This is due to the empty flag is
not updated accordingly.

Taskid: 2090927
X-original-commit: 43f05c0b92cf24812187490fb326fb6cfd9ca021
2020-03-26 16:43:04 +00:00
qmo-odoo 12c6d77e7f [FIX] website_slides: fix slide reordering in frontend
This commit fixes the reordering of slides on upload or drag and drop
in frontend. This issue was due to the fact that in a previous commit
(c4eba6f) uncategorized slides were moved to the bottom of the list,
which broke the reordering after drag and drop.

Indeed we use the dom order itself to reorder the slides with a simple rpc
call to dataset/resequence. Instead we revert part of the previous fix
to display uncategorized slides at the top. It allows to be coherent with
resequence and with backend behavior that displays uncategorized at the
top of the list.

Another issue was that, on slide upload, in the controller, we used
the category_id on the slide (which seems to not always be correct at
this stage) instead of the one given by the javascript. This caused the slide
to not be uploaded in the right section.

This commit also adds some margin to the categories in frontend for training
courses. Otherwise uncategorized slides are too close to the first category.

Task ID 2090927

X-original-commit: 7bd042d6e20c44558b90641409a6e3f8fa8000ed
2020-03-26 15:57:43 +00:00
Quentin Mourier 843caa270c [FIX] website_slides: fix resequencing based on category
When new slides are added through frontend a resequencing of slides and
categories sequence is done by calling _resequence_slides on the channel.
However this method is not working as expected, and resequencing should
take a category in order to better know where to start its resequencing.
Otherwise it simply reorder slides in the same order as before, or in an
unpredicted or prodicted but fasly order if new slide category has just been
created.

Task ID 2090927

X-original-commit: f038946ae2e3f174bee086281a541c6bc770e354
2020-03-26 15:57:43 +00:00
RVE-odoo 3efffa8a55 [FIX] website_slides: allow feedback update on review update
Currently, when updating a review on a course, the feedback field is not
updated on the rating model. Therefore, the backend view for rating is
always displaying the first feedback posted

Task ID 2184038

closes odoo/odoo#48382

X-original-commit: f2d04753be9f1feb75e575b0598b3520caa4744d
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-03-25 17:29:21 +00:00
jvm-odoo 5eea6b278e [FIX] website_slides: fix undeletable question answer
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-25 16:04:59 +00:00
Thibault Delavallée 3d86a29aeb [MOV] mail, various: move replace_local_links to render mixin
PURPOSE

Move links shortening tools on mail.render.mixin to have rendering and
post procesing tools available on that mixin.

LINKS

Task ID 1963529
Community PR odoo/odoo#32397
2020-03-24 10:24:44 +00:00
Thibault Delavallée 822f468059 [MOV] mail: move rendering code to mail render mixin
We also have to update code calling directly the rendering itself. Indeed
some code bits does some rendering directly on jinja-enabled input and not
through templates. Those calls have to be updated accordingly.

LINKS

Task ID 1963529
Community PR odoo/odoo#32397
2020-03-24 10:24:19 +00:00
Thibault Delavallée a03f6483d6 [REF] mail: clean code about rendering in mail_template
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-03-24 10:24:18 +00:00
Martin Trigaux 81a5cc2e10 [FIX] *: correct English terms
Some bad phrasing
Courtesy of Cecile Collart

closes odoo/odoo#48233

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2020-03-24 09:26:24 +00:00
Martin Trigaux 800db7405c [FIX] website_slide: correct frenglish
closes odoo/odoo#48185

X-original-commit: 3ad726f3019e4aa6f7043ef08bf4fae8eec49a09
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2020-03-23 11:29:34 +00:00
Nisha patel e428d473c3 [IMP] various: Allow to select only internal users on m2x field with res.users
Purpose of this task is to prevent users from setting portal users on
internal documents by mistake, and preventing noise and performance
issues resulting from loading all the portal users in those fields.

This commit fixes internal many2x fields to res.users which are now
restricted to internal users by setting domain (share=false) on form view.

closes odoo/odoo#47553

Taskid: 2172779
Related: https://github.com/odoo/enterprise/pull/9204
Related: odoo/enterprise#9204
Closes: #47553
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-03-16 10:28:35 +00:00
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
Lavish Chhatwani 9a9edeaf35 [FIX] website_slides: avoid trying to browse categories in frontend player
Before this commit when you browse a course's contents,the category is
displayed as a blank page with a pdf icon rather than going directly to the
next content.

This commit fixes that by skipping the category. User is redirected to the
next available slide.

Task 2201175
Closes #46824

closes odoo/odoo#47886

X-original-commit: 4625c017cfda9ad800124452448252a11a8ac9bb
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-03-18 10:23:31 +00:00
Florent LejolyandAurélien Warnon 660e105431 [IMP] website_[sale_]slides: allow users to take the slide quiz before joining the course
PURPOSE

When previewing a slide of type 'quiz', users are tempted to answer the
questions even if they are not member of the course yet.

This commit will allow users to answer the quiz without being a member of the
course, and offer a smart redirection to join / buy based on the enroll type
of the channel.

SPECIFICATIONS

We introduce a "CourseJoinWidget" that will handle the display and the behavior
of the "join" button based on the user (public or not) and the enroll type
(public course or based on a payment).

When the user answers questions and he's not a member yet, we store the answers
temporarily in the session object.
When he comes back on the quiz page after having completed his membership, we
fill in the quiz based on his previously entered answers and clean the session.

LINKS

Task 2045571
PR #41972

Co-authored-by: Florent Lejolyn <fle@odoo.com>
Co-authored-by: Aurélien Warnon <awa@odoo.com>
2020-03-12 08:30:16 +00:00
Aurélien Warnon 1a92829c7d [REF] website_slides: rename 'channel_management.xml' to 'slide_course_join.xml'
This commit simply renames a template file to better reflect its purpose and
also align with its JS widget file naming. It is a preparation commit for
pending changes.

Task 2045571
PR #41972
2020-03-12 08:29:55 +00:00
Martin Trigaux a14fd21c60 [FIX] website_slides: completly leave a channel
When leaving a channel, remove the earned karma in addition of the
slides.
This way, the user goes back in the same state as before completing
the course.
Add a message to clarify to the user the impact of leaving a course.
Add a test to answer questions

opw-2199066

closes odoo/odoo#47166

X-original-commit: a5e66d681ccd760c0af7bd0b179b5e42c76577ba
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2020-03-09 09:10:29 +00:00
Tiffany Chang (tic) 4bc66ffc79 [IMP] website_slides: Add color to course tags
This commit allows assignment and visibility of colors to course tags.
In order to reuse existing code, the colors offered are the same colors
used for Kanban tags.

Visibility of these tag colors has been added to:
- slide channel form view
- individual course website
- courses (not-filtered) website
- user profile "about" page

Note that visibility was purposely not added to:
- Kanban view for courses since "no color" assigned tags are not shown in
  the kanban view by pre-existing design.
- Filtered courses website since selected tag filters are already
  color highlighted to make selected tag filter(s) more obvious.

Supports Task: 2128166
PR #44365
Upgrade PR: odoo/upgrade#862
2020-03-05 10:53:54 +00:00
Tiffany Chang (tic) 27005ebdbb [IMP] website_slides: Add course tags creation to frontend
This commit makes it possible for course tags to be added via the
frontend. To support this, course tags were also made viewable in a
specific course's website since previously these tags were only visible
in the courses frontpage (i.e. within the course cards). "Add Tag" is
placed after course page's tags. Note that due to the ability to make new
tags within this "Add Tag" modal restricts addition to only 1 tag at a
time since new tags require a "Tap Group" to be assigned and handling a
mix of new/existing tags would get confusing and complicated.

Supports Task: 2128166
PR #44365
2020-03-05 10:53:45 +00:00
Tiffany Chang (tic) ff828a3e0c [IMP] website_slides: Update "Course Tag" UX
Minor UX updates for clearer wording, better visuals, and more intuitive
interface. Specifically:

- update slide.channel.tag.group form view and related menu item
- update css so 2nd line of course tags on main course page are not cut
  off

Supports Task: 2128166
PR #44365
2020-03-05 10:53:31 +00:00
Swapnesh Shah 8f703cb050 [FIX] website_slides: reset public views when duplicating
Followup on 82ce815a8c . 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>
2020-02-24 11:52:00 +00:00