Commit Graph
329 Commits
Author SHA1 Message Date
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
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
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
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
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
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
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
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
Joseph CaburnayandJulien Mougenot 3a798039d6 [REF] web_tour,*: convert web_tour to owl
* The tours are now run by the `MacroEngine` defined in `macro.js`.
  * This is accomplished by converting (at runtime) the user-defined tours to
    `Macro`s. See `tour_compilers.js` for the step (and tour-to-macro) compilation.
* API is kept the same as much as possible. Basically, declaring tours stayed
  the same with some exceptions:
  * `allowInvisible` can be provided in a step to allow consuming the trigger
    element even if it is invisible.
  * `isCheck` can now be used to replace the no operation `run` that is
    traditionally signals the runner to only perform a check.
  * Before, multiple `run`s can be called simultaneously. Now, each `run` method
    is awaited before proceeding to the next step.
* If the trigger element is `disabled`, the tour runner will *not* proceed on
  calling the `run` method and the runner will stay on current step until the
  trigger element becomes `enabled`.
  * However, the tour runner is okay with `disabled` trigger element if the step
    has `isCheck = true`. As long as the trigger element is found for `isCheck`
    step, the tour runner will happily move to the next step.
* Some tours are adjusted to properly run with this new tour runner.
* When the tour failed:
  * The dom string is not logged anymore.
  * However, a warning message containing the relative location of the step will
    be logged. This is better in helping the author in locating the failed step.

**Some guidelines learned during the development:**

* Each step may trigger a dom mutation. It's a good practice to insert an
  intermediate step that *checks* the existence of an element that result from
  the action of the previous step.
* Refrain from using the `run` method for assertions. `run`, in principle, is
  provided to perform actions that are not offered by the helper. Use the
  `trigger` for assertions.
* During dev, find `SHOW_POINTER_DURATION` and set it to `250`. This will show
  the pointer (pointing to the trigger element) for 250ms when watching the
  tour.

closes odoo/odoo#107618

Task-id: 3082036
Related: odoo/enterprise#37560
Signed-off-by: Géry Debongnie <ged@odoo.com>
Co-authored-by: Julien Mougenot <jum@odoo.com>
2023-03-15 13:19:45 +01:00
Louis Wicket (wil) 9afe7c74c9 [IMP] *: remove "French spacing" 👺
According to Wiktionary, French spacing is "the archaic practice (though
still current in French) of inserting a space around colons, semicolons,
question marks, and exclamation marks". This is not standard practice in
English and most languages of the world.

The purpose of this commit is to start purging the code from this typo,
as it may reflect poorly on the software for some people.

closes odoo/odoo#114533

Related: odoo/enterprise#37853
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-03-14 15:52:10 +01:00
amdi-odoo 226ed6001d [IMP] survey: add matrix visual help
Purpose
=======
In addition to the current alert message, when a user
forgot to pick an answer in a matrix, highlight in red
the rows where the answer is missing.

Task-3162051

closes odoo/odoo#111715

Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2023-03-09 09:41:40 +01:00
Bruno BoiandMathieu Duckerts-Antoine d19037e141 [IMP] web,*: better classes handling in view archs
**Before this commit**
- The optional "class" attribute set on the root node of a view arch
  is ignored, except for the kanban view which has a custom
  way of using it.
- The optional "js_class" attribute set on the root node of a view arch
  does not have any impact on the class names passed to its controller.

**After this commit**
The content of the optional attribute "class" set on the root node of an
arch like in

<list class="o_custom_class">
    ...
</list>

as well as an additionnal class derived [1] from the value of the
"js_class" attribute set on the root node of an arch like in

<list js_class="extended_list">
    ...
</list>

will both be found in the prop "className" of any view controller.

[1] a js_class value of "xyz" yields to the class "o_xyz_view"

**Note on this commit**
The kanban view was already appending the root node class attribute
to its renderer element. This is no longer the case and some styling
rules has been adapted.

closes odoo/odoo#113014

Related: odoo/enterprise#37265
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Co-authored-by: Bruno Boi <boi@odoo.com>
2023-03-01 17:01:03 +01:00
Thomas Josse (thjo) 09c2b5cdbd [FIX] survey: adding test for QuestionPageListRenderer
This commit adds a QUnit test to ensure that the colspan value for the title
column of a section in a List View is correctly computed in order to let enough
space to edit the `random_questions_count` column.

We are testing 4 scenarios:
 * Without the random column,
 * With the random column,
 * With the question_type column at the start of the row,
 * With the random and question_type columns at the start of the row.

For each scenario, we test the value of colsan of the title column and if
every editable column is indeed being edited when clicked on.

closes odoo/odoo#113564

X-original-commit: 98e6b6e932c595881c1a2e4804b505ee9eec6a63
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-02-28 15:58:57 +01:00
Thomas Josse (thjo) 22e3c9749b [FIX] survey: corrects progress number for random questions
Purpose
=======

Ease the edition of sections.
Make sure we display a correct progress number.

Specs
=====

There is now more space when editing the number of random
questions.
We added an icon on hover to indicate that a section is editable.

When configuring a survey as one page per question, the numbers
near the progress bar where not correct.
With this commit they now are.

Inside this commit we are overriding a function `focusCell`.
This is necessary to enable te user to edit the right column in the view
if those were moved with studio.

Now the method identifies the requested column via its name and not the
actual object.
This is necessary for section rows in which the title column is modified
with an additional parameter `colspan`, rendering the column different from
the original one.

task-2988062

X-original-commit: 737e080bd25fe9136c5606c1f77f94d6cfb0ddf4
Part-of: odoo/odoo#113564
2023-02-28 15:58:57 +01:00
amdi-odoo deaf9939b5 [IMP] survey: add every question type filters
Purpose
=======
Improve the results page filter to allow the filtering
on questions of type text_box, char_box, numerical_box,
date and datetime.

Specifications
==============
Updating the URL filters representation to avoid passing the
question types directly in the URL parameters.

Answer matching per question type:
- char_box, text_box: 'ilike'
- numerical_box, date, datetime: '='
Adding a new filter restricts the current filter results.

Handling the filters depending on the 2 different answer models:
'survey.question.answer': matrix, simple_choice, multiple_choice
'survey.user_input.line': char_box, text_box, numerical_box, date,
datetime.
The filters can be combined but their query count doesn't add up
if their related answers data are stored in the same model.

Task-3138245

closes odoo/odoo#110252

Related: odoo/enterprise#36383
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2023-02-24 17:13:05 +01:00
Thomas Josse (thjo) 6774024e0e [IMP] survey: add fa-pen icon to sections in question ListView
This commit adds an icon on hover of sections inside the questions ListView
to indicate more clearly to the user that they can edit these lines.

task-2988062

closes odoo/odoo#108731

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-02-23 16:08:23 +01:00
FrancoisGe 5126c9b1d4 [REF] *: register widget descriptors instead of components
Before this commit, the widget's description was stored on the
component and this component was then registered.

Now, an object describing the widget is used on registration the same way
as it is done for views since b828cfc.
This split the component's description (props, template, ...) of
the widget's description ( component, extractProps, ...) and makes
it clearer.

We did the same thing for fields in 9f4622492c

Part of task: 3179751

closes odoo/odoo#112962

Related: odoo/enterprise#37215
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-02-21 15:53:06 +01:00
Florian Charlier 145fe958c2 [REF] survey: clean trigger icon rendering
The specific classes used to render the trigger icon should be as
localized as possible (not used in js and xml if not necessary).
We also take the opportunity to simplify the widget `state` items.

At this occasion, we also eliminate the flicker that could occur
with the icon of a triggered question when deleting its trigger.

Task-3151916

closes odoo/odoo#113168

X-original-commit: 5ce6915e66673b7d88363676473154c3ec8fd3aa
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2023-02-21 07:35:02 +01:00
Jordan D. (Joda)andFlorian Charlier 1d8691eb4a [FIX] survey: fix validation on conditional question
What are the steps to reproduce your issue?
1/ Setup
* Create a survey with single select multi choice question
* Create a 2nd question which is also a single-select multi-choice
 question, which appears based on the answer selected for 1st question.
* Create a 3rd question which is a text question which is visible based
 on the answer to question 2.
* All 3 questions are mandatory

2/ Take the survey
* Answer 1st question in a way the 2nd question appears
* Answer 2nd question in a way 3rd one appears
* Change the answer the 1st question in a way 2nd question should not
 appear.

3/ Submit the survey

What is the current behavior that you observe?
Odoo will not allow to submit the survey as it will require an answer
for the 2nd question, even though it should not appear.

What would be your expected behavior in this case?
to be able to submit the survey.

A test tour is added to enforce this logic.

opw-3087514
Task-2987929

closes odoo/odoo#112856

X-original-commit: edb0187ee1ec2c45b7059a2a009a1a361e8ae2cb
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Co-authored-by: Florian Charlier <flch@odoo.com>
2023-02-17 09:50:53 +01:00
Michael (mcm) 9f4622492c [REF] *: register field descriptors instead of components
Before this commit, the field's description was stored on the
component and this component was then registered.

Now, an object describing the field is used on registration the same way
as it is done for views since https://github.com/odoo/odoo/commit/b828cfc72c587d0b73fcc5459695705640437671.
This split the component's description (props, template, ...) of
the field's description (displayName, supportedTypes, ...) and makes
it clearer.

closes odoo/odoo#112498

Task: 3171520
Related: odoo/enterprise#37105
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-02-16 14:13:32 +01:00
Patrick Hoste da33b5547d [IMP] survey: add clone action on question
After this commit, the user will be able to clone a question
inside a survey, the cloned question will have the same sequence
as the original and thus will be displayed just below it.
This commit also remove the is_conditional icon on the overall
questions tree view and the misplaced warning which was
previously introduced in commit [1].

[1] : b1d1856245

Task-3088848

closes odoo/odoo#112385

X-original-commit: bdcc2e6c4bec23c200a3fa2a2b4dd1bb06943f39
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-02-10 11:23:08 +01:00
Aaron Bohy 49297bc7bb [REM] *: remove legacy basic views + some fields/widgets
This commit removes the legacy implementation of the form, kanban
and list views. It also removes the legacy view widget registry,
and all legacy widgets it contained. The legacy field registry
couldn't be removed yet as some fields are still used (e.g. in
client actions: FieldMany2One, FieldMany2ManyTags...), and
sometimes accessed from that registry (e.g. uom service). More
clean up will come later. Note that all tests using legacy views
have thus been removed, even though the tested feature might still
remain (e.g. FieldMany2One tests have been removed, but that field
is still there). However, those features are deprecated and
unlikely to evolve. They should be removed in the next saas, or the
one after.

Finally, this commit also removes the legacy view dialogs.

Task 3168640

Part-of: odoo/odoo#111809
2023-02-08 13:27:58 +01:00
fdardenne 1bfc3aa1cf [IMP] web: x2many list: deactivate modal when in editable
Before this commit, in a form view, it was possible to open a record in
a x2many list field when the list is editable (`editable="top|bottom"`)
and the form view or the field is in readonly.

We want to disable the opening of the record in this case to stay
consistant for a better UX:
- when in a editable x2many list, the record form view never opens (even
  if the form view or the field is in readonly)
- when not in editable, the form view always opens

This commit does not modify the behaviour of the x2many field kanban
view.

task-2964320

closes odoo/odoo#110838

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-02-07 15:35:49 +01:00
Nasreddin Boulif (bon) 556b1b656d [FIX] survey: fix print of survey results
Steps to reproduce (Using Chromium-based browser > v. 108):

  - Install Survey module
  - Open 'Feedback Form' survey
  - Click on 'See Results' button
  - Try to print the 'results' of 'Feedback Form'

Issues:

  - Hundreds of empty pages added when printing.
  - Chart not fully displayed.

Cause:

  - The chartjs library add some HTML elements not displayed (inside div
  with class `chartjs-size-monitor`) to handle the resizing of the
  chart canvas.
  One of the element has a width and height of 1000000px with an
  overflow:hidden, but the overflow does not work properly when printing.
  (Issue introduced in Chrome v. 108, working fine in v. 107 or on any
  Firefox version)

  - The chart canvas is not resized to 100% of its parent container and
  therefore not fully displayed. (Not working in all Chrome and Firefox
  versions)

Solution:
  (in print media rule)
  Add CSS :
  - Set style to `display: none` on `chartjs-size-monitor` HTML element.
  - Set the width and height of the chart canvas to 100%.
  Remove css that set a fixed max-width on the parent element of the
  chart canvas parent.

opw-3109523

closes odoo/odoo#111640

X-original-commit: a3fd499b1cd1416093d1f4348302f090b0f38554
Signed-off-by: Nasreddin Boulif (bon) <bon@odoo.com>
2023-02-02 03:19:43 +01:00
Géry Debongnie b53f78e224 [REF] web_tour,*: use the registry in collecting the tours
This is a step closer to a goal of avoiding dependence on asynchronous
modules. Starting from this commit, new tour definition should be
registered to `registry.category("web_tour.tours")` registry.

So, instead of the following:

```js
import tour from "web_tour.tour";
tour.register(name, options, steps);
```

We now do:

```js
import { registry } from "@web/core/registry";
registry.category("web_tour.tours").add(name, optionsWithSteps);
```

Notice the `options` and `steps` params are merged when registering
the tour definition. It should look something like so:

```js
registry.category("web_tour.tours").add("account_tour", {
  test: true,
  steps: [ ... ],
});
```

And if the `TourManager` instance is needed, one can get it from the
registry like so `registry.get("tourManager")`. Note however that
this instance is only available when the `TourManager` has been
instantiated -- so it's not available at top level of the module.

closes odoo/odoo#111103

Related: odoo/enterprise#36335
Signed-off-by: Géry Debongnie <ged@odoo.com>
2023-01-27 23:17:35 +01:00
Florian Charlier ba8e25384f [FIX] survey: add missing run action in tour
An `input` wasn't clicked as it should and other DOM elements then the
expected target could be found and make the tour fail.

Task-3141104

closes odoo/odoo#110882

X-original-commit: 19013c4ea5a5d4a2bc7485b4012ba0db125b99c4
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Signed-off-by: Florian Charlier (flch) <flch@odoo.com>
2023-01-25 03:04:27 +01:00
amdi-odoo 4b7bfbc252 [IMP] survey: prevent table flicker
Purpose
=======
Prevent table with answers from flickering when
having multiple pages with different items count.

Specifications
==============
Adjust the table height to the question types to
keep the pagination buttons on the same level while
switching pages.
Each table line is expected to be, for the text_box
questions, 3 lines height and for the char_box,
numerical, date and datetime question types
(+ comments), only one line height.
Adding a scrollbar if the table height is greater
than expected.

For the text, char, number, date and datetime
question type (+ comments), set the input line id
cells width to a percentage to avoid horizontal
flicker while changing pages and to reduce first
column width.

Task-2957775

Part-of: odoo/odoo#100168
2023-01-20 20:57:57 +01:00
amdi-odoo c4f954c808 [IMP] survey: add no answer helper
Display a no answers helper instead of the empty table
and the alert message when a question doesn't have
any answers.

Task-2957775

Part-of: odoo/odoo#100168
2023-01-20 20:57:57 +01:00
Andro Gvivradze 9b5173fd9c [IMP] survey: show images in result page
With this commit we add images to the answers in result page.
when clicking on the image, we open a survey_image_zoomer widget.
We also add "Responsible" filter on survey.survey view

task-3092439

closes odoo/odoo#108430

Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2023-01-19 17:48:50 +01:00
Ivan Yelizariev 7209a84910 [FIX] survey: update cursive font
New version of the font is downloaded from Google Fonts website:
https://fonts.google.com/specimen/Alex+Brush?preview.text=c%C4%8Dc&preview.text_type=custom#standard-styles

The reason of this update is because old version doesn't support special
characters, e.g. Aleksandar Vučić.

opw-2891706

closes odoo/odoo#110058

X-original-commit: a3c6db01173cf5a97a74ae4f9a09201e49690fb6
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: Ivan Elizaryev (iel) <iel@odoo.com>
2023-01-17 10:21:02 +01:00
Florian Charlier 24ef92f66f [FIX] survey: fix handleSurveyError
Due to changes in errorService added in dd6f103b, a traceback was shown due to
our (handled) "unhandled" rejected promise that wasn't an "Error" object.

Using the original error works now for our handleSurveyError function. The only
additional requirement was to restore the buttons of the dialog when saving is
blocked due to our validation process.

Task-3128957

closes odoo/odoo#109648

Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2023-01-12 14:34:48 +01:00
Florian Charlier b1d1856245 [IMP] survey, web: enable chaining question creation
## Survey
Due to the behavior of X2Many fields, the questions created when editing
a survey were not usable immediately after creation to be conditional
triggers for new questions. The whole survey had to be saved first, which
wasn't a smooth experience for the user.

This commit will save the survey and question at several times:

### For each new question added

Similarly to what was implemented for chatbot scripts, enables the
immediate computation of allowed question/answer triggers, permitting their
use when chaining question creation.

This also enables to check the answers "validation" fields immediately, and
activating scoring and add scores to question/answers without requiring the
extra steps of saving and re-entering edit mode for the survey.

### When rows are deleted

This will trigger the immediate removal of the triggers icons on
questions that were triggered by an answer to the deleted question.

### NOT when questions are moved

As there is no convenient way to ensure questions are properly ordered with
respect to their triggers (order dependency) without popping error messages
at every step when reordering questions, we chose to mark the misplaced lines,
missing trigger records or triggers that will be ignored (with the new
`trigger` widget).

This could have been done entirely with 'server' logic, but that would have
required additional saves and cleaning fields even more often, even during a
temporary reordering step, which isn't convenient.

### Misc
Finally, note the extra fields added on the question_and_page_ids field of the
survey form view, required to trigger these fields' update consistently
(required after reordering or removing records which sometimes doesn't occur
without these).

Tests ensuring the behavior of the X2Many (saving parent on open/edit and show
notifications on error) and the trigger widget are included.

## web
To support the functionality described above, we need to allow the caller of
'save' to catch errors to prevent default handling (here to use a notification
instead of an additional Dialog).

Task-2623482
Part of odoo#78705

Part-of: odoo/odoo#78705
2023-01-10 18:54:28 +01:00
Florian Charlier 51b4e6d098 [IMP] survey: improve validation parameters UI and logic
Purpose: Showing validation parameters with an arrow on one line (when
possible) is prettier.

Additionally, we now
- Improve data consistency by preventing saving `validation_required` without
  setting validation parameters (also allows to keep arrow invisible when no
  value is set)
- Explicitly add required flags to float values as they cannot be not set (see
  c5ae9b38).

Task-2623482
Part of odoo#78705

Part-of: odoo/odoo#78705
2023-01-10 18:54:27 +01:00
Aurélien Warnon a6f1fc7e79 [FIX] survey: disable submit button during javascript loading
This commit disables the submit button on the survey main form during loading.

This is done to avoid the user clicking on the submit button *before* the
JavaScript code is loaded, which will by default trigger a page reload.

That situation can happen on slow connections, and as it reloads the page, the
user keeps clicking on "start" and it keeps reloading, creating frustration.

Task-3111551

closes odoo/odoo#108802

X-original-commit: cb12745329177812bd48ac5520044069ed6ecb9e
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2022-12-29 13:26:03 +01:00
Thomas Josse (thjo) 220e0271bf [IMP] survey: mail modal simplification
Purpose
=======

Simplifying the mail modal used to share surveys

Specifications
==============

* We simplified the modal, you can hide all the parameters for the template creation
* The dynamic values are displayed as computed in the modal

task-2901947

closes odoo/odoo#100705

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-12-19 11:33:38 +01:00
qsm-odoo d49200feca [REF] website, *: remove (deprecated) $target uses in public widgets
*: auth_totp_portal, mail_group, portal, survey, web, website_event,
   website_event_track, website_mail, website_mail_group,
   website_mass_mailing, website_payment, website_sale

Although this is deprecated since 5 years with [1], new occurrences of
`this.$target` in widgets kept being introduced. `this.$el` can be used
just like in any other widget, or even better: `this.el` to not rely on
jQuery.

For now, this still keeps the definition. This just removes the bad uses
to prevent more copy/paste... let's delay the decision to remove the
definition entirely to another day.

[1]: https://github.com/odoo/odoo/commit/2972976962617d4b8a0113bae58c640ab41cdff8

closes odoo/odoo#106437

Related: odoo/design-themes#618
Related: odoo/enterprise#34343
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2022-11-24 19:25:14 +01:00
Brieuc-brd 6c2a50769e [FIX] survey: adapt section rows for dark mode
This commit adapts the colors of section rows for dark mode.

task-2710677

X-original-commit: 9302f920b3d6f31bc2cf24a7ac47a49343cca7c4
Part-of: odoo/odoo#103162
2022-10-25 15:03:29 +02:00
Brieuc-brd 0df55c3709 [FIX] survey: survey_question_views, adapt color for dark mode
This commit adapts color of `survey_question_views` for the dark mode.

task-2710677

X-original-commit: 08b3e78fab239f914301e8d67e0a1f1bf91bf5bb
Part-of: odoo/odoo#103162
2022-10-25 15:03:28 +02:00
Aurélien Warnon 286fe8dca1 [FIX] survey: fix the survey list view
It was not possible to open the survey list view anymore because the renderer
override was trying to set the "canCreate" property, which only as a getter.

Instead, we base our logic on the existing "canCreate" property, as it does
exactly what we want.

Task-3026904

closes odoo/odoo#103351

X-original-commit: 6db2847b476a21d6a96baddecb8231e47157ae0e
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-10-18 12:19:39 +02:00
stefanorigano (SRI) d53d432361 [IMP] *: adapt for dark-mode
*: hr, hr_holidays, project, purchase, point_of_sale, rating,
spreadsheet_dashboard, stock, survey

This commit adapts modules and components in order to correctly handle
color-scheme variations.

task-2710677

Part-of: odoo/odoo#102868
2022-10-11 13:15:54 +02:00
Jeremy KerstenandBenoit Socias 878351d840 [IMP] base, web, website, *: differentiate essential & optional cookies
*: im_livechat, survey, utm, website_crm_iap_reveal, website_forum,
   website_livechat, website_sale, website_sale_comparison

Before this commit all cookies were considered essential.

This commit makes some of them optional. It also makes it possible for
the website visitor to only accept the essential cookies.

task-2800976

X-original-commit: 9a8a9463289a7446e9be0ef62ff895feb37a4de4
Part-of: odoo/odoo#101845
Co-authored-by: Benoit Socias <bso@odoo.com>
2022-10-03 10:56:58 +02:00
Thomas Josse (thjo) f4f61a4b5e [IMP] survey: UI Preening
Purpose
=======

Keep iterating on the UI & Onboarding of Survey as we plan to massively
distribute it with the new Saas formula (installed by default).

Specs
=======
* Changed the look and feel of the Action Helper inside the Surveys
* Changed the Default Feedback Form: end message modified and two layers
removed

task-2901947

closes odoo/odoo#101507

X-original-commit: 6280f160d77e3c1777516fbfd2e225e13642872b
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-09-28 21:26:47 +02:00
Michael (mcm)andluvi 710271240f [IMP] web: remove readonly mode of form view
This commit does multiple things:
- The readonly mode of form view is removed but not for the fields.
  it means that the fields in the view are always in edit mode except
  if we force them to be readonly.
- The control panel is revamped to take less vertical space and shows now
  the record editing (dirtiness)/validity status after editing the record.
- The record is saved only when leaving the view or by clicking the save
  button when hovering the record status in the control panel.
- The record can still be discarded by clicking the discard button when
  hovering the status text in control panel.

task id: 2822553

X-original-commit: 77824ad44b6945a9811120380747f87ef6362ae2
Part-of: odoo/odoo#101118
Co-authored-by: luvi <luvi@odoo.com>
2022-09-27 12:43:50 +02:00
Aaron Bohy a7766e0f4d [FIX] web: SelectCreateDialog: remove padding
We don't want any padding in those dialogs. The presence of the
padding was a consequence of the rewritte of that dialog in owl.

It is a frequent usecase to remove the padding from the body of
dialogs. We thus introduce a new props on Dialog and when this
props is set to `true`, we do not set any padding on the body.

This commit refactors other usecases to make them use the added
props.

closes odoo/odoo#100045

Signed-off-by: Géry Debongnie <ged@odoo.com>
2022-09-14 21:22:12 +02:00