Commit Graph
2775 Commits
Author SHA1 Message Date
Nasreddin Boulif (bon) 2cdebb3783 [FIX] survey: copy the triggering question to the right question
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

closes odoo/odoo#127681

X-original-commit: 70f7e13c38acd07ea04324bc78e379dac6051e41
Signed-off-by: Nasreddin Boulif (bon) <bon@odoo.com>
2023-07-06 23:44:32 +02:00
Elisabeth Dickinson f590fcb7d1 [FIX] base, web, survey: fix spacings between buttons
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
2023-07-06 20:55:58 +02:00
amdi-odoo 51fdad6ade [IMP] {hr_recruitment_}survey: improve survey test page
* 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

closes odoo/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>
2023-07-04 15:18:20 +02:00
Rémy Voet (ryv) c5cb357d90 [IMP] *: add dependencies to display_name field
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.

closes odoo/odoo#122085

Related: odoo/documentation#4639
Related: odoo/enterprise#42599
Related: odoo/upgrade#4780
Signed-off-by: Raphael Collet <rco@odoo.com>
2023-06-28 17:41:19 +02:00
Rémy Voet (ryv) 3c62ca1eb9 [REM] core: remove name_get API
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
2023-06-28 17:41:19 +02:00
Nikunj Ladava 3cb6785d4b [IMP] survey: raise access error when user dont have access of survey
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

closes odoo/odoo#102612

Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2023-06-23 16:34:46 +02:00
dasz f9bc67fbcd [IMP] survey: adapt survey inherited views to appraisal
change print action's target to new for all surveys.
see odoo/enterprise#37387
task 3127424

closes odoo/odoo#121283

Signed-off-by: Kevin Baptiste <kba@odoo.com>
2023-06-21 20:09:26 +02:00
Samuel Degueldre 81be42d8f9 [FIX] *: ensure tour tips are correctly translated
*: 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.

closes odoo/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>
2023-06-19 13:35:28 +02:00
Saurabh Mishra 46f46b6072 [FIX] survey: prevent question deletion when session in progress
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

closes odoo/odoo#124769

X-original-commit: f636025fce4edda8a5f89b7161c4e9481460f03f
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Signed-off-by: Saurabh Mishra (sami) <sami@odoo.com>
2023-06-13 07:39:01 +02:00
Vivek Pathak 94601f6ec4 [IMP] survey: graph conditions change for MCQs with one answer
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.

closes odoo/odoo#120629

Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2023-06-07 14:43:16 +02:00
Pratik Raval (PRRA) ea35602ff2 [FIX] survey: hide limit attempt field when survey_type is live_session
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

closes odoo/odoo#123596

X-original-commit: d5d0b97b9ada57f43b026da758a0f0044519f460
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-06-05 11:49:55 +02:00
Martin Trigaux 2afdda2576 [I18N] *: export saas-16.3 source terms
closes odoo/odoo#123046

X-original-commit: 137f5ca0cb703ee953cb01db525362f7a778e6bd
Related: odoo/enterprise#41703
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-06-01 11:43:51 +02:00
Adrien Dieudonne 42a458f144 [FIX] web, *: x2many list horizontal overflow
Follow-up of https://github.com/odoo/odoo/pull/121468

Since https://github.com/odoo/odoo/commit/9f4622492c5cd84847368d32bf02b0b538a6dd69 (16.2), ´additionalClasses´ has to be added on the field
instead of the component.

closes odoo/odoo#122963

X-original-commit: 82228e65b59427d536f10970cd85610136347ff8
Signed-off-by: Michaël Mattiello (mcm) <mcm@odoo.com>
2023-05-31 09:23:16 +02:00
Damien Bouvy 5a51d7246d [FIX] survey: css issue with empty view helper
X-original-commit: cdd0989643c6b2bc8d03a577d07f0e8f7230029e
Part-of: odoo/odoo#122111
2023-05-23 22:32:45 +02:00
Damien Bouvy fa50fb9277 [FIX] project: alignment issue
X-original-commit: 43cf1e63e757ffab84fd411a210281b49fd3a0d9
Part-of: odoo/odoo#122111
2023-05-23 22:32:45 +02:00
Florian Charlier def0e28fb9 [FIX] survey: fix and refactor tour session manage
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

closes odoo/odoo#122107

X-original-commit: 79caedee3141d9882ffa54abe0302fc52ea6a9fe
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2023-05-23 18:02:06 +02:00
FrancoisGe ddf67f83be [FIX] *: tests: utility to mock RPCError
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.

closes odoo/odoo#121932

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-05-23 16:32:04 +02:00
Adrien Dieudonné fdf4cbf600 [FIX] web, *: x2many list horizontal overflow
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

closes odoo/odoo#121979

X-original-commit: add1df806157c074fd1a3224d1d8bdf1922481fb
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2023-05-23 08:42:12 +02:00
Louis Wicket (wil) 04189318cc [I18N] *: update master translations
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).

closes odoo/odoo#121629

Related: odoo/enterprise#41171
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-05-22 17:52:07 +02:00
Brieuc-brd fa60bac197 [IMP] *: app icons : add viewBox attribute
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
2023-05-22 13:54:08 +02:00
Brieuc-brd ee75969979 [IMP] *: app icons: replace svg to png
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
2023-05-22 13:54:07 +02:00
Martin Trigaux 077bbd0b0b [I18N] *: export master source terms
closes odoo/odoo#121563

Related: odoo/enterprise#41140
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-05-17 10:34:00 +02:00
Aman Patel a4ab4fa76c [FIX] survey: send email toggle button fix
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

closes odoo/odoo#120236

X-original-commit: 7962a7b751e18cea55b6f72208583931beec6b08
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-05-17 09:29:55 +02:00
Pierre Paridans eef262abf4 [FIX] *: adapt QUnit tests and tours
[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
2023-05-12 22:59:22 +02:00
Brieuc-brd 418413e499 [IMP] web, *: directional icons
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
2023-05-12 22:59:22 +02:00
Elisabeth Dickinson 80098df3dd [FIX] *: fix ribbons position and size
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
2023-05-12 22:59:21 +02:00
Damien Bouvy 1e706d3069 [IMP] web, *: milk adaptations
*: 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
2023-05-12 22:59:19 +02:00
Elisabeth Dickinson b2ef35a431 [IMP] *: replace .bg-color by .text-bg-color on ribbons
Also remove unnecessary CSS on ribbons.

Part-of: odoo/odoo#116641
2023-05-12 22:59:16 +02:00
Brieuc-brdandElisabeth Dickinson 21d87a3da5 [REF] *: milk graphical assets
- apps icons
- base: replace demo avatars Mitchell, Marc and Joel
- mail: replace odoobot avatar

Part-of: odoo/odoo#116641
Co-authored-by: Elisabeth Dickinson <edi@odoo.com>
2023-05-12 22:59:14 +02:00
Aditya Sharma 2bbe5d438c [FIX] survey: traceback while opening multiple answer question
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

closes odoo/odoo#120618

X-original-commit: c65c15eaab4b6e62e671c00a25d2aef2287d4387
Signed-off-by: Stéphane Debauche (std) <std@odoo.com>
2023-05-10 02:00:43 +02:00
Pierre-Yves Dufays a0a78f807a [IMP] survey: simplify survey form
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

closes odoo/odoo#115297

Related: odoo/enterprise#38268
Related: odoo/upgrade#4464
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2023-05-08 15:18:10 +02:00
Bruno Boi f22961ad07 [FIX] web,*: repair root class attr
*: 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>
2023-04-27 16:10:30 +02:00
Julien Carion (juca) eaacaf122d [IMP] web, *: Add autoresize hooks
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

closes odoo/odoo#117355

Related: odoo/enterprise#39493
Signed-off-by: Géry Debongnie <ged@odoo.com>
2023-04-25 14:07:15 +02:00
Renaud Thiry 87b0189ff1 [IMP] mail: remove default logo
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
2023-04-24 10:20:12 +02:00
Pulinckx Pierre (PIPU) 608e90e998 [REF] *: Replace underscore functions by native JS
Replace _.map(), _.flatten(), _.delay(), _.contains(), _.pluck(), _.isUndefined(), _.isEmpty(), _.isString(), _.isEqual(), _.isBoolean(), _.memoize(), _.invoke(), _.bind(), _.escape(), _.debounce(),
_.str.sprintf(), _.str.repeat(), _.str.startswith(), _.str.trim(),
_.str.escapeHTML(), _.str.escapeRegExp(), _.str.startsWith(), _.str.include()

closes odoo/odoo#118012

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2023-04-20 11:57:29 +02:00
Rémy Voet (ryv) 234db70d86 [IMP] *: Use the new API of _read_group for backend use
Part-of: odoo/odoo#110737
2023-04-19 21:58:27 +02:00
Xavier-Do 608c1ea100 [FIX] tests: check test tags *_install
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')

closes odoo/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>
2023-04-19 11:01:13 +02:00
Andro Gvivradze 6540944fb4 [IMP] survey: make certification reports editable by studio
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

closes odoo/odoo#113469

Related: odoo/upgrade#4503
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2023-04-19 11:00:51 +02:00
Antoine Boonen (aboo) 938c47a76e [FIX] survey: adapt to new feature in 16.
Version 16 has new description for field. This commit adapts the field definition to that new API.

OPW - 3258716

closes odoo/odoo#118488

X-original-commit: af099eadfae9d5018ff1094208ca1c1d640af17f
Signed-off-by: Vranckx Florian (flvr) <flvr@odoo.com>
Signed-off-by: Antoine Boonen (aboo) <aboo@odoo.com>
2023-04-14 10:44:58 +02:00
Pulinckx Pierre (PIPU) 614de86989 [REF] *: Replace underscore function by native JS
Replace _.isNumber(), _.filter(), _.reject(), _.unique(), _.indexOf(), _.lastIndexOf(), _.findIndex(), _.range()
_.keys(), _.values(), _.str.sprintf() and some _.each()

closes odoo/odoo#118003

Signed-off-by: Géry Debongnie <ged@odoo.com>
2023-04-13 16:40:11 +02:00
Aurélien Warnon 66a49c7ae8 [IMP] survey: scored questions need at least one correct answer
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

closes odoo/odoo#115322

Signed-off-by: Stéphane Debauche (std) <std@odoo.com>
2023-04-12 20:43:53 +02:00
Nikunj Ladava 35bd7c43b0 [IMP] survey: move data creation to setupclass
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
2023-04-12 18:58:22 +02:00
Michael (mcm) ff0d6dd580 [REF] *: replace odoo module by native one
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

closes odoo/odoo#117305

Related: odoo/enterprise#39118
Signed-off-by: Géry Debongnie <ged@odoo.com>
2023-04-03 17:07:24 +02:00
Géry Debongnie 332c781ff6 [FIX] web: make mock_server implementation closer to orm
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.

closes odoo/odoo#117434

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-04-03 12:56:54 +02:00
Mahamadasif Ansari 1de2820e5c [FIX] survey: consider question as normal if question selection is random
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

closes odoo/odoo#117048

X-original-commit: 73552632b4397ebad1149c6e394ce4ff6d0f0d1e
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2023-04-03 12:56:51 +02:00
Nikunj Ladava 65190c9d72 [IMP] survey: add tooltip for presenter on live survey
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

closes odoo/odoo#97713

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-03-30 08:49:57 +02:00
Olivier Dony 3e5880236e [FIX] survey*: add missing index FKs for performance
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).

closes odoo/odoo#116875

X-original-commit: 2dc929cd530ba4fd80c17f91af2bfad02a819dd6
Signed-off-by: Olivier Dony (odo) <odo@odoo.com>
2023-03-29 23:37:17 +02:00
Patrick Hoste 14b7eff7c2 [IMP] survey: move scoring graph data to review answer page
This commit moves the graph data the user got at the end
of the survey to the review answers section.

Task-2991360

closes odoo/odoo#114130

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-03-28 13:43:20 +02:00
Aurélien Warnon baef8dee44 [FIX] survey: fix invite modal layout
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

closes odoo/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>
2023-03-22 18:09:05 +01:00
Florian Charlier 1353cd8687 [FIX] survey: fix _compute_allowed_triggering_question_ids
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

closes odoo/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>
2023-03-20 19:15:25 +01:00