From 0cc49b6e46c51cb25150197159f4828e97affbd1 Mon Sep 17 00:00:00 2001 From: Sylvain LE GAL Date: Tue, 28 Feb 2017 17:32:54 +0100 Subject: [PATCH] [IMP] replace search by search_count --- mass_sorting/models/mass_sort_config.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mass_sorting/models/mass_sort_config.py b/mass_sorting/models/mass_sort_config.py index 175d2492c..efad37b85 100644 --- a/mass_sorting/models/mass_sort_config.py +++ b/mass_sorting/models/mass_sort_config.py @@ -48,9 +48,9 @@ class MassSortConfig(models.Model): def _check_model_sequence(self): field_obj = self.env['ir.model.fields'] for config in self: - if len(field_obj.search([ + if field_obj.search_count([ ('model', '=', config.one2many_field_id.relation), - ('name', '=', 'sequence')])) != 1: + ('name', '=', 'sequence')]) == 0: raise ValidationError( _("The selected Field to Sort doesn't not have" " 'sequence' field defined."))