Fix location domain if warehouse is empty

This commit is contained in:
Cédric Krier committed 2009-03-31 13:48:15 +02:00
1 parent e4edde5691
commit e5fdf77e22
1 file changed
+1 -1
+1 -1
View File
@@ -17,7 +17,7 @@ class ProductLocation(ModelSQL, ModelView):
domain=[('type', '=', 'warehouse')])
location = fields.Many2One('stock.location', 'Storage Location',
required=True, domain="[('type', '=', 'storage'), " \
"('parent', 'child_of', [warehouse])]")
"('parent', 'child_of', warehouse and [warehouse] or [])]")
sequence = fields.Integer('Sequence')
def __init__(self):