Purpose
=======
Allow to add an attribute ``show_unusual_days="True"`` to display
some days in green, according to a linked method ``get_unusual_days``
that should be defined on the related model to return all the
concerned days for a given period.
Before this rev, it crashed when opening the (sale or purchase)
product matrix (e.g. on runbot, go to quotations, create, add a
line, select 'My Company tshirt').
This was due to a recent override of _applyChanges (see 4bf98b47),
which didn't return the value returned by super.
OPW 2116083
closesodoo/odoo#39747
X-original-commit: 49626acbacb87a6f5d37bea22d0b51a506121914
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
In form views, there are stat buttons.
When the window size is too small, some buttons are packed into
a "More" dropdown.
Before this commit:
- The form view dropdown's buttons are shifted on Microsoft Edge
and IE 11.
After this commit:
- The form view dropdown's buttons are not shifted anymore on
Microsoft Edge and IE 11.
There was a fixed line-height on the button's icon. On Edge and IE 11,
it makes the icon moving down and this causes the offsetting.
The purpose of the line-height was to fix the button height to 44 pixels
So, I set up the button's height and centered the content.
Also, I removed a useless border-left because there was already one
border on the dropdown container.
OPW-2079694
closesodoo/odoo#39635
X-original-commit: a7d9f2a5a94662602a34f7e68e5cd0c4cd07c7f3
Signed-off-by: Jason Van Malder <jasonvanmalder@users.noreply.github.com>
In form views, when the window size is too small, a "More" button
appears and it should contain the overflow buttons.
On all browsers, the "More" dropdown doesn't contain the expected
amount of buttons, so it is shifted on the second line.
Before this commit:
- The "More" dropdown doesn't contain the expected amount of
buttons, so it is shifted on the second line.
After this commit:
- The "More" dropdown contains the expected amount of buttons
and it is not shifted on the second line anymore.
OPW-2079694
X-original-commit: 2bda8230fba07a229fcda77a1528694a0e317917
Before this commit, when a dropdown overflew its container
i.e. in the case of a long filter menu in modal
The scrolling of that dropdown to get to Add custom Filter
was impossible
This was because dropdowns react pretty bad when contained in a
relative positioned container
https://github.com/twbs/bootstrap/issues/26512https://github.com/twbs/bootstrap/issues/28513 !!
After this commit, the btn-group that adds the relative positioning
is forced into the default value
This commit corrects what was initially
corrected at https://github.com/odoo/odoo/pull/37594
in v12.0.
The incriminating commit that retriggers the issue
is irrelevant because it is the refactoring of action manager
but here it is: 40dd121938closesodoo/odoo#39541closesodoo/odoo#39636
Original-signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
X-original-commit: 7f72b837473f68a1dcd6a303ac1bf355dddcc2b1
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
Be in Right to left
Open a m2o search more, to get onto the list modal
toggle the filters menu
Before this commit, the filters dropdown was almost invisble
and too much on the right anyway
This was because the RTL was not taken into account
After this commit, we anchor the dropdown on the right
(both as in good and as in side) side of its trigger button
Also, when modifying the dropdown, by developping the Custom Filter
we force the repositioning of the dropdown, to take those new elements
into account
It is expected though that after this commit, in RTL, the
dropdown in a modal that has a scrollbar (which is on the left)
will be slightly pushed to the right. It is usable and visible though
Some kind of plumbing using $el.data('offset', fn) from popper.js
is possible, but has been deemed not robust enough
Docs
https://getbootstrap.com/docs/4.0/components/dropdowns/#methods
OPW 2088934
X-original-commit: 105b4affd65ea23e1aa65b53f4595c174c9984ef
Be in RTL mode, on a list view
Click on the button to set up optional fields
Before this commit, the dropdown expanded to the right, and was partly invisible
After this commit, we dynamically set to which direction the dropdown should expand
depending on RTL/LTR
Consequently the dropdown is fully visible in either mode, and expands to the list
rather than away from it
closes#39402closesodoo/odoo#39628
X-original-commit: fb914d176de5a4711f11de32945ebaec0164f62e
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
When loading a page on an existing starting database, registry is not
fully loaded causing potential error when trying to access model
existing in database (views, menitem, ...) since model added in last
loaded module does not exist in registry.
Thus, executing browser js test may lead to errors when executed during
an update on a database with other modules installed.
HTTPCase should be executed post_install to ensure that registry is
fully loaded to avoid this problem.
Since HTTPCase are slower than other test, it is also a good idea to
execute them at the end, in order to prioritize fast fail.
With this commit, a warning is isued if such a test class is tagged to
run at install time.
While at it, remove deprecated at_install and post_install helpers and
remove the deprecated phantom_js alias.
closesodoo/odoo#39462
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
In discuss, make a search with some stuff, and try to save
that filter as favorite
Before this commit, there was a crash, because the Discuss action
did not implement what the controllers do to save favorites.
After this commit, it is possible to save a filter as favorite
OPW 2087258
closesodoo/odoo#39519
X-original-commit: 5514a414324675bf5c2cc0360e429a7d2548b16f
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
Before this commit, the calendar searched records on the wrong time ranges
which did not take into account the timezone of the user
It obviously resulted in some records not being there
After this commit, all the relevant records are fetched according to the right
time range in UTC, corresponding to start/end of the week/month/day of the calendar
OPW 2076114
closesodoo/odoo#39466
X-original-commit: 0f10927efe490bd82e7c23e0fc646dd6c8de2d27
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
Have a parent template
Have a child, in extension inherit mode of the parent
The child has a xpath like
`<xpath expr="." position="replace" />`
Before this commit, there was a crash.
That was because the Comment
(which indicates which templates modified the parent)
was taken as the replacer node
instead of the actual content of the xpath
After this commit, there is no crash, and it works as expected
closesodoo/odoo#39453
X-original-commit: 02d790e1d21b78395e489f57bf30c82f728cbee6
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
To reproduce the issue, go in the settings of the employee app,
simulate a slow 3G connection, modify the working hours:
* Select the first one, modify it but don't save it,
* Click on some others working hours consecutively
They will be all editable
* Edit them quickly
Before this commit:
- You get an error
After this commit:
- You get no error and the behavior is the same than in V12:
the working hours are updated consecutively
Note: when you stress the relational field quickly, there is a moment
where this.$el is undefined. This is the reason why the error is raised.
OPW-2088558
closesodoo/odoo#39435
X-original-commit: 2acb76ffbb2f1ca2a6af0e316da15ce605f2273a
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Remove SignatureDialog from `signature.js` to put it in its own file,
`signature_dialog.js`. The purpose of this change is to be able to
require SignatureDialog in any other file and to separate dialog and
field business.
task-1878607
Before this commit, all the computation of the default widths for column
headers was done before the list was attached to the DOM, meaning that no
column was actually visible. This was a problem since columns that are
meant to stay unseen were taken into account in the calculation of relative
column widths.
Now, the same algorithm runs once the columns are visible so that invisible
columns can be properly excluded.
fixes#38744
Task 2076721
X-original-commit: 4bf98b47898b075049975dfe597f0fb92c7c14d1
Before this commit, the `width` attribute was interpreted by a jQuery node generator
function as a `style="width"` property and gave an incorrect width value to the affected node.
Now, the `width` attribute is automatically plucked in the list renderer in the
specific function used to render buttons.
Task 2076721
X-original-commit: c67b36c00ca263f51e0dd49d6e38702c4d614289
The nightly clickall runbot fail due to a crash of the underlying chrome
browser used to run the test suite. The problem is related to the
resources the browser is using. We leverage the problem by starting one
dedicated browser per app.
closesodoo/odoo#39190
X-original-commit: 228e57d980839bd2b4e9123bf26f8a64de2ae6ab
Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
Due to commit odoo/odoo@f4031c62f9
it was not more possible to scroll in a grouped kanban.
Steps to reproduce:
* Go to project app
* Select a project with a few numbers of task
* Create as need new task to have more task than visible on the screen
* Try to scroll (BUG)
Note: we also fix the swipe in empty column
opw-2080491
closesodoo/odoo#39168
X-original-commit: 023941e25cae34e60eaabcc54841b3d908a59414
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
Go on a kanban view with a scroll bar
scroll all the way down
Open a record in form view
Use the breadcrumb to go back to the kanban
Before this commit, the kanban was re-opened
but the position were we were before opening the record was lost
This was due to 40dd121938
which refactors the dom, puting the action manager on top of controllers
After this commit, when re-opening the kanban, we end up at the same position
we left it at
OPW 2074077
closesodoo/odoo#39120
X-original-commit: c0d48878c452b256859f067186567c126d8de27e
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
Before this commit, the search bar auto focus was already disable
on mobile based on media queries.
But "isMobile" equals false since we force the desktop mode.
To fix this, we use isMobileDevice which doesn't depend on the
resolution.
Task ID: 2090202
In this commit, we introduce "isMobileDevice".
Do not confuse with isMobile.
isMobile:
A frequent use case is to have a different render in 'mobile' mode,
meaning when the screen is small. This flag (boolean) is true when
the size is XS/VSM/SM. It is also updated dynamically.
isMobileDevice:
Mobile device detection using userAgent.
This flag doesn't depend on the size/resolution of the screen.
It targets mobile devices which suggests that there is a virtual keyboard.
Task ID: 2090202
Before this commit, some views appeared broken on mobile.
We don't consider this as a bug because Odoo is not supposed
to be responsive in Community edition. This feature is only
available on Enterprise.
This commit aims at clarifying this situation by clearly moving
the base requirements to support browsers' responsive to the
Enterprise edition and stating that the Community edition only
targets desktop.
It's important to note that, for technical reasons, some
responsive-related JS/CSS code may still be present in the
Community codebase but they are not meant to provide any
explicit or implicit support for responsive/mobile devices.
Technically speaking, this commit removes the viewport meta tag.
This change will then force the "desktop-like" rendering even on
small screens for the Community edition and will keep the current
behavior (scaling/zooming on small screens) for the Enterprise edition.
By doing this we do not let the users think that something is broken
and must be fixed.
So,
in Community edition, desktop is always displayed;
In Enterprise edition, Responsive Web Design is available.
We also had to adapt a test to be able to apply XPath adding
viewport meta tag in enterprise.
Task ID: 2090202
Description of the issue/feature this PR addresses:
In pivot, when we click on '+', it must open the selection box at
the point where we click.
Current behavior before PR:
The box opens at the top of the page
Desired behavior after PR is merged:
The box opens at the point where we click
id=2066675
closesodoo/odoo#39034
X-original-commit: 989df08fd8bbfa4a1f05784b599b1657a9b28fe5
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Before this commit, the trash icons and "OR" indicator of each filter
was too far and couldn't be seen
Now, both of them are closer to the filter and can be seen in any circumstance.
Task 2073707
closesodoo/odoo#39026
X-original-commit: 87a91c78fb15ee941e72023e02e539de64f0486d
Signed-off-by: Julien Mougenot (JUM) <Arcasias@users.noreply.github.com>
A 404 will take 3 to 5 seconds to be resolved and execute +- 1900 query, to return
a rendered page which is quite expensive, especially when multiple missing images
are rendered in a view.
Catching static route and marking them as not frontend will help to avoid to handle miss
on static resources. In this case server returns a standard 404.
This commit also fix a iframe src in order to avoid a 404 on
/web/(test )/report/html/some_report (thx to aab-odoo)
X-original-commit: 818d0cb59fbae78d0edf06318082981f318e4db7
On a list view, Add a custom filter on a date
Change the operator to "in between"
Change it back to "equal"
Apply the search
Before this commit, the label of the filter still was in between
Whereas it should have been "equal to ..."
After this commit, the label of the filter is correct
OPW 2085951
closesodoo/odoo#38705closesodoo/odoo#38869closesodoo/odoo#38936
Original-signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
Original-signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
X-original-commit: bb775152b79f1212258ff47daac387eaf11f64e2
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
In a list view, create a custom filter involving a date or datetime field
Before this commit, the domain that was sent to the server
contained the date or datetime as the pure string
representation that Moment.js constructs
that is a ISO compliant one, containing info on timezone
After this commit, the format is the one of the server, in UTC
and NOT ISO compliant. Also, the format for date is dealt with
OPW 2085936
X-original-commit: 1f1fa173c38dae105637edeb3a1e856e9748a14f
Purpose
=======
We want to add an option on the widgets
- many2many_binary,
- binary,
- image
This option specifies what file extensions the user can pick from the file input dialog box.
Examples
========
```xml
<field widget="many2many_binary" options="{'accepted_file_extensions': 'image/*'}"/>
<field widget="many2many_binary" options="{'accepted_file_extensions': '.png,.jpeg'}"/>
<field widget="many2many_binary" options="{'accepted_file_extensions': 'application/pdf'}"/>
<field widget="image" options="{'accepted_file_extensions': '.png,.jpeg'}"/>
<field widget="binary" options="{'accepted_file_extensions': '.pdf,.svg'}"/>
```
How
===
Add an option (accepted_file_extensions) in the template ``HiddenInputFile`` (the widget many2many_binary is using this template)
So, we can also use this new option in others widgets using ``HiddenInputFile``
In the many2many_binary, read the ``nodeOptions`` and set the widget attribute ``accepted_file_extensions``
We also have to fix some other widget, because an property ``image_only`` was already existing in the template ``HiddenInputFile``
(we just need to replace ``image_only=True`` to ``accepted_file_extensions='image/*'``
The widget ``FieldPdfViewer`` (pdf_viewer) now use the new option to filtrate PDF
(instead of removing the <input/> and adding <input accept='.pdf'/>).
Tests
=====
We also test if the option is correctly set on the <input/>
- binary
- image
- many2many_binary
Impacted widgets
===============
- many2many_binary
- image: this widget use ``options="{accepted_file_extensions='image/*'}"`` instead of ``image_only=True``
- tablet_image: same as ``image``
Task #2082815closesodoo/odoo#38351
Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
The attribute `self._fields` is not well named. This is not a list of instances
of the Field class.
It is a list of field names to export.
e.g. 'journal_id', 'account_id/name'
X-original-commit: 6225ce60082d5d2b5fec0e678fe2a1f3f9b93668
When exporting a grouped list view with some nested groups, the aggregate value
of parent groups are not correct. It always sums aggregated values of children
whether the group operator is 'sum' or not (could be 'max', 'avg', ...).
This behavior is wrong and can even lead to a crash if the aggregated field is a
date field (e.g. with group_operator='max'). (Try two sum two dates...)
The quick fix 85cf47f was merged just before OXP to avoid any crash. This fix
limited the support of aggregates to only int and float fields.
This commit remove this limitation.
This commit correclty implements the aggregation for parent group for all
field types and all group_operator.
This commit also improves the export feature tests.
X-original-commit: 5e7e4fa98698967e3c4fd0903f4aa8e91981a6cd
Before this commit, when we export a list with a groupby on
boolean, the groupby title 'False' is replaced by 'Undefined'
in xls document.
After this commit, with an export and groupby on a boolean, we
will have correct title: True and False.
X-original-commit: 7e2c7bc35f2a5b3bc22e0e6c9d3b38279cda9367
Before this commit:
When there few elements in kanban and a search panel, all kanban
cards try to take a maximum of height and become deformed.
After this commit:
The behaviour of dimensions of kanban cards must be the same with
or without searchpanel.
closes#38556closesodoo/odoo#38871
X-original-commit: a95cbbd631a2fa9be62eb42cba43e853fdf4b789
Signed-off-by: jbm-odoo <jbm-odoo@users.noreply.github.com>
The fieldbinary widget has an internal max upload limit set to 25mo.
This was set a long time ago, probably more than 5 years ago. Since
then, a lot of things have changed and it may be more frequent for users
to hit the limit. And it happens for some users, we had to increase
locally their limit.
Also, nginx is configured to accept files up to 64 mo, so it makes sense
that the web client also uses that same limit.
closesodoo/odoo#38856
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
This option, if set to True, prevents the user from modifying the
color of the tags.
Part of task 2070454
closesodoo/odoo#38848
X-original-commit: a62b65a8f9114493064d4efae92825814a880c04
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
- The copy CopyClipboardChar widget is not nicely rendered for very long strings (e.g. URL).
- This commit modify the behavior of the CopyClipboardChar widget to display it nicely win such cases.
TaskID: 2059972
Before this commit, it was not possible to show a message using a client
action. (e.g. show a success message only with core in Python)
Now, it's possible using a client action. This client action call
displayNotification and so we can use the same options also.
A test is added to be sure that this action do not change the current action
Note: in the future a custom registry may be created in a refactoring
to specific function action registry.
X-original-commit: 8775fd670b6b3ec19a77fc0eab72d2223baa36c8
Before this commit, if we use some client action like: reload, logout, ...
in the console a warning is show, because the action are function and not
AbstractAction.
After this commit, if the client action is not an function and not
a AbstractAction the warning is show.
X-original-commit: 122b76594aeb2c5d923d13c040c2da2048133aac
Before this commit, when we have a list (editable top) in a form
with some mandatory fields and some existing rows. If we click on
'add a line', a new empty line appear on the top, then we click on
the last row, the empty row will disappear and we will have a
traceback.
After this commit, if we repeat this scenario, we click on the last
row, we will be able to edit this last row.
closesodoo/odoo#38471
X-original-commit: 996f77b03eaf6dd646b1816e7f70209d5ee6f8df
Signed-off-by: jbm-odoo <jbm-odoo@users.noreply.github.com>
-Import a subscription with end date beyond 200 in the future (ex: 2500-01-01).
-Open the subscription and click the Edit button.
Before this commit:
A stacktrace appears indicating that a date is not valid. It's not possible to
edit the subscription.
After this commit:
The maxDate of the date picker has been increased to 31/12/9999, allowing the
user to edit subscriptions whose end date is that far in the future.
A test `toggle datepicker far in the future` for this case has been created.
closesodoo/odoo#38527
Opw: 2079696
X-original-commit: 32b6131c04fef7a542a0ccbdb924d177627bfe38
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Before this rev., if the week_start param (the first day of week)
of the user language was changed, it wasn't reflected on datepickers
(however, it worked fine in the calendar view). This rev. makes this
work by updating the moment locale with the corresponding param.
Fixes#36450Closes#36532closesodoo/odoo#38472
X-original-commit: eeb518316f25d652bea3ec6d387db6ad93284fb2
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
When there are many events at the same moment in a calendar,
events are thin and on mouse hover the event take all the width.
Before this commit, when we drag or we resize a event in calendar,
the event returns to the state thin.
After this commit, the width event stay width during resizing and
draging.
closesodoo/odoo#38384
X-original-commit: 405294602070590083a2b438f631615f72000292
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
This controller never really worked in the last 3 versions.
It was fixed in 11.3 with e9350993ca but broken with refactoring in 12.0 at a
higher level with 19eacf7d23.
It was even worse in 13.0 as it was leading to a traceback: `view_type` field
got removed with 3cd7ed07a2 but this controller was still reading that
field.
closesodoo/odoo#38355
X-original-commit: a5c4e262449fef03d05d5250e4523832db5fbf00
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
- fix condition to correctly display company logo placeholder
- use avatar_grey on the "Contacts & Addresses" as white on white is not visible
- use `cover` to avoid excessive zoom on mobile
closes#38001closesodoo/odoo#38319
X-original-commit: 1210cb70bec421936c9d332b1347797bc83845cf
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Allows the quick create on m2o in list views
Before this commit, when entering a new value in a many2one in a list and
exiting the cell through a click, the quick-create modal appeared for the
duration of the mousedown.
Now, the modal remains and allow to edit the new many2one value
Task 2076380
closesodoo/odoo#38289
X-original-commit: c00f84eb0a176b8d23927080078eb02dc2e5d806
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
We don't want the browser to fill inputs in the backend.
Most of the time this is useless but sometimes it is
even problematic. For example, focusing an input in a
modal can trigger autofill not only in the modal but
also in the whole page. If there is an input outside
the modal and it is recognized by the browser as a
candidate to fill, bad things occur.
For that reason, we set the attribute autocomplete to
"none" by default for input elements.
Note that "off" does not work all the time because
the browsers sometimes decide to ignore it.
Task ID: 2076730
closesodoo/odoo#38039
Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>