[FIX] Update server_env_mixin.py to avoid NoneType error

This commit is contained in:
jsanchez 2021-10-27 10:18:30 +02:00 committed by Marcos Oitaben
parent 73b77ae3f7
commit cae9e7df22
2 changed files with 2 additions and 2 deletions

View File

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

View File

@ -376,7 +376,7 @@ class ServerEnvMixin(models.AbstractModel):
# (inherits), we want to override it with a new one # (inherits), we want to override it with a new one
if fieldname not in self._fields or self._fields[fieldname].inherited: if fieldname not in self._fields or self._fields[fieldname].inherited:
base_field_cls = base_field.__class__ base_field_cls = base_field.__class__
field_args = base_field.args.copy() field_args = base_field.args.copy() if base_field.args else {}
field_args.pop("_sequence", None) field_args.pop("_sequence", None)
field_args.update({"sparse": "server_env_defaults", "automatic": True}) field_args.update({"sparse": "server_env_defaults", "automatic": True})