Commits

Raimon Esteve (Zikzakmedia) committed 98c8fed

Get manufacturer: Return none if not manufacturer in product

Comments (0)

Files changed (2)

     def get_manufacturer(cls, records, name):
         result = {}
         for line in records:
-            result[line.id] = line.product.manufacturer.id
+            result[line.id] = line.product.manufacturer and \
+                line.product.manufacturer.id or None
         return result
 
     def on_change_product(self):
     def get_manufacturer(cls, records, name):
         result = {}
         for line in records:
-            result[line.id] = line.product.manufacturer.id
+            result[line.id] = line.product.manufacturer and \
+                line.product.manufacturer.id or None
         return result
 
     def on_change_product(self):