Commit Graph
883 Commits
Author SHA1 Message Date
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
Cédric Krier 1f013a7eec Convert read column into proper type with SQLite
As SQLite has few basic types, we must use column names cast parsing to ensure
to read values in proper type.

issue9652
review310801004
2020-10-21 23:11:13 +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 cd7d40eb07 Add symbol widget
issue9059
review276871002
2020-10-09 19:09:06 +02:00
Cédric Krier 576b6265a6 Update ModelSingleton to use the custom cache class API
issue9641
review292321003
2020-10-08 21:26:20 +02:00
Nicolas Évrard bfd07fffef Ensure that views are valid when replacing link by label
issue9548
review327881002
2020-09-23 10:06:49 +02:00
Nicolas Évrard 70b2c9b56c Manage deletable and writable state from ir.rule
issue9357
review290101002
2020-09-23 10:04:19 +02:00
Nicolas Évrard f6841f7d68 Remove useless deepcopy call
The copy is having a big impact when computing huge views

issue9557
review300321002
2020-09-18 16:27:29 +02:00
Cédric Krier 82e64bf66a Send client email via server
issue9449
review292001002
2020-09-17 17:18:02 +02:00
Cédric Krier bc1f29e6c9 Use the ids order to fill cache with read data
The shared cache is designed for loop usage so we must ensure that we fill the
LRU dictionary in the same order as the loop will request attributes.
So we must order the result of the read because the API does not return data in
the same order as the list of ids.

issue9518
review318041002
2020-08-10 23:24:02 +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
Cédric Krier d882e84c74 Delete read data after having instantiated all targets
Some read value may be needed to instantiate other records if it is used in the
context.
Also the test to fill fields dictionary was always false as it tested the field
instance instead of the name.

issue9380
review298171002
2020-07-13 20:55:53 +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 4a1f2c938b Use different hash for records without id
In order to have store them efficiently in dictionary, we generate a different
hash for each unsaved record by using the instance id.

issue9240
review295421002
2020-06-17 00:30:53 +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 3242096509 Evaluate PYSON domain with the origin record
When a relation domain is not valid, the domain used to set on the exception
must be evaluated with the origin record and not the invalid target record.
We take the first origin record as any of the passed record will generate the
same domain per design.

issue9383
review317531002
2020-06-12 12:36:47 +02:00
Cédric Krier cf1cdf1c98 Ignore link of action that user can not read
We must also prevent the client to read link action for which the user has not
read access.

issue9364
review305661002
2020-05-28 18:17:40 +02:00
Nicolas Évrard cfb307238e Add support for properties to fields.depends
issue9313
review319451002
2020-05-25 09:39:17 +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 ad4a2bdf75 Add link button
issue9051
review280841002
2020-04-13 12:21:55 +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 5626018cd6 Add export CSV data route
issue9090
review261011002
2020-04-12 23:10:30 +02:00
Cédric Krier a2c783371d Do not use only cache if context depends on other fields
We must read all the required fields to set a correct context on the field.

issue9187
review297391002
2020-04-10 18:25:03 +02:00
Cédric Krier b12d729c2d Add test on target of relation fields
issue9132
review291211004
2020-04-02 00:01:14 +02:00
Sergi Almacellas Abellana 0cb3377825 Add depends fields on view_attributes
issue8862
review303161002
2020-03-30 09:33:15 +02:00
Cédric Krier 34e5c61a1a Run trigger in the queue
This ensures that internal changes that are reverted later in the same
transaction does not trigger an action.
Also we ensure that a record is triggered by the same trigger only
once per transaction.

issue8342
review280971002
2020-03-28 17:13:12 +01:00
Cédric Krier 72a71019c0 Do not copy Binary content with file_id
This avoid the filestore to reprocess the binary data as the file_id is
already copied.

issue9153
review297241002
2020-03-28 16:57:05 +01:00
Cédric Krier 7691b89822 Set saved tree width only if client save them
We rename also the option from save_width_height to save_tree_width which
correspond better to the current behavior.

issue9130
review258921051
2020-03-28 00:33:27 +01:00
David Harper ba776f36a5 Replace memoize with functools.lru_cache
issue9081
review286781002
2020-03-25 17:34:35 +01:00
Cédric Krier d0a82c8bdc Support multiselection field in EvalEnvironment
issue9144
review285001004
2020-03-17 23:28:57 +01:00
Cédric Krier 62f2ce0198 Set all fields readonly for inactive records
issue3747
review295061011
2020-03-17 20:08:13 +01:00