From 2a1cd3933e15c2ad72c80b58d3950089d2ef96a0 Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Sun, 27 Oct 2019 13:04:39 +0100 Subject: [PATCH] Migration to v13: always set computed fields --- models/oovideo_folder.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/models/oovideo_folder.py b/models/oovideo_folder.py index 3156d74..265cd1b 100644 --- a/models/oovideo_folder.py +++ b/models/oovideo_folder.py @@ -53,7 +53,10 @@ class VideoFolder(models.Model): @api.depends("path") def _compute_root_preview(self): ALLOWED_FILE_EXTENSIONS = self.env["oovideo.folder.scan"].ALLOWED_FILE_EXTENSIONS - for folder in self.filtered(lambda f: f.root and f.path): + for folder in self: + if not folder.root or not folder.path: + folder.root_preview = False + continue i = 0 fn_paths = "" for rootdir, dirnames, filenames in os.walk(folder.path):