Commit Graph
914 Commits
Author SHA1 Message Date
Cédric Krier 0973bd6c9d Ensure to read only validated records
The list of records can be part of a large browse list which may be also read
when accessing attribute of the record. To prevent that we must use a new
browsing list.

issue10632
review334631003
(grafted from b799fb16468dec19830732f762088051140a1b53)

--HG--
branch : 6.0
2021-08-16 23:07:06 +02:00
Cédric Krier 6f966ac8c9 Use subquery when searching for similarity on translated Char
issue10624
review363621002
(grafted from 9cc55cca68b0fa69631ae93b0a63a229a5e83375)

--HG--
branch : 6.0
2021-08-12 18:38:15 +02:00
Cédric Krier 4a6e513544 Set field context when validate domain
issue10386
review336171002
(grafted from 3f6ad2b8a63147715020daa288c4a3fe30d51769)

--HG--
branch : 6.0
2021-06-06 09:27:28 +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 7cd224905e Do not use root user to validate records
It is no more needed as record rules are now ignored by _check_access.

issue10303
review357871002
2021-04-23 22:59:19 +02:00
Cédric Krier 22370bebaf Ensure sequence_ordered is ASC
issue10299
review334181002
2021-04-22 23:44:39 +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
Cédric Krier 7aa2ef6b5e Do not set _timestamp on fake singleton instance
It is not really useful because the id of the future record can not be guessed
for sure by the client.
Also when write is called with such fake _timestamp as singleton create the
record before actually write, the timestamp check always fails (if the id was
correctly guessed).

issue10282
2021-04-14 00:39:56 +02:00
Cédric Krier 85646eec35 Ignore pseudo-field when reading singleton
The default_get method fails when called with non-existing fields.

issue10262
review348161009
2021-04-12 20:15:13 +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 1788bcb544 Check rule only if _check_access is set
issue4080
review343891009
2021-04-10 23:44:39 +02:00
Cédric Krier 4d0a6fa864 Prevent infinite loop when generate avatar without PIL
Without PIL the value returned by generate_avatar is None which is saved and
trigger again the call to generate_avatar and so on.
2021-03-28 19:49:52 +02:00
Cédric Krier 80ac9eb0be Add support for avatar
issue10085
review343561002
2021-03-28 19:20:37 +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 55143f1009 Compute default values on creation only once per schema of missing default values
issue10131
review341491002
2021-03-12 12:33:30 +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 04a0aea2ad Add __access__ to Model
issue9903
review324601002
2021-03-07 11:13:53 +01:00
Nicolas Évrard 0e73e59095 Update MPTT only for affected fields
issue10130
review353331002
2021-03-05 18:22:55 +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
Nicolas Évrard eb78acc47b Call Function.get by bunch of cache size
issue9927
review324701002
2021-02-23 18:50:27 +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 77dbb6df2f Make ModelView.parse_view public
issue10073
review333851028
2021-02-14 15:56:18 +01:00
Cédric Krier dcdd1707b4 Check record rule in button decorator
In order to relax internal control of record rules, they must be enforced on
the button entry point.
This is done by just reading the id of the records already stored.

issue7638
review349381002
2021-02-14 15:47:00 +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
Cédric Krier 0a7268f6ef Do not instantiate other fields loaded eagerly
It has a cost to instantiate such fields and there is not guarantee that they
will be used. But as their values are stored in the cache, if they are needed
they can be instantiated using only the cache values.
Also there is no real benefit in instantiate two fields together.

issue10026
review341251002
2021-02-13 11:15:16 +01:00
Cédric Krier 37d80d6f7f Update translate field of all copied records
The same record can be passed multiple times in the list. So we must update all
of the new records with the translated value of the fields.

issue9866
review353091002
2021-01-18 23:20:15 +01:00
Nicolas Évrard 750b597043 Use created_at text for create_date field
issue9902
review308761002
2021-01-07 10:52:08 +01:00
Cédric Krier bc22445e3d Raise explicit message when view is missing XML
issue9940
review316651002
2021-01-03 13:06:13 +01:00
Cédric Krier d766a67fbb Use cache to fill Reference selections
issue9235
review335301003
2020-12-27 00:19:30 +01:00
Cédric Krier b16604550c Skip access check on ModelStorage instances
There is no need to enforce access right on instances because only internal
code can use them and the design is to only check on the external calls.

issue7765
review322581002
2020-12-18 00:09:03 +01:00
Nicolas Évrard 1d29cbe2b8 Compute once selection field's value when possible
issue9222
review309331002
2020-12-11 11:57:10 +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 e18501c644 Support other methods for button_change decorator
issue9871
review314871002
2020-12-05 12:09:27 +01:00
Cédric Krier 1618881692 Allow copying Python instances of Model
issue9869
review337071002
2020-12-05 11:58:41 +01:00
Cédric Krier 0aa6c7c80b Add all buttons to default form view
issue9870
review333231002
2020-12-05 11:43:59 +01:00
Cédric Krier 4f83dff439 Convert rule domain for _write and _delete without active test
We must convert in ModelSQL.read the rule domains like the ModelSQL.write and
ModelSQL.delete convert their rule without the active test to have the same
result.

issue9819
review300951006
2020-11-23 23:43:01 +01:00
Cédric Krier 10f85f8bc0 Include recursively the depends of the depends into the view
The value of a field, added to the view because it is a depends, may not be
correctly computed if it is missing its own depends.

issue9828
review292751003
2020-11-23 23:33:59 +01:00
Sergi Almacellas Abellana 02d4e18e35 Remove unused overrided function in modelstorage
issue9863
review331351002
2020-11-23 17:55:20 +01:00
Cédric Krier 3271788e7c Remove unused import 2020-11-15 18:18:11 +01:00
Cédric Krier 2bedebbccc Disable record rule when validating records
issue9796
review329451002
2020-11-11 20:33:18 +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 0a2cc7162d Construct recursively Tree search_rec_name with 'in' operators
Each value of the 'in' operators must be processed as a '=' clause.
The None values must be supported just in case it set in the 'in' values
because the mixin does not allow empty name.

issue9354
review304601002
2020-10-26 21:27:13 +01:00
Cédric Krier 26076d82f1 Fallback to stored values to compute changed xxx2Many
The client may not send the values for the xxx2Many if they have not been
loaded. So in order to provide proper changes to apply once the values are
loaded we must base those changes on the current data stored.

issue9719
review308391002
2020-10-21 23:27:13 +02: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