Commit Graph
104 Commits
Author SHA1 Message Date
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
Cédric Krier fe674cef55 Enforce unique list of records on method calls
An option is added on RPC definition to enforce uniqueness of records
instantiated. The key methods ModeView.button and Workflow.transition have an
assert to detect error in development code.

issue6184
review36411002
2017-07-16 23:49:15 +02:00
Cédric Krier 4130a14d48 Use _changed_values for added record on One2Many
This allows to have the 'rec_name' set for xxx2One and Reference field but we
need to ensure that even the initial values are returned because the instance
does not come from the client.

issue6579
review40471002
2017-07-10 23:59:26 +02:00
Nicolas Évrard ddf4e0fe3c Remove empty pages from notebook
issue3295
review40421002
2017-06-09 16:07:03 +02:00
Nicolas Évrard 39c12cf496 Add set_rpc on Field
The __rpc__ attribute is currently filled by method in ModelView. Allowing
fields to define themselves what endpoints should be remotely callable make
this process more flexible.

issue4044
review30991002
2017-02-01 16:11:00 +01:00
Sergi Almacellas Abellana 226caf249b Allow to define the text color and background color in calendar view
issue5953
review33461002
2016-10-28 17:55:09 +02:00
Cédric Krier ea605d2e9c Do not decorate with ModelView.button the ModelView.button_change
The button_change is similar to the on_change, they run under a read-only
transaction so there is no need to check the access right like it is done for
the button.

issue5983
review26841002
2016-10-27 17:40:31 +02:00
Cédric Krier e843bd23c5 Add button rule
issue5944
review26791002
2016-10-26 09:44:09 +02:00
Cédric Krier ddb5fc3026 Manage selection function for Function field
ModelView automatically adds missing RPC definition for selection function but
only for Selection or Reference field. It should also do the same for Function
field which mimic such fields.

issue5903
review30531002
2016-09-27 12:19:47 +02:00
Cédric Krier d305c26e54 Add support for derivative translations
This is done by calling first the getter method for the parent language for the
terms that are not yet cached. After existing translations are set for the
language. And finally the result is stored in the cache.
The synchronisation wizard remove also the translations that are identical to
their parent language.
The method load_module_graph adds all parent languages to be loaded for
derivation.

issue5443
review25581002
2016-09-10 23:25:03 +02:00
Sergi Almacellas Abellana b24c4143a2 Remove string attribute from ir.ui.view and ModelView.view_header_get
issue2350
review24251002
2016-07-05 12:42:46 +02:00
Cédric Krier 6232dabdf3 Don't check write access on model for button with groups
issue5010
review23181002
2016-06-30 21:51:03 +02:00
Cédric Krier 66a6f7aad4 Keep colspan attribute when replacing field without access rights
The colspan attribute is important to keep the layout of the view intact.
So we must keep it after clearing all other attributes.

issue5444
review21901002
2016-04-02 15:22:24 +02:00
Cédric Krier 29129855ec Add support for Python 3
issue3211
review7311002
2016-02-07 16:46:16 +01:00
Cédric Krier 1bd76628c6 Set view_ids attribute only if it is not empty
issue5207
review15861002
2015-12-31 14:17:03 +01:00
Cédric Krier 71c0e0a3af Allow nested inherited views
Search and use the recursive type of the views

issue5206
review17691002
2015-12-31 14:15:51 +01:00
Cédric Krier 1f04a58562 Remove comments from view.arch
A side effect of this change is that now the method parse only once the arch of
each view instead of dumping and parsing the intermediary result of
inheritance.

issue5189
review18831002
2015-12-31 14:13:03 +01:00
Cédric Krier 2e37bf7852 Don't return changed many2one if the id is None
If the id is None, it is a temporary record which should not be considered as a
value change.

issue5190
review20601002
2015-12-27 20:03:59 +01:00
Cédric Krier 1a7c6c3a06 Add missing id on label
Fields without read access are replaced by empty label but they still require
at least a name attribute or an id.

issue5187
review19701002
2015-12-27 20:01:03 +01:00
Cédric Krier 9a58954703 Add view_ids on tree view
issue5052
review24511002
2015-11-10 12:55:06 +01:00
Cédric Krier 0e467f1b5d Fix order when searching view in ModelView
When id is given, there is no need to perform a search otherwise only root
views or inherited views from other model should be considered.
Instead of explicitly define orders, it is better for modularity to use the
default one defined on the view model.

issue2041
review21461002
2015-10-15 10:44:30 +02:00
Cédric Krier cd47b8cf85 Use specific test 'elem is None' to remove lxml warning
FutureWarning: The behavior of this method will change in future
versions. Use specific 'len(elem)' or 'elem is not None' test instead.
2015-09-15 14:52:03 +02:00
Cédric Krier 9bc7174254 Backed out changeset 0fd061e7c87f 2015-09-15 14:51:13 +02:00
Cédric Krier 228a8ca7d9 Use specific test 'elem is not None' to remove lxml warning
FutureWarning: The behavior of this method will change in future
versions. Use specific 'len(elem)' or 'elem is not None' test instead.
2015-09-14 12:00:43 +02:00
Cédric Krier 8299e1c133 Validate XML generated by ModelView.fields_view_get
- Add missing attributes to {form,tree}.rn{c,g}
- Add validatation to test_view
- Prevent fields_view_get to set attribute to the wrong view type

issue4944
review19421002
2015-09-04 12:04:07 +02:00
Cédric Krier dad49fa98b Always test field presence in initial value when computed changed values
The value could be None which is also the default value returned by dict.get.
So it will fail to detect change in such case.

issue4839
review23281002
2015-07-14 00:04:08 +02:00
Nicolas Évrard 34acc0885b Allow to replace view's root node with an XPATH
issue4802
review19291002
2015-06-23 17:12:18 +02:00
Cédric Krier 611b96c5f0 Add is_instance_method tool compatible with Python3
issue3211
2015-03-18 23:34:55 +01:00
Cédric Krier ad5eb3ed97 Add ModelView.button_change
issue4397
review7781002
2015-03-16 12:56:11 +01:00
Cédric Krier c17fbf5f25 Iter over copy of lxml.etree children
and remove deprecated usage of lxml.etree getchildren.
The cffi implemenation of lxml doesn't support to change the parent of element
while itering over it. It results of missing loop of some elements.

issue4408
review11741002
2015-03-15 15:49:37 +01:00
Cédric Krier bcd28ca071 Remove safe_eval
We convert all the fields that were storing python code into PYSON.
We add a pyson attribute on field tag to store PYSON value.

issue4416
review6971002
2015-03-09 19:40:41 +01:00
Sergi Almacellas Abellana 1ecdc9d3c9 Remove all the view elements which the user doesn't have access
issue4487
review10071002
2015-01-21 19:50:39 +01:00
Cédric Krier 286860f6b1 Fix documentation of ModelView.fields_view_get
review8811002
2014-12-16 22:19:01 +01:00
Cédric Krier c144f8c349 Fix most flake8 errors
review8771002
2014-12-02 12:54:01 +01:00
Udo Spallek 389b56a7b6 Test 'field' object for attribute 'field'
issue4358
review12731002
2014-11-24 16:36:58 +00:00
Cédric Krier 8553dfe9b0 _change_values miss some one2many changes
If only records of one2many change but the tuple is still the same than
_changed_values miss it.

issue4345
review7721002
2014-11-21 10:08:35 +01:00