Task #1902306
Purpose
=======
Preliminary cleanup
---------------------------
survey.question is now also the model used for the survey's pages (with the "is_page" field set to True).
This allows to put all the pages and questions together in a o2m field on the view side and
easily reorganize your survey by dragging the items around.
It also removes one level of encoding by directly having 'Add a page' and 'Add a question'
links on the tree view of questions, enabling a faster encoding.
However, this has the downside of making the code reading a little bit more complicated.
Efforts were made at the model level to create computed fields so that the use of these models
still seems somewhat logical. That means:
- A survey still has "page_ids" (question_and_page_ids filtered on is_page = True)
- These "page_ids" still have question_ids (questions located between this page and the next)
- These "question_ids" still have a "page_id"
That makes the use and display of these information at view and controller levels easier to understand.
Certification
----------------
This commit adds certification capabilities to the survey module.
A certification is a survey with the "certification" flag set to true than can be linked
to a certification email template that contains a certification document (PDF).
This template can be edited by the user in the technical settings to customize the certification email/document.
To be able to implement this certification concept, we also have to add scoring mechanisms to surveys.
survey.questions of type 'simple_choice' and 'multiple_choice' now have scores for the suggested answers.
These question scores allow to compute a global score that is used to determine whether the user has successfully
passed the certification or not.
As additional features, we also have:
- A time limit with an interface timer that limits the test to X minutes
When reached, the survey is automatically submitted and unregistered (= unsubmitted) answers are not taken into account.
- A limited number of attempts for the survey/certification
If reached, the user can't take the survey/certification anymore
The 'survey result' layout was adapted accordingly to show the success rate of participants and the correct answers
to the survey questions.
Randomization and survey layout selection
---------------------------------------------------------
The "page" concept is now only present in the user interface.
Surveys are split in "sections" that have two purposes:
- Organizing a (long) survey/certification
- Allow to pick a random questions count for that section (more information here after)
On the user interface, based on the questions_layout field, surveys are displayed:
- On a single page, where sections still appear but are only used as visual separations
- On multiple pages, having one page per section (this matches the previous behavior)
- On multiple pages, having one page per *question*
On top of that page concept, this commit added randomization for the survey questions.
The randomization mechanism will take X questions per section of the survey.
The survey.user_input is initialized with the selected questions to be sure to keep that
set of questions and avoid showing a new set of questions every time the user refreshes the page.
This also allows to easilly go back and know which question we have to show.
Specs
=======
- Create a new survey :
- Add a description field for the survey
- Options on a survey :
- Passing score : (sum of all good answers) in %
- If No scoring => No passing score, no certificate
- If Scoring with answers => Passing score and can see the answers (can create certificate)
- If Scoring without answers => Passing score but can't review the answers at the end (can create certificate)
- for the questions, if "no scoring" selected, can 't see the option "good answer" and "score" on the questions
- If the 2 others options, can see the options "good answer" and "score" on the questions
- all the types of questions are available for each option.
- Questions
- Add the option correct answer on the multiples questions (one or more good answers)
- Certifications
- If scoring, force "mandatory" for "mutliple choices (1or multiple answers)"
- On the dashboard => visual information that this specific survey is a certification
- Time Limit : The student is informed on the home screen of the survey of the time limit.
The clock start when he clicks on "start survey"
- Template of the certificate : send email with attachment PDF
- Front-end :
- Add some margin
- Replace "Back to survey" with the blue-bar from the portal
- Add a timer (start when the survey starts)
- Add a progress bar (number of section and number of question inside the section)
- Analyse of the results :
- First a global graph with the number of people who''ve participated and passed the test
- Stages of a survey :
- Remove the stage "Permanent"
- 3 stages :
- draft : not on-line but can be tested (with phantom token)
- In progress : on-line
- closed : not on-line
- Who can test a survey : the manager and the user. Add this condition to the phantom token.
closesodoo/odoo#29577
Task #1902306
Purpose
=======
When creating a question of type "matrix", the "matrix_type" field needs to be "required".
(survey UI is broken if left empty).
Task #1902306
Purpose
=======
When you invite people to take a certification multiple times, the user will have his "attempts" count reset
with every invitation.
This is important when there is a limited number of attempts available.
ex: A user invited twice will have 2 x allowed_attempts_count to succeed the survey.
Attempts are now separated in different pools using a "invite_token" field on the survey.user_input.
- Improve warning message when user tries to create credit note
- Hide 'Active' column in Taxes/Currencies and added default 'Active' filter in Taxes
- Removed 'save this page...' under 'Account Follow-up Levels','Budget Management',
'Asset Management','Deferred Revenues Management' section in Accounting Settings
- Fixed margin between Cash Rounding checkbox and it's link in Accounting Settings
- Renamed action menu 'Confirm Payments' to 'Post Payments' for payments to make it
consistent with it's form view
- Hide payment acquirers config for non-adviser users and also restric editing access
rights for non advisior and employee user (only data read access rights on payment acquirers)
- Renamed Journal type from 'Sale' to 'Sales' and journals 'POS Sale Journal, Stock Journal,
Cash Basis Tax Journal to Point of Sale Journal, Inventory Valuation Journal and Cash Basis
Taxes Journal respectively
- Renamed the stat button 'Entries' to 'Items' for account assets form view
- Improved description and name of account_voucher module
- Improved Menu typo, Purchase Receipts to Purchases Receipts
- account_check_printing, hr_expense_check: made field storing check numbers character
instead of integer, integer field for check numbers shows check numbers as amount
(i.e., with thousand separator) on UI, which is wrong, hence replaced it with character
type field and a constraint to allow only numbers to be stored in it.
TaskID: 40157
Co-authored-by: Ravi Gohil <rgo@odoo.com>
closesodoo/odoo#21982
Task #1902306
Purpose
=======
The "page" concept is now only present in the user interface.
Surveys are split in "sections" that have two purposes:
- Organizing a (long) survey/certification
- Allow to pick a random questions count for that section (more information here after)
On the user interface, based on the questions_layout field, surveys are displayed:
- On a single page, where sections still appear but are only used as visual separations
- On multiple pages, having one page per section (this matches the previous behavior)
- On multiple pages, having one page per *question*
On top of that page concept, this commit added randomization for the survey questions.
The randomization mechanism will take X questions per section of the survey.
The survey.user_input is initialized with the selected questions to be sure to keep that
set of questions and avoid showing a new set of questions every time the user refreshes the page.
This also allows to easilly go back and know which question we have to show.
Task #1902306
Purpose
=======
This commit adds certification capabilities to the survey module.
A certification is a survey with the "certification" flag set to true than can be linked
to a certification email template that contains a certification document (PDF).
This template can be edited by the user in the technical settings to customize the certification email/document.
To be able to implement this certification concept, we also have to add scoring mechanisms to surveys.
survey.questions of type 'simple_choice' and 'multiple_choice' now have scores for the suggested answers.
These question scores allow to compute a global score that is used to determine whether the user has successfully
passed the certification or not.
As additional features, we also have:
- A time limit with an interface timer that limits the test to X minutes
When reached, the survey is automatically submitted and unregistered (= unsubmitted) answers are not taken into account.
- A limited number of attempts for the survey/certification
If reached, the user can't take the survey/certification anymore
The 'survey result' layout was adapted accordingly to show the success rate of participants and the correct answers
to the survey questions.
Specs
=======
- Create a new survey :
- Add a description field for the survey
- Options on a survey :
- Passing score : (sum of all good answers) in %
- If No scoring => No passing score, no certificate
- If Scoring with answers => Passing score and can see the answers (can create certificate)
- If Scoring without answers => Passing score but can't review the answers at the end (can create certificate)
- for the questions, if "no scoring" selected, can 't see the option "good answer" and "score" on the questions
- If the 2 others options, can see the options "good answer" and "score" on the questions
- all the types of questions are available for each option.
- Questions
- Add the option correct answer on the multiples questions (one or more good answers)
- Certifications
- If scoring, force "mandatory" for "mutliple choices (1or multiple answers)"
- On the dashboard => visual information that this specific survey is a certification
- Time Limit : The student is informed on the home screen of the survey of the time limit.
The clock start when he clicks on "start survey"
- Template of the certificate : send email with attachment PDF
- Front-end :
- Add some margin
- Replace "Back to survey" with the blue-bar from the portal
- Add a timer (start when the survey starts)
- Add a progress bar (number of section and number of question inside the section)
- Analyse of the results :
- First a global graph with the number of people who''ve participated and passed the test
- Stages of a survey :
- Remove the stage "Permanent"
- 3 stages :
- draft : not on-line but can be tested (with phantom token)
- In progress : on-line
- closed : not on-line
- Who can test a survey : the manager and the user. Add this condition to the phantom token.
Task #1902306
Purpose
=======
survey.question is now also the model used for the survey's pages (with the "is_page" field set to True).
This allows to put all the pages and questions together in a o2m field on the view side and
easily reorganize your survey by dragging the items around.
It also removes one level of encoding by directly having 'Add a page' and 'Add a question'
links on the tree view of questions, enabling a faster encoding.
However, this has the downside of making the code reading a little bit more complicated.
Efforts were made at the model level to create computed fields so that the use of these models
still seems somewhat logical. That means:
- A survey still has "page_ids" (question_and_page_ids filtered on is_page = True)
- These "page_ids" still have question_ids (questions located between this page and the next)
- These "question_ids" still have a "page_id"
That makes the use and display of these information at view and controller levels easier to understand.
Task 1933763
Be able to reconcile this scenario :
- You invoiced 00 to a contact—> receivable 00
- You received a 0 bill from the same contact—> payable 0
- Contact pay you 0 (bank statement)
- You want to reconcile all the things easily from bank reconciliation
the story looks like (bank move is the one to be managed) :
```
journ n° compte contact DEBIT CREDIT Mach
sales 12 400000 Clients Azure Interior 100.00€ 0.00 € A1
sales 12 701000 Ventes Azure Interior 0.00 € 100.00 €
purchase 11 440000 Fournisseurs Azure Interior 0.00 € 50.00 € A2
purchase 11 600000 Achats Azure Interior 50.00 € 0.00 €
bank 3 550001 Bank Azure Interior 50.00 € 0.00 €
bank 3 400000 Clients Azure Interior 0.00 € 100.00 € A1
bank 3 440000 Fournisseurs Azure Interior 50.00 € 0.00 € A2
```
closesodoo/odoo#30664
Access rights issues are currently hard to diagnose (especially from
ir.rule) due to how little details they provide.
This makes a pass over various sources of access errors and:
* improve/clarify the base message
* provide an alternative message with more details in debug mode
- [x] ir.model.access
- [x] ir.rule
- [x] related fields
- [x] fields with groups
- [x] close#28451 (provide both _name and _description in access error messages)
Task [1886746](https://www.odoo.com/web?debug#id=1886746&model=project.task&view_type=form&menu_id=4720)
closesodoo/odoo#30144
When an access error bubbles through a related field (aka the user
doesn't have access to the delegate or the delegate's field), append
the "intermediate step" so that it's easier to understand e.g. that
the access error to a partner really comes from accessing a user or
somesuch.
In debug mode, if an access fails due to access rules, try to provide
a clearer error message & include a list of the rules which fail for
the record-set.
Note: for read() operations it'll be a bit misleading as failed
records will get a list of all the rules failing for the recordset,
only some of which might apply to that specific record.
Impacted modules: portal, rating, website_rating, website_slides
This merge modifies the some aspect of posting a message for public
document, in order to implement the rating (message+rating) on a slides
channel.
We now support the use case of posting without having the right to write
on a document, and force the author of the message (as it is required to
be logged to post a message). The security has been improved: to do so,
the document token is not leaked anymore. Only the signed token (by current
partner id) is used.
The rating mixin has been modified to handle displaying average and count
(per document), in an efficient way.
A new frontend message composer is born in website_rating (as it allow to
post a rating with a comment). To do so, a little refactoring of the
Portal Chatter has been done.
For more details, please have a look at the subcommits. They are well
explained and correctly split.
Task-1902304
closesodoo/odoo#30655
When a portal user post a message to review a channel, we
want to allow him to edit its own comment and rating.
This commit modifies the special check access method in
portal to extract the security check and reuse it to
allow user to update its comment on slide.channel only.
We decided to reuse existing widget (new rating popup
composer) to do the message modification.
Task-1902304
This commit fix the display of a label when the user add
a review; when selecting desired stars, the label corresponding
to the star is displayed in a badge.
The bug probably comes from the update to bootstrap 4.
This commit allows user to rate a slide channel: using the new Popup
Rating Composer, users having access to the slide channel can submit
a rating with a comment. Then, lower in the page, they can see the
ratings of other users.
Task-1902304
Before this commit, it was possible to post a message on a document
the user has no access, thanks to a token. In addition to this token,
if a hash (signed token with a partner id), the author_id of the message
was forced.
This commit change a little bit that logic by distinguish 2 cases:
1/ Token only: anyone with the token can post a message on the document. If
the user is not logged (public with token), the author_id will be the
customer of the document (or the public user). This case is moslty used
for business document, through the portal or with the "share link" for
instance.
2/ Signed token: user has no write access to the document, but can post a
message on it. The user have to be logged, as the token is signed with its
identifier. The goal here is to avoid leaking the access token's document
to all visitors. This case is mostly used for public content, such as blog
posts, slides, ...
The token case was already existing. The second is now working with this
commit. To do so, it was required to
- move `_sign_token` from the portal mixin to mail.thread.
- transfering 'pid' and 'hash' parameters from the controller to template
to js widgets.
This commit also change the `_message_post_helper` signature by making
the 3 first parameters required, as to post a message you need at lease
res_model, res_id and the message body. The optional argurments and kwargs
are here to check the bypassing access rights mecanism.
Task-1902304
Rating document available on a website will become more common, but
we want to do it with different UI widget. This commit introduces a
new "popup rating composer": the idea is the rating average is
displayed with stars, and when clicking on it, a popup with the
composer appears. The user can so submit its review.
To do so, we factorize the Portal Composer into a dedicated widget
(instead of natively inside Portal Chatter).
Task-1902304
This commit provides 1 more field on the rating mixin: the average of
the ratings of the document. Before that, the only way to get the
average was to call `rating_get_stats` record per record.
As we are on a mixin, this new field is not stored to avoid recomputation
each time a rating is added. To improve performance, we decided to
compute `rating_count` and `rating_avg` in one `read_group`.
This commit also set an extendable method to get the domain of the
rating to include in those statistics computation, called `_rating_domain`.
This way, each model inheriting the rating.mixin can define the subset of
pertinent ratings.
As consequence, this commit uniformized the way average is displayed:
instead of taking the closer value to the 0.5 value, it only round it
at 2 digits.
Task-1902304
Every new page was being considered an empty homepage with "Welcome to
your Homepage! Let's start designing." shown. Now only an empty homepage
shows that message.
closesodoo/odoo#30839
- if currency is set on vendor, and set that particular vendor to product, the currency will not being changed by vendor's currency.
- after this commit currency in pricelist will be changed by the currency of the vendor
This commit is related to Task ID 1826166
closesodoo/odoo#24468
Between 11.0 and master there was a mismatch in the legal values used to
compute the co2 fee and the ATN of a company car.
Task : 1937082
closesodoo/odoo#30841
* web, web_editor
See sub-commits for details.
Currently, when an user wants to edit the css of its website, he has
access to lots of files and, in debug mode, to even more files. While
the feature is nice for people who know what they are doing, a lambda
person can easily break its website by changing the wrong files. Also,
nothing warns the user that the files that are edited will never receive
updates anymore (unless if they are reset). The goal is to prevent
those behavior while still allowing the add custom css. Another goal
is to be able to *add* custom javascript.
Custom files created for the user:
SCSS: user_custom_rules.scss, user_custom_bootstrap_overridden.scss
JS: user_custom_javascript.js
task-1919350
closesodoo/odoo#29999
* web_editor
Currently, when an user wants to edit the css of its website, he has
access to lots of files and, in debug mode, to even more files. While
the feature is nice for people who know what they are doing, a lambda
person can easily break its website by changing the wrong files. Also,
nothing warns the user that the files that are edited will never receive
updates anymore (unless if they are reset). The goal is to prevent
those behavior while still allowing the add custom css. Another goal
is to be able to *add* custom javascript.
Custom files created for the user:
SCSS: user_custom_rules.scss, user_custom_bootstrap_overridden.scss
JS: user_custom_javascript.js
See https://github.com/odoo/odoo/pull/29999
task-1919350
Purpose of this commit is to prepare future code addition by making some
noise in a separate commit. In this commit we move compute methods below
fields definition because currently it is a complete mess and finding a
given field gives a headache.
Commit linked to task ID 1933820 and PR #30830.
In order to avoid spam and unwanted notification this commit limits auto
subscription on channel when
* creating a channel;
* automatically telling a channel a new publication has been done;
* creating a slide;
As being a follower of a slide channel means following its slides user should
choose manually to be follower of a channel, notably through the UI.
A new way of managing subscription will come with elearning in mind and
therefore auto subscription should be limited.
Commit linked to task ID 1933820 and PR #30830.
This fixes issues with CTRL+A then delete.
Now CTRL+A selects all the contents of the unbreakable node in
which the range is contained. Deleting it all will replace the contents
with `<p><br></p>` so the user can start editing afresh.
Note: Only CTRL+A is handled: ``select all`` in contextual and edit
menus are still handled by the browser.
closesodoo/odoo#30648
In the overrides of _name_search we should avoid creating domains with
huge lists of ids as it is inefficient.
We can also make sure that we optimize the empty search as in this case
the custom domain doesn't make sense, we can simply search on an empty
domain and, thanks to the limit argument, still keep a fast query.
Linked to task 1918906
Thanks to @odony and @nseinlet
closesodoo/odoo#30155
This merge improves the Dashboard app and make it more usable on mobile:
- The layout is fixed to 1 column.
- Embedded Kanban view is fitted to its content and handle correctly empty columns.
- Embedded Pivot view has smaller left indentation for readability purpose.
Task ID: 1904747
closesodoo/odoo#30467
-Moved the share Button to the dropdown Action menu as it was better suitable there.
-moved sale order item field to extra info as it was better suitable there.
-changed display of settings for project to give it organized look.
Related Task ID: 1928422
closesodoo/odoo#30310
Purpose
=======
It only makes sense to display 'Save' and 'Discard' if the user actually
changed something in the settings.
So after this commit, the 'Save' and 'Discard' buttons of statusbar in
general settings will only appear when you make any changes.
Also when there are changes, there will be a message shown that will tell
the user that he/she has unsaved changes.
The commit is related to Task ID: 1917637
Co-authored-by: Mohammed Shekha <msh@openerp.com>
closesodoo/odoo#29726
Purpose of this merge is to update main addons and set activity types used
for automated activities as master data. This means they cannot be removed.
Indeed those activity types are used in business flow to generate activities
and removing them may break some flows.
This commit is linked to task ID 1907970 and PR #29257.
Purpose of the task is to improve the usability of activity types and
activity scheduling.
Another purpose is alto to protect some master data activity types by flagging
them and preventing their deletion.
Containing
* make the activity type as master data so deletion will be prevented;
* improve the usability of the activity type;
* prevent the deletion of activity type which are used for automated activity;
* change the usability of activity scheduling modal;
This commit is linked to task ID 1907970 and PR #29257.
Purpose
=======
Every change to invoice is indicated in the chatter - the state, the
person, and the time is indicated in the chatter.
This is currently not the case for payment - It should be the
case, as if I were in charge of these things, I would like to know who
did what and when.
Specification
=============
Add chatter followup on payment to know who
did what and when.
Related Task ID : 1880825
* website_forum, website_gengo, website_mail_channel, website_sale
Retrieving the global context is now the root's job, this will prevent
problems when trying to extend the values the context has.
See upcoming improvements with https://github.com/odoo/odoo/pull/29442closesodoo/odoo#30816