Commit Graph

7 Commits

Author SHA1 Message Date
Guewen Baconnier 6b44590605 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-07-24 09:56:20 +02:00
Guewen Baconnier 60375bbf65 Add global section 2018-07-24 09:56:18 +02:00
Guewen Baconnier 64c3e29b73 Use a dictionary to configure the fields 2018-07-24 09:50:06 +02:00
Guewen Baconnier 8d43652dbd Fix a few small issues in mixin 2018-07-24 09:49:27 +02:00
Guewen Baconnier 04bbfce412 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-07-24 09:31:47 +02:00
Guewen Baconnier ff91cc4a0f 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-07-24 09:31:47 +02:00
Guewen Baconnier 59fab426e1 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-07-24 09:31:47 +02:00