Commit Graph
4993 Commits
Author SHA1 Message Date
Cédric Krier e2676bcd85 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
2023-08-04 15:59:35 +02:00
Cédric Krier 2d8cc458fd Convert element joined domains into domain when searching for OR-ed domain
The content of joined domains can be a single clause, so it must be converted
into a domain before calling search_domain.

Closes #12460
2023-08-10 13:55:00 +02:00
Cédric Krier d706ab7ffa Support GIN index with btree_gin PostgreSQL extension
Closes #12480
2023-08-16 22:03:59 +02:00
Cédric Krier f58582b636 Include Similarity in the indexed expression of BTREE
The Similarity expression increase the score and are supported in BTREE.

Closes #12479
2023-08-16 21:53:32 +02:00
Cédric Krier 318950e03b Filter expressions for BTREE and GIN indexes
IndexMixin is calling the method _get_indexed_expressions instead of
_get_expressions.

Closes #12478
2023-08-16 21:50:05 +02:00
Cédric Krier de1386328b Update style for flake8 6.1.0
Closes #12475
2023-08-16 11:49:30 +02:00
Nicolas Évrard 82ae036d3a Add a canonicalize function for domains 2023-08-14 22:32:14 +02:00
Cédric Krier bf9735dd5a Remove useless state variable when initialize database 2023-08-14 22:02:09 +02:00
Nicolas Évrard f8de1d23c6 Replace NEXTVAL call by IDENTITY for database initialisation 2023-08-14 21:26:59 +02:00
Nicolas Évrard fe44d98d76 Move sleep loop introduced in a32b84d96649 to prevent deadlock to tests
In this changeset we fix an issue with testing.

When using the listener for cache invalidation it results into the database
lock used by the pool that is acquired twice. Once when calling Pool.init ;
once when the transaction is started which calls Cache.sync which in turn calls
Pool.refresh and finaly Pool.stop. It tries to acquire again the re-entrant
lock (but it cannot because it's another thread).

Closes #12457
2023-08-08 15:33:33 +02:00
David Harper f52d70e5ba Add res module documentation
Closes #9793
2023-08-13 17:08:48 +02:00
Cédric Krier cc3b71bae4 Replace domain on view type by validation on view tree optional
The validation of type must be recursive up to the first inherited view which
cannot be expressed with a domain.

Closes #12341
2023-07-30 10:45:03 +02:00
Nicolas Évrard 6893789faa Rename function with_inactive_records in documentation
The commit e6c72b1f23e7 added the function but the documentation used another
name
2023-06-13 13:39:22 +02:00
Cédric Krier adc26533da Add .readthedocs.yaml configuration [skip ci]
This is required by Read the Docs service:
https://blog.readthedocs.com/migrate-configuration-v2/

Closes #12344
2023-08-06 11:06:08 +02:00
Cédric Krier b0c63782bf Use configured minimal connection also for default database name
When the default database name is also a Tryton database, we must keep the
minimal connection in the pool instead of of 0.

Closes #12387
2023-07-12 09:16:08 +02:00
Cédric Krier 84b2c346b5 Remove unnecessary group on menu
Menu with an action window do not anymore to be hidden by group for access
since #12322
2023-06-23 14:51:59 +02:00
Cédric Krier c90d2f2ca4 Filter menu with action window for which user has not read access
Closes #12322
2023-07-23 12:17:02 +02:00
Cédric Krier 427dda4e0d Replace action of menu by a filtered list of action keywords 2023-06-23 15:09:07 +02:00
Cédric Krier 2ac7600b3d Add reference to the type of action in action 2023-06-23 14:03:45 +02:00
Cédric Krier 920d841ffa Extend the action views for all type of actions 2023-06-23 13:55:16 +02:00
Cédric Krier e5b53852a5 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
2023-07-23 10:18:04 +02:00
Cédric Krier acc1b31c05 Use environment variable as default for command line coroutine option 2023-07-11 22:50:52 +02:00
Cédric Krier e3fb65f35a Use environment variable as default for command line logging options 2023-07-11 22:49:25 +02:00
Cédric Krier 7c6137f070 Document active test in ModelStorage 2023-07-05 12:57:15 +02:00
Cédric Krier 69f82e8100 Set default value of active_test from transaction
Instead of testing the context in _search_domain_active, it is simpler to set
the active_test default value using the transaction context.
2023-07-05 12:39:48 +02:00
Cédric Krier f4210f8143 Document active field part of DeactivableMixin 2023-07-05 12:36:46 +02:00
Cédric Krier 317bdb7019 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
2023-07-15 00:40:59 +02:00
Cédric Krier 041a3fb9b2 Support PYSON comparison of timedelta
Closes #10727
2023-06-15 17:06:13 +02:00
Cédric Krier d7aaac6740 Support encoding timedelta into PYSON TimeDelta
Closes #10727
2023-06-15 13:57:15 +02:00
Nicolas Évrard 99ded91b41 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
2023-07-14 18:50:44 +02:00
Cédric Krier df86c766ac Add completer for database option of trytond-console 2023-06-19 15:36:58 +02:00
Cédric Krier a40be04d82 Document on_change methods under ModelView instead of Model 2023-07-04 18:39:28 +02:00
Cédric Krier 69b2916b9c 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
2023-06-08 18:42:07 +02:00
Cédric Krier 4c9e0f94a5 Prevent None value in selection of MultiSelection
Closes #12313
2023-06-30 00:18:00 +02:00
Nicolas Évrard 0918f6f425 Allow to use width attribute in button columns of tree views 2023-07-05 10:08:42 +02:00
Sergi Almacellas Abellana 50cab67fab Allow date formating in sequences substitutions
Closes #8945
2023-06-06 09:00:50 +00:00
Cédric Krier b69dae7205 Make ModelSQL based on table query read only by default
Closes #12331
2023-06-18 17:26:27 +02:00
Cédric Krier c28380a159 Keep default access for model without model access entry 2023-06-18 17:21:06 +02:00
Cédric Krier d2ad167946 Set Tryton as default user agent header
Closes #11979
2023-05-19 17:25:55 +02:00
Cédric Krier 421b0752f3 Normalize stored emails 2023-04-29 19:03:42 +02:00
Cédric Krier 66df0be6a9 Validate email fields
Closes #12215
2023-04-29 19:07:13 +02:00
Cédric Krier 13cedb53e8 Convert email address to ASCII to support RFC6530
Python email library does not support non-ASCII emails so we convert email
addresses to ASCII version before passing them to sendmail.

Closes #10650
2023-04-29 19:04:18 +02:00
Cédric Krier 66f10aed84 Add email validation tools 2023-04-29 18:52:40 +02:00
Cédric Krier b4771f3c95 Use strict parameter of sendmail_transactional instead of datamanager 2023-04-29 18:24:37 +02:00
Cédric Krier 4ead8b6461 Fail gettext on test 2023-06-13 08:57:01 +02:00
Cédric Krier b6f1b2533c Use proper module prefix for msg_dict_schema_help_selection_help 2023-06-13 15:52:27 +02:00
Cédric Krier 40691db7e6 Use message for constraint on tests models 2023-06-13 08:56:52 +02:00
Cédric Krier 9830447295 Use message for exclusive constraint on trigger 2023-06-13 00:06:06 +02:00
Cédric Krier a28a8268c8 Deprecate log method for report to store exception 2023-06-19 15:23:18 +02:00
Cédric Krier 6b9f87c4b3 Manage naming collision for log method on ir.error
Since a2eaa8f46096, ModelStorage has a generic log method which collides with
the exiting log method introduced in f6b0d437b5b6.
For backward compatibility we test the arguments to decide which version is
actually called.

Closes #12333
2023-06-21 11:11:25 +02:00