Commit Graph
4632 Commits
Author SHA1 Message Date
Cédric Krier 36aa3a5aed Discard disconnected connection from the pool
When a connection in the pool is disconnected, it stays in the pool and it may
still be served.
Using such connection raise an OperationalError and so the request is retried
but before that the connection is put back to the pool. So we may get it back
again.
It is not possible to distinct between an OperationalError due to a
disconnection or due to a isolation error for example.
So with the current design of Transaction API, an OperationalError always put
back the connection to the pool.
This main that we can only ensure that the connections served are still
connected by executing a simple query. And close connections that are failing.

Closes #12452
(grafted from f8aaf62a0c7508e3f3398e47dc2b86e6f8f06cc0)

--HG--
branch : 6.0
2023-08-04 15:59:35 +02:00
Cédric Krier 944afc59ff Add .readthedocs.yaml configuration [skip ci]
This is required by Read the Docs service:
https://blog.readthedocs.com/migrate-configuration-v2/

Closes #12344
(grafted from ffef63a3959b55756c395ebfd3ee1224f4dc7611)

--HG--
branch : 6.0
2023-08-06 19:31:44 +02:00
Cédric Krier cb850dd05b Increase version number
--HG--
branch : 6.0
2023-07-31 17:08:14 +02:00
Cédric Krier c5999897d1 Prepare release trytond-6.0.34
--HG--
branch : 6.0
2023-07-31 17:07:59 +02:00
Cédric Krier 88abcdddd1 Read ids from the table even without columns if a rule domain exists
The rule must be enforced also when only non SQL type fields are read.

Closes #12428
(grafted from bd69f1025bca6648fd9ff11f585a60214d2bbf6e)

--HG--
branch : 6.0
2023-07-23 10:18:04 +02:00
Cédric Krier f9908ca812 Do not fail on ValueError when formatting message with gettext
If wrong variables are used to call gettext, the formatting may raise a
ValueError. It is better to not fail for such minor error when not testing.

Closes #12371
(grafted from 47809a507263c47b927c318750f22499adecd036)

--HG--
branch : 6.0
2023-07-15 00:40:59 +02:00
Nicolas Évrard 751292ea1d Clear caches after commit when installing modules
A call to clear_all is required after the commit in order to ensure that the
transaction uses an empty cache from this point. clear_all is not required to
prevent the deadlock on ir.cache because the rollback ensures that nothing
changed from the point of view of this transaction.

Close #12343
(grafted from 48396d9cfed6caccb3fca6d981fec5016a1f6ca2)

--HG--
branch : 6.0
2023-07-14 18:50:44 +02:00
Cédric Krier c38f44dc10 Document on_change methods under ModelView instead of Model
(grafted from a379ef0e1567383579001994c4c11f9cd711ad62)

--HG--
branch : 6.0
2023-07-04 18:39:28 +02:00
Cédric Krier 90eac45ba9 Skip child position of exported data based on field names
When exporting data of a xxx2Many field, the column to skip should be based on
the child field names instead of the exported value (which can be 0 for
example).

Closes #12316
(grafted from a91e1a9f95ca2b22d4ce5372b1753999d03aa8af)

--HG--
branch : 6.0
2023-06-08 18:42:07 +02:00
Cédric Krier 5264c5745d Prevent None value in selection of MultiSelection
Closes #12313
(grafted from 470a28314f49c5c02112d17fa95f0ef5941626c0)

--HG--
branch : 6.0
2023-06-30 00:18:00 +02:00
Cédric Krier 17d1629087 Use proper module prefix for msg_dict_schema_help_selection_help
(grafted from d223f6f40c6aac3b47a26b90e70a8ca526ad1ee1)

--HG--
branch : 6.0
2023-06-13 15:52:27 +02:00
Cédric Krier 50d1d63e3e Increase version number
--HG--
branch : 6.0
2023-06-21 19:11:32 +02:00
Cédric Krier cec8fd81e0 Prepare release trytond-6.0.33
--HG--
branch : 6.0
2023-06-21 19:11:15 +02:00
Cédric Krier 96a48f4910 Do not try to login if Authorization has no username
User application request has an Authorization header so an Authorization
instance is returned but it can not be used for login.

Closes #12312
(grafted from 0a4e13728c0a9bb24536cb1033d95ca6749a2b9d)

--HG--
branch : 6.0
2023-06-09 08:17:20 +02:00
Cédric Krier 3f5565bcc7 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
(grafted from 0bd0b8a0e20ad8d2f3d13cc8d879c78717817b7a)

--HG--
branch : 6.0
2023-05-08 13:21:10 +02:00
Cédric Krier d8f75ba1d6 Increase version number
--HG--
branch : 6.0
2023-05-17 22:33:47 +02:00
Cédric Krier 1da8788b71 Prepare release trytond-6.0.32
--HG--
branch : 6.0
2023-05-17 22:33:30 +02:00
Cédric Krier 00c943a727 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
(grafted from 5f14ca66744e53cd1d6200dfd569c2dca19f99c6)

--HG--
branch : 6.0
2023-05-08 12:20:39 +02:00
Cédric Krier d1c67443ff Do not override deleted record instances by related records
(grafted from 5b67535bb4cdf07df76c15e6fb4b425f44f4ad23)

--HG--
branch : 6.0
2023-04-22 18:31:30 +02:00
Cédric Krier b38bb01a6f Do not update related records by foreign key if they are going to be deleted
Closes #3689
(grafted from a99b53347ecf5f6ffaff45b62086209b61e7ab72)

--HG--
branch : 6.0
2023-04-22 18:29:44 +02:00
Cédric Krier eb55eef349 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
(grafted from 7fd0bb7e6864bdf3fa83fafb17262316fded5b0c)

--HG--
branch : 6.0
2023-04-28 09:39:34 +02:00
Cédric Krier c9283fe6e6 Increase version number
--HG--
branch : 6.0
2023-05-03 18:26:53 +02:00
Cédric Krier 61c0766b56 Prepare release trytond-6.0.31
--HG--
branch : 6.0
2023-05-03 18:26:36 +02:00
Cédric Krier 9763ee5d39 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
(grafted from ceb3118cd35511412d7cf8f2eae6c1891cf5f47a)

--HG--
branch : 6.0
2023-04-08 12:03:00 +02:00
Cédric Krier 4abe447839 Update model data also when old values are different from the current values
Closes #12190
(grafted from 4820f12259f64a26ada02af640231459fb6ab820)

--HG--
branch : 6.0
2023-04-06 20:36:25 +02:00
Cédric Krier 771a4373bc 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
(grafted from 1bb024e29dfae1cbb0487b1f66d325f3bb0059fa)

--HG--
branch : 6.0
2023-04-13 19:05:11 +02:00
Nicolas Évrard d217fcf7d5 Do not shadow previously defined table handler
(grafted from d6ec428a2511f4666cb860413328dbde8a375c90)

--HG--
branch : 6.0
2023-03-24 18:07:29 +01:00
Nicolas Évrard 953fd5ec9e Update definitions of constraints only when they changed
Closes #12136
(grafted from fa3839097da4ee5ba663fb3265d81ac9216762bc)

--HG--
branch : 6.0
2023-03-13 17:58:27 +01:00
Nicolas Évrard 0ad727b7bc Do not pass class to __table_handler__ classmethod
(grafted from 6b92a1e2a0f33986a09b1bcd89a887360263ab19)

--HG--
branch : 6.0
2023-03-13 17:56:41 +01:00
Cédric Krier 4a9bd00be0 Increase version number
--HG--
branch : 6.0
2023-04-01 23:54:01 +02:00
Cédric Krier c09761c2be Prepare release trytond-6.0.30
--HG--
branch : 6.0
2023-04-01 23:53:40 +02:00
Cédric Krier cd6001bafd Clear password hash read even if there is no cache
This was introduced by 2c557f1b4882
(grafted from 8ae09df296211e3517e3f485c1efbea590662a5b)

--HG--
branch : 6.0
2023-04-01 00:18:01 +02:00
Cédric Krier 6cff284c1d Do not fails to clear password from cache if there is no cache
This was introduced in 7b5157206d32

Closes #12165
(grafted from 2c557f1b4882006ec487e11f4e0b8aed1ef37860)

--HG--
branch : 6.0
2023-03-30 22:36:18 +02:00
Cédric Krier e183806cdf Remove password hash also from the transaction cache
Closes #12120
(grafted from 7b5157206d328bfe020fabece59fb7747dd2dd9d)

--HG--
branch : 6.0
2023-03-07 16:33:58 +01:00
Cédric Krier 7b7cd1ba3b Do not copy password hash nor reset from user
(grafted from c94f99afeadbc10e483ed3d34d707635f77ac945)

--HG--
branch : 6.0
2023-03-15 16:09:10 +01:00
Cédric Krier 9e16b94a53 Increase version number
--HG--
branch : 6.0
2023-03-03 19:17:27 +01:00
Cédric Krier 0c4bfaa65f Prepare release trytond-6.0.29
--HG--
branch : 6.0
2023-03-03 19:17:09 +01:00
Cédric Krier 4c9854f464 Do not alter argument values of with_transaction decorator
Closes #12108
(grafted from 107b68af389a2cb5c95f663f7a3107fc12aecaf7)

--HG--
branch : 6.0
2023-02-26 00:20:09 +01:00
Cédric Krier bf4db77b11 Require at least version 0.12 of werkzeug
Closes #12021
(grafted from 9f76ec6a7449de9286a96c48f7c12e8928e5e33e)

--HG--
branch : 6.0
2023-02-19 11:23:50 +01:00
Cédric Krier 6ab873702d Clear tasks when transaction is rollback
The tasks records are removed on rollback so there is no need to try to run
them.
(grafted from d2e0256f3478213d5c1ab375bc842c1222157692)

--HG--
branch : 6.0
2023-02-19 20:58:01 +01:00
Cédric Krier ea8477391a Find invalid records of xxx2Many field using intersection
For xxx2Many field, the contain test is not working correctly because the
field value is a tuple of records which is never in the list of invalid
relations.

Closes #12099
(grafted from 9dabdd3422a69e132269c4e9cc02076286aba3ed)

--HG--
branch : 6.0
2023-02-17 12:56:18 +01:00
Cédric Krier 4e2c6c4325 Do not use One2Many with filter to get MultiValue records
The filter may prevent to find the right value.

Closes #12078
(grafted from ddda112e1c42deefa7e03473cfad84542c6d17d4)

--HG--
branch : 6.0
2023-02-10 16:10:08 +01:00
Cédric Krier bc8456b0c7 Increase version number
--HG--
branch : 6.0
2023-02-17 19:08:42 +01:00
Cédric Krier 63032a2579 Prepare release trytond-6.0.28
--HG--
branch : 6.0
2023-02-17 19:08:25 +01:00
Cédric Krier 2b7c02984c Fill DomainValidationError message using an invalid record
The invalid relations are the invalid records only if Target is the class.
(grafted from 7b9b3e13592be94d9b226085c8a89f05d5941137)

--HG--
branch : 6.0
2023-02-07 16:44:14 +01:00
José Antonio Díaz Miralles 1666b79a4a Do not write creation values in ModelSingleton
(grafted from 6ba6ad79208e3aa6af62a480f977f30e2a1f64ae)

--HG--
branch : 6.0
2023-02-03 20:08:26 +01:00
Cédric Krier 0d2778f372 Increase version number
--HG--
branch : 6.0
2023-02-05 21:50:33 +01:00
Cédric Krier 690ebe5fd5 Prepare release trytond-6.0.27
--HG--
branch : 6.0
2023-02-05 21:50:15 +01:00
Cédric Krier 1207c441ef Define url_size on image of form
Closes #12007
(grafted from 2bcaf38ad19a3178e01565995c408accb92b0cda)

--HG--
branch : 6.0
2023-01-15 15:27:54 +01:00
Cédric Krier 62d1f29c78 Increase version number
--HG--
branch : 6.0
2023-01-15 18:34:05 +01:00