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<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
closesodoo/odoo#51305
Taskid: 2256589
Related: odoo/enterprise#10614
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
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>
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.
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>
- 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
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
closesodoo/odoo#50815
X-original-commit: 90152abef30e043d36f8a8aabfe18c46e807973f
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
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
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
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
closesodoo/odoo#49081
Related: odoo/enterprise#9733
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
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
closesodoo/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>
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
closesodoo/odoo#49333
Related: odoo/enterprise#9834
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
* = 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
closesodoo/odoo#50254
X-original-commit: 28a6cd49b6e87b75c2e70771e241c41778bf9e87
Related: odoo/enterprise#10236
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Purpose of this commit is to avoid de-synchronization where content could
be unpublished whereas slide was published.
Task ID 2239840
closesodoo/odoo#49908
X-original-commit: d0f4a3e85eab63e335766a823185fd6ada6e07b4
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
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 : #49951closesodoo/odoo#50164
X-original-commit: 44bfb8c73f9abc563ce764411610f45e5bdf18b1
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
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
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
This commits fixes 6d9b367a79d09d3d7a9dde890ca651aa09b93987 that fixed 0a980d4be6300fbc888dcc9daf760a48c1b0ec32 that fixed dc9fa6e2166ad803c91ca4f3e3e17b8065eeee82 .
Amazing.
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
closesodoo/odoo#49390
X-original-commit: b2f2c5e4ecfd6bf39ce0b2b724827202629231f1
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
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
closesodoo/odoo#49198
X-original-commit: 6d9b367a79d09d3d7a9dde890ca651aa09b93987
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
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`.
closesodoo/odoo#45723
Task: 2187728
Related: odoo/enterprise#9162
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
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
closesodoo/odoo#49125
X-original-commit: 84270b8f542313235a35fc0449600a8ff5dc8785
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
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
* = 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
closesodoo/odoo#47318
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
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.
closesodoo/odoo#46325
Related: odoo/enterprise#9117
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
- 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
closesodoo/odoo#48534
X-original-commit: f0b616348f11e00aae8c9b30df4c0ed922041b26
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
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
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
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
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
closesodoo/odoo#48382
X-original-commit: f2d04753be9f1feb75e575b0598b3520caa4744d
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
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
closesodoo/odoo#48372
X-original-commit: 799ee72facbca7a7eaf348938ed312a6d723854e
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
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
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
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
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.
closesodoo/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>
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.
Full rights were not granted on technical models for managers leading
to issues notably when archiving.
Followup of 90bf317c01
Task ID 2219806
closesodoo/odoo#47911
X-original-commit: c78553340008c1094bfc2c4dd554c5ad5f368fe9
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
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#46824closesodoo/odoo#47886
X-original-commit: 4625c017cfda9ad800124452448252a11a8ac9bb
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
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>
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
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
closesodoo/odoo#47166
X-original-commit: a5e66d681ccd760c0af7bd0b179b5e42c76577ba
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
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
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
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
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.
closesodoo/odoo#46084
X-original-commit: a2f5f8b552b48483ce5fdf0be04da7c27b326f2e
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>