Fix/imp about the #19777
Replace cron of garbage_collector by a call from autovaccum. Don't try to find
which session is expired or not to avoid to check each one by one, but use a
stupid heuristic to delete all old session older than 5 weeks by default.
(overridable in autovaccum: model.power_on(**dict(wishlist_week=10)) e.g.)
Use 'display: none' instead of class hidden, to avoid flickering at load and
let jquery work with .show / .hide without removeClass('hidden').
Without it, the animation of the first product that you add in your wishlist
will be wrong because Wishlist menu is not visible while you don't refresh.
Remove all old test that check if we was the public user or not and that make
the PR not working ;)
Courtesy of @yajo for dev, and @rdeodoo for quick review/testing
When you was in debug=assets and that a less file was malformed, the
error was not displayed correctly.
Now we load a minimal layout (bootstrap style)
This commit closes#19799
The 'xmlrpc'-based configuration parameters have been a misnomer since
the introduction of the generic HTTP service, years ago.
Hide these options from the server parameters, and replace them with
more appropriate 'http' ones:
--xmlrpc-interface -> --http-interface
--xmlrpc-port -> --http-port
--no-xmlrpc -> --no-http
The config entries for these have been adapted as well.
The old parameter names are still silently supported in both
command-line arguments and config files. However they are
stored with the new names in the `tools.config` dict,
and when saving config files (with the -s option).
Also clarified and cleaned up the descriptions of the HTTP/WEB server
parameters.
And finally, added a short version `-p`, for the `--http-port` option.
Credits to @dreispt for this (via #19518)
Closes#19518Closes#19778
This commit introduces a new way to hide a column in a x2m list view.
The attribute 'tree_invisible' can be add in the field attrs in the x2m
view definition. This attribute can use the 'parent' key to make a reference
to the parent record (e.g. 'parent.id').
Make it easier to take advantage of subqueries whenever possible.
Also remove some weird semantics of the operator `not in`: searching with the
domain `[(F, 'not in', [])]` was returning the records with relations, instead
of all the records. The new semantics makes `[(F, 'not in', ids)]` equivalent
to the complement of `[(F, 'in', ids)]` in all cases.
The `isMobile` variable was defined at the right place (`config.device`)
but was set at the wrong place (`config`).
Thank you for making me author of all the `isMobile` lines by
the way... :)
1/ Lint
2/ Follow new .js guidelines (mainly re-sequence function alphabetically)
3/ Introduce BaseSetting.SearchHeader template for search header instead of replicating html code
4/ Add some comments in code
5/ When we close a modal or come back using breadcrumb, left panel is lost and all the settings are displayed. This commit fix the issue
6/ Remove the fact that the current app is in top of the app list
7/ Improve search
Verifies that admin operations on modules/apps are indeed performed by
an administrator, regardless of ACLs on `ir.module`.
Also logs these important operations, whether completed or blocked.
If the Odoo server runs with its sources read-only
for itself, this is not possible for the server
to touch the files contained in the assets.
In such a case, instead of touching the file,
we alter the attachment checksum, to simulate
a change within the modified date.
However, in such a case, we can only test that the
bundle is well generated again.
We can no longer check the change of version and modified date,
since the modified date of the files have not changed,
and therefore the checksum (which is based on the files
modified date, among others) neither.
Since the revision
5e3de76f36
The `::text` is included within the `unaccent` call
The expession tests have never been changed according
to this change of behavior in the building of the unaccented
queries. This has never been detected by runbot because
you need to start the Odoo server with the option
`--unaccent`
and to create the database with the unaccent extension
`CREATE EXTENSION unaccent`
to be able to fail the former tests,
and this is not the case on runbot.
Was only done when updating base.
The cost of scanning the addons path should small in comparison to the update
time itself.
Followup of #9133Closes#9140
When reading a one2many field, the inverse field of the retrieved lines may
already be assigned in cache to a new record. This can happen during an
onchange. In that case, the algorithm crashes. Let's clean it up!
Reading them as bytes would not crash but could fill the corresponding
field with pretty much garbage. Turns out Html fields inherit from
Text and XML content generally goes into text fields, so handling
these items as text makes much more sense than as binary data.
Following commit https://github.com/odoo/odoo/commit/dbb931976fd102a1eceea4ebf195efea7576f260:
The inherit_children field was not showing the proper order of
inheritance in form view, making debugging complex.
Note: this commit adds the code to show the proper order but revealed
a bug which will be fixed in another commit: the default_order of
x2m views only considers the first ordering field.
Currently, the view inheritance order is 'priority,name,id', the
default order for the 'ir.ui.view' model.
This commit changes the order to 'priority,id' while computing
inheritance. This make views chronologically ordered according to their
installation order, after the primary sorting on `priority`.
This helps to automatically solve some inheritance order bugs that would
have traditionally required explicit view priorities.
Considering this example: an app C depends on two others apps A and B.
We want the LESS files of C to come after the LESS files of A and B as
CSS rules order matter. The only solution to make sure of that with the
current implementation is to change priority field of C to be higher
than 16 (default of A and B). With a complex hierarchy, that will induce
errors. Ordering by 'priority,id' solves the problem, indeed views' ids
of apps A and B will be lower than views' ids of app C. The "name"
ordering is fine for list views display but not for views inheritance.
Closes#19658
Coercing the result of the compilation to text is easier and more
portable than P3-specific code for putting the Popen streams in text
mode.
Fixes#19659
This is an attempt at fixing the long timeout occurring on P3 when
trying to stop the server with Ctrl-C, both in multithreaded and
multi-process mode.
The root cause is the implementation of PEP-0475[1] as of Python 3.5,
which make system calls silently resume after an interrupt.
With this PEP, interrupting a syscall now requires the signal handler to
raise an exception, which get propagated in places where they did not
use to occur (e.g. time.sleep() used to return early when interrupted)
The solution handles 2 separate cases:
1. Multithreaded
In multithreaded mode, stopping the server requires interrupting
the main thread, while ensuring that all other threads are daemon ones.
The previous commit fixed the latter.
Interrupting the main thread is easy, because it simply sleeps until
it gets interrupted. And it already catches KeyboardInterrupt for
win32 quirks. All we need to do is thus to raise a KeyboardInterrupt
in the signal handler, as proposed in PEP 475 (Use Case 2)
2. Multi-process
In multi-process mode, stopping the server requires interrupting the
main thread of each process. The signal is already propagated to all
processes, so it should be as simple as for multithreaded mode.
Unfortunately, the main threads are far from idle in this case,
and raising a KeyboardInterrupt from the signal handler causes a
series of ugly tracebacks before stopping the server.
Effective, but frightening for the admin.
Instead of doing that, we can watch the wakeup file descriptor
(also suggested in PEP 475, Use Case 2) during the sleep() part of the
main loop of each worker. An interrupt signal won't therefore stop
the server immediately, but will wait until each worker is done with
their current request.. even better.
For select() syscalls, this is done with an extra pipe fd that is passed in
the "read fds", and used as wakeup fd.
And for sleep() syscalls, that don't support a wakeup fd, we can
replace them with an equivalent select() call on the wakeup fd, and
a timeout.
The combination of the above seems to restore a relatively fast
interrupt shutdown on both Python 2.7 and Python 3.5, in both
multithreaded and multi-process mode, with no surprising traceback.
[1] https://www.python.org/dev/peps/pep-0475/
By using the thread's repr() we get its type, name, daemon status and
ID, all at one time. No need to include them separately.
Fall back to the threadId in case the repr() is empty, which can
happen for exotic threads (the gevent main thread seems to be like that)
Before this commit, when trying to preint an invoice when minimal company details were set (without the logo),
- the wizard of company edition was not clear enough on what was needed
- did not print on clicking save
After this commit:
- the wizard is clearer, specifically it tells the user to add a logo
- clicking on save now prints the invoice, even though no logo has been set on the company