- Switch to French language
- Go to Inventory > Inventory Adjustment
- Launch an adjustment
The field 'Real Quantity' doesn't follow the float formatting.
This is because the widget is set as `field_float_scannable`, which is
not recognized by the formatting function.
Since the widget descriptor has priority over the type descriptor, we
must explicitly take this widget into account, on top of adding the
`format_value` method.
opw-1940884
closesodoo/odoo#31366
On IE11, in 10.0 up to master in some instance when creating a record
under some conditions the dropdown may be automatically opened and need
to be closed.
This has been pinpointed to 90c1af1151 so it seem that a combination of
fields/code/autocomplete and changing the placeholder at one time causes
the issue.
Since IE11 lie and say it is mozilla 11.0 we just apply the 90c1af1151
when the browser is chrome (we did no did this at first to have the same
behavior accross browsers).
note: there is an opened bug in chromium https://crbug.com/928305 if
solved the hack could be removed completely.
opw-1940592
closes#31271
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
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
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
Since march 2015, using in a domain "relativedelta(months=X)" with
X being bigger than 11 or lower than -11 would result in an error.
This is because in the refactoring adding modules (e8a00bc50d) the two
functions divmod and utils.divmod with different implementation in
pyeval.js were replaced by one function divmod in web.utils module.
But there was still an usage of the removed implementation.
opw-1880766
closes#26816
On a database where many modules are installed (e.g. runbot all), with
the option "manage available packaging options per products", doing a groupby
"product" on the "package type" list view triggers a js error.
It comes from the fact that the fixed_group variable contains a "length"
attribute; the _().each function uses this to determine (erroneously)
that the object is an array.
It thus uses fixed_group[0] to get an undefined, and then tries to access
a method of undefined.
We replace the each by a simple js loop.
opw 1863576
Before this commit, it was not possible to add an amount to a new
bank statement. The input (.o_form_field_monetary) appeared as disabled.
This bug was due to this commit: @a1224f5ca
This rule should be only applied to .o_form_field_radio.
Closes#18887
Task ID: 35832
Commit bcd4c90 was intendend to make get_file handle uncaught/unserialized exceptions
in the context of a http request
The drawback is that when get_file received a serialized exception (route: /report/download)
the JS modal was empty in that case
This commit handles both the cases
OPW 1848606
closes#24794
In case we define a field like,
<field name="my_domain" widget="char_domain" context="{'active_test': False}"/>
when selecting records the dialog should display all records (as asked by the
context), but it's not the case.
This commit ensure the field context is passed to the selection dialog.
opw-1831902
Before this commit, we had the following issue with binary widget in a form:
Suppose we have a binary field with filename attribute set. When uploading a
new file 'temp.txt' with content 'Cg==', the displayed value is 'Cg=='. When
the changes are saved, the displayed value becomes 'temp.txt'.
It should always display 'temp.txt', which is what is fixed by this commit.
In addition to fixing this issue, we describe what is the expected displayed
value of a binary field. This is based on whether the attribute filename is
provided, and whether the record is in edit or read-only mode.
Fixes#21630Closes#24275
Co-authored-by: Nick Booker <nick.booker@opusvl.com>
When we edit a list view and change page before the change has been
savec, the saving and page changing will be done concurrently thus
possibly causing an error if the page is changed before the saved is
finished: the save will try to modify the page that is no more
displayed.
In this change, the list view editable wait for the saving to be
finished before reloading its content.
note: for 9.0 up to saas-15
opw-1839149
closes#24471
- Create a binary field which takes some time for computation. For
example:
```
ding_dong = fields.Binary(compute='_compute_ding_dong')
def _compute_ding_dong(self):
if not self.env.context.get('bin_size'):
while True:
3*3
for x in self:
x.ding_dong = x.product_id.image_medium
```
- Run the server with a limited CPU time, for example:
`--workers=2 --limit-time-cpu=10`
- Download the file
A JS traceback occurs, without any information about the real crash.
The error management is simply not working: `JSON.parse` is called on a
string which is not JSON-parseable.
opw-1838832
Assume a list view with a many2many field, and a record for which
that many2many contains a single value, whose nameget returns the
empty string (which is a falsy value in JS). Before this rev., it
triggered an infinite number of namegets, and the browser crashed.
It was because the cell was re-rendered when the nameget returned,
and in the rendering of the cell, it re-performed a nameget if
the value was falsy.
opw 1838255d
Before this commit, if you or a lib uses Glyphicons, the font was loaded from
/web/content/fonts/ (or /web/static/src/less/fonts/ in debug=assets)
It is because bootstrap is imported from /web/static/src/less/import_boostrap.less
not directly from /web/static/lib/bootstrap/less/bootstrap.less
Now, we use absolute path to load font, overriding the variable define in
variables.less from bootstrap.
Steps to reproduce:
- Create a sale order and add sale order lines(Not Inline) without saving the sale order.
- Edit any of the existing sale order line and hit on "Save & New" on the sale order line.
- Add another sale order line and hit on "Save & Close"
Bug:
A validation error was raised.
opw:1829723
Some status were shown in the statusbar even though they were not specified in
the `statusbar_visible` attribute. This happened when the value was a substring
of one specified value.
Example:
```
hello = fields.Selection([('hello', 'Hello'), ('hello_world', 'Hello World')])
<field name='hello' widget='statusbar' statusbar_visible='hello_world'/>
```
In this case, both status were shown ('hello' is a substring of 'hello_world').
Fixes#20034
Consider the following scenario: open in edit mode a form view
containing a many2many field displayed with widget many2many_tags,
on the many2many field dropdown, click on 'Search More' (it opens
a dialog), and in the dialog, try to save the current search in
the searchview's favorite menu.
Before this rev., it tried to retrieve the context of the active
view in the closest instance of a ViewManager-like widget in the
SearchView's ancestors.
First, it is wrong as in the given scenario, the requested context
is actually the one of the list controller in the dialog, not the
one of the form controller in the background.
Second, it produces a crash in Studio, when trying to save filters
in the dialog opened by clicking on 'Search More' on the groups
many2many field in the sidebar.
This part of the code can't be tested in this version, but tests
will be added in master.
Fixes#23293
If the user tried to generate a report with more than 256 columns,
he would get a traceback instead of an error message.
Furthermore, if only one measure was selected, then the check was not done
and the user would also get a traceback.
opw-1816931
This commit improves link creation in web editor.
Before this commit, anything with a @ would be considered as valid email which
is obviously not the case. It would then be prefixed by 'mailto:'.
This was causing 2 issues:
- URL with @ symbol in it would have 'mailto:' added as prefix, like google
maps coordinates.
eg: mailto:http://www.google.com/maps/whatever/@312211.22,321321
- Incorrect emails would go through (eg: @@@, ko@k@k@, mail@mail)
Now, we will try to detect and identify valid emails from invalid emails from
URLs. It will also handle 'mailto:' directly typed in the input.
This commit comes with it's counterpart in enterprise https://github.com/odoo/enterprise/pull/1859
This closes#11984, closes#22936
Note that there is a WIP in master to use this new is_email function
everywhere we try to validate emails. It will aim to uniformize email
validation in odoo's javascript that are often performed with different mean
here and there, some more permissive than others, some only checking for @.
In df69b5bb the aggregates of a column with currency was shown only if
records were of the same currency when a grouping was closed.
But when the list view is grouped, this would cause a number of issue:
- error if with first grouping is opened, another one is closed
- if the first grouping was closed aggregates were always shown
- the code only acts when closing a grouping
- aggregates could be shown when they should not
- aggregates could be not shown when they should
So this commit change things so this feature is ignored when the list
view is grouped.
There is also a fix so `currency_field` of the column is used instead of
just using `currency_id` that may be wrong.
note: only for saas-14 and saas-15 (feature is not present in saas-16)
opw-810835
closes#22598
- Set the OS to a GMT- timezone (e.g. 'America/Los Angeles')
- Set the format of the date to '%d/%m/%Y'
- Go to 'Account > Adviser > Journal Entries'
- Type '02-01-2018'
The suggested date is 31/01/2018.
Setting the moment object as UTC will lead to a conversion of the date
to the OS timezone when calling `toDate`, e.g.:
Mon Jan 31 2018 16:00:00 GMT-0800 (PST)
UTC should only be used in case of datetime, not date.
opw-803466
- In some languages the kanban images are not displayed because of a bug in human_size method in JS.
This method translates the Unit Size for data and strip with the string with a comma as separator.
When the translatation contains spaces after the commas (like in the French translation), there is extra spaces in the final result.
This then cause an issue with the method is_bin_size that expects a unique space between the value and its unit.
Resulting in a bug in the method 'kanban_image'.
opw #804973#804970#804648