Commit Graph
4934 Commits
Author SHA1 Message Date
Cédric Krier dd2b2fbb23 Add sum_tree helper 2023-06-04 09:30:39 +02:00
Cédric Krier 1b025feab5 Escape % in replaced value of strftime format 2023-05-09 22:58:50 +02:00
Cédric Krier 5c1f28efa0 Do not replace strftime placehoders escaped with double % 2023-05-09 22:53:51 +02:00
Cédric Krier f141830d1b Avoid unnecessary database access when formatting date/time
When the format does not contain placeholders that need to be replaced, there
is no need to compute the replacement.
2023-05-09 19:11:44 +02:00
Cédric Krier ffc7ce55a3 Parse authorization header for session scheme without token
Since Werkzeug >= 2.3, it always tries to parse the Authorization header as a
digest. If the session value which is encoded in base64 needs padding, the
trailing `=` are interpreted as header values and the token attribute is not
filled.
In this case we must parse ourself the Authorization header to decode the
base64 value as session.

Closes #12259
2023-05-08 13:21:10 +02:00
Cédric Krier 9612d5cb7a Fallback to raw selection value as selection string
The changeset 2763339d88d5 removed the fallback when reading invalid data for
a selection but it is important to not fail on reading to let the user fix the
error.
2023-05-11 09:31:20 +02:00
Cédric Krier 2f88f2534a Do not validate model that requires transaction lock
Since c8771e45b861 an exception is raised if the table was not locked on
transaction starts.
When validating some records with trytond-admin, we do not want to restart the
validation process to lock the tables to avoid creating conflict with the
running server.
2023-05-10 10:22:21 +02:00
Nicolas Évrard ba66fb9c6d Set the score to 0 for HashTranslator in PostgreSQL when include is specified
For now indexes using the HASH method do not support the use of included
columns on Postgres.

Closes #12294
2023-05-27 17:12:48 +02:00
Wolfgang Schröder b769623b79 Support has_returning for sqlite database backend 2023-05-24 11:45:47 +02:00
Cédric Krier 5366e00f56 Clear cache before commit each module
As the cache is rollback to avoid dead lock, the transaction commit could
restore cache version that is no more valid.
For example the language cache of `ir.translation` which is filled initially
with only English and then reset when other languages are created by the `ir`
module. So at the end of `ir` module load, the cache is reset to contain only
English as it was the content before the first cache reset. This prevents to
load any other language from other modules.
So to ensure the next module is loaded using a fresh cache, all the caches are
cleared.

Closes #12246
2023-05-08 12:20:39 +02:00
Sergi Almacellas Abellana c3c61da4f2 Use plural form on messages action name 2023-05-12 09:23:30 +02:00
Cédric Krier 6092ca035c Group call to on_change_with for later fields
Closes #12218
2023-04-14 17:04:01 +02:00
Cédric Krier 5335a2022d Convert sum attribute into boolean 2023-05-06 14:25:22 +02:00
Adrià Tarroja Caubet 960c220329 Remove migrations previous to 5.0
Closes #11324
2023-01-19 11:25:25 +01:00
Cédric Krier 7ddfbb5ee2 Support order method for all fields
#7075
2023-04-10 13:14:03 +02:00
Nicolas Évrard 4f28d7ac39 Shorten arguments when logging 2023-05-03 23:13:42 +02:00
Cédric Krier 54fad3a1c8 Store records selection on export
Closes #12179
2023-04-12 17:41:48 +02:00
Cédric Krier 05a0b221d1 Lock cron table at the transaction starts
If the lock is not taken at the transaction starts since c8771e45b861 an
exception is raised.

Closes #12248
2023-05-02 14:34:37 +02:00
Cédric Krier 1a11e103bf Increase version number 2023-05-01 14:11:22 +02:00
Cédric Krier 1901135502 Prepare release 6.8.0 2023-05-01 13:19:11 +02:00
Cédric Krier f0005d74b7 Do not override deleted record instances by related records 2023-04-22 18:31:30 +02:00
Cédric Krier a94b20b70f Do not update related records by foreign key if they are going to be deleted
Closes #3689
2023-04-22 18:29:44 +02:00
Cédric Krier 84a2b5e271 Update translations 2023-04-29 10:07:40 +02:00
Udo Spallek d3c41cb73c Try __main__.__file__ as application name and fallback to 'trytond' on fail
sys.argv is not reliable to get the process name.

Closes #12242
2023-04-28 23:45:43 +02:00
Cédric Krier 8039dfd5a4 Do not rely on INSERT returning in the same order as VALUES
There is no guarantee by SQL standard that the order of the returned values of
INSERT are the same as the order of VALUES.
Also there is neither any guarantee that the generated id follow the order of
VALUES but the ORM relies on such order to keep records ordered in the same
order as the user insert them (and also for sequence order with NULL value).
So for database that supports multirow insert, we need to set explicitly the
value for the column id to ensure to preserve the insert order.

Closes #12220
2023-04-28 19:04:02 +02:00
Cédric Krier b4d78247cf Support returning more than one nextid 2023-04-22 11:05:23 +02:00
Cédric Krier 4a9e0713d6 Support authorization for werkzeug >= 2.3
The werkzeug refactoring always return an Authorization instance.
If the type is our custom 'session', we must parse the token attribute.

Closes #12234
2023-04-28 09:39:34 +02:00
Cédric Krier ae6978354e Limit the size of grouped insert depending on number of columns inserted 2023-04-11 15:57:57 +02:00
Cédric Krier 1d2f4d7163 Reuse on_change_with_result to convert result of Function field getter 2023-04-15 09:15:46 +02:00
Cédric Krier e74fe80df9 Convert instances in RPC call result for on_change_with on field
Since d142b33fa3ab0fe5af25957f90ee77fe7eee51b3 the on_change_with method can
return instances.

Closes #12217
2023-04-14 13:09:23 +02:00
Cédric Krier 0233bfe8d6 Format using SQL Identifier type sequence name
The sequence functions are using string parameters so for case sensitive
sequence name we must pass a string containing double-quoting if necessary.

Closes #12194
2023-04-08 11:24:45 +02:00
Cédric Krier 4d950fc8e9 Do not quote sequence name coming from pg_get_serial_sequence
The result of the function is already quoted to be suitably formatted for
passing to the sequence functions.
2023-04-08 11:12:20 +02:00
Cédric Krier d49f0ce8fc Set cron timezone with default value
Closes #12056
2023-04-11 00:12:33 +02:00
Cédric Krier a826d91015 Ensure reset password has at least the minimal length for password
Closes #12028
2023-04-11 00:08:28 +02:00
Cédric Krier 61f2f749f4 Update model data also when old values are different from the current values
Closes #12190
2023-04-06 20:36:25 +02:00
Cédric Krier cb3fcf5d48 Do not strip monetary thousands separator
Closes #12191
2023-04-06 20:39:18 +02:00
Cédric Krier ace9beeab4 Log transition only for updated records
Closes #12202
2023-04-11 15:10:27 +02:00
Cédric Krier 6c1f09e551 Do not always enforce access on resource selection
When the reference field is validated (without check access), it should not
fail for SelectionValidationError if the user has no access to the resource.

Closes #12178
2023-04-03 10:54:50 +02:00
Nicolas Évrard 4301c56033 Drop default on id column of history tables
The migration introduced in baa87cf1a343 would fail because previous migration
would have wrongly set a default value in id column of history tables

Closes #12186
2023-04-05 19:36:27 +02:00
Cédric Krier 43b1d28326 Return rec_name for on_change_with of xxx2One and Reference
Closes #9638
2023-03-26 00:29:14 +01:00
Cédric Krier 4d6b36e711 Support return instances for Function getter and on_change_with
Closes #9640
2023-03-25 01:27:19 +01:00
Cédric Krier 9ad95c58ed Log modification of sale and purchase header via wizard 2023-02-08 19:05:00 +01:00
Cédric Krier 17bbce3919 Log events for ModelStorage
It logs by default:
 - the write and delete done directly by the users
 - the execution of a button
 - the execution of wizard state that has modified the database
 - the workflow transition to a new state
2023-02-08 19:03:29 +01:00
Nicolas Évrard 5179e6cd40 Insert multiple rows at once
Closes #12106
2023-03-02 22:43:30 +01:00
Nicolas Évrard e18d604aa8 Use IDENTITY column for table id columns 2023-03-13 17:59:29 +01:00
Nicolas Évrard eef0c3d870 Do not shadow previously defined table handler 2023-03-24 18:07:29 +01:00
Nicolas Évrard 37f2ed9e84 Update definitions of constraints only when they changed
Closes #12136
2023-03-13 17:58:27 +01:00
Nicolas Évrard 09dbef446e Do not pass class to __table_handler__ classmethod 2023-03-13 17:56:41 +01:00
Nicolas Évrard d945809d35 Update all table definitions or only those specified in arguments
Closes #12136
2023-03-13 17:55:28 +01:00
Cédric Krier 2808d7dfc2 Fix languages variable name typo in emails 2023-03-27 16:11:19 +02:00