To reproduce
============
on a quotation's description write a description with two or more nested bulletlists
on web it looks good, but when printing the quotation thes nested bulletlists are not
correctly rendered.
Problem
=======
nested bulletlists on report level need style to correct their display
Solution
========
add the style
opw-3196888
closesodoo/odoo#118434
X-original-commit: f7220566fa649ade4ac1db30c81cf5aa6de3f8e4
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: abla001 <abla@odoo.com>
**Before this commit**
Almost all of the use cases of the `usePopover` hook are dealing
with an abnormal amount of complexity:
- they have to store the closing function of the popover, and sometimes
keep track to its opening state,
- you can find a duplication of a useUniquePopover hook, which is
anyway the behavior that is always wanted for popover users.
This is due to the fact that usePopover is just some kind of wrapper
to the lower level popover service.
**After the commit**
- The usePopover now has a new API, which simplifies its usage.
- The useUniquePopover hook implementations have been removed and
this "unique" behavior is now merged into usePopover
and has become the standard one (not configurable).
- All of the use cases have been adapted, even the cases where
components used directly the popover service (through `useService()`).
See the adapted jsDoc around the hook in popover_hook.js
closesodoo/odoo#118066
Related: odoo/enterprise#39654
Signed-off-by: Michaël Mattiello <mcm@odoo.com>
**Before this commit**
The popovers will close on click away.
This makes impossible to start selecting text within a popover
using the mouse and finishing the move outside of the popover
(as it will get closed).
**After this commit**
Popovers will close on mousedown away instead, which is a general
standard for user interfaces anyway.
Part-of: odoo/odoo#118066
**Before this commit**
Only four positions authorized for popovers:
- bottom,
- left,
- top,
- right.
These four positions are by default with the "middle" variant.
But the positioning hook could replace the variant with "start" or "end"
and furthermore the popover already handle those cases to properly
place its arrow.
So it does make sense to authorize all the possible variants as well.
**After this commit**
All the following position are available to popovers:
- {bottom|left|top|right}-{start|middle|end|fit},
- {bottom|left|top|right} (same as {bottom|left|top|right}-middle).
Part-of: odoo/odoo#118066
Since c959386 the calendar filter panel does not
make use of popovers.
So there is no need to call the usePopover hook
in this component's setup.
Part-of: odoo/odoo#118066
Purpose of this commit to make the example currently being selected
more obvious, as the current small green bar is very discrete.
So, in this commit highlight the whole cell currently being selected
instead of displaying a small green bar on the left.
task-3165202
Part-of: odoo/odoo#112620
Before this commit `Measure` button in pivot and graph view
was small compare to other buttons in control panel because
flex class on left button control panel and pivot/graph view
has two button groups in their left button control panel and
flex class is only applied on first button group.
This commit add style for pivot & graph view to display then in
block to fix that issue in stable and we will move those two
button group in single div in master to apply flex class on
both button groups.
task-3187910
closesodoo/odoo#118379
X-original-commit: 6a185985867b9138378fb476ab93fd18f60357e8
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
Currently, there is a download function exported that expects data and a url.
You would provide a controller url and some data to send, and the result would be downloaded.
However, it may be useful to sometimes trigger a download on the spot if there is no need to reach for a controller. Like having some json data and download it.
The code already existed, so this function is now exported as `downloadFile`.
closesodoo/odoo#118227
X-original-commit: cd9a5d491715247636d95c9f768ffc42616f4b47
Related: odoo/enterprise#39564
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
This commit adds an information in the topbar (thus always visible) to
indicate the number of QUnit.todo tests that have been completed and the
number of QUnit.todo tests that are uncompleted.
closesodoo/odoo#118402
Signed-off-by: Nicolas Seinlet (nse) <nse@odoo.com>
This commit removes the space between the field name and the colon in the calendar view popover
closesodoo/odoo#118347
X-original-commit: 2e220c722faf688a0bce68c3af1f92e9b379802b
Signed-off-by: Luca Vitali <luvi@odoo.com>
Signed-off-by: Larcin Vincent (vila) <vila@odoo.com>
New module that would allow restaurant customers to see the menu on their own devices by scanning a qr code and navigating to the provided link.
Task id 3232765
closesodoo/odoo#114022
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
This commit ensures that keys ending with _view_ref are properly
removed from context when using create and edit action
opw-3256019
closesodoo/odoo#117471
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Calendar popovers are now easier to read and navigate.
If an event contains a lot of information, its popover now grows tall
instead of wide.
In case of more than a few attendees, the widget shows a summary and
allows the user to expand the full list.
The displayed total number of attendees is now accurate, without the
default field limit.
task-2685440
closesodoo/odoo#112114
Signed-off-by: Arnaud Joset <arj@odoo.com>
Before this commit:
It is not possible to add a popover in an iframe (with the popover
service of an app from outside the iframe).
After this commit:
The position hook now finds out the possible target's iframe element,
from which it can compute an offset so it could position properly the
popper element.
Known limitations:
The popover element is not attached inside the iframe's DOM, so there
may be some cases where the popover is shown outside of the iframe
(depends on scrolling).
closesodoo/odoo#116499
Taskid: 3184061
Related: odoo/enterprise#36168
Signed-off-by: Arnaud Joset <arj@odoo.com>
Co-authored-by: Leonardo Pavan Rocha <lpr@odoo.com>
**Before**
The "reference" argument of the usePosition hook is badly named as it
easily be confused with useRef's references.
**After**
The argument has been renamed "target",
which is a terminology used in other places, for example for popovers.
Part-of: odoo/odoo#116499
Steps to reproduce:
- Install appointments
- Log in as Marc Demo
- Go to Calendar/Online appointments
- Click on a record in the availability x2many fields
Current behaviour:
It opens the record in a form modal.
Expected behaviour
It should not open the record since #110838 because the x2manyfield
is in `editable="bottom"`.
closesodoo/odoo#118225
X-original-commit: d4399a87f1ca59389d7e58754b67c3fc816cb25a
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Before this commit, the field node id (`field_id`) uses the field name
for the first occurrence on the arch, and add an underscore and a number
for the rest of the occurrences. This can create inconsistencies when
sombody assumes that the field_id is equal to the name, and don't take
into account the possibility of multiple occurrences.
Now, a unique id is created since the first occurrence, this remove all
ambiguity between the id and the name.
Part-of task-id 3179751
closesodoo/odoo#117799
Related: odoo/enterprise#39511
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
How to reproduce:
- create a list embedded view in Knowledge (/item list)
- in the control panel click on "Filters"
Current behavior:
- the dropdown is not correctly positioned
Expected behavior:
- the dropdown should be positioned around the button
Fix:
`getBestPosition` uses dimensions and layout positionning based on the viewport,
but `reposition` modifies the style properties `top` and `left` of the element,
which are relative to the closest containing block. Since in that case the style
position is `fixed`, there are a number of factor that can influence the
containing block, as specified in:
https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
We can easily compute the layout offset caused by the containing block just
after resetting the popper top and left to `0px` and take it into account for
the final value.
Task-3267555
closesodoo/odoo#118018
Signed-off-by: Bruno Boi (boi) <boi@odoo.com>
Before this commit, when clicking on "Attach files" in discuss
composer, then removing it, it was not possible to upload the same
file again.
This happens because file input of file uploader relies on `change`
from the input. The `input.value` contains the filepath, so if we
upload the exact same file without clearing the value, the value
will be unchanged and it won't trigger uploading as a result.
This commit fixes the issue by clearing the input just after
the file has been uploaded, so that we can upload the same file.
Cannot reproduce bug in QUnit tests because `inputFile` helper
programmatically always trigger "change" on input file.
closesodoo/odoo#117704
Signed-off-by: Luca Vitali <luvi@odoo.com>
Fix the phone field buttons text alignment
("Call", "SMS", ...) which is currently rendering
the letters on different lines because of a text-break
css class introduced by: odoo/odoo#114442
Override this text-break class for the phone field
buttons links.
Task-3258943
closesodoo/odoo#118109
X-original-commit: 012f97b7e6811bfa4804ba49696811f7f6b98582
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
We move the function loadFields from the view service to a newly created
field service. That service can also be used to load model fields for a
given path (loadPath), i.e. load all model fields for the models
traversed by the given path.
We use loadPath in useModelField and DomainSelector.
closesodoo/odoo#117882
Related: odoo/enterprise#39418
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
We introduce two new methods for Cache:
- a method "clear" that can be used to delete a specific path
- a method "invalidate" that can be used to delete all paths
Part-of: odoo/odoo#117882
Before this commit:
- The burndown chart displayed the stage in order of the data fetching which wasn't logical especial for a chart that supposed to represent the evolution of the tasks in the project
- When sorting all/my tasks by stage, It was possible to select any project in any quickcreate of the stages which didn't make much sense
After this commit:
The burndown chart legend is now ordered according to the stage sequence (previously was ordered randomly by comming data)
Modified the burndownChartModel, simply makes a RPC to get the stages and sequences then sort the legend elements (one by stage) with it
Display only the projects which uses the stage in the dropdown menu of the task kanban quickcreate (when grouping by stage)
When sorting by all/my tasks by stage, the quickcreate now only display the projects which contains the stage selected
done by adding a domain in the quickcreate form
(shoutout to LTU and AUON who actually found the fix)
Task-3067445
closesodoo/odoo#105694
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
before this commit, in the calendar view, if there is
a field of selection field, instead of showing the
filter value, currently it is shown as undefined.
after this commit, the filter will show the selection
value instead of undefined.
closesodoo/odoo#118007
X-original-commit: edf838d791ee02f41af2bff32dc20b5657ef0d81
Signed-off-by: Bruno Boi (boi) <boi@odoo.com>
partial revert of https://github.com/odoo/odoo/pull/117205
Since there was no link between the odoo instance and the new tab,
it was impossible to determine if it was really open and the test
afterward would always trigger
closesodoo/odoo#117973
X-original-commit: 5717eeec9eb8d5cc9cd684e6b147919d808f5db1
Signed-off-by: Vranckx Florian (flvr) <flvr@odoo.com>
This commit introduces an optimization to reduce the number of read
operations performed in kanban views that are grouped by a field with
a group_by_tooltip. Specifically, we now fetch the required values
from group_by_tooltip only when the tooltip is first opened, instead
of performing a read every time the view is loaded.
Part of Task: 3179751
closesodoo/odoo#117758
Related: odoo/enterprise#39349
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Since 5da90dfc4 a test has been added in which
a global readonly variable from `window`
is reassigned.
Furthermore, it is the global "parent" which is
read-only and should nerver be modified.
closesodoo/odoo#117927
X-original-commit: 169a471c7d48891d3295e2b597300425fb145abc
Signed-off-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Signed-off-by: Bruno Boi (boi) <boi@odoo.com>
This commit removes the onCreate param in Kanban, as it is no
longer useful since [1]. It also removes the beforeLoadProm param
and replaces it by an onWillStart option, which is slightly cleaner
(there was no reason for this to be a model param as it is only
used by the useModel hook).
[1] 067bcac533
Part of task 3179751
closesodoo/odoo#117889
Signed-off-by: Géry Debongnie <ged@odoo.com>
*: web
This commit removes the use of the legacy environment from the PoS, as
it is no longer needed. This will allow us to more easily use the new
unit testing infrastructure from web.
Part-of: odoo/odoo#117290
This commit adds a new prop to the Dropdown component: autoOpen.
It is true by default and follows the current behavior of all
current dropdowns (automatically open the dropdown when it is
hovered and a sibling is already opened) when set to true and
disable this feature for the dropdown when set to false.
The commit also applies this new property and set it to false on
all small icon dropdowns that are present by default in the
enterprise navbar to facilitate navigation with these (debug,
messaging and activity)
opw-3259473
closesodoo/odoo#117622
Signed-off-by: Bruno Boi (boi) <boi@odoo.com>
This commit removes the manualOnly prop on the Dropdown component
and all its related code because it seems unused.
opw-3259473
Part-of: odoo/odoo#117622
This commits makes the TagsList component able to display icons as well
as images were previously supported. A test has been added to verify the
presence of the icon set in each tag.
closesodoo/odoo#117751
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
*: project
This commit adds test to this component and removes unused props. Since commit (1),
it is now considered as a core component. Those props have been removed from the
props declaration, to better match the real usage of the component.
Since the className props was not present:
- The o_kanban_tag class given in theory were not set in practice. The rules
corresponding to that class were already adapted to fix the display of tags in the
kanban view. It was possible to get rid of the references to the o_kanban_tag class.
- The o_field_property_tag_readonly class was also missing, and the logic to prevent
the click on tags was duplicated in the onTagClick function. This makes the class
useless. I removed mentions to this classname. Instead, each tag has the pe-none class
using the same condition, but set in the tag declaration.
(1): 129fa3f150
Part-of: odoo/odoo#117751
When we use a 12 hour time format (without the `%p`), the time set is
always in the morning regardless of the period used (AM or PM).
Using `preparse` and `postformat` in the locale to change the symbols
used for numbers prevents the user from changing the date in the
datepicker because the date will be unparsable
Steps to reproduce:
1. Install Calendar
2. Go to Settings > Translations > Languages and open 'English (US)'
3. Set the time format to `%I:%M:%S`
4. Open Calendar and create a new meeting in the morning
5. Edit the meeting, set the time period to 'PM' and save
6. The time of the meeting doesn't change
Solution:
Get the time from the event passed when we close the bootstrap
DateTimePicker and convert it to luxon.
The period displayed when we open the datepicker is always 'AM'. This is
a limitation with the bootstrap DateTimePicker that uses the value from
the element[^1] (which is already formatted with the 12 hour format,
without the period info). Hence, the time is always in the morning
Problem:
The value of the element is used to set the date but this value is
already formatted with the 12 hour format (without the period info) so
it's always in the morning
opw-3150033
opw-3233229
[^1]:https://github.com/odoo/odoo/blob/16.0/addons/web/static/lib/tempusdominus/tempusdominus.js#L395closesodoo/odoo#117781
X-original-commit: dc195613ecff17d6aadc6e6ad8ab6da3670eb85a
Signed-off-by: Julien Mougenot (jum) <jum@odoo.com>
Signed-off-by: Guillaume Merlin (megu) <megu@odoo.com>
Removing the "Oks" from the "Archive" modals to
clarify what confirming the action will do.
Also fixing a wording error in the form controller
archive modal.
Task-3241064
closesodoo/odoo#117588
X-original-commit: 61c8b51a3d77e913acacead6379cd686693f86ce
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
This commit is a security reinforcement.
Before this commit:
ir.action.act_url was able to handle and redirect to protocols like
file:, javascript:, date: ... This is unnecessary in the context of
this action. It could potentially be abused by a poorly written custom
module
It also would not isolate the landing page in case of a new tabs.
It means that chrome would still consider the tab to be from the
previous domain in case no url was passed and js was executed.
This would allow the newly open tab to still make query's to the
referrer using the referrer's cookie. While not stricly necessary
if we already prevent url that start with "javascript:", it is a
nice to have.
After this commit:
New tabs are not able to access referrer informations or execute
javascript interacting with the referrer. Also, it is now impossible
to redirect to protocols other than http and https directly from
the ir.action.act_url
Test update:
All new tabs are required to have the "noreferrer" argument
Tested an example of an unsupported protocol.
closesodoo/odoo#117687
X-original-commit: a020072da17e32fca0bbe6ed02b1afaeec8e8a02
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Since saas 16.1, we added a more visible error information box when the
module system cannot find some dependencies, or if there is an error in
the JS code. This error box is very useful to understand a lot of
typical devlopment issues. However, it was occasionally displayed in
production code.
However, we sometimes observe that the error information box was
displayed, because the request to load an assets failed with a 404.
It is unclear in which circumstance this can happen, but it seems that
the following elements are involved:
- the user has an open tab with odoo, kept open for a while
- some js code is changed on the server, which causes the previous
assets to be deleted
- the user reload its open tabs, so the browser will load the /web page
from disk, which points to the old assets files
- then it will try to load all assets, with a 404 on one of the script
- the error information box is displayed
This commit intercepts the loading error and stop displaying the error
information box, which is basically the same behaviour as 16.0 and
before. We could force a reload in that case, but it seems dangerous,
since in case of errors, it could easily lead to an infinite loop.
closesodoo/odoo#117625
X-original-commit: 0a44b5b1e008b591a716efd26217c7db7360c37b
Signed-off-by: Géry Debongnie <ged@odoo.com>
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
closesodoo/odoo#117456
Signed-off-by: Géry Debongnie <ged@odoo.com>
The aim of this commit is to simplify the RelationalModel by moving
Kanban's specific quick create record functions to the Kanban View.
Before this commit, when asking to create a new record using the quick
create on a kanban view, a new virtual record was created by the
DynamicRecordList and added to the DynamicGroupList on the
RelationalModel. A complex mechanism was used to be sure that only one
virtual record is created between all DynamicGroupLists. When the record
was save, the new record (in form view style) was modified to a kanban
style (to do this, the record's activeFields were modified to be
compatible with the kanban card).
Now, the virtual record is created on the Kanban View, in a more simple
way, the kanban renderer knows in which group there is a quick create,
and only in that one the form renderer of the quick create record card
is shown (not need of complex mechanism to have only one quick create
between all groups). After the save, we simply call an existing function
to add the new record to the group using the record's ID (not need of a
complex mechanism to modify the record to a kanban style).
part-of task-id 3179751
closesodoo/odoo#117449
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
As the upload service (js) only uses iteration, index based access and length
on the files parameter, it is compatible as well with an array of File as files
parameter (instead of a FileList). So, we have updated the files parameter
docstring to accept as well array of File. With this change we can easily pass
a modified list of files (ListFile being hard to create on some browser).
Example of use-case, only send to the upload service the files smaller than a
given threshold by transforming a FileList to an array and then by filtering
it.
Task-3179130
closesodoo/odoo#117385
Related: odoo/enterprise#38490
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
guardedCatch is a legacy feature meant to differenciate promises
rejected as control flow from promises rejected because of an error. In
recent years we have settled on the stance that using promise
rejections, which are treated as errors by the language in many ways, is
a bad idea. This commit removes the dependency of the odoo module system
on this legacy feature.
closesodoo/odoo#117457
Signed-off-by: Géry Debongnie <ged@odoo.com>
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
closesodoo/odoo#117305
Related: odoo/enterprise#39118
Signed-off-by: Géry Debongnie <ged@odoo.com>
Before this commit:
When the label of the selected value was too long, the SelectMenu width
would grow indefinitely to accomodate, this behaviour was causing some
layouts to break.
After this commit:
The width of the SelectMenu is still automatic and will try to fill its
parent but will not make it grow. Instead, if the label is too long and
does not fit in the parent, it will be truncated.
Solution:
Using a grid display we can easly set the label to auto and truncate it
while keeping a constant size for the icons.
closesodoo/odoo#115799
Related: odoo/enterprise#37285
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Before this commit, in multiselect mode, clicking on a selected choice in
the dropdown did nothing. Now, while hovering, the choice's background
becomes red and clicking on it will remove it from the selection.
Part-of: odoo/odoo#115799
This commits exports the SCALE_LABELS list from the calendar_controller.js
file. This allows us to import and know the list of available scales from
other locations (Studio for example), and be updated with the supported
scales with their value and label.
Part-of: odoo/odoo#115799