Steps to reproduce:
- Install 'survey' module
- Create a survey with 2 questions
- Change the sequence of the questions
- Edit the second question (last in the sequence)
- Set it as conditional
- Select first question as trigger (with any answer)
- Duplicate the survey
Issue:
The triggering question is not set on the right question.
Cause:
When copying the survey, we map the old question to the new ones but
there are by default sorted by order of creation and not by sequence
and therefore the mapping is wrong.
Solution:
Order the questions and answers by sequence before mapping them.
opw-3330476
closesodoo/odoo#127681
X-original-commit: 70f7e13c38acd07ea04324bc78e379dac6051e41
Signed-off-by: Nasreddin Boulif (bon) <bon@odoo.com>
Some buttons were stuck together or some had too much of a gap between
them, this commit aims to harmonize the space between buttons.
task-3378519
part of task-3326263
X-original-commit: 68d16f5b2131f44b2dfc3a5d6756aea8987b3fd5
Part-of: odoo/odoo#127613
* Remove close button from the edit banner when
testing a survey so that users can't hide it anymore.
* Reduce height of the banner to align with the
website Home/Go-to-backend button.
* Open Test survey in a new tab
Task-3374928
closesodoo/odoo#127219
X-original-commit: e312a956af52fcd0627c8d169fc86bee035e2dea
Related: odoo/enterprise#43590
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Signed-off-by: Amélie Dieudonné (amdi) <amdi@odoo.com>
The previous commit introduced an optimization to reduce the number of
queries and fields fetched when we call `name_search`. But it works much
better when the dependencies of `display_name` contain field names used
in the calculation (on the same record/model).
Then, to improve the performance and the cache coherency, add `depends`
and `depends_context` depending on the custom `_compute_display_name`.
Add only the first level of dependencies (never traverse relational
field) because only these have a positive impact on the previous
optimization and the cost is very low (see `modified`).
About `depends_context`, we don't include `lang` because (when `_` is
used by example) it is unlikely to get the same display_name in the same
request with two different lang.
closesodoo/odoo#122085
Related: odoo/documentation#4639
Related: odoo/enterprise#42599
Related: odoo/upgrade#4780
Signed-off-by: Raphael Collet <rco@odoo.com>
Rationale
=========
Since v8, the `display_name` field is present on all models. By default,
`display_name` uses `name_get` which has pretty much the same purpose
(return record name used by the web client). Gradually, many (backend)
developers (and the ORM: https://github.com/odoo/odoo/commit/6da1c3ac4c036eac289597602976538e243cb939)
started using `display_name` (more convenient than
`record.name_get()[0][1]`) but it still had the `name_get` override.
It becomes more complex than necessary and poeple start to misunderstand
the two (and sometimes override both, leading to inconstiencies between
`display_name`/`name_get`).
To simplify the ORM and the API, we decided to keep only one of them,
the `display_name` field:
- It is much more convenient from a backend point of view
(`record.name_get()[0][1]` vs `record.display_name`)
- It is cached during the same transaction (and invalidated if
its dependencies change)
- It can be overridden like any other compute field (override
`_compute_display_name` with any extra dependencies)
- `name_get` is replaced by `read(['display_name'])`
(API perceptive), which can actually be more efficient
(if `display_name`'s depends are correct, the ORM will only fetch the
fields it needs instead of every prefetchable field)
Changes
=======
- Deprecates `name_get` for the v17 and based the method on
`display_name` (the opposite of before)
- Converts all usage of `name_get`
- Overrides of `name_get` are now overrides of `_compute_display_name`
- For `res.partner`, rename the field store `display_name` into
`complete_name` because `display_name` context-dependent and it makes
no sense to have a compute store that is context-dependent.
- Previously, it was possible to return multiple names for the same
record with `name_get`, but it was tricky and most of the usage of
this `name_get` didn't take this into account. The only example of
this is the `name_get` of `product.product`
(now use `", ".join(<names>)`).
Part-of: odoo/odoo#122085
before this commit,
once users got an invitation to fill out any survey and if they log in with
another credential than the shared credentials, they will be redirected to the
home page instead of a survey.
after this commit,
if the user tries to fill out the survey with another credential, an error
will be raised that the user doesn't have access
Task-2960271
closesodoo/odoo#102612
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
*: account, crm, crm_iap_mine, event, hr_expense, hr_holidays,
hr_recruitment, lunch, mail, mass_mailing, point_of_sale, project,
purchase, purchase_stock, sale, survey, web, website, website_blog,
website_event, website_forum, website_sale, website_slides,
test_main_flows
In odoo/odoo#111103 the tour system was rewritten. The previous tour
system used to depend on the `root.widget` js module, and this module
was an async module that indirectly depended on `session_bind` which
would load the translations, meaning that the js module definition code
of the tours would only run after the translations were loaded. This is
no longer the case with the new tour system, this means that the module
definition code is executed as soon as the dependencies of that module
are fulfilled, which is generally befoe the translations are loaded,
causing most tour tips to not be translated.
This commit adds a hacky workaround for this problem: it creates a new
module that has a default export which is a promise, and has a legacy
alias, this creates an async module that waits for the translations to
be loaded. This module is then imported for its side-effect in all
onboarding tours, causing them to be translated correctly once again.
This commit also needs to convert the steps key in the tours internal
registry to a getter. In previous versions, the steps were directly
added as is to the internal state of the tour service, but since
odoo/odoo#122834 the steps are now mapped, and without a getter, any
edits to the steps occurring after registration will not be taken into
account. This causes issues in some modules that change original
behaviour of other modules (eg accounting makes invoices into a menu in
the accounting app instead of a top-level app in the home menu) as they
need to edit the steps of existing tours to make them work.
In a separate PR, we will implement a more proper fix by changing the
API of the tour manager so that we no longer need this workaround.
closesodoo/odoo#125284
X-original-commit: d130699ba82dc9919c9116f4b64a5e461ebb6319
Related: odoo/enterprise#42655
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Samuel Degueldre (sad) <sad@odoo.com>
If we create a survey and start a new session. When the session state is in
progress and If the survey creater deletes a question and participant tries to
answer the deleted question and submits it then participant will face the issue
of 'False is not in list'.
This commit will raise an usererror if the survey creater tries to delete the
question when the survey session is in progress.
sentry-4113791861
closesodoo/odoo#124769
X-original-commit: f636025fce4edda8a5f89b7161c4e9481460f03f
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Signed-off-by: Saurabh Mishra (sami) <sami@odoo.com>
This commit improves the behavior of MCQs with one answer. Previously, when
there were multiple correct answers and any one of them was selected,
a "partial" graph was displayed instead of a "correct" graph. With this commit,
the behavior has been modified as follows:
- If the selected option is correct and has any score, the "correct" graph will
be shown.
- If the selected option is incorrect but scores are above zero, the "partial"
graph will be shown.
- If the score is zero or less and the option is not correct, the "incorrect"
graph will be shown.
Task- 3252605.
closesodoo/odoo#120629
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
fix-up of https://github.com/odoo/odoo/commit/a0a78f807abd15cb64994aa626a48a0589e16570
Currently, When a user selects 'Live Survey' as the survey type, the
`is_attemps_limited` field is visible although it should be hidden.
This commit fixes this issue by hiding the field when the survey type
is set to 'Live survey'.
Along with that, this commit also removes the condition that hides the
`is_attemps_limited` field when there is/are conditional question(s) in the
survey.
TaskID-3326930
closesodoo/odoo#123596
X-original-commit: d5d0b97b9ada57f43b026da758a0f0044519f460
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Two problems were identified, causing intermittent tour failures.
1. Data not yet fetched
In this tour, we modify the SessionManager widget to trigger the
loading of participants input immediately after the widget's start.
This is however a chain of promises, and it sometimes happened that the
tour proceeded to the next step between these, i.e., before the question
results were fetched. The simplest fix is to use the progress bar
(`.o_survey_session_progress_small`) whose width is updated only once
records are loaded.
2. Click for next screen not yet handled
Likewise when triggering _onNext(), we sometimes checked the next tour
step before the DOM could be updated.
When going forward, we can rely on the "next button"'s tooltip which
is updated last.
We also take this opportunity to refactor the code to use more recent
JS syntax and Odoo tools.
Task-3284627
closesodoo/odoo#122107
X-original-commit: 79caedee3141d9882ffa54abe0302fc52ea6a9fe
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
In this commit we add the makeServerError utility which allows you
to easily create a valid RPCError in the tests.
We have added this utility to prevent the use of invalid or incomplete
errors. We will give default values for all the parameters needed for
a valid RPCError.
For example, in some tests, we only check the presence of an error
dialog and not the expected one. So there was a set of tests that were
green because the failure was in the RPCError handling. So we had an
error dialog but it was not the right one. In general, the crash occurred
because the RPCError contained no data.
closesodoo/odoo#121932
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
This issue only occurs on Firefox because ´has´ is not supported
and the following rule is not applied:
https://github.com/odoo/odoo/commit/2cd0106e63785dd34553c2b4747d72b93b9a7afd
Anyway, there is an existing css rule that is applied if the field
class is correclty added.
Steps to reproduce:
- Open Sale
- Add some content in the sale order line
opw-3201461
opw-3285854
opw-3266130
opw-3244581
closesodoo/odoo#121979
X-original-commit: add1df806157c074fd1a3224d1d8bdf1922481fb
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
Currently, only stable releases see their translations updated. This has
resulted in master accumulating outdated stuff for years, which can be
confusing for users testing master on runbot.
This one-shot commit resynchronizes master translations based on the
content from 16.0 and removes empty PO files (i.e. no longer containing
translations).
closesodoo/odoo#121629
Related: odoo/enterprise#41171
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
Prior to this commit, the SVG's viewBox attribute was missing, which
prevented svgs from being scaled.
This commit fixes this issue.
task-3326633
Part of task-3326263
X-original-commit: 30300c373ad1c63a6cf8b035cae0785a09c6933f
Part-of: odoo/odoo#121886
The introduction of Milk has brought new app icons.
Using the svg format creates a lack of anti-aliasing on the edges of the
shapes, which makes the icons look bad.
Since the png size has been reduced, we can afford to use the png format
to have the best possible quality without having a lack of performance.
task-3326633
Part of task-3326263
X-original-commit: e07cb722f2b11407a3ad093bd688b7d37afd5a88
Part-of: odoo/odoo#121886
Currently when user tries to share the survey and the access mode is public
(Anyone with the link) , the 'Send by email' button is flickering and not
working properly.
As we have used the widget 'boolean_toggle' it saves everything on Change,
and as a result compute function '_compute_send_email' was called every time
which is not required and caused toggle button to deactivate itself
automatically.
This commit fixes the issue and 'Send by Email' button does not flicker and
works properly by using autosave='False' used from
(https://github.com/odoo/odoo/pull/117103).
Recipients (partner_ids) field is set to required in XML.
Hence we stopped the widget from saving on Change and hence a result every time
compute method is not called and toggle button maintains its state.
Task-3240813
closesodoo/odoo#120236
X-original-commit: 7962a7b751e18cea55b6f72208583931beec6b08
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
[FIX] *: selectors in tours
[FIX][TMP] account: CogMenu selector in tours
[FIX][TMP] web*: Breadcrumb targetting in tours
Adds a `o_breadcrumb` class to target the whole breadcrumb, no matter
how much elements it contains (collapsed parts, visible path, single
name...).
add classname on last breadcrumb item
[FIX][TMP] project: View buttons selector in tours (moved away from CP)
[FIX][TMP] project: Kanban selectors in tours (quick create)
[FIX][TMP] *: SearchBar selectors in tours (toggle menu)
[FIX][TMP] *: ButtonBox selector in tours
[WIP][IMP] web: add toggleSearchBarMenu in search helpers
adapt and unskip 3 list tests
adapt and unskip calendar tests
unskip web_tour test that actually pass
post rebase fix
allow to lose cell focus after multi edition (given to searchbar) - bug reported, to check later
post rebase fixes
fix
Part-of: odoo/odoo#116641
This commit adapts the directional icons to improve the usability and
maintain consistency with the ui icons library.
task-2818586
Part-of: odoo/odoo#116641
This commit fixes the ribbons used in `kanban` and `form` views.
The SCSS uses the square root of the parent `div.ribbon` to calculate its
diagonal width and applies that width to the child `span`.
After changing the ribbon's transform-origin, we calculate the ribbon's
position based on CSS variables of the view's top padding,the height of
the ribbon and the shadow's size (to avoid it being cropped by
overflow-hidden).
By changing the values of a few of these variables in the kanban view,
we were able to remove all the specific SCSS related to ribbons in the
modules.
Other changes were applied inside some of the modules to make this
work:
- `event`: padding corrections on the kanban's cards;
- `hr_holidays: replaced `margin:0` in the SCSS with negative margin
utility classes on the element to achieve the same visual result;
- `discuss`: moved the ribbon to the parent element;
- this was also done to `discuss`, `survey` and `helpdesk`;
- `crm_team_view` in `sales_team`: the ribbon's height made it overflow
from the kanban's card. We fixed this by changing the value of one of
the CSS variables in the view's SCSS file;
- the same thing was done in `survey` and `appointment`;
- `website_event_exhibitor` had some SCSS that wasn't being used because
it uses `.o_ribbon` instead of `.ribbon`
task-2818586
Part-of: odoo/odoo#116641
*: hr_holidays, stock, sale, product, web, sale, purchase, stock,
website, survey
Adapt some custom control panels (mainly for custom reports) to the
milk controlpanel.
hr_holidays:
Move the buttons to create a new time off or a new allocation to the
"create button" slot and transform it into a dropdown (creating
allocation requests is clearly a secondary action, not a primary one)
stock:
3 lines does not fit, must be on 2 lines
Part-of: odoo/odoo#116641
The above two fields, which we are cleaning up, were added to fix the
resequencing issue https://github.com/odoo/odoo/pull/108450.
The other problem that remains here is that whenever we are opening the multiple
choice question from the (survey.survey) form view after changing the question
selection field, we get traceback.
The problem was generic, so a more generic fix was pushed into the JS framework
https://github.com/odoo/odoo/pull/116561 ,which solves the earlier resequencing issue. So here we are cleaning up
the earlier fix, which is unnecessary now. And by this issue while opening multiple
choice question also resolves.
Task-3127646
closesodoo/odoo#120618
X-original-commit: c65c15eaab4b6e62e671c00a25d2aef2287d4387
Signed-off-by: Stéphane Debauche (std) <std@odoo.com>
In order to ease the creation of survey, we simplify the option form in survey
by adding a new field survey_type in survey_survey. Thanks to it, we only
display relevant options in the form depending on the survey type chosen.
We also adapt the "no content helper" which help the user to create his first
survey with an example for each survey type (mostly a renaming).
Technical note: in hr_appraisal, the added survey type is used instead of the
field is_appraisal, which is removed as we don't need it anymore. The value of
the field is_appraisal is used during the upgrade to set the survey type to
appraisal when that field is true.
When changing the survey_type, some fields are updated to guide the users. For
some fields, we also set them in readonly. But in that case, the updated value
is not saved. That's why we have added the force_save="1" attribute for those
field in the form.
Task-3061869
closesodoo/odoo#115297
Related: odoo/enterprise#38268
Related: odoo/upgrade#4464
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
*: web + adaptations in base, fleet, hr, hr_expense, hr_recruitment,
loyalty, lunch, mail, mass_mailing, note, project, stock, survey,
web_tour
**Foreword**
Since d19037e141 the rootnode class attribute for form/list views was
copied two times:
- on the o_view_controller div
- and on the root node of the view renderer.
Examples:
<form class="foo">...</form>
gives
<div class="o_view_controller o_form_view foo">
<div class="o_control_panel">...</div>
<div class="o_content">
<div class="foo o_form_editable ...">...</div>
</div>
</div>
and
<list class="foo">...</list>
gives
<div class="o_view_controller o_list_view foo">
<div class="o_control_panel">...</div>
<div class="o_content">
<div class="o_list_renderer foo ...">...</div>
</div>
</div>
**Issue**
This could lead to confusion and also unexpected styling issues.
See this PR #119815 to read a message JS Framework team has received.
See also another a fix that had to be made for x2m fields: 980244fa8
**Introduced Changes**
- in the form compiler, the root node attributes are no more copied to
the root div node of the compiled template the form renderer receives
- the root div node generated by the form compiler now has the
"o_form_renderer" class, which was removed during the recent form view
refactoring.
- the list renderer no more adds the root node class attribute to its
"o_list_renderer" div
- the X2ManyFieldDialog has been adapted too
- since View, X2ManyField & X2ManyFieldDialog both need to compute view
classnames derivated from the arch root node, an util has been
introduced to avoid duplicating code
- the whole codebase has been checked and adapted.
Related: odoo/enterprise#40418
Signed-off-by: Mathieu Duckerts-Antoine <dam@odoo.com>
This commit adds two autoresize hooks for text inputs and textareas to
make it adapt their size (width for text inputs, height for textareas)
depending on their content.
The commit therefore solves the issue of several form view task titles
being restricted to 1 line while it can be annoying if the title is too
long. The autoresizeTextarea feature was moved from TextField to the
autoresizeTextarea hook and the autoresizeInput feature was moved from
the AutoresizeInput mail component to the autoresizeInput hook.
The TextField component has a new option for disabling linebreaks.
task-3138826
closesodoo/odoo#117355
Related: odoo/enterprise#39493
Signed-off-by: Géry Debongnie <ged@odoo.com>
Many templates use the company logo that is set by default on
database creation. As that logo is clearly a placeholder and the user
isn't necesserely prompted to update it. It's possible for a user to
inadvertently start sending emails with "your logo" placeholders
plastered all over.
This removes the default logo of the company and removes it from
templates conditionally.
The logo isn't simply replaced with a transparent PNG as the templates
set a fixed height for the logo, which would look weird.
task-3067315
Part-of: odoo/odoo#106307
Making a test post_install using @tagged should always remove the
at_install tag.
The main reason for that is that runbot split config select if an
at_install or post_install tests should be executed is using negation:
`--test-tags -post_install`. The reason for that is that giving a positive tag will
replace the "standard" tag and non standard tag could be executed if
giving `--test-tags at_install` (without negation)
Since runbot tests in parallel builds, one of them using
`--test-tags -post_install` and the other `--test-tags -at_install`,
a test that is both post install and at install wont be executed at all.
Also, a tests with both tags will be executed twice
in a normal flow, usually not intended.
The correct way to make a test post_install is to use
@tagged('post_install', '-at_install')
closesodoo/odoo#118969
X-original-commit: d1db306b212d4abb5b2faab9e56c8e83b85c53b9
Related: odoo/enterprise#39966
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
The goal of this commit is to make certification reports editable by
studio. We also move certification reports into separate report folder
from views, and merge modern and classic views into one. This way we avoid
duplicated code and at the same time the structure will make more sense since
it is already working as a single template.
Task-3148819
closesodoo/odoo#113469
Related: odoo/upgrade#4503
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
Version 16 has new description for field. This commit adapts the field definition to that new API.
OPW - 3258716
closesodoo/odoo#118488
X-original-commit: af099eadfae9d5018ff1094208ca1c1d640af17f
Signed-off-by: Vranckx Florian (flvr) <flvr@odoo.com>
Signed-off-by: Antoine Boonen (aboo) <aboo@odoo.com>
This commit slightly modifies the condition to be considered as a
"scored question" for questions of type simple/multi choice.
Now, to be scored, you need to have at least one correct answer.
This notably allows not showing "incorrect answer: 1" when displaying survey
statistics as there is no way to get it correctly.
Task-3224732
closesodoo/odoo#115322
Signed-off-by: Stéphane Debauche (std) <std@odoo.com>
Move data creation of survey tests from setUp to setupClass as there is no reason
to completely re-create data in between every test and this increases the test
speed without drawbacks.
Task-2199207
Part-of: odoo/odoo#79119
This commit converts almost all odoo module by native module.
The goal is to deprecate odoo.define in favor of native module and then
simplify boot.js by removing the regexp that finds module dependencies.
task id: 3162300
closesodoo/odoo#117305
Related: odoo/enterprise#39118
Signed-off-by: Géry Debongnie <ged@odoo.com>
The mock server implementation does not exactly match the actual orm
implementation. It is not really a big deal, but it makes the test suite
less useful.
In particular, the onchange call should return a value for all fields
when we are creating a new record. Also, the default get implementation
was not exactly correct.
The motivation for this change is to prepare the future relational model
refactoring.
closesodoo/odoo#117434
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Currently in the survey:
- If we have a conditional question and the question selection mode is
random and we select the question layout as one page with all questions
or one page per section, the conditional question is not visible. This
happens because the random mode condition is ignored.
- If we have a conditional question and the question selection mode is random
and we select the question layout as one page per section, the traceback is
generated when we start the survey. This is because it is trying to get value
from the "selected_answer", which does not exist in random mode.
Expected behaviour is If the question selection mode is random, the conditional
questions are considered normal and visible and do not generate a trace back if
the question layout is one page per section.
This commit fixes the above issue by adding a condition that treats
the conditional question as a normal question when the question
selection mode is random.
task-3142209
closesodoo/odoo#117048
X-original-commit: 73552632b4397ebad1149c6e394ce4ff6d0f0d1e
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
While presenting a survey, sometimes it is good to know what content
will be next. However, this is not possible currently.
This commit improves the behavior to display a tooltip msg on the right
arrow so that the presenter/speaker knows what is next.
Task-2791000
closesodoo/odoo#97713
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
1) `survey_user_input.slide_partner_id`: this is a sparse column (so using
`btree_not_null` means a very small footprint). But it makes a ton of
difference when trying to delete a slide.slide.partner entry.
e.g. on a db with 500k survey inputs, the deletion of 1000
`slide.slide.partner` records goes from 40s to 100ms (400x speedup)
2) `survey_user_input_line.survey_id`: this is the inverse field of the
`survey_user_input.user_input_line_ids` O2M field, so the index is
always useful to retrieve the O2M lines. It will also marginally help
for cascading the deletion of any `survey_user_input` record from
case 1).
closesodoo/odoo#116875
X-original-commit: 2dc929cd530ba4fd80c17f91af2bfad02a819dd6
Signed-off-by: Olivier Dony (odo) <odo@odoo.com>
This commit moves the graph data the user got at the end
of the survey to the review answers section.
Task-2991360
closesodoo/odoo#114130
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
This commit fixes a small issue in the survey invite modal layout.
The label and the associated field for the share link did not have a matching
attrs configuration, leading to an extra label which broke the form visually.
Oversight of 220e0271bf
Task-3203875
closesodoo/odoo#116234
X-original-commit: c68b56254005eb94ad90192e6cf8648866aca55d
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
If the method were called on several new questions from different
surveys at the same time (can it happen?),
allowed_triggering_question_ids would include questions from all
surveys for each of them.
A unit test of the method is also included.
Introduced in b1d18562.
Task-3226408
closesodoo/odoo#115930
X-original-commit: e506e8b049c61d5b772370792541b6875d5e5d72
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
Signed-off-by: Florian Charlier (flch) <flch@odoo.com>