added test case for text paste in autocomplete in the searchbar using mouse,
it should populate the autocomplete dropdown.
task-2204174
closesodoo/odoo#48251
X-original-commit: 010961ee3eac55a1e885ce918b597943078324f6
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Now we have the mobile search_panel in enterprise,
this commit simply adapt the Odoo repos part with:
- Css Clean up
- Remove the no longer existing step inside the tour
the button 'o_enable_searchview' no longer exist
inside a M2X dialog
Task ID: 2200099
closesodoo/odoo#48376
Related: odoo/enterprise#9494
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
Signed-off-by: Pierre Paridans <pparidans@users.noreply.github.com>
In 13.0, as of 369c20a9 there is some style that will show an event with
bigger font-size and spacing in calendar day view.
In this commit, if an event is short (less than 30 pixels, so less than
45 minutes) we will decrease the spacing to have the same as in week
view and see the event title more easily.
opw-2216654
closes#48391closesodoo/odoo#48409
X-original-commit: a4d170ad9e73d1d63404532b161911df020b5c36
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
In 12.0 9de1bc0e aria-label translation was added for python views, but:
- aria-label attribute are not exported
- aria-label are not translated for JS view rendering
So by default, aria-label would only be translated for python views that
had the same aria-label term in a translatable element (eg. "title"
attribute).
opw-2222504
closes#48255closesodoo/odoo#48275
X-original-commit: 6b6b11ea2f8391f1f195bd1650531f77b6bed729
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Some menus contain items that are selected/checked when they're
activated, e.g. when a filter is applied, the menu item corresponding to
that filter is checked. However, that information of what items are
checked and what don't, is not reported correctly using aria attributes.
To solve the above, the following is performed:
- Attribute `aria-checked` is set accordingly, usually using the same
logic as the clas `selected`
- Attribute `role` is set to `menuitemcheckbox` or `menuitemradio`
instead of `menuitem`, so `aria-checked` is applicable
This applies on the following cases:
- Standard topbar's menus: Filter, Group by and Favorites
- The company switcher widget
closesodoo/odoo#48301
X-original-commit: 64c0b47c0e8e8fdd3fa9b1bc13f2b49b6f49f4e1
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Issue
- Be in multicompany
- Have a company with a long name
- Install Accounting
- Settings > Currencies > Dollars
- Click on the smart button "Rates"
- Group by company
Company name and rate overlap
Cause
In `_computeDefaultWidths`, we use the method
`_getColumnWidth` which returns a width depending on the
field type.
When you use group by, the fields order doesn't change
so the company name in the group line have the width
of the date field (92px) and there is nothing that
limits the place that the string can takes so there
is overflow.
Solution
As it seems to be something very accurate, I think the
safest solution would be to use the `o-text-overflow`
saas mixin.
OPW-2218143
closesodoo/odoo#48318
X-original-commit: 2898dd4577e12326cbe83dce9fdbdef0e32d51e6
Signed-off-by: Jason Van Malder (jvm) <jvm@odoo.com>
Some elements contain superfluous `aria-label` attributes, which
overrides any default useful information. For instance, some dropdown
menus contain the `aria-label` "Dropdown menu" (e.g. the company
switcher), which doesn't add any useful information, as dropdown menus
are already labelled correctly using `aria-expanded`.
This change applies on the following buttons:
- Schedule an activity
- View attachments
- View followers
- Switch company
- Open user options from systray
- The widget `state_selection`
closesodoo/odoo#48317
X-original-commit: e3c7f66e89d7be39dfa4cc3d6b038c6f4a114aa5
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Before this commit, coming back on a view when in 'debug=assets' would erase the
previously loaded favorites with an 'undefined' value. This was due to an incorrect
cache invalidation mechanism in the DataManager's load_views' method.
Now the views and filters caches are properly loaded if any of them has been invalidated.
closesodoo/odoo#48085
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Before this commit, when PDF viewer opens, it opens the sidebar forcefully.
Now with this commit, we have restricted to open the sidebar on initial load
by passing the false value to the forceOpen flag, we did this changes directly
in the library file itself as the file loads in iframe so we can not change the
file from outside by overriding the existing function or parameter.
task-2209742
closesodoo/odoo#47458
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
before this commit, email widget was not trimming value and due to which
space aroung email value remain as it is added by user.
after this commit, email widget will trim the value and remove leading/trailing
space.
task-2197432
closesodoo/odoo#47470
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Steps to reproduce:
- install sales
- go to sales > go to any list view (SO for example) and group by
anything (customer for example)
- click on action > export > add ID to the exported columns
- click export
Previous behavior:
you get a traceback: "Invalid field specification '.id'."
Current behavior:
ids are exported as intended
opw-2194233
closesodoo/odoo#48222
X-original-commit: c8217080d960ec3f8436111ce60a17754fe64f2d
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Signed-off-by: mightyjol <jhk-odoo@users.noreply.github.com>
stdout:
stderr:
closesodoo/odoo#48197
Error: could not apply b0c5370fd25... Revert "[FIX] web, purchase, sale: fix no currency in calendar view"
Hint: after resolving the conflicts, mark the corrected paths
Hint: with 'git add <paths>' or 'git rm <paths>'
Hint: and commit the result with 'git commit'
X-original-commit: e8d6f1eae0f4f9c0f4df78553b7d51a03087940f
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: Jason Van Malder (jvm) <jvm@odoo.com>
before this commit:
when manually adding field in export wizard, string has extra space in
begining.
after this commit:
manually added field in export field list doesn't contain any extra
spaces.
task-2065433
closesodoo/odoo#36759
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
Before this commit, when user attempts to edit or delete a private
event without being an attendee, it raises an access right error.
This commit disables edit and delete buttons in this case, in
addition to hide event details.
task-2151150
Closes https://github.com/odoo/odoo/pull/42569closesodoo/odoo#42569
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Purpose Of the task is, we need a visual cue on those fields to let
the user know that their value is company-specific.
So, in this commit On company depedent field we added a building
icon with title 'Values set here are company-specific' next to the
label in the form view.
closes odoo/odoo#47178
Taskid: 2001748
Closes: #47178
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Let's assume a form view with an x2many list, containing itself
an x2many field (no widget, so simply displaying the number of
records). When a record of the list is clicked, a form view
opens and displays the same sub x2many field, with widget
many2many_tags. Both list and form views of the x2many aren't
inline (thus have to be fetched on demand).
Before this commit, it crashed when the user clicked on a row
of the x2many list.
The bug has been introduced by a9cebd5a, which wrongly removed the
code handling this specific situation. At least, now we have a
test attesting that this code isn't useless.
Note that the diff isn't as scary as it looks like (we just added
an if/else, and thus indented the former code inside the else
clause).
closesodoo/odoo#48116
Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
Before this commit,
Hovering on a responsible on the right column of the calendar will:
- show a classic yellow tooltip
- show a custom tooltip with a bigger image
After this commit,
Hovering on a responsible on the right column of the calendar will:
- show a custom tooltip with a bigger image if image exist
else, show classic tooltip
PR odoo/odoo#45353
Task-2194828
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Before this commit, if an action context would contain a key/value pair
like
search_default_foo : 0
the filter foo would be activated, while it should be not considered
as default.
The present commit fixes that situation.
closesodoo/odoo#47958
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Purpose
=======
When being logged on company A and clicking on company B, I should
log into the company A only.
Currently in mobile, the checkbox next to A remains enabled before the
refresh. With this commit, this behavior is fixed.
closesodoo/odoo#48045
Taskid: 2205603
X-original-commit: 19f196c0afd73c5d64b612aa413e6e6772e0c288
Related: odoo/enterprise#9373
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Before this commit and following the refactoring of the home menu and the control
panel to the Owl framework, some of the helpers of the 'clickEverywhere' test have
not been properly updated to the new classes/behaviours.
Now the selectors target the right elements and some actions that were previously
synchronous are now properly awaited (home menu toggling, filter menu interactions,
etc.).
Also slightly changed the behaviour of the clickAll functions:
- requesting a click on a null element will make the test crash (added some conditions
to avoid this in a standard flow).
- any error crashing the test at a deeper level will be displayed in the console
- an animation frame is awaited after clicking on an element. This is to comply
with the Owl rendering system.
closesodoo/odoo#47762
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Before this commit, widget='text' was not available in web_studio since 'html'
was missing from the supportedFieldTypes list of the TextField.
After this commit you can use widget text (and other derivated type of text).
task-sbu-feedback
closesodoo/odoo#48043
X-original-commit: 34bd90e7fc2aa094eac92b6f635c2d8d933ecb86
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
Before this commit, we compute the hash on each request, to know if we need to
download the file from the frontend or if we can use cache.
Now we store the hash computed in cache. The cache will be invalidated when we
touch one of these translations (openerp-web in the comments) or when you
install a new lang (already the case).
+ avoid to use read on a record, since it will not use the cache from record.
Related to #47257
task-2211013
X-original-commit: d5aaecbc51de19ef1d8d9988b691177fc73a4b86
We have an editable list with 4 fields:
- fieldA (say boolean)
- fieldB with readonly modifier, readonly iff fieldA is true
- fieldC with readonly modifier, readonly iff fieldA is false
- fieldD
Add a new row to the list: fieldA being false by default, fieldC
is readonly whereas fieldB isn't.
Change the value of fieldA: fieldB becomes readonly, and fieldC is
now editable.
From that point, before this commit, clicking on fieldC activated
fieldD (instead of fieldC).
The bug occurred since 3fd7b20, which added a delay between
the moment fields are re-rendered (and inserted at the end of
allFieldWidgets) and the moment there previous instances are
destroyed (and the new ones take their place in the list). So when
several fields were re-rendered at the same time, the order in
allFieldWidgets could not match the actual column order anymore,
and cause issues like the one described above.
Part of task 2210323
closesodoo/odoo#48039
X-original-commit: 89b9717c08e148ad94db17d8746faa2312b6a07a
Signed-off-by: Michaël Mattiello <mcm-odoo@users.noreply.github.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
In the RedirectWarning exception handler, it is better
to use 'do_action()' instead of using a BBQ push_state() and then
a location.reload(), to preserve the context and avoid losing menus
and breadcrumbs for example.
As the RedirectWarning receives only the action ID and not the full
action, a new parameter has been added to be able to provide a context.
This context is added in the 'additional_context' parameter of the do_action()
TaskID: 2168071
studio now supports adding of oe_avatar, in few cases oe_avatar field is added
inside oe_title > h1 and while input is also inside h1 so height of input
increase as we have image tag as a sibling, to fix this set height of input
to fit-content.
task-2172320
Closes#47968
Related: odoo/enterprise#8176
Signed-off-by: Damien Bouvy (dbo) <dbo@odoo.com>
When passing a default field chain to ModelFieldSelector, the page data is
not set correctly for the relational field. To understand the issue :
- login to master enterprise all db branch in runbot (debug mode recommended)
- create a mass mailing, add subject, select 'Contact' in `Recipients` field
- click on domain selector and select 'Company' from ModelFieldSelector popover
- click somewhere else to close the popover
- again open domain selector and observe the popover
Current behavior : fields of `Contact` are visible in the page even thogh
`Company` is selected in the ModelFieldSelector
Expected behavior : fields of `Company` should be visible in the dropdown page
This commit fixes the issue by correctly pushing the page data
in ModelFieldSelector.
task - 2058702
closesodoo/odoo#39548
Related: odoo/enterprise#5370
Signed-off-by: Damien Bouvy (dbo) <dbo@odoo.com>
When using a mock environment, some services are started and need to be loaded
for some tests to work as intended. Before this commit, we waited for the result
of the `start` method of each service to be resolved. This was flawed because these
methods are all synchronous, so the awaiting period was actually a single microtask
tick.
To clarify this and still make sure that the asynchronous services have enough time
to load properly, the `Promise.all` has been replaced by an Owl next tick method
(with animation frame request).
Consistently waiting for services to be fully ready does not make sense anyway as
we may want to mock a delay during the starting mechanism.
closesodoo/odoo#47865
Related: odoo/enterprise#9328
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Steps to reproduce:
- install recruitment
- go to recruitment > configuration > job positions > duplicate a job
and keep the exact same name as the original > change the department
- add any application to the newly created job position
- go to recruitment > applications > all applications > select the
graph view > group by job
Previous behavior:
you only see one of the two jop positions with the same name
the graph view does not handle multiple labels with the same name
and only keeps the latest values when rendering
Current behavior:
duplicate labels are suffixed to prevent the view from confusing them
opw-2214284
closesodoo/odoo#47948
X-original-commit: a77086f8bcb4498361d1183ba8af3d0663cd031b
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: mightyjol <jhk-odoo@users.noreply.github.com>
Before this commit, the 'mounted' hook of the control panel in the
report client action was never called, because of a missing call
to '_super'. As a consequence, the 'Print' button wasn't displayed.
closesodoo/odoo#47940
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
Before this commit, the context sent by an action performed by the action menu
could hold an 'undefined' select_all key, which would cause the context evaluation
to crash.
Now, the select_all key is defaulted to 'false' and does not crash in actions that
do not provide it.
closesodoo/odoo#47745
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Performances from a general point of view can be difficult to track.
This commit proposes to improve logs in two ways:
The current logs only use the sql_counter, wich will only be updated
when a cursor is closed. In a test-enable install, this counter
is actually the queries of the tests wince the install cursor is
open untill the end. The first fix is to use bot sql_counter and
sql_log_count to have total queries untill now on closed cursor,
but also the current number of queries of the current cursor.
This means that the new log format will be
{nb} modules loaded in {time}, {loading_querie} (+{test_cr_queries}) queries
instead of
{nb} modules loaded in {time}, {tests_cr__queries}queries
Nothe that in the current version, {nb} is actually the total number of
loaded modules until now.
This commit also add an equivalent end log by module and change the
loglevel of module start on install (mainly usefull if an error occurs
before anything else is logged hidding the module causing this error.)
A cleaner runbot logger is also added, in order to be abble to call
_logger.runbot( instead of _logger.log(25. This will clarify the purpose
of such a log level.
closesodoo/odoo#47283
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
In JavaScript, the following computation introduces numerical errors:
```
Math.pow(10, -4) = 0.00009999999999999999
Math.pow(10, -5) = 0.000009999999999999999
```
In the context of `round_decimals`, such errors propagate to
`round_precision`, ultimately leading to inconsistencies between Python
and JS (see #47300 for detailed use case).
Instead of computing `Math.pow(10, decimals)`, we parse the scientific
notation to prevent such inaccuracies.
We also introduce tests in line with the Python tests.
opw-2205092
closesodoo/odoo#47694
X-original-commit: cb471897bfa08d1fee6a9f49e90d9c120e1733fc
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Issue
- Install CRM and Events
- Change Azure Interior Name with a
very long string
- Click on "1 Events" smart button
The view is shifted out of the screen
Cause
In 12.0, the control panel was separated
with 2 div where width = 50%
Now they use flex. (they are still 50% width
by default)
The long name is hidden by a `overflow:hidden`
and there is a `text-overflow: ellipsis` to
avoid extra-width issue.
The problem is that there is a `white-space:
no-wrap;` which force an extra width and
this cause the shifting.
Solution
We come back to the 50% even if there is no search view.
Breadcrumb will always be on the top left area of the screen
which simplifies the code and avoid jumping left to right
(taking all the width of the screen) which can be disturbing
for users.
closes#47063
OPW-2210786
closesodoo/odoo#47603
X-original-commit: 019dc91020a461263c29004ef0c304a8f91abae9
Related: odoo/enterprise#9219
Signed-off-by: Jason Van Malder (jvm) <jvm@odoo.com>
Use of the new control panel helpers to increase consistency and change the assertions
according to the new DOM/behaviour (e.g. components removed instead of turning invisible).
Part of task 2196029
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Use of the new helpers in control panel (and subcomponents) tests and addition
of new tests.
Part of task 2196029
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Some web actions/controllers/viewsl have been adapted to properly instantiate the
newly refactored control panel and update it accordingly. We needed to adapt the
starting mechanism of actions and controllers to ensure that the control panel
instantiation did not delay the loading of any widget.
Part of task 2196029
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Refactoring of the control panel with the Owl framework.
The MVC structure of the control panel has been changed to a 'component <-> model'
relationship. As such:
- Removed the old control panel: view/model/controller/renderer
- Created a new Owl Component (ControlPanel)
- Created a new class: the Model (an Owl Store did not fit here) and a newly
designed ControlPanelModel extending it
Refactored all inner subcomponents, including:
- Pager
- ActionMenus (peviously SideBar)
- Filter menu
> Custom filter item
- Group by menu
> Custom group by item
> Removal of groupby_menu_mixin (and refactored graph controller in sibling commit)
- Time range menu
- Favorite menu
> Custom favorite item
> Moved the favorite menu registry to the favorite_menu file
- Search bar
> Removed and splitted auto-completion dropdown logic between the new SearchBar
Component (descriptions) and to the new ControlPanelModel (domains).
The templates (all in web/base.xml) have been adapted to the new standards. Most
of the DOM structure remains unchanged with some occasional improvements (replace
hiding with not rendering, removed pointless wrapper divs, etc.).
Part of task 2196029
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
1. Test utils helpers adapted to properly instantiate the new Owl control panel
2. New file 'test_utils_control_panel' to create a control panel and use helpers
3. New helper: createComponent (creates a generic component, see jsdoc)
4. Use of the new helpers in the current tests (more in sibling commits)
5. Helper 'addMockEnvironment' is now asynchronous
6. Owl config mode set to 'dev' in test suite (props validation)
Part of task 2196029
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Now that mobile is not supported anymore in community, the mobile layout of the
control panel has been entirely moved to enterprise. This caused some conflicts
with the community mobile test suite (which does not make sense anyway). The failing
tests and related style sheets have been moved as well.
Part of task 2196029
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
There are situations where we don't want clicks to be detected behind an opened
dialog: for example, when a dialog is opened by a dropdown, we may want to keep the
dropdown open while we interact with the dialog.
There is now an option (default: true) to stop clicks propagation when
they arrive at the dialog container.
General cleaning of some helpers and generic files. The idea is that they are
less likely to be entirely re-written in the near future so this is a way to
keep the code clean, readable and compliant to the current standards. Changes include:
- Use of async/await when possible
- Use of const/let instead of var
- Removal of underscore.js
- Use of native JS instead of jQuery when possible
The logic of the affected code remains the same.
This reverts commit d6b854306c.
The reverted commit introduced issues in patching class methods.
Introducing getters in the patch function is not actually compatible
with the original method patching.
Test for patch method is also introduced to guard patch from future
invalid modification that happened.
A more robust way of patching classes is now being developed.
closesodoo/odoo#47557
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
The FieldMany2One allows to quick create record (name_create).
However, sometimes, required fields on the co-model make the
name_create crash. In this case, the FieldMany2one opens a form
view in a dialog to let the user specify those fields, and create
a new record with the 'create' method. This was working fine.
The FieldMany2ManyTags embeds a FieldMany2One to let the user
search for and select or (quick) create tags. In this case, failing
quick creation didn't fallback on the dialog form view, but
displayed a server error instead. This commit fixes this issue.
Bug introduced by 50bf8309f8
Task 2192754
closesodoo/odoo#47183
X-original-commit: 63ab065f3298c13bb19ae1245d7fd2652581b254
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
This commit allows to pass a bin_size context to False.
Before this commit it wasn't possible because it was
always overriden.
OPW-2208232
closesodoo/odoo#47491
X-original-commit: 17d53cea1043054dfa9c39b16b430539c4082a9d
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Commit ca4eaf4 introduced the data-mobile attribute, used
to specify options to pass when executing an action, only in
mobile (like using a fullscreen modal).
However, we forgot to add the 'isMobile' check, so the option
was passed in desktop as well.
This commit fixes the issue and adds some tests.
Task ID: 2155601
closesodoo/odoo#47333
X-original-commit: 6cb68a53106fa7326a7f818461418437d5a0df77
Signed-off-by: res-odoo <res-odoo@users.noreply.github.com>
Follow-up of d0c852f
The parser of `many2one_reference` was not introduced when the new field
type was created and then later when the formatter was added, which
leads to errors when the web client is trying to set the value of such
fields.
Since the value of this field is an ID, it is parsed as an integer.
closesodoo/odoo#47330
X-original-commit: db1e16bc041e1d892fd1f3ac5b694e12496a32f9
Signed-off-by: Damien Bouvy (dbo) <dbo@odoo.com>