Commits

Raimon Esteve (Zikzakmedia)  committed 6d05db5

Get variants if more than 1

  • Participants
  • Parent commits dbe935b

Comments (0)

Files changed (1)

     def get_variants(self, ids, name):
         res = {}
         for template in self.browse(ids):
-            res[template.id] = len(template.products)
+            variants = len(template.products)
+            if variants <= 1:
+                variants = None
+            res[template.id] = variants
         return res
 
     def search_variants(self, name, clause):