The 4th element of the clause is the parent field for the child_of/parent_of
operators, so it must be used to check access as related field.
Also we must remove the 4th element when checking related domain.
issue11115
review391371002
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
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
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
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
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
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
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
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
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
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
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
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