This commit does 4 things:
- adds a file for deprecated legacy fields.
- moves legacy FieldBoolean into this file.
- converts FieldBoolean to owl component.
- adds a new xml file for component fields' templates.
task id: 2193996
* account
This commit adds a new field registry for component fields.
This field registry is used to only register the new field components
and the other one should register the legacy fields.
Those two registries will be used together while all legacy fields are
not converted to owl component.
As the legacy registry now throws an error when adding a component
field the existing component fields (account.ShowGroupedList and
account.ShowResequenceRenderer) are moved into the new registry.
This commit also refactors some field managers (form renderer, list
editable renderer, calendar popover) to use the new registry and thus
support the component fields.
task id: 2193996
... when toggling an optional field.
This bug wasn't really important until now, but with the new
selection mechanism, it could lead to weird situations (e.g. the
selection box says that all records are selected, but the thead
checkbox isn't checked).
Part of task 2185145
We don't change the multi edit mechanism for now: it still only
applies to the selected records, limited to the current page.
However, we add the information in the confirm dialog to make it
clear for the user.
Part of task 2185145
The export feature already exported the whole domain when the
thead selector checkbox was checked (unlike all other actions
which were executed on the current page only).
Following the new selection feature, this commit uniformizes the
behavior of the export with other actions: if the page is selected,
only the records on that page are exported. To export all records
matching the current domain, the user has to click on the 'Select
all' link in the control panel.
Part of task 2185145
This commit allows the user to apply actions to all records
matching the current domain in list views. It also ensures that
the user is aware of the set of records actually selected.
The number of selected records is now displayed in the control
panel, and the user can, with an additional click, select all
records matching the current domain instead of the ones of the
current page.
Task 2185145
Currently there is two ways in view to have a phone number displayed in
LTR in a RTL language:
- have `widget="phone"` on a field
- have a class o_force_ltr on the field
But this is currently done very rarely and fail in list view because the
direction of data cells is used, eg.:
```
<div style="direction:rtl">
<table><tr><td style="direction:ltr">
<span>+1 2 3</span>
</td></tr><tr><td>
<span style="direction:ltr">+4 5 6</span>
</td>/tr></table>
</div>
```
will be displayed as:
+1 2 3
6 5 4+
In this commit, we use unicode-bidi* to optionally add an additional
level of embedding so direction is taken into account by the
bidirectional algorithm.
This commit also adds o_force_ltr class or phone widget on phone fields
where it is not already defined.
*: https://drafts.csswg.org/css-writing-modes-3/#propdef-unicode-bidi
opw-2224828
closes#48425closesodoo/odoo#48588
X-original-commit: ab067218e069f0a92610c3f0d4137e563e47755c
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Background
==========
After the refactor on the multi-company behavior performed for v13, now
there are two possible actions per company, depending on where they're
clicked: switch to the company or toggle it. Such actions were handled
by `<div>` elements, which aren't keyboard-reachable by default.
The Issue
=========
Because of the above, the company switcher was neither reachable nor
usable when using the keyboard.
Solution
========
To solve this, the following is performed:
- Add HTML attributes required to make elements reachable, along with
their corresponding aria attributes
- Actions that are currently triggered when clicking on an element, now
are also triggered when the keyboard focus is on the element and `ENTER`
or `SPACE` are hit
Closes#47650closesodoo/odoo#48627
X-original-commit: 33a7238d0b03ccb89e4c4d2f0d7380b5649dc4d4
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: Luis González [Vauxoo] <luisg123v@users.noreply.github.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, 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>
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>
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>
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>
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>
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>