| Age | Commit message (Collapse) | Author |
|
|
|
The API of `Registry` has been modified as follows:
- `Registry(name)` returns the registry of the given database
- `Registry.new(name)` forces the creation of a new `Registry` object
- `Registry.delete(name)` discards the given registry
- `Registry.delete_all()` discards all registries
- `registry.setup_signaling()` initializes the signaling for `registry`
- `registry.check_signaling()` returns an up-to-date `registry`
- `registry.signal_registry_change()` notifies that `registry` has changed
- `registry.signal_caches_change()` notifies potential cache invalidation
|
|
|
|
- The test for %f/%d is useless, eveybody has been using %s for
ages, and the psycopg2 error is pretty explicit if you don't.
It can introduce a small but useless delay for long queries.
- The duplicate except block was redundant with the generic `except
Exception` block, with only a different log prefix.
+ the logging for the type testing of `params` was useless too,
raising a error is enough (though that particular test is still
relatively useful because the psycopg2 error isn't very clear
when you mess up the parameters)
|
|
Minor improvement: subtracting time.time() floats is about
10x faster than creating `timedelta` objects, and the code
is simpler.
|
|
That way queries are visible at DEBUG level while they
are executing, rather than after the fact, making
the log less confusing to watch when long-running queries
are involved.
Closes #11182
|
|
When the database_or_uri is not a URI, rather than generate a dsn string
just collect the various psycopg2.connect keyword arguments in a
dictionary, and return that. This way psycopg2/libpq is the one doing
any necessary processing on the various parameters.
Fixes #3865 and fixes #6958 in a more resilient manner than manually
escaping dsn-injected values so database names or passwords containing
spaces or non-ascii characters work correctly.
In case a URI is provided to the dsn() function, return it as the `dsn`
keyword to get the same behaviour as previously.
Since we're checking dsns by equality, a dict should work just as well
as a string.
|
|
|
|
|
|
Borrowing a cursor each time you access `field.digits` may be costly, because
of the connection reset. Moreover, in most cases, the cursor is not used at
all, since the decimal precision are kept in cache.
For the installation of module `product` with its demo data, the number of
cursor allocations was reduced from ~1500 to about 50!
|
|
|
|
If you commit the transaction inside the context manager `cr.savepoint()`, the
savepoint is lost. In that case, releasing the savepoint fails. That failure
should not be handled by rolling back to the savepoint...
|
|
- Preserved explicit 3rd-party copyright notices
- Explicit boilerplate should not be necessary - copyright law applies
automatically in all countries thanks to Berne Convention + WTO rules,
and a reference to the applicable license is clear enough.
|
|
|
|
|
|
`_obj` doesn't exists anymore when the cursor is effectively closed.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
When reading over IN_MAX (currently 1000) records, the select is slip into
subsets of IN_MAX records. However the list of ids was split using set() method
which removes order that may have been pass. The subsets are ordered using
_order attribute but the subsets were not ordered between themself.
This is an issue in case of browsing a o2m field with more than 1000 lines as it
will return sorted blocked but the order of the blocks is the order of the
contained ids (e.g. split(2, [5, 4, 3, 2, 1]) -> [[2,1], [4,3], [5]]).
Removes the set() to make sure the order of the given ids is preserved.
opw 616070, linked to #439
|
|
Unify and refactor exception handling in framework and addons.
The generic `except_osv` is now deprecated, and replaced by more specialized exception subtypes:
- `UserError` (renamed from Warning, as it conflicts with the built-in `Warning`) raised when a non-technical error occurs during a business operation. It could be a missing information in the data provided by the user, or a misconfiguration.
- `AccessError`: raised when any operation is denied because the user conducting it does not have the required access rights.
- `AccessDenied`: raised when an operation that requires authenticated access is attempted via an unauthenticated request.
- `MissingError`: raised when an operation is attempted on a record that does not exist.
- `ValidationError`: raised when an operation violates a SQL or Python constraint.
- All other exceptions are internal errors due to a system problem or bug, and raised untouched to the client-side, which should display a traceback.
All exceptions take a single message argument.
The `test_exceptions` module has been updated to showcase both new and old (deprecated) exceptions.
A great many old `except_osv` had a useless title with "Error!" or "Warning", those have been removed, as this is handled by the client-side widget that displays the messages.
This commit introduces a more consistent policy for logging errors and warnings:
- All messages that do not require administrator attention should be logged at INFO level or lower. This includes all errors that are notified to the user in a friendly manner, even for access right problems or validation errors during business operations.
- All messages that indicate a likely misconfiguration or malicious use by the users should be logged at WARNING level, as they typically require administrator attention.
- All other unhandled internal errors cannot typically be handled by the user and should be logged at ERROR or higher level, as they require immediate administrator attention.
|
|
|
|
Let 2015 be a year without modelines!
cf #4174
|
|
|
|
|
|
Closes #831 aka lp 1322191
|
|
The dsn may contain the connection password of the database when not accessed from a psycopg connection object.
Replace the unfiltered logs to use cxn.dsn avoiding password leakage in logs.
Fixes #1433
|
|
|
|
|
|
setted in config
|
|
|
|
|
|
launchpad_translations_on_behalf_of_openerp-20140412094159-mhy3v2prb3ctx32k
bzr revid: jke@openerp.com-20140409153527-mic1a8afcvdhsd27
bzr revid: chs@openerp.com-20140410102422-fcwxhjk40z0oy8x5
bzr revid: chs@openerp.com-20140415133650-y46i0o3qkb2atbvi
|
|
bzr revid: rco@openerp.com-20140414075906-2d0i4qhe4x7czsao
|
|
bzr revid: rco@openerp.com-20140410113950-71gcyz0t2rfuww57
|
|
chs@openerp.com-20140410102422-fcwxhjk40z0oy8x5
bzr revid: chs@openerp.com-20140410105454-6utwgruj80h8wdss
|
|
check inside embedded code objects.
bzr revid: jke@openerp.com-20140409151659-xwttchbtbj02v1w7
|
|
database, and use it for http tests
bzr revid: rco@openerp.com-20140409145830-rop8esgic2y435kf
|
|
overriding
bzr revid: rco@openerp.com-20140409130825-rnc9hqh9t16hqcaq
|
|
tools.config['test_enable']
bzr revid: rco@openerp.com-20140409103337-r0a1nx9h8nfg3cn3
|
|
used as a context manager
bzr revid: rco@openerp.com-20140409095604-joh9dt0qkma12ykm
|
|
accross requests
- TestCursor subclasses Cursor, and simulates commit and rollback with savepoints
- the registry manages a test mode, in which it only uses the test cursor
- a reentrant lock forces the serialization of parallel requests
bzr revid: rco@openerp.com-20140408151736-j0guy68i2wjexy3d
|
|
bzr revid: al@openerp.com-20140317124343-kgesa5c215z19vpn
|
|
time.time doesn't guarantee sub-second precision.
Use a uuid1 instead (lower anonymity but higher isolation than uuid4
especially in distributed systems, and we don't care about anonimity for
savepoint names from application servers).
Quote name so first character can be a digit.
bzr revid: xmo@openerp.com-20140220103345-xistzxy17r8j87hf
|
|
columns failed.
When a varchar column has a dependence on a view, we cannot change the size in-place,
we need to manually re-create the column with the correct type.
bzr revid: chs@openerp.com-20140217182045-qor70r3gb0fch2ki
|
|
bzr revid: al@openerp.com-20140122221525-hify023pk5i8d0jm
|
|
bzr revid: vmt@openerp.com-20130404130704-24vsmczw34cssytd
|