From adf6172a652c1c61c5c7b9699478390cc0cdc050 Mon Sep 17 00:00:00 2001 From: Arnaud Pineux Date: Mon, 6 May 2019 16:20:16 +0200 Subject: [PATCH] [FIX] onchange_helper: invert condition to avoid [None] Co-Authored-By: lmignon --- onchange_helper/models/models.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/onchange_helper/models/models.py b/onchange_helper/models/models.py index d532fbde3..5505153ec 100644 --- a/onchange_helper/models/models.py +++ b/onchange_helper/models/models.py @@ -132,7 +132,10 @@ class Base(models.AbstractModel): if self: self.ensure_one() - if not isinstance(onchange_fields, list): + if not onchange_fields: + onchange_fields = values.keys() + + elif not isinstance(onchange_fields, list): onchange_fields = [onchange_fields] if not onchange_fields: