If xlwt is not installed on the server, the option is disabled.
However, the first element was checked, even if it is disabled.
Trying to export record without xlwt was causing a traceback.
Introduced at b60de0db41 where xls is now the first choice
closesodoo/odoo#30724
On mobile, swiping right/left switches to next/previous record.
This feature prevents the horizontal scroll of the form notebook's tabs by
overtaking the swipe gesture on those elements.
This issue had different consequences depending on the platform:
- on iOS: the tabs cannot be scrolled at all.
- on Android: the tabs can only be scrolled by using a two-fingers
gesture
This commit restore the horizontal scroll on the tabs but also keep the
swipe-gesture to navigate records.
opw-1929267
closesodoo/odoo#30658
Following revision 61eef73b52
the fallback to the standard external layout when
the external layout is not set on the company has been removed.
It therefore leaded to the raise of the exception
```
The report's template '%s' is wrong, please contact your administrator.
Can not separate file to save as attachment because the report's template
does not contains the attributes 'data-oe-model' and 'data-oe-id'
on the div with 'article' classname.") % self.name)
```
when the external layout was not set,
which could happen quite easily in a multi-company environment,
if you do not set the company external layout after having created it.
This revision simply puts back the fallback as it was before.
opw-1931195
closesodoo/odoo#30687
Before the control panel refactoring, whenever a user pressed ENTER in
the search bar (with no text), the current view was reloaded. This
untested behaviour was changed (not on purpose) with that refactoring:
instead of reloading, the search view add a useless filter in the list
of facets.
We restore the previous behaviour in this commit.
closesodoo/odoo#30503
Improve the mobile kanban when it's embedded in another view like
the Dashboard app
- Improve swipe: Allow to swipe on empty space
- When it's embedded :
- The Kanban column height now is fit to the content
- A empty space is now display if the Kanban column is empty
Task Id: 1904747
purpose of this commit is to remove default parameter of "casesensitive",
because default parameter is ES6's feature. it's not supported in IE9.
closesodoo/odoo#30751
During the unit tests, I have noticed that the test window was doing a
lot of work after the test were completed, it was using CPU and using RAM
in jigsaw pattern. Eventually after being left alone for a few hours,
the window would just crash.
This was due to an unlimitted chain of deferred running when an image
field had a load error.
The situation is as such:
1. The image is put in the DOM with an onError handler
2. There is an error, as the image is a dummy text for the tests
3. The onError is called, it clears the image field, then calls _render
4. _render re-adds an image with the same onError handler <----------
5. The onError is called - again - it clears the image field - again |
(wich does nothing this time because the value is the same) - |
then calls _render - again |
6. The second time _render is called, go to step 4 --------------------
... In the meantime, the widget has been destroyed by the test,
so it should not do anything anymore.
This fix breaks the loop, as well as bind the onError handled with 'one'
instead of 'on'.
closesodoo/odoo#30716
- Set the OS in a timezone such as the current day is different from the
day in UTC (e.g. America/Nome before 10:00 AM or Australia/Melbourne
after 3:00 PM)
- Open any datepicker
- The 'little triangle' indicating the current day is wrongly set (one
day before or after)
Knowing that Odoo always creates momentjs date and datetime with the
`UTC` flag set to `true`, the `bootstrap-datetimepicker` does something
which seems inconsistent.
First, it retrieves the `viewDate`, and sets it to the beginning of the
month and week in:
https://github.com/odoo/odoo/blob/1c6c504215f3ef09e6336c92c9d350e87599eaa1/addons/web/static/lib/bootstrap-datetimepicker/src/js/bootstrap-datetimepicker.js#L725
In this part, it is important to note that each `startOf` functions
called sets the hours/minutes/seconds to zero. It means that the
reference time is changed.
Then, it iterates on this newly created date, and determines `today` by
comparing it to `getMoment()` in:
https://github.com/odoo/odoo/blob/1c6c504215f3ef09e6336c92c9d350e87599eaa1/addons/web/static/lib/bootstrap-datetimepicker/src/js/bootstrap-datetimepicker.js#L748
However, `getMoment()` returns the current date and time, but with the
`UTC` flag set to `false`.
Therefore, we compare a UTC datetime on which the reference time has
been changed to a non-UTC datetime, which fails to give the appropriate
current day.
There are two approaches to solve this. The first possibility is to
change the way Odoo defines momentjs dates and datetimes, maybe by
removing the `UTC` flag at creation. This sounds like a bad idea, since
other widgets or views (such as the calendar or the pivot view) make use
of them. This is likely to introduce a bunch of new issues with TZ in
these views. The second approach is patching the library to fit our use.
Although we usually don't do such a thing, this allows to specifically
solve this use case, and in particular placing the 'small triangle' at
the appropriate date without impacting any other part of the system or
the library. It can be easily performed by comparing the dates and the
months to make it work.
opw-1915251
closesodoo/odoo#30538
When using the datepicker with norwegian locales, the dates are
correctly formatted using the norwegian locale but the name of
the months are shown in english. This cause a date validation
error and thus it is not possible to change the date.
tempusdominus.js uses moment.js to deal with dates, it sometimes
copies/creates some and set their option according to the ones
given at instantiation time and fallbacks on default options for
that are not set.
opw-1922437
closesodoo/odoo#30276
Before this commit, the web client had a naive strategy to handle lost
connections: it tried to poll the server every 2 seconds until a rpc
succeeds.
This works quite well from the perspective of the user, but may be a problem
from the perspective of the server. If a server is down for a longish period,
then each users active tabs will then perform a request every 2 seconds. This
means that the server will be progressively hammered by many requests, which
will clutter the logs, and make it more difficult to gracefully recover.
With this commit, we simply exponentially increase the delay each time, and add
a little jitter to give a better distribution.
Cherry-pick of 4a3f04bcc5closesodoo/odoo#30136closesodoo/odoo#30596
Before this commit:
Editing a translatable field -> clicking on a translation
warning ->
come back through breadcrumb do not preserve translation
warning.
After this commit:
Editing a translatable field -> clicking on a translation
warning ->
come back through breadcrumb preserves translation warning.
Technical note: alertFields is now an object and an attribute
of the form renderer
that stores translation alerts per record. The translation
alerts
created for a given record are maintained unless
they are closed manually or the renderer is destroyed.
Issue-ID: 1877480
Co-authored-by: Mohammed Shekha <msh@openerp.com>
closesodoo/odoo#29377
Before this commit, when opening the calendar view with a specific locale
in the "week" view
the days were translated but the date format was wrong and fell back to english
This was because the translated terms were passed explicitly, but the locale did not
get passed
After this commit, we do what it takes to pass the locale to fullcalendar
and the dates are formatted with the right pattern
Also, there may be a bug in fullcalendar, because just passing the locale in the options
won't work, it should be instanciated first in fullcalendar's "locales cache"
OPW 1922092
closesodoo/odoo#30530
For editing many2one fields (and partially many2many) most widget show
an autocompleting list of targeted records.
They thus have `autocomplete="off"` to prevent browser completion.
But chromium has an history of breaking `autocomplete="off"`, see:
- https://caniuse.com/#search=autocomplete
- https://crbug.com/468153
- https://crbug.com/587466
- https://crbug.com/914451
- https://crbug.com/923895
It seems that since chromium 71, the heuristic to ignore
`autocomplete="off"` has become more aggressive and for example if there
is at least 3 fields like an address in a page, chromium will ignore
`autocomplete="off"` for the fields like an address.
So for example the eidting the many2One field with placeholder "Country"
in a contact page now has a browser autocomplete menu that is:
- hidding the many2one autocomplete
- going to save empty country it appeared visually filled if the
autocomplete result was selected.
With this changeset, the placeholder in the many2one instance is
interspersed with U+FEFF charcters (ZERO WIDTH NO-BREAK SPACE) so the
browser does enable the autocomplete feature by force.
This should thus remove the issue (until it is fixed by chromium) in the
case of field named "Country" or matching other regexes in this file:
https://github.com/chromium/chromium/blob/cdb1b2073f12/components/autofill/core/common/autofill_regex_constants.cc
U+FEFF has been chosen instead of more recommended characters because
other have been shown erroneous for printing in some windows
configuration (see cb2a3afa7).
10.0 version of #30439
opw-1930588
closes#30439closes#30449
Commit 9af941428880af8e1810dfd9feef494d7a745e98
made it so that the value_from function depends on a variable defined after
the function complete has been called, without any guarantee that this function
would be called after. Apparently this is the right OOP thing to do.
opw 1930523
closesodoo/odoo#30712
Before this commit, the menu to go into the backend from the website was
not possible to open on iOS without opening the right menu first. This
was because position: fixed is not able to counter overflow: hidden in
iOS. This is the fix for stable versions, the proper solution will be
done in master.
Closes https://github.com/odoo/odoo/issues/29390
task-1923151
closesodoo/odoo#30507
Create record A on form view, on which a dynamic domain is added by an onchange.
Switch to kanban view. Quick create a record B. Click edit.
This sends you to the complete form view to edit the record.
The dynamic domain of A is still applied.
When discarding the changes, the _domains attribute was not reset.
Example of a model on which this flow can be reproduced is helpdesk.ticket,
with _onchange_partner_project providing the new _domain.
test courtesy of @aab-odoo
opw 1920874
closesodoo/odoo#30308
Open a pivot view with default filters automatically activating
Disable those filters
Change the groupBys on the rows and cols of the pivot
Save your result as a favorite filter
Before this commit, the filter did not contain the context information for columns groupby
Also, the search view did not exploit the context of the new filter as it should be
After this commit, the flow works as expected
OPW 1913732
closesodoo/odoo#29415
Before this fix, in studio when the user select the field then focus out
then focus in and selected a child field, an exception is triggered because
the last page is visible but the data are removed.
backport of 12.0's 9eef25ae0a
opw-1928453
closes#30277
Before this rev., a crash might occur when the user quickly
switched twice between pages (e.g. go to page 2, then page 3) on a
slow network.
In the given example, when data of page 2 returned, the list was
re-rendered. Unfortunately, the offset of that list' datapoint was
already changed due to the switch to page 3, meaning that the view
tried to render a page that wasn't loaded yet, leading to a crash
if there were modifiers to evaluate, or to empty records being
displayed.
This rev. ensures that the view is rendered with the data of the
page it expects.
closesodoo/odoo#30150
Start on the modal obtained by a "search more". The offset is never reset.
So suppose you are on page 2, looking at record 81-160.
Do a research that gives less than 80 records.
The result of the search is nothing, since is has been done with a 80 offset.
It should be reset to 0 when we do a new search.
opw 1920826
closesodoo/odoo#30109
As of saas-11.3 there is a "Attach document" widget that is meant to
more easily add attachment.
But on firefox the click event is coming from the button, where on other
browsers it was possibly from a child element.
So the code expecting the child element did not work on firefox.
opw-1920842
closes#29903
Most operations on X2Many widget possibly propagates a field context
(name_create, name_search, ...) but the original read or read on an
onchange does not.
With this changeset, the field context is also used in these instances.
The assertions added in the added test failed with:
expected: ["world"], result: [undefined]
expected: ["world","world"], result: [undefined,undefined]
fixes#29203
opw-1914466
closes#29866
In 3d2ca8104e some change were introduced to the graph view.
But part of it had no sense when displaying data over 2 group by.
eg. if the first level has 2 groups (2018, 2019) and each second level 2
groups (Done,Cancelled), we could have:
2018/Done: 0
2018/Cancelled: 5
2019/Done: 8
2019/Cancelled: 9
this gives us two main groups [2018: 5] / [2019: 17], the code
remove the 2018 because [2018/Done] is 0 so we have something odd
with columns not in order, and in stacked bar chart some part of
a bar at the wrong offset
opw-1932517
closes#30529
The display of many fields in the setting overlaps other elements,
e.g. OnSIP WebSocket, Domain and VoIP Environment in General Settings.
We override the flex: 0 0 66,6% set by Bootstrap by flex: 0 0 auto
so that everything automatically looks nice.
closesodoo/odoo#30359