Fix context on sale line if there is no warehouse for issue929

This commit is contained in:
Cédric Krier committed 2009-04-05 14:08:34 +02:00
1 parent b3c30216a3
commit d1b6b54ac7
1 file changed
+3 -1
+3 -1
View File
@@ -881,7 +881,9 @@ class SaleLine(OSV):
'invisible': "type != 'line'",
}, on_change=['product', 'unit', 'quantity', 'description',
'_parent_sale.party', '_parent_sale.currency'],
context="{'locations': [_parent_sale.warehouse], " \
context="{'locations': " \
"_parent_sale.warehouse and [_parent_sale.warehouse] " \
"or False, " \
"'stock_date_end': _parent_sale.sale_date, " \
"'salable': True}")
unit_price = fields.Numeric('Unit Price', digits=(16, 4),