Browse Source

[IMP] replace search by search_count

pull/706/head
Sylvain LE GAL 8 years ago
parent
commit
0cc49b6e46
  1. 4
      mass_sorting/models/mass_sort_config.py

4
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."))

Loading…
Cancel
Save