Commit Graph
139 Commits
Author SHA1 Message Date
Cédric Krier 10d277f001 Add optional column on tree view
issue10989
review374321002
2022-02-03 23:13:28 +01:00
Cédric Krier 4a023ef216 Add RPC view_get method to View
This allows to extend the inherit mechanism of the view and support inherit for
the board view.
Also the inherit is now applied to all element found by the xpath.

issue11107
issue11108
review389601002
2022-01-23 13:32:59 +01:00
Cédric Krier 51a08fb809 Set view_id in the context when calling view_attributes
issue11091
review364531002
2022-01-04 22:30:41 +01:00
Cédric Krier a0bfbfa255 Follow isort formatting
issue10928
2021-12-11 17:58:45 +01: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 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 bc22445e3d Raise explicit message when view is missing XML
issue9940
review316651002
2021-01-03 13:06:13 +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 0aa6c7c80b Add all buttons to default form view
issue9870
review333231002
2020-12-05 11:43:59 +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
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 cd7d40eb07 Add symbol widget
issue9059
review276871002
2020-10-09 19:09:06 +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 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 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 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 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
Sergi Almacellas Abellana 0cb3377825 Add depends fields on view_attributes
issue8862
review303161002
2020-03-30 09:33:15 +02: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
Cédric Krier 1ede807a81 Do not prefetch view of xxx2many using multiselection widget
The view is not required by the widget and it allows non ModelView relation to
be used.

issue8894
review288631002
2019-12-18 21:40:42 +01:00
Cédric Krier 0811414d49 Update button_action with returned values
issue8766
review268241002
2019-12-07 16:03:36 +01:00
Cédric Krier f7e5c68664 Do not consider as changed the reverse field of One2Many
issue8742
2019-11-17 23:42:02 +01:00
Cédric Krier be8ffa6f0c Use new related API for _changed_values
The rev 596528aa0139 introduced a new API for related values. The rec_name set
by ModelView._changed_values must follow this new API to be used as cache by
the clients.

issue8637
review280081004
2019-09-11 23:49:34 +02:00
Cédric Krier 262f81979d Do not call _changed_values on non ModelView instance
When the target is not a ModelView, we can not compute the changed values.
2019-09-08 22:11:31 +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 d2bc591d18 Use stored value for One2Many changed without initial value
If the client does not send the value for the One2Many (it happens when it is
not modified), we must assume that it has the stored value unchanged. Otherwise
the current records are considered as to be added but with only their changed
values.

issue8605
review265901016
2019-09-07 23:34:20 +02:00
Cédric Krier 2d0002d8e9 Allow to search on related field in search box
The server adds to the definition of the fields, the definition of relation
fields up to specific deep level.
The clients use this relation fields definition to extend the domain parser
with those fields using a dot notation. But those "dotted fields" are not
shown in the search filter to not bloat the popup as it is dedicated to
learning.
In addition, Dict fields are also filled with relation fields coming from the
keys defined in the schema model. As the size can very large, it is possible
to deactivate this feature from the configuration.

issue8293
review259391005
2019-06-16 15:44:14 +02:00
Cédric Krier 5e6638c072 Remove useless callables dictionary 2019-05-28 10:03:40 +02:00
Cédric Krier da5b0daf68 Fill ModelView.__change_buttons in __post_setup__
Since the refactoring from a57cd35eec06, we loop only on fields in __setup__
so button_change are not processed. And __change_buttons is not filled.
We fill it in the __post_setup__ when the _buttons dict is filled when values.

issue8329
2019-05-06 11:34:11 +02:00
Cédric Krier 722db3252a Remove id to on_change calls that are cached
issue8234
review275131002
2019-04-08 10:14:39 +02:00
Cédric Krier 0fbf5cecd2 Add cache management on RPC
issue8233
review257231002
2019-04-08 10:10:40 +02:00
Cédric Krier 9e10625111 Set the requested view_id in result of fields_view_get
The client uses the id of the view received by fields_view_get to construct
the URL so it must be the one requested to ensure to have the same view.

issue7988
review275081002
2019-03-22 18:18:36 +01:00
Cédric Krier 6d16b629f2 Add CSV exports to print toolbar
issue8130
review54571002
2019-03-22 17:21:21 +01:00
Cédric Krier 9eb1c2eaaa Compute depends on-demand instead of for all callable
issue7939
review64521002
2019-01-18 00:24:28 +01:00
Cédric Krier 1738a4ec35 Add ir.message and use custom exceptions
issue3672
review35291002
2018-12-29 14:19:08 +01:00
Cédric Krier 81375e0d45 Use callable instead of instance of collections.Callable
issue7666
review50571002
2018-09-11 00:19:52 +02:00
Cédric Krier a6a7325f46 Remove deprecation warning
- remove invalid escape sequence
- use  read_file instead of read_fp
- use importlib instead of imp and __import__
- use callable instead of instance of collections.Callable
- fix silent file closing
- replace SafeConfigParser by ConfigParser
- replace decodestring by decodebytes
- replace encodestring by encodebytes

issue7666
issue7390
review53361004
2018-09-01 17:06:28 +02:00
Sergi Almacellas Abellana 3158279cb3 Remove button if it is not allowed to access some of its dependant fields
issue7502
review47511002
2018-08-01 10:44:06 +02:00
Sergi Almacellas Abellana 119af696a1 Recursively remove dependant fields when no access
issue7501
review46551002
2018-07-11 16:22:37 +02:00
Cédric Krier d2a461390a Remove support for Python 2.7
issue7497
review53261002
2018-06-26 19:11:19 +02:00
Cédric Krier 7408bb8090 Simplify the creation of dependencies graph
There is no need to create the graph step by step with only dependencies
already registered as far as the depth computation is propagated to all the
children.
Instead of searching level by level the nodes to iterate, it is faster to use
the sort of Python.
create_graph does not need to return its internal states but only the graph.
The ir.module activate and update method does not need to check for missing
dependencies because it is already checked at startup.

issue7466
review45211002
2018-06-11 23:22:35 +02:00
Cédric Krier 35bba61748 Make depends on methods generic to any method
issue5191
review50381002
2018-05-31 13:23:55 +02:00
Sergi Almacellas Abellana bfb76a70ad Add deactivable mixin and ensure active field is present
issue4341
review38401002
2018-03-26 14:07:45 +02:00
Sergi Almacellas Abellana ff2bded417 Ensure that all buttons are registered in ir.model.button
issue6389
review36621002
2018-03-01 11:59:23 +01:00
Sergi Almacellas Abellana 54f70e2971 Add depends on Button
issue6919
review40811002
2018-02-19 11:35:37 +01:00
Cédric Krier 87dfddc17a Do not use defaultdict as changed value
xmlrpclib can not dump it and _changed_value is used by RPC on_change methods.

issue6943
review44431002
2017-11-18 11:12:45 +01:00