Commit Graph

14 Commits

Author SHA1 Message Date
Guewen Baconnier ea5204d471
Fixes for review feedbacks 2018-11-05 17:35:32 +01:00
Guewen Baconnier 98bc9ea988
Infer configparser getter from field type 2018-11-05 17:35:32 +01:00
Guewen Baconnier e096c209ed
Add tests for the server env mixin 2018-11-05 17:35:32 +01:00
Guewen Baconnier 80a56d320a
Reinforce server_environment base tests 2018-11-05 17:35:31 +01:00
Guewen Baconnier 398b324b03
Allow integration with keychain
By adding options to change the compute and inverse methods for default
fields
2018-11-05 17:35:31 +01:00
Guewen Baconnier c5f56e6336
Allow to edit all fields on creation 2018-11-05 17:35:31 +01:00
Guewen Baconnier d7f0a1b24b
Use global section name as first part of the section 2018-11-05 17:35:30 +01:00
Guewen Baconnier 27c1a41f24
Disable prefetch on env-computed fields
As in the inverse field that write the value into the <field>_env_default
we have to browse the record, the prefetch has the effect of calling
compute on the env-computed field which resets the value to it's
previous state before we have the occasion to store it.
2018-11-05 17:35:30 +01:00
Guewen Baconnier e0832cb649
Add global section 2018-11-05 17:35:30 +01:00
Guewen Baconnier 572f581bfa
Use a dictionary to configure the fields 2018-11-05 17:35:30 +01:00
Guewen Baconnier 70d6966ce0
Fix a few small issues in mixin 2018-11-05 17:35:30 +01:00
Guewen Baconnier f7e207a1a1
Allow to edit default values for env-computed fields
When they don't have any key in the environment configuration files.
In the UI, when a field is set in a configuration file, the field is
readonly, if not the field is editable. Which means you can selectively
choose which fields depend on the environment and which can use a
"default" value stored in database.
2018-11-05 17:35:29 +01:00
Guewen Baconnier d917407672
Read default values from database when no config is provided
Automatically add <field_name>_env_default for every field transformed
to a "computed from env" field, so a default value can be set. It will
be used when the configuration is not set in a configuration file
(when the key is absent, not empty).
2018-11-05 17:35:29 +01:00
Guewen Baconnier fbc4f8f928
Add a server environment mixin
To automatically convert fields into fields reading values from the
environment. Until now, every module reimplements the same computed
field.
2018-11-05 17:35:29 +01:00