- 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 printing multiple reports with the "Reload from Attachment" option
selected, the order of the rendered pdfs was not respected. Using an
ordered dictionary instead of a randomized one solves the problem.
opw 1915685
closesodoo/odoo#30690
Fedora 29 switched to python 3.7. It seems that there is no official
way to build a RPM package that could works with 3.6 and 3.7.
Building two different packages for each version could open the pandora
box of packaging.
With this commit an ugly hack is used: if python3.7 is found, the odoo
directory is symlinked into its site-packages dir.
fixes#30579closesodoo/odoo#30618
Usecase to reproduce:
- Set 1 unit of product A in stock
- Scrap 1 dozen of product A
Warning message for Insufficient Quantity is not triggered.
It happens because there is no UoM conversion between scrap qty and
product quant quantity.
Fixes#30570closesodoo/odoo#30589
- Create a SO with 2 stockable products: 1 is available, the other is
not.
- Validate, go to the picking
- Set the 'Shipping Policy' to 'When all products are ready'
The 'Unreserve' button disappears, while some products were reserved.
When changing the shipping policy, the state of the picking is
recomputed and set as `confirmed` ('Waiting').
We make the button visible in this state also, when 'Shipping Policy'
is set to 'When all products are ready'.
opw-1932658
closesodoo/odoo#30635
In a pos session:
OFFLINE
make an order with invoicing , try to validate
The order stays there because it needs to be validated by the server
make another non invoiced order, validate
ONLINE
make another order
At validation, all orders will be pushed to the server
Before this commit, when trying to validate the invoiced order
the report download couldn't find the order id, and crashed
This was because the order in question was already pushed
but treated as a non invoiced order
After this commit, an "warning" message is displayed to the customer
saying he/she has to print the invoice from the backend.
In most cases it is enough and acceptable, since a customer would actually leave the premises
and come back later for the invoice
It is also safer in terms of data consistency to keep pushing all orders once the connection is back
OPW 1918044
closesodoo/odoo#30485
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
Have a tax that has a different account for refunds
make an invoice and its refund
Before this commit, the refund's tax is still in the old account
After this commit, the refund's tax is in the account for refund defined on the tax
OPW 1907950
closesodoo/odoo#30325
In case the discount product is misconfigured and therefore not loaded
by the POS, a traceback appears when applying a discount.
Add a comprehensive error message instead.
Closes#30574
opw-817527
closesodoo/odoo#30582
On mobile the frontend menu navbar is an hamburger menu that open on
click.
If the option "Customize > Main layout | Affix Top Menu" is
enabled, there is two menu:
- one at the full top of the page
- one affixed to the top of the viewport (only shown if we are at least
scrolling 300px away from the top of the page)
But there is a side effect: when scrolling if the menu at the top of the
page is opened, it will be automatically closed => this makes sense to
avoid having two menu shown on the same page but is an odd behavior.
With this commit, the behavior is changed and when the menu is opened in
the top, the affixed menu is not shown (it only works if the top page
menu has no opened dropdown).
opw-1920310
closes#30567
The sale.order model has an expense_policy selection field, with values in 'no',
'cost', 'sales_price'.
However that value can also be set to False.
The code that handles that field expected the value to always be set to a value.
We explicitly treat False as if it was 'no' (the default value for that field).
opw 1915508
closesodoo/odoo#30336
Commit f727e9d9b6 made the rating field
of mail.message non-stored for performance reasons.
When the rating is activated on the website, it adds the possibility to filter
product reviews by rating (1 to 5 stars).
It does so by searching the messages that have a given rating value.
However the osv complains that you can't search on a non-stored field.
As a result, instead of displaying messages filtered by ratings,
it would always display all of them.
We add a search='_search_rating_value' on the field to allow that field to be
searched anyway.
opw 1931038
closesodoo/odoo#30499
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
Use read_group is faster than the python equivalent,
and then don't push ids in ORM cache, which makes
the ORM faster later in the process.
Also unlink in batch.
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
- Create a SO, do not set a partner
- Add a product with a tax
The untaxes amount as well as the taxes remain 0.0.
This is because there is no pricelist, therefore no currency.
There is actually no need of rounding explicitly since these are
monetary fields which will be rounded automatically.
opw-1931796
closesodoo/odoo#30450
Task #1930691
Purpose
=======
If the download security is set to 'Authenticated users', the route should prevent public users
from downloading the slides.
closes#30281closesodoo/odoo#30399
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
Modifying less files and saving them using the web editor can raise
and error. The error is due to the way odoo save the modified file.
It extends the view containing the URL of the file by filtering views
related to the xml bundle id and keeping those that have the said URL
in their content.
This lookup fails to give just one result in case there are multiple
file containing the said URL. This fix change the filter from a
bare `if url in view.arch` to a correct xpath lookup.
The "/web/static/src/variables.less" less file was one of the
problematic files.
opw-1889794
closesodoo/odoo#30186
Create any module that inherit 'res.lang'.
Define any new field that is added with that inheritance.
Install that module. Then try to uninstall it. Traceback ensues.
When trying to write 'state': 'uninstalled' on the module,
the prefetching tries to read a column that has been deleted
by the _module_data_uninstall.
opw 1917369
closesodoo/odoo#30176
OPW 1918926
Current behavior:
The sql query groups by date,id in a intermediary table instead of the result. This allows to get data in the wrong order if the statements were not produced sequentially. The fill values are computed in the wrong order and may override correct values.
Desired behavior:
There is no override of the values correctly computed.
closesodoo/odoo#29936
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 commit, there were not specific view for the mobile devices.
The analytic account views were used.
Now, there are specifics views for the timesheet in the tasks.
opw-1913371
closesodoo/odoo#30309
Define a field on a model as:
- o2m to res.partner
- the field's column, hence its name, has capital letters in it
(studio does that)
create two objects of that class, each one linked to a different partner with the new o2m
merge the partners
Before this commit, the object linked to the second partner, was deleted
This was because merge partner sql requests did not quote the column name
After this commit, the second object still exists
This commit is tested in v12.0 with PR #30300 only. In v10.0 it is not testable as
the model concerned is in CRM, and that no new fields in business modules can be added in stable
OPW 1925060
closesodoo/odoo#30301
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