Commit Graph
18148 Commits
Author SHA1 Message Date
Aaron Bohy 39874b0e9c [FIX] web: tests: make mock fetch almost sync (micro-tick)
Before this commit, a studio qunit test ("edit/delete menus")
sometimes failed on runbot, because it tried to click on a button
in a modal footer, but it found 3 of them, because another dialog
which was expected to be closed at that moment, was still opened.

There was no guarantee for the dialog to be closed because of the
way browser.fetch was mocked. The fetching part was ok, but the
function returned a Response object, whose `json` method is async
(setTimeout-like async, i.e. "real" ticks).

This commit mocks some functions of the returned Response instance
to ensure that, by calling nextTick after a click or whatever, the
fetch operation has been done, the body has been decoded, potential
renderings are finished and the DOM has been patched.

Runbot error 23054

closes odoo/odoo#143980

X-original-commit: 66ef3ae730a233dc510425e0a5baca2973de493e
Signed-off-by: Samuel Degueldre (sad) <sad@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-11-30 10:13:23 +00:00
Chrysanthe (chgo) 5ba7e9e16c [FIX] web: fix bolder label in properties field
This commit fixes a visual issue with a label of the properties modal
that has a bolder font-weight than the other.

This issue comes from the fact we recently changed the behavior of our
`bold` and `bolder` variants.

To avoid this issue, we simply remove the label to render the text
directly inside the `label`.

task-3580556

closes odoo/odoo#143794

X-original-commit: 467fb0cb5318594a3b7222640645ad0d15d03c42
Signed-off-by: Stéphane Debauche (std) <std@odoo.com>
Signed-off-by: Chrysanthe Gomrée (chgo) <chgo@odoo.com>
2023-11-30 04:12:46 +00:00
Julien Carion (juca) 05eea6dfc1 [FIX] web: kanban: missing quickcreate button in empty kanban
This commit fixes an issue where the quickcreate button was missing from
the kanban view when it was grouped by a non many2one field and contained
no record yet (so that no column is shown yet).

Steps to reproduce:

-Go to a kanban view on a model with no record
-Group by as scalar value (eg: Description)
->The "New" button disappears

OPW-3459808

closes odoo/odoo#143793

X-original-commit: 112ba1cb64b5170fdefd267de8e765f87b444b56
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
Signed-off-by: Julien Carion (juca) <juca@odoo.com>
2023-11-30 03:03:58 +00:00
Aaron Bohy 0dfada3f3f [FIX] web: avoid translation not ready error in errors
Before this commit, error message like "Uncaught Promise" were
translated. However, it may happen that the error is created (and
thrown) before the translation service is ready, i.e. before the
translations are loaded. Indeed, the error service is started first
and starts listening on errors that might be raised. If a module
throws an error (e.g. rejects a promise) before the localization
service is started, the error service being already set up, it
catches it and instantiates the appropriate Error. Doing so, a
"translation error" is thrown as translations aren't ready yet.

Translating those messages makes little sense anyway, as they
target developpers and they can't be found in the code if they
are translated. This commit thus stop translating them.

Issue found while investigating on opw 3602193

closes odoo/odoo#143551

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-11-29 16:30:19 +00:00
Michael (mcm) 036c72e5ec [FIX] web: disable browser autocomplete
Before this commit, browsers added suggestions when focusing fields.
This commit removes these suggestions.

Warning: there are two kind of autocompletion. One which suggests data
you already entered and completes only the current field if chosen.
The other is auto-fill which suggests your personal info like
email, address, ...
Only the first kind is fixed here, the second cannot be removed at the
moment.

task id: 3114291

closes odoo/odoo#143854

X-original-commit: 201cc48b50b374ea9445f0d148c4e0faeb825327
Signed-off-by: Mathieu Duckerts-Antoine (dam) <dam@odoo.com>
2023-11-29 14:49:49 +00:00
vlst 08f5c071b6 [IMP] pos_self_order: update linting rules
In this commit we update the lists of modules from `_eslintignore` and
`jsonconfig.json` such that they now contain all pos modules.

In addition, we also create script in the `tools` directory of pos that
returns a list of all the pos modules. This list is often very useful.

closes odoo/odoo#142366

Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2023-11-28 21:20:53 +00:00
Tom De Caluwé 48634a2adf [FIX] web: avoid week number calculation errors
When opening the calendar view in, for example, the timesheets app, the first
day of the week used for the number calculation is provided by the localization
service, which in turn requests it from the database. Because the first day of
the week is stored as a number between 1 and 7 in the res.lang model and a
value between 0 and 6 is expected by the DateEnv, offset errors can occur.

The error is fixed in various components (for example, the CalendarDatePicker
and CalendarCommonRenderer) but not in others (CalendarYearRenderer). Instead
of patching each component separately, a better solution is to require the
CalendarModel to expose a 0 to 6 firstDayOfWeek value as part of its public
interface.

opw-3389617

closes odoo/odoo#142056

X-original-commit: aea22a46515304df41dfaf427f5955824fe342f5
Signed-off-by: Michaël Mattiello (mcm) <mcm@odoo.com>
2023-11-28 21:20:48 +00:00
Pierre Rousseau 0828bd1239 [FIX] board: do not give form view to children views
Before this commit, the form view of the board action is given to the
children views. This can lead to some issues, for exemple in the
following case:

- Add a pivot view to a board
- Click on a cell to open the list view
- Click on a record of the list view to open the form view

=> The form view used is the one of board, which lead to an empty view.

opw-3598945

closes odoo/odoo#143756

X-original-commit: f65efabb938bf5643754c426ad3db813d9eff581
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Pierre Rousseau (pro) <pro@odoo.com>
2023-11-27 11:20:10 +00:00
Mathieu Duckerts-Antoine 2b80c8e647 [FIX] web: pivot: clear sortedKeys when pruning
Due a typo, sortedKeys were not always cleared when pruning the
new trees after an update. Consequently the method _getTableRows could be
called on a inexisting sub tree. Here we simply fix the typo and a test.

opw-3584675

closes odoo/odoo#143714

X-original-commit: 3fa2d6e418daa2b1fa0df3c8d1ca643fac4cbaa2
Signed-off-by: Julien Mougenot (jum) <jum@odoo.com>
Signed-off-by: Mathieu Duckerts-Antoine (dam) <dam@odoo.com>
2023-11-27 09:51:11 +00:00
Odoo Translation Bot 3ffba892de [I18N] Update translation terms from Transifex 2023-11-26 00:20:02 +01:00
Samuel Degueldre eb1d96e011 [FIX] web: correctly display module errors in the qunit suite
Since the module loader rewrite, it now reports errors directly in the
DOM. The error alert also has the class "modal" so that in case a tour
comes accross a page with module loading errors, it will only look for
elements inside it and fail. But in the QUnit test suite, modals are
invisible by default, causing the page to be blank in those cases.

This commit adds a css rule to make sure that this error alert is shown,
and updates the code that was previously used to report these errors in
the qunit suite to instead simply check for errors reported by the
module loader.

closes odoo/odoo#143589

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-11-25 05:41:45 +00:00
Samuel Degueldre 5385b65384 [FIX] web: correctly use readonly value in datetime field
Previously, the datetime field read the value for readonly directly in
the attrs when extracting its props when available. This resulted in 2
separate bugs:
- in debug mode, props validation of the datetime picker would fail, as
it expects to receive a boolean for the `range` prop.  This was caused
by the fact that required was the raw attribute (a string) instead of
the boolean and ended up being propagated to the `range` prop
- outside of debug mode, the value for required did not cause a crash
but any value for required that was not empty would be interpreted as
truthy, causing the field to always be display itself as though it is
required. In non-range mode, this is invisible, but in range mode, it
would always show the second datetime input and the arrow between the
beginning and end date, even with required being 0/False, or a python
expression that may evaluate to false

This commit fixes that by instead reading the value for required from
the dynamic infos provided to `extractProps`, which will always be a
boolean and contain the value of the evaluated expression when
appropriate.

closes odoo/odoo#143509

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-11-24 23:57:36 +00:00
Mathieu Duckerts-Antoine 71ee2c0995 [FIX] web: expression editor: between operator
We make the expression editor support the between operator.

closes odoo/odoo#142483

Signed-off-by: Michaël Mattiello (mcm) <mcm@odoo.com>
2023-11-23 17:50:40 +00:00
Mathieu Duckerts-Antoine 40e0b4e324 [IMP] web: expression editor: model field selector
The component ExpressionEditorFieldSelector used by the expression editor
to allow the selection of a field has several drawbacks:
- the fields are not alphabetically ordered
- there is no possibility to (fuzzy search) a field
- the field types are not indicated in debug mode.
- the style is different from the classical style to be found in the
  domain selector.

Here we make the expression editor use a version of the ModelFieldSelector
component where the debug input is not shown. Indeed, this would require
some validation of the input value in order to prevent complex path like
user_id.company_id that are forbidden in studio for instance. Anyway,
there is not real need for such an input since it is easy to find/select
a simple path with the fuzzy search.

Task ID: 3599699

Part-of: odoo/odoo#142483
2023-11-23 17:50:40 +00:00
Julien Carion (juca) 019e11bb93 [FIX] web: m2o: always display 'No records' if no result found
This commit fixes an issue where if one sets no_create_edit and
no_quick_create to true on a m2o while no_create is unset, no dropdown
is shown to tell the user that no record was found. Since the quick create
and create and edit options are disabled by default when create is false,
we no longer need it in the condition and can only rely on quick create
and create and edit.

task-3599696

closes odoo/odoo#143202

X-original-commit: 9da78c1b2bdd85f06e8682b99c8c481e91546ec7
Signed-off-by: Mathieu Duckerts-Antoine (dam) <dam@odoo.com>
2023-11-23 01:20:11 +00:00
mano-odoo d62662effc [FIX] web: model_field_selector header and contrast
In commit b47be9f254b2f7327ea3e0e92c6b1b97bff016d0 we changed the
background of the popover selector making the title unreadable in
white mode.

This commit applies the text-dark color to make sure the title is
readable. It also removes the primary background on hover behind the
btns to use a color change instead. We will later on improve this
component with the btn-link + contextual class to manage the hover
effect in another task.

When a field is selected the active class is added on the parent <li>
rather than the <button>. This commit applies it on the button to
display an active state on the selected element.

task-3577065

closes odoo/odoo#143164

X-original-commit: 3d664d6e7daedecc5e995636bfe055c9ba800bb2
Signed-off-by: Mathieu Duckerts-Antoine (dam) <dam@odoo.com>
2023-11-22 16:04:06 +00:00
Aaron Bohy c9e3866b5f [FIX] web: fix SelectCreateDialog test failing randomly
Before this commit, the modified test sometimes failed on runbot
because it couldn't click on "Create and edit..." in the many2one
dropdown. Here's what happened:
 1) call editInput to write something in the many2one input
 2) call selectDropdownItem to select "Create and edit..."
This was done without mocking setTimeout.

The problem is that editInput triggers the opening of the dropdown,
but as setTimeout wasn't mocked, that opening was delayed. Then,
selectDropdownItem first clicked on the input to open the dropdown,
and then clicked on the requested item. It might happen that the
click on the input actually closed the dropdown instead of opening
it, if it had been already opened via editInput. In that case, the
test failed because it couldn't click later on on "Create and edit".

This commit also improves the test utils to better log what really
happens: in this case, the dropdown isn't open at all, so we
detect that specific issue and log it with a proper message (which
is different than "the dropdown is open, but I can find the item
you're looking found).

Runbot issue 28207

closes odoo/odoo#143044

X-original-commit: 220d4325866330235ceccd61b8d1d00d8c919ba8
Signed-off-by: Francois Georis (fge) <fge@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-11-22 07:43:10 +00:00
FrancoisGe d0b7736fa5 [FIX] web: fix profiling to show stats again
Since the refactoring to owl, the stats in the left zone were not shown
anymore and the hover was missing.

This was because the method that fixes the xpath to match line by line
the qweb, was done on a getter and not on the data itself.

Now we replace in the prop value, from this way, in every place we use
the getter, we have fixed the data with the xpath.

/t/div -> /t[1]/div[1]

closes odoo/odoo#142912

X-original-commit: 2124057052255d86591b9f3345bf7e62fcd8d3b3
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Francois Georis (fge) <fge@odoo.com>
2023-11-21 23:24:03 +00:00
Aaron Bohy 5bd6dcd944 [FIX] web: tests: fix SwitchCompanyMenu tests failing randomly
Before this commit, some tests of the SwitchCompanyMenu sometimes
failed:
   - "companies can be logged in even if some toggled within delay"
   - "can toggle multiple companies at once"

They failed because the debounce delay between the first click to
toggle a company and the moment the company service is notified to
actually select the companies was sometimes too short for the 2 or
3 clicks on the menu to toggle companies to occur, as those clicks
are separated by nextTick(), i.e. a mix of calls to setTimeout and
requestAnimationFrame.

In tests, we patch the debounce delay to 0 by default, and before
this commit we set a delay of 50 in the two faulty tests. This
commit fixes the issue by keeping the real delay in those tests (1s),
as they aim at testing the fact that the user has the time to do
multiple clicks before committing the company changes and reloading.

Fixes runbot error 29962

closes odoo/odoo#142904

X-original-commit: 2ec65691ac11cb4216d873dcab77a84e2c35ba17
Signed-off-by: Francois Georis (fge) <fge@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-11-21 23:24:00 +00:00
Aaron Bohy 7cea6c5980 [FIX] web: fix form test failing randomly
The test 'buttons with attr "special" in dialog close the dialog'
sometimes fail on runbot because it can't click on 'Create and edit...'
inside the many2one dropdown. Before this commit, the test edited
the many2one as follows:
 1) edit input to write a new value (with editInput)
 2) click on the input to open the dropdown
 3) click on 'Create and edit...' in the input

But calling editInput opens the dropdown (even though the opening
is a bit debounced, which is why it only failed sometimes). So it
might happens, in rare cases, that the dropdown is already opened
when we click in the input (step 2), which closes it and makes
step 3 fail.

This commit changes the test to do something similar as what we do
in many2one_tests.js: we patch setTimeout to execute the callback
directly, and thus remove the opening delay. We call editInput
which triggers the opening of the dropdown, and we click inside
the dropdown.

Runbot issue 24739

closes odoo/odoo#142863

X-original-commit: 4a011149cba968585d5e74ee4f4fff7212c729e3
Signed-off-by: Francois Georis (fge) <fge@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-11-21 22:00:10 +00:00
FrancoisGe a24aa74602 [FIX] web: m2o field use the right context
When we save a many2one in a dialog opened by the external button, we
trigger a "read" of the "display_name" to update it if the changes made
in the dialog have had an impact on it.
Before this commit, the context used for this "read" was completely wrong,
it was an unevaluated string. This commit will therefore allow you to use
the evaluated context.

closes odoo/odoo#142862

X-original-commit: 7e9c8d41f5d035a00117198539ddebdbd8b4aa7c
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Francois Georis (fge) <fge@odoo.com>
2023-11-21 22:00:09 +00:00
FrancoisGe d71d52d16b [FIX] web: popover clickAway don't preventDefault by default
Since commit 3d218e1, clicking outside
a popover closes the popover and performs a preventDefault on the event.
As a consequence, changes made in the property definition popover are no
longer applied when the popover is closed by clicking outside.

Problem:
The preventDefault has the consequence of cancelling the input change
event allowing the change to be applied to the property definition when
the popover is closed.

Solution:
Remove the preventDefault by default and only use it in the case of the
calendar view, which is the only use case that wants to prevent the click
event so as not to open a record creation dialog (see commit 3d218e1).

How to reproduce the PropertyField bug:
- Go to a form view with a properties field
- Click on the edit property button
- A popover opens so that you can edit the field definition
- Type a few characters in the label input
- Click outside the popover

Before this commit:
    The value inserted in the popover is ignored

After this commit:
    The value inserted in the popover is applied to the property.

It is not possible to write a test reproducing this native browser behaviour.

closes odoo/odoo#142842

Signed-off-by: Michaël Mattiello (mcm) <mcm@odoo.com>
2023-11-21 22:00:07 +00:00
clesgow 7157ded5d1 [FIX] web: allow clicking on button column cells
Steps to reproduce:
- Purchase -> Open any RFQ/PO.
- Click on the cell containing the "forecast" button, without clicking
on the button itself.

Following 28f2622, it will generate a traceback when clicking on a cell
list from a button column.
Since button columns don't have a `name`, no `record.fields` will match
and throw a traceback, as we try to access `type` from nothing.

closes odoo/odoo#142597

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-11-21 20:06:46 +00:00
Samuel Degueldre 86635b5cc6 [IMP] web: extract owl app creation logic into helper
Currently mounting an owl application using the Odoo web framework takes
a good bit of boilerplate. This is both annoying but also creates the
opportunity to misconfigure created applications. This commit exctracts
the application creation logic to a helper function which will make it
much easier to create Owl applications correctly.

task-3580007

closes odoo/odoo#142498

Related: odoo/documentation#6493
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-11-21 20:06:45 +00:00
Bastien PIERRE 4c3fde5412 [FIX] web: min width for many2many_tags
Before this commit, the width of the cells for many2many_tags was often
too small, so the tags were truncated. (e.g.: the tax_id column on the
sale order lines on the form view of the sale order)

After this commit, the column has a min-width of 150px

closes odoo/odoo#141415

Task-id: 3581756
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-11-21 20:06:37 +00:00
Janvi Lakhore 07aa750194 [FIX] web: fix save button issue
Steps:
- Open Field Service
- Go to gantt view
- Create new task
- Leave the title and customer field empty
- Save the form dialog

Issue:
- The customer required notification show in the gantt view instead of form view
dialog.

Cause:
- When we save the form 'saveRecord' method triggered and this doesn't return
 anything.

Fix:
- Add the return statement in 'saveRecord' method.

task-3502839

closes odoo/odoo#142698

X-original-commit: e7d999429dcf91501b0803d32639a181277cb5f0
Signed-off-by: Francois Georis (fge) <fge@odoo.com>
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-11-21 07:56:11 +00:00
Xavier Luyckx (xlu) 5a62dbfc73 [FIX] web: adapt dropdown-item checkmark position
Prior to this commit, the positioning of the checkmark in the project
task state dropdown was slightly off, not optimally aligned.

This commit solves this alignment.

task-3575446

closes odoo/odoo#142725

X-original-commit: 539f156d480473cfd8bf31ed10aea427248fa3fc
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2023-11-20 15:51:32 +00:00
Adrien Dieudonné 6eea43a706 [REV] web: blockui when executing a target=self act_url action
Follow-up of https://github.com/odoo/odoo/pull/134277

This reverts commit 91b80fbb5c as it adds some unwanted visual
effect. In other words, the "block UI" is never unblocked when some
actions are triggered. this is specific to the mobile app when the
URL is outside of the webview scope ("/web" or "/pos"). Even if
the target is self, the mobile app forces a new tab because opening
something else that the backend in the webview could disturb users.

Steps to reproduce:
- Open "Field Service"
- Choose a task and start it
- Stop it and confirm time spent
- Sign report
=> A new tab is openened in the mobile app and the block UI is
never unblock in the app.

To fix this, we simply decided to avoid to use the block UI for
act_url actions. this is consistent with what we did previously:
See https://github.com/odoo/odoo/commit/ebe64aafacec8eaa69a5a1781fc159ff77bc884a
We will only use `BlockUI` when really necessary and not by default.

Note that this commit will also remove the block UI when you do
some operations on apps like installing it. For now, we consider
that is OK. This means that the user will be able to continue his
work during installation. Also note that if the user navigates to
another application during the process, the page will not be refreshed
at the end. He will have to do it himself by pressing "F5" to be able
to see the app in the home menu.
In the future, the idea should be to better notify the user at the end
of this king of background operations but we will see...

closes odoo/odoo#142656

Signed-off-by: Romain Estievenart (res) <res@odoo.com>
2023-11-20 12:41:39 +00:00
FrancoisGe daab70796f [FIX] web: image/sign field doesn't correctly update its unique
Before this commit, if the value of an image/sign field is modified by an
onchange and the record is saved manually, the old image is displayed.

Why:
ImageField's rawCacheKey, which is used to know if the image has been updated,
is not updated. So we will reuse the old image.

Solution:
rawCacheKey becomes a getter that always returns the current value of __last_updated.

How to reproduce:
- Go to a form view with a char field and an image field
- Edit the char field
- An onchange is performed and modifies the value of the image field
- The new image is displayed
- Click on the save button

Before this commit:
    The old image is displayed

After this commit:
    The new image is displayed

closes odoo/odoo#142471

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Francois Georis (fge) <fge@odoo.com>
2023-11-20 11:13:26 +00:00
Lucas Perais 0bc8d169f5 [FIX] web: popover validation target props
Using the OdooEditor, the following use case arises often:
- create an Element with document.createElement.
- append that node into the DOM tree of an iframe.
- spawn a popover with that node as target.

The spec (https://developer.mozilla.org/en-US/docs/Web/API/Document/importNode) considers this a malpractice:
`Before they can be inserted into the current document, nodes from external documents should either be:
cloned using document.importNode(); or
adopted using document.adoptNode().

Note: Although Firefox doesn't currently enforce this rule, we encourage you to follow this rule for improved future compatibility.`

Before this commit, in debug mode, there was a crash because the class of the new Element
did not match the class of the element's ownerDocument defaultView.

After this commit, we keep the check that says that the target should be an instance of
the iframe's document's Element class, but we fallback onto the main Window Element class as well.

closes odoo/odoo#142464

X-original-commit: 0cdd8cf9354e494c3e56d9eefe81c3fb6a59ac09
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2023-11-20 11:13:25 +00:00
Saiyed Irmi addfbb5a39 [FIX] web: button assign appear on mouse hover in Activity View
Steps:
 - Open Projects
 - Go to Tasks
 - Open Activity view
 - There is a button to assign a new user

 Issue:
 - The button to assign a new user should only be visible on hover

 Cause:
 - There was no css class added for button in activity record.

 Fix:
 - By making button visibility hidden by default and should be visible only on
   hover.

closes odoo/odoo#142381

Task: 3522113
X-original-commit: d60519ae4cb3c9c7d83e8143c3015c28b2a929ad
Signed-off-by: Luca Vitali (luvi) <luvi@odoo.com>
2023-11-20 11:13:24 +00:00
Morgane (morm) 01ad9b9213 [IMP] web: kanban header priority star alignment
Prior to this commit, the alignment of the `priority` field star inside
the header of the `kanban card` was not perfect.
Adding `margin: auto` fixes this issue.

task-3586924

closes odoo/odoo#141506

Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2023-11-20 11:13:15 +00:00
Maruan Aguerdouh (magm) 4a7d93d089 [FIX] web: incomplete record reload in x2many form view context
Steps to reproduce:

- Install eLearning
- Create or go to an existing course.
- Add Content
- Fill the name and use Save & Close
- Click again in the same content we have just created.
- Click on website preview.

Issue:

Saving a record from a form view that is part of an x2many field would
only reload the fields present in the list view. This led to incomplete
data being loaded into the model.

Solution:

- Pass the `viewType` option to `_fetchRecord` to ensure that the record
is reloaded in the context of the form view, thereby including all
fields.
- Add `viewType` to the `saveOptions` in the `basic_relational_model.js`
to ensure the correct view context is used during the save operation.

This ensures that all fields are reloaded into the model, providing a
complete view of the data.

opw-3330010

closes odoo/odoo#139968

X-original-commit: 3cec34e659222073b0fba36983eaec9f7bf5514f
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-11-20 06:45:47 +00:00
Odoo Translation Bot f6fe982853 [I18N] Update translation terms from Transifex 2023-11-19 00:28:08 +01:00
Lucas Perais e08ddc21a6 [FIX] web: reload on usable view when switch company does AccessError
Be logged in multiple companies (A and B).
Be on a form view of some record which is visible only on company B via ir.rules.

With the company switcher, unlog from company B.

Before this commit, the user received an AccessError and arrived on a blank webclient.
To say the least, it was rather inelegant.

After this commit, the user ends up on the multi-record view of that model, provided that it is available for use.

Task-3029616

closes odoo/odoo#141796

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-11-17 16:11:50 +00:00
Aaron Bohy 7fc1c10a3a [FIX] web: cog menu: add description for command palette
The cog menu in the control panel (displayed next to breadcrumbs)
has a shortcut, so it is available in the command palette. However,
as is has no text content and no title/tooltip, the command palette
displays "No description provided". This commit adds a tooltip on
the icon, which is thus also displayed in the command palette.

closes odoo/odoo#141913

X-original-commit: 991e2e75d20bbb56b080c97e6b5ca96b746de3f3
Signed-off-by: Pierre Rousseau (pro) <pro@odoo.com>
2023-11-13 23:41:55 +00:00
FrancoisGe d93446a9bd [FIX] web: x2many shouldn't have virtualId in domain
Before this commit, if we have x2many fields which contain a virtual
record with the many2many_tags widget, a server error will occur during
a search because the "name_search" will be performed with a domain containing
a virtualId.

This commit will therefore filter the virtualId when generating the domain
used by the "name_search".

closes odoo/odoo#141269

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-11-13 14:38:34 +00:00
FrancoisGe f833e7e052 [FIX] web: x2m not editable inline with save & new
Before this commit, in a form view with an x2many in non-editable list mode,
creating a record by clicking on "Save&New" allows it to be edited inline
despite the list view not being editable. The purpose of this commit is
to prevent this from happening.

How to reproduce:
- Go to a form view with an x2many field in non-editable list mode
- Add a record
- Edit the new record
- Click on Save&New
- Edit the new record

Before this commit:
    The new record is in edition in the list view

After this commit
    The new record is not in edition in the list view

Part-of: odoo/odoo#141269
2023-11-13 14:38:34 +00:00
FrancoisGe ad7be43149 [FIX] web: boolean field toggle in editable list
Before this commit, in an editable list view (or in x2many), you need
to click twice on a boolean field to change its value. The first to set
the record to edit and the second to toggle the value.
The purpose of this commit is to simplify this flow by only requiring one click.

How to reproduce:
- Go to a form view with an x2many in editable list mode that contains a boolean field.
- Click on the boolean field of the first record

Before this commit:
    The record goes to edition and the value of the field has not changed.

After this commit;
    The record goes to edition and the value of the field has changed.

closes odoo/odoo#141153

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-11-13 14:38:33 +00:00
qsm-odoo 1ae10492df [FIX] web: make AutoComplete's value optional
The recent use of owl AutoComplete component in the website builder
broke some things (see [1]). This commit handles this bug:

Steps to reproduce:
- Go to /web?debug=1
- Go to the website app
- Enter edit mode
- Drop the text-image snippet
=> Traceback

This was because the AutoCompleteWithPages extension of website was
inheriting the AutoComplete props whose "value" prop was not optional
but was not used for this case.

This commit goes the easy way: make the original prop optional with the
default value being the empty string.

[1]: https://github.com/odoo/odoo/commit/86a9171ec7790aa09f2b9a50dcb26deb029e8bed

closes odoo/odoo#141751

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2023-11-13 13:20:12 +00:00
Jorge Pinna Puissant d1fed769d6 [FIX] base, test_assetsbundle, web: multiple broken XML files in assets
When there are multiple broken XML files in an assets bundle. During the
bundle processing, a template containing the parsing error message is
returned for each XML file that is broken.

Before this commit, each of the returned templates had the same name,
raising another error ("Template already exists in module").

Now, all the returned templates has unique names.

closes odoo/odoo#141568

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-11-13 10:31:46 +00:00
Odoo Translation Bot b61c1ac0b3 [I18N] Update translation terms from Transifex 2023-11-12 00:21:23 +01:00
Louis (wil) b4b4842718 [I18N] web: remove unfortunate wording
Administrators sometimes machine-translate Odoo into their own language.
In this respect, we should avoid ambiguous wording* that could be poorly
machine-translated.

\*: in this case, the onomatopoeia "Poof!" was misinterpreted by a
machine-translation as a British slur.

opw-3590503

closes odoo/odoo#141723

Signed-off-by: Tiffany Chang (tic) <tic@odoo.com>
2023-11-10 21:23:24 +00:00
Jorge Pinna Puissant afc8dde97a [FIX] base, web: log correctly error in assets
Since [1], when an error exists in an asset, the assets raise a not
found exception. The issue, is that, there is no feedback for the
developer to find the error.

Now, a new console log with the error details is shown.

[1] : bf3b6b0b8b

closes odoo/odoo#141705

Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
2023-11-10 12:33:40 +00:00
Xavier-Do 0a8f326397 [IMP] web: improve missing map reporting
If a .map is missing (outdated) the error message will report

    'min' expected in extension in non debug mode

when the problem is actually that map are not generate through this
route.
If the attachment corresponding to a .map is not found, it
was most likely garbage collected.

Change the message to:

    .map should have been generated through debug assets, (version
    5eff983 most likely outdated)

closes odoo/odoo#141469

Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
2023-11-10 11:31:42 +00:00
Morgane (morm) 5232ec6a7a [FIX] web: missing caret in some fields (settings)
This commit fixes the missing caret in some of the selection fields inside
the settings.

It is not possible to fix it another way than adding a `:not` targeting
the settings `formView`, because the `formView` css rule is overriding any
css in settings.
The caret was also hidden in the `datepicker` field.

This commit also change the `$-down-arrow` variable to a global one,
`$o-caret-down`.

task-3451370

Related to task-3326263

closes odoo/odoo#141672

X-original-commit: e01d4211cd36bd1a7d4ad190c89d3c966ec3e41e
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2023-11-09 14:51:23 +00:00
Michael (mcm) 6a30ab1353 [FIX] web: mount on detached element
Before this commit, a component couldn't be mounted on a public widget
that wasn't yet attached in the dom.

closes odoo/odoo#141665

Signed-off-by: Samuel Degueldre (sad) <sad@odoo.com>
2023-11-09 13:38:43 +00:00
Louis (wil) 68b4dfc2bb [I18N] *: import translations
closes odoo/odoo#141655

Related: odoo/enterprise#50484
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
2023-11-08 20:48:14 +00:00
Aaron Bohy 1983ec11d0 [FIX] web: kanban: disallow to quick create if cannot create
Before this commit, a grouped kanban view with create="0" on the
root node would still allow to quick create record in columns (i.e.
the "+" icon would still be displayed). However, clicking on it
would most likely raise an AccessError as the user isn't allowed to
create records.

This commit restores the pre 16.0 behavior, which is to disallow
quick creation if the user can't create.

Task 3559638

closes odoo/odoo#141631

X-original-commit: 775475aaed6ea88f54a6530b81f35f3114431716
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
2023-11-08 14:36:29 +00:00
abd-msyukyu-odoo 708573b0f5 [FIX] web: prevent command palette deadlock
Impacted versions:
16.0+

How to reproduce:
- create a lot of articles in Knowledge (i.e. 3000+)
- click twice on the `Search Articles` fake search bar in the Knowledge Form
  view

Current behavior:
- the command palette does not open
- the command palette is broken and won't open again (even with the `CTRL+K`
  shortcut)

Expected behavior:
- the command palette open once and should not break even if the user clicks
  multiple times.

Technical explanation:
- The promise given to the `onWillStart` hook of the `command_palette` can
  sometimes never be resolved by design (see `KeepLast`). i.e.:
  - `setCommandPaletteConfig` is called `onWillStart`
  - `setCommandPaletteConfig` is then called as a result of the `SET-CONFIG`
    bus event
  - the first promise will never be resolved since it uses a `KeepLast`,
    therefore `onWillStart` will never be resolved either.
- In `command_service`, the variable `isPaletteOpened` is set to `true` before
  the command palette dialog is actually mounted.
- If `onWillStart` is never resolved, the component will never be mounted, and
  as such the dialog can never be closed, therefore `isPaletteOpened` stays
  `true` forever resulting in a deadlock preventing any further opening of the
  command palette.

The issue can be resolved by adding all `KeepLast` promises in a race, which is
what `onWillStart` should actually be waiting for, since it will be resolved as
soon as any `KeepLast` promise is resolved.

task-3554068

closes odoo/odoo#141613

X-original-commit: 6b5fc71e67569b93b699090b225eea147ef463d2
Related: odoo/enterprise#50466
Signed-off-by: Francois Georis (fge) <fge@odoo.com>
Signed-off-by: Damien Abeloos (abd) <abd@odoo.com>
2023-11-08 14:36:27 +00:00