Commit Graph
446 Commits
Author SHA1 Message Date
Cédric Krier 507a8e26fe Add start value to PYSON Date and DateTime
This enable the customization of the starting point for delta operations.

issue8561
review264041002
2019-09-20 11:36:05 +02:00
Cédric Krier def268915a Add MultiSelection field
issue7851
review249911002
2019-09-20 11:32:56 +02:00
Sergi Almacellas Abellana 058a816879 Support dot notation on PYSON Eval
issue8528
review287841003
2019-09-19 14:11:17 +02:00
Sebastien Marie afd08618f0 Import zero value as non null value
issue8658
review282121004
2019-09-17 23:12:51 +02:00
Cédric Krier d782949f5a Add tests for translation in ModelSQL
issue8632
review280081002
2019-09-17 00:05:09 +02:00
Sergi Almacellas Abellana b60b01c569 Ensure view arch is defined on test_view
issue8603
review270141003
2019-09-12 18:54:25 +02:00
Cédric Krier 5e68f7c0ab Test _changed_values with rec_name
issue8637
review280081004
2019-09-11 23:50:20 +02:00
Cédric Krier d9b4d71a11 Ensure context is correctly set when initializing Model
We make the assignation twice if any field has a context defined. This ensures
that the context will be evaluated with all initialized values when
the target records will be instantiated.

issue8586
review282041002
2019-09-09 22:41:54 +02:00
Cédric Krier 4154b93a01 Prevent assign unknown attributes on Model
by adding __slots__ on PoolMeta

issue8567
review254091002
2019-09-07 23:45:08 +02:00
Cédric Krier 845eee5ea1 Add test to use stored value for One2Many changed without initial value
issue8605
review265901016
2019-09-07 23:34:55 +02:00
Daniel Möller 38bbe4d820 Pass app and request to wsgi error handlers
issue8548
review271931002
2019-09-02 18:25:12 +02:00
Cédric Krier 2b78f07a98 Use MagicMock for message when testing sendmail
Since issue8596, sendmail test message contains Date header so message must
implement the magic method.
2019-08-30 11:32:32 +02:00
Cédric Krier 340cb2f630 Loop over all expression of the relation domain to valid
When the field is a relation, the field name can not be used to inverse the
domain because the record evaluated it the Relation. So we inverse the domain
with all the field in the domain until find one invalid. If we find any then we
raise a generic error.

issue8597
review270141002
2019-08-28 22:31:22 +02:00
Cédric Krier 589e27cc87 Add lazy_gettext
issue8560
review283901002
2019-08-25 13:00:28 +02:00
Cédric Krier 9fff734230 Raise proper exceptions when context is missing in RPC
issue8565
review257921003
2019-08-22 22:48:13 +02:00
Cédric Krier 064f501aaa Improve Report.format_timedelta
- Use static default converter
- Remove skip_zeros as alignment will not work any way
- Manage None value
- Translate labels
- Split tests

issue7443
review257891002
2019-08-18 19:08:11 +02:00
Sergi Almacellas Abellana a338fa6478 Validate xml files definition on tests
Update tryton.rnc format and use grouped attribute on message.xml

issue8556
review272001002
2019-08-09 16:31:29 +02:00
Cédric Krier f56c5be5ad Add minimal to_char for date and datetime on SQLite
We support only date and datetime with common pattern between SQL and Python.

issue8464
review261761002
2019-08-07 19:34:33 +02:00
Xavier Codinas c1a59b07e7 Add format_timedelta in report
issue7443
review42151002
2019-07-31 11:08:18 +02:00
Cédric Krier ac9fc496df Convert cache_name by TableHandler when used as database name
The name of the cache can be longer than the maximum length of database name.
2019-07-28 16:05:45 +02:00
Cédric Krier 7f9191dece Test unique pyson domain validation with greater IN_MAX
issue8474
review257701002
2019-07-13 00:08:56 +02:00
Cédric Krier dd26e03001 Test 'id' not removed from read result when in context field
issue8470
review263841002
2019-07-08 21:31:26 +02:00
Cédric Krier 190657e0ef Make CurrentTimestamp transactional for SQLite backend
It must return the same timestamp during the all transaction.

issue8457
review271641002
2019-07-08 21:27:55 +02:00
Cédric Krier 7dbcc96b8e Use separate connection to query cache table
The table is a hot spot for contention so we must minimize the duration lock
are kept on it. As at the start of a transaction, the cache may be sync and so
it locks all the row in the table, the transaction used for this query should
not be the main one that lasts a long time. Idem for the commit.

issue8447
review283591002
2019-07-08 21:24:33 +02:00
Cédric Krier 51c99aaa12 Allow SQL expression as value of fields
issue6460
review279431002
2019-06-26 21:56:16 +02:00
Cédric Krier 2d4f6766b1 Improve domain validation error from server
We add to DomainValidationError the invalid domain and the field definition so
the client can format and append it to the description of the error.

issue8288
review255351002
2019-06-16 19:04:55 +02:00
Cédric Krier dbda770234 Skip tests relying on assertion when python is optimized
issue8381
review271471002
2019-06-12 19:15:00 +02:00
Nicolas Évrard 57c53f429a remove useless breakpoint() introduce in f6fe262d310f 2019-06-05 18:34:23 +02:00
Nicolas Évrard 94c2a212c8 Allow to store SEPA Message content on the file system
issue7295
review44851002
2019-06-05 18:32:08 +02:00
Cédric Krier 5b355f37d0 Check access on target only if related field has a target
The Dict field can use the relate syntax to access keys but it does not have
any target model to check.

issue8298
review251291002
2019-04-24 23:46:59 +02:00
Cédric Krier 12376f30e5 Order by target name and context hash
None can not be compared to a class so we always use strings to order before
grouping. Also dictionary can not be compared neither.

issue8265
review253351002
2019-04-24 23:40:46 +02:00
Cédric Krier eb3882e113 Verify keys of fields and buttons states
issue8262
review279221003
2019-04-12 13:08:01 +02:00
Cédric Krier 4b4c57a362 Add duration on Cache
issue8249
review283181002
2019-04-11 18:35:25 +02:00
Sergi Almacellas Abellana 49b7238d3f Add strip wildcards helpers
issue7347
review64541002
2019-04-11 15:17:30 +02:00
Cédric Krier e9ee50982b Allow to update records when importing data
issue652
review273131003
2019-04-04 20:00:25 +02:00
Cédric Krier 3e9784c8d7 Set context on record instantiated in Field.__set__ and read related
Field may have a context defined so when it instantiate a relational record,
the field should set this context like when the record is read from the
database in ModelStorage.__getattr__.
And when such field is read as related field, the context should also be set.

issue8225
review287171002
2019-04-04 19:06:09 +02:00
Cédric Krier 34316ae615 Check read access on field in search order
issue8189
review279061002
2019-04-02 19:01:33 +02:00
Cédric Krier 792ebac88b Use locale format for data export and import
issue8196
review255151002
2019-03-28 19:22:49 +01:00
Cédric Krier 07d79c7861 Validate selection format in Dict schema
issue7947
review257131002
2019-03-22 11:46:52 +01:00
Cédric Krier 45946c23ef Wait up to 10 seconds for cache sync in tests
On busy host, it may require some time to receive the notification.

issue8198
review269141003
2019-03-16 14:56:32 +01:00
Cédric Krier e2318257bb Allow to extend Field string and help
Those attributes are stored as StringPartitioned and each part creates its own
translation record. The translated strings are constructed by concatenation of
each translated part.

issue8040
review46731002
2019-03-15 13:01:11 +01:00
Cédric Krier 10e31bc311 Add Model.__names__ to retrieve model and field names
issue8159
review72431002
2019-03-15 12:27:44 +01:00
Cédric Krier e5e92ac81a Allow to use channel to synchronize Cache
When the clear timeout of the cache is zero, we launch a thread to synchronize
caches if the back-end support channels.
The thread is started on the first call to sync for the database.
The channel is also used to clear the cache of the process initiating the
clearing. This allows to test the mechanism is working with a single process.
So there will be a small delay even on single instance.

issue8027
review68431002
2019-03-09 17:03:38 +01:00
Cédric Krier f9622e9b2d Test XML-RPC dumps using allow_none
issue8143
2019-03-09 00:12:23 +01:00
Cédric Krier c255cfe785 Display ids and rule names on access error
issue8093
review60551002
2019-03-03 23:11:17 +01:00
Cédric Krier c4ddbb064a Prevent filling cache with data from old transaction
Once the cache has been cleared, we must ensure that transaction started
before the clearing cannot fill the global cache.

issue8019
review56541002
2019-03-02 23:11:14 +01:00
Cédric Krier 9eaac0f3a3 Cast timestamp as datetime for sqlite back-end
SQLite backend returns a string for the datetime so the comparison between
timestamp fails.

issue8080
review48721002
2019-02-13 10:23:44 +01:00
Cédric Krier b315e9a6d9 Do not update db_id when deleting XML record without noupdate
If the record has been removed from the XML file, the db_id field will be
required. So we must not update it and let convert delete the data in
post_import.

issue8051
review70521002
2019-02-03 20:33:01 +01:00
Cédric Krier 774d6eeb5a Do not keeping lock when relaunch listener and join listener in test
We can not recursively call Bus._listen when holding the lock because it
blocks all subscription until the listener stops.
The tearDown of the test should ensure the listener is really stopped before
ending.

issue8039
review52611002
2019-01-30 10:04:11 +01:00
Cédric Krier b34cac78d5 Allow to lock records for update
issue8012
review45901002
2019-01-30 09:45:59 +01:00