From d1b6b54ac72fb2dedeef7c9825f9ccca52e615c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sun, 5 Apr 2009 14:08:34 +0200 Subject: [PATCH] Fix context on sale line if there is no warehouse for issue929 --- sale.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sale.py b/sale.py index 56c2aba213..201f23db8f 100644 --- a/sale.py +++ b/sale.py @@ -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),