server_environment: Update default fields label

this to avoid Odoo warning messages on labels check
This commit is contained in:
Adrien Peiffer 2022-03-18 09:31:38 +01:00 committed by Marcos Oitaben
parent 97c4c5b829
commit ef20d82588
2 changed files with 9 additions and 2 deletions

View File

@ -4,7 +4,7 @@
{
"name": "server configuration environment files",
"version": "15.0.1.1.0",
"version": "15.0.1.1.1",
"depends": ["base", "base_sparse_field"],
"author": "Camptocamp,Odoo Community Association (OCA)",
"summary": "move some configurations out of the database",

View File

@ -378,7 +378,14 @@ class ServerEnvMixin(models.AbstractModel):
base_field_cls = base_field.__class__
field_args = base_field.args.copy() if base_field.args else {}
field_args.pop("_sequence", None)
field_args.update({"sparse": "server_env_defaults", "automatic": True})
fieldlabel = "{} {}".format(field_args.get("string", ""), "Env Default")
field_args.update(
{
"sparse": "server_env_defaults",
"automatic": True,
"string": fieldlabel,
}
)
if hasattr(base_field, "selection"):
field_args["selection"] = base_field.selection