Commit Graph
5147 Commits
Author SHA1 Message Date
Cédric Krier ea53fb3ce8 Test number of dots in name before computing unique value from a domain
The type of value may not correspond with the single_value parameter if the
domain does not apply directly to the field but to a nested field.

Closes #12843
2024-02-12 11:59:13 +01:00
Cédric Krier 53460ad511 Add duration in logging message of with_pool decorator
This applies the same design as 180997544b2e did to the dispatcher.
2024-02-06 14:17:10 +01:00
Cédric Krier ffaa3f096c Clear transaction tasks on retry of with_transaction decorator
Closes #13008
2024-02-06 13:26:34 +01:00
Cédric Krier f02c9cf04c Lock table at transaction start for with_transaction decorator
Since c8771e45b861 TransactionError is raised if a table is not locked at the
transaction start. The decorator must manage such exception in case the
decorated route needs to lock a table.

Closes #12962
2024-02-06 12:59:00 +01:00
Cédric Krier 53a383db4d Restore passing activatedeps to load_modules when initialize to Pool
e00d867eda85 removed the argument.

Closes #13000
2024-02-05 12:59:35 +01:00
Cédric Krier 9cc7de53e6 Compare original functions to compute access of table query models
The bound methods are different because they are bounded to different classes.

Closes #12965
2024-01-29 11:35:16 +01:00
Cédric Krier 122dd1aa57 Apply access rights only on resource record linked to an instance
Closes #12977
2024-01-30 17:09:22 +01:00
Dani Möller bd54284d6f Use processing pool and selector as context managers
Delegate closing both resources to the with instruction.
2024-02-04 19:45:59 +01:00
Dani Möller aa96c33cbc Rewrite worker with concurrent.futures instead of multiprocessing
Unlike multiprocessing pools, the concurrent library pools will raise an
exception if child processes have died and can't accept further tasks. This
should cause the main worker to stop instead of stalling in an inifinite wait.

Introduce a dummy noop execution in the pool to probe if it is still operative
to mitigate the volume of lost tasks if the next submited execution would raise
a BrokenExecutor exception. This isn't 100% bulletproof because the pool might
still break between the probe and a new task being pulled.

The maxtasksperchild CLI option will only work for Python 3.11 onwards because
former concurrent.futures pools do not support this option.

Closes #11104
2024-02-04 20:32:09 +01:00
Cédric Krier c6f095c760 Do not copy readonly relational fields
Closes #12849
2023-12-20 13:56:57 +01:00
Cédric Krier 3e3c047ca1 Define explicitly escape char used for like operators
For now we rely on the default value set by python-sql but SQL-92 does not
define a default value.

Closes #12933
2024-01-14 13:32:27 +01:00
Cédric Krier 413048c312 Add template filters after being cached
The MemoryCache copy the stored template since 7bbbb91621ab but Genshi
Template clear the filters when copied.

Closes #12963
2024-01-28 00:34:12 +01:00
Cédric Krier e5a6aba9bb Support list of single value in sortable_values tools 2024-01-15 20:31:33 +01:00
Cédric Krier 7fab261d1c Clear reset password when setting a new password 2023-12-27 17:50:15 +01:00
Cédric Krier e6736aaed7 Allow resetting password of user via RPC
Closes #10629
2023-11-07 16:52:06 +01:00
Cédric Krier 013a47d35f Do not remove existing password when reset password 2023-11-07 16:52:31 +01:00
Cédric Krier e193722acb Convert reset_password method into dualmethod 2023-10-20 14:49:37 +02:00
Cédric Krier be1aac4fac Support cached_property on object with __slots__
Closes #12894
2024-01-05 01:36:50 +01:00
Nicolas Évrard 5c36f4ddee Commit when all modules are upgraded
Closes #12542
Closes #12518
2023-10-24 20:27:14 +02:00
Nicolas Évrard a466db9eed Create table as they are finally set up
If the base tables are not in their final set up the update process will lock
them and it could result in a deadlock when the ir_cache table is used by the
Cache
2023-10-25 18:11:31 +02:00
Nicolas Évrard 75d1af9f84 Allow creating index concurrently 2023-09-27 17:20:20 +02:00
Nicolas Évrard 9ef3a0aafa Allow skipping index creation
Closes #12596
2023-09-27 17:15:44 +02:00
Cédric Krier f26aa8863a Prevent modify mutable cached value
The cached values are copied when set and copied again when returned so the
stored values can never be modified.

Closes #9558
2024-01-15 23:48:50 +01:00
Cédric Krier c76a4f85d1 Remove global OPJ variable 2024-01-05 19:57:01 +01:00
Cédric Krier 33a369385a Use pkgutil to list modules in directory 2024-01-05 19:55:51 +01:00
Cédric Krier 93980a94b8 Find module paths using entry points
Closes #12900
2024-01-05 19:57:49 +01:00
Cédric Krier 88b26a7eb6 Display the actual wrong ids in domain rule error message
Closes #12907
2024-01-07 19:11:58 +01:00
Cédric Krier b913ad45d8 Add assert methods to test tools
Closes #12879
2023-12-29 19:02:08 +01:00
Cédric Krier f15e7a901f Strip trailing 0 when checking Decimal in doctest output of SQLite
Closes #12878
2023-12-30 19:45:32 +01:00
Cédric Krier 72f5012be5 Set ELLIPSIS option flag on doctest
Closes #12877
2023-12-28 23:00:52 +01:00
Cédric Krier 2743dc7a06 Set IGNORE_EXCEPTION_DETAIL option flag on doctest
Closes #12877
2023-12-28 14:39:39 +01:00
Cédric Krier dfadc5b62b Do not fail to get keyword action with empty record id
Closes #12767
2023-12-23 18:50:58 +01:00
Cédric Krier 1cc73c08ab Convert __export_row from static method to instance method 2023-12-23 18:30:59 +01:00
Cédric Krier 7b3107a8a0 Instantiate list of ids when exporting data with domain as list of ids
Closes #12868
2023-12-23 18:26:00 +01:00
Cédric Krier 7c7af11e7a Check selection of dict schema when selection or help selection are modified
It is the modification of stored field that must be checked and not the json
version.

Closes #12781
2023-12-17 20:33:32 +01:00
Cédric Krier 0d437d341c Use empty value Function xxx2Many fields without initial value
Since d142b33fa3ab the on_change_with relies on _changed_value. But for
Function xxx2Many fields if their value is not in the initial value, we should
not retrieve it from the database because the result will be the same as the
one set by on_change_with.

Closes #12836
2023-12-15 18:09:30 +01:00
Cédric Krier 071364744e Use sortable function to test origin of xxx2Many 2023-12-02 18:33:07 +01:00
Cédric Krier 37ef23134a Order xxx2Many targets by id origin instead of order name
The ordering is only to group records for cache alignment, so ordering by id
avoid to have to join on the origin table.

Closes #12795
2023-12-02 18:25:11 +01:00
Cédric Krier 1c0ff8eec2 Do not try to read action values if the ID does not exist 2023-12-17 22:57:20 +01:00
Cédric Krier 3d3ffc5c7c Do not check access when retrieving action ID
The ID does not contain any security data. If the user does not have access to
the action, an access error will be raised later when actual values are read.

Closes #12803
2023-12-17 22:54:17 +01:00
Cédric Krier 2b0d50afc4 Compare leaf values only of the same type to sort domain
Closes #12792
2023-12-12 18:02:14 +01:00
Cédric Krier 278c61466b Prefix record name with "record" in validation error message 2023-11-17 23:00:57 +01:00
Cédric Krier 779b329705 Use string version for selection values in error message 2023-11-17 19:55:48 +01:00
Cédric Krier 9ad54faa98 Update documentation to use python3 instead of python 2023-11-20 00:04:08 +01:00
Cédric Krier 0d625d4010 Remove usage of set_user to skip check access
Since ce8d7a19766a the access rule are enforced only if check access is set.
2023-12-01 21:14:37 +01:00
Nicolas Évrard 8c82dccd9f Filter history using SQL
Closes #12687
2023-10-29 01:31:05 +02:00
Nicolas Évrard 2f2f15e49b Create indexes on the history table
Closes #12686
2023-10-30 16:37:40 +01:00
Nicolas Évrard 67fe5021ba Do not prevent to fill the cache of fields with a datetime_field set
The value of those fields do not depend on the value of the datetime_field,
only the value of the remote fields read.

Closes #12715
2023-11-22 01:29:47 +01:00
Nicolas Évrard 32fa5569ad Do not prevent to fill the cache of fields with a context
The value of those fields in the database do not depend of the context and
Function fields getter depending on context are tested separately.

Closes #12715
2023-12-12 22:48:01 +01:00
Nicolas Évrard 59b686b264 Report DatabaseOperationalError as an HTTP Service Unavailable error
Closes #12736
2023-11-13 10:42:37 +01:00