Commit Graph
256 Commits
Author SHA1 Message Date
Cédric Krier 09c9e90506 Do not update field definition with Function field definition
issue11225
review360871002
2022-02-16 11:07:19 +01:00
Cédric Krier 2495c0cbdd Order unsorted Selection by index definition
issue11169
review387771003
2022-02-15 00:06:57 +01:00
Cédric Krier 632deb43e5 Use dictionary as domain for Reference field
issue11074
review383911002
2022-02-03 23:05:47 +01:00
Nicolas Évrard 82b6bf9f1a Do not rely on depends to select the fields to read in form view
issue11134
review389681019
2022-01-31 22:25:59 +01:00
Cédric Krier 49f6350151 Use simplified parser for get_eval_fields
Instead of using the PYSONEncoder we can just iterate over the basic JSON types
and use the pyson method to retrieve nested PYSON instances.

issue11164
review376551002
2022-01-30 13:10:57 +01:00
Cédric Krier a0bfbfa255 Follow isort formatting
issue10928
2021-12-11 17:58:45 +01:00
Cédric Krier e02c830159 Fill local cache of Function field instances with values
issue10936
review377511003
2021-11-28 13:40:30 +01:00
Cédric Krier a00d26dd3c Cache Function field getter without context in readonly transactions
issue10936
review367781002
2021-11-28 13:27:52 +01:00
Cédric Krier 6162729234 Do not order on NULL when rank column is None
It is not valid to use NULL in ORDER BY clause.

issue10947
review381411002
2021-11-19 23:56:36 +01:00
Cédric Krier a1a2e6eb70 Use JSONB to store Dict field on PostgreSQL backend
issue10858
review379371002
2021-11-08 19:27:03 +01:00
Cédric Krier 878e8747df Prevent assign SQL value to record instances
issue10413
review379441002
2021-10-28 09:00:33 +02:00
Cédric Krier 8bbecaa817 Allow to cast as date using timezone
issue10860
review372321002
2021-10-21 00:11:57 +02:00
Cédric Krier c9fd498cb6 Fall-back to target default order
issue10818
2021-10-11 08:53:21 +02:00
Cédric Krier c99e0fa7f4 Align instance caches of xxx2Many targets
issue10818
review369841002
2021-10-10 22:20:27 +02:00
Cédric Krier 66a0dcf2b5 Add stored path as alternative to MPTT
issue7177
review352501002
2021-10-03 01:14:08 +02:00
Cédric Krier 0e41c6940a Factorize the instantiation of LRUDict and LRUDictTransaction
We use default_factory to avoid create unnecessary instances. The
default_factory_with_key argument is added to LRUDict to pass the missing key
to the default_factory method. And we use an LRUDict also for the
Transaction.cache.

issue10726
review362531002
2021-09-26 22:55:52 +02:00
Cédric Krier c345b0c693 Use tuple in Dict value instead of list
issue10715
review371771002
2021-09-23 10:15:16 +02:00
Cédric Krier 9f8b847c15 Use immutable dictionary for Transaction context
issue10691
review358741002
2021-09-19 00:30:35 +02:00
Cédric Krier f8358b1229 Search by similarity only if a threshold is defined
issue10710
review363851002
2021-09-10 19:13:05 +02:00
Cédric Krier 03e2a7f2dc Avoid instantiate set
issue10660
review342911003
2021-09-02 23:56:13 +02:00
Cédric Krier fb9238b8bf Add digits mixin
issue10596
review338511002
2021-08-21 09:05:34 +02:00
Cédric Krier 0cca1c8d57 Use subquery when searching for similarity on translated Char
issue10624
review363621002
2021-08-12 18:38:15 +02:00
Cédric Krier 92d98b36ff Translate LazyString of ir.model and ir.model.field
issue10326
review321041002
2021-04-25 18:19:29 +02:00
Cédric Krier e4015d7bf3 Include records without link with negative search on xxx2many
issue10178
review345981002
2021-04-25 17:56:39 +02:00
Cédric Krier 42cb4a0f53 Set name clause on join condition instead of subquery
The name is a column from a table that is not available in the subquery.

issue10257
review346001004
2021-04-24 19:27:07 +02:00
Cédric Krier 14ccff94a0 Use order definition of xxx2Many fields
When empty it must be the order of the target and it must not be encoded as it
can not be PYSON.

issue10297
review349721004
2021-04-21 23:47:30 +02:00
Nicolas Évrard a426d9f398 Use immutable datastructures for Dict and MultiSelection fields
In case a Dict field is sent during an on_change, modification of its value
won't be detected because a shallow copy will keep its reference in the
pseudo-record

issue10105
review347541002
2021-04-12 19:39:25 +02:00
Cédric Krier 45d406e270 Add full text and similarity search
issue10023
review320601007
2021-03-21 16:21:05 +01:00
Cédric Krier 9c81cb6a4a Replace cursor fetchall by iteration over cursor
issue5817
review335831003
2021-03-21 16:09:13 +01:00
Nicolas Évrard 30c8c41c26 Ensure dependencies of fields are also loaded on Form display
issue9630
review298641002
2021-03-11 23:34:44 +01:00
Cédric Krier 2925c971b5 Add context field of parent to on_change calls
Those fields are required to instantiate the parent fields with the proper
context.

issue10182
review359301002
2021-03-11 19:20:32 +01:00
Cédric Krier 837c2f6164 Do not switch selection value if the result is neither in the selection
issue10120
2021-03-02 08:38:10 +01:00
Cédric Krier daf1b6e5ad Add fallback to the value for missing translated selection
issue10120
review341441002
2021-03-01 23:28:52 +01:00
Cédric Krier 3592175067 Use column to order when translation value is empty
issue10094
review331871002
2021-02-20 00:58:39 +01:00
Cédric Krier fffb8efb5a Ensure to join with only one translation row
If there are multiple translations for the same record, the join will generate
result with multiple times the same id on ModelSQL.search.
As DISTINCT ON is not always supported, we must also ensure that duplicated
translations are all updated.

issue10061
review351261002
2021-02-20 00:48:50 +01:00
Cédric Krier 964fc0a74b Add help for each value to selection and multiselection
issue9649
review320021002
2021-02-14 14:28:55 +01:00
Sergi Almacellas Abellana 06346f0c76 Eager load Function field with same multiple getter
issue9561
review314201002
2020-12-06 18:34:19 +01:00
Cédric Krier a1671ab214 Forbid all white spaces except space in Char field
They can not be displayed by all clients (nor OS).
But also they can be trimmed automatically by web input which breaks comparison
against changes.

issue9248
review312681002
2020-11-05 23:58:15 +01:00
Cédric Krier 39a6751726 Set default value for missing depends field
This avoid to fill an instance with None value which will prevent it to be
saved with the default value for fields not explicitly assigned.

issue9726
review314481004
2020-10-21 23:23:17 +02:00
Cédric Krier 001245bf60 Support timedelta in CSV import/export
issue9220
review297531002
2020-10-11 19:04:16 +02:00
Cédric Krier e11a23deb2 Rationalize import path
We use absolute path when imported module is from a different context.
And we remove unnecessary __all__ definition.

issue9466
review323591002
2020-07-21 14:38:36 +02:00
Sergi Almacellas Abellana d3f7ea5889 Do not write to existing targets on xxx2Many add
issue9194
review313581011
2020-06-17 13:55:00 +02:00
Cédric Krier b3f8d125f9 Use custom class to store record data
By using a class with slots instead of standard dict, we can reduce a lot the
memory usage to store the record data in the caches and values.
Also we can rely on the data in the cache to exist only for real field which
can be used to create a fast path in ModelStorage.__getattr__.
As now storing data in the cache has no extra cost, we can store data from the
transactional cache in the local. This allow also to have a shorter path in
ModelStorage.__getattr__.
For more memory efficiency, we remove the record from the cache instead of
clearing them. It was better to clear a dict but a record is less expensive to
re-instantiate than clearing.

issue9369
issue9225
review297861002
2020-06-13 09:48:03 +02:00
Cédric Krier fc66c17eb0 Call getter function when accessing Function field
If the record is unsaved and the getter is based on on_change_with, we can call
the getter to compute the value.
This value must not be stored in the cache as it may change prior to saving.

issue4193
issue9263
review317291002
2020-05-03 14:34:44 +02:00
Cédric Krier 8824c5a11b Add context field to on_change calls
Those fields are required to instantiate the fields with the proper context.

issue9236
review293501002
2020-04-19 16:36:15 +02:00
Cédric Krier a48382124f Support explicit delete and remove for saving and on_change xxx2Many
issue4140
review291281002
2020-04-12 23:18:15 +02:00
Cédric Krier b12d729c2d Add test on target of relation fields
issue9132
review291211004
2020-04-02 00:01:14 +02:00
Cédric Krier d7ed5f91f5 Fix flake8 errors and warnings
We add the flake8 configuration used so we ensure everyone uses the same.
We remove the usage of __all__ for non public API.
When possible, we rationalize the class name according to its __name__ and module.

issue9082
review297061002
2020-03-01 12:33:54 +01:00
Nicolas Évrard e2d8b6b295 Add MultiSelection entry to Dict field
issue8903
review284571003
2019-12-30 14:26:14 +01:00
Cédric Krier 6b14518eff Position new record based on order
We sent an order to the client for action and xxx2Many so its screen has
always a default order set.
To position a new record on non editable tree, we use the order of the 'id'
column if presents.

issue8880
review276501003
2019-12-28 18:16:28 +01:00