Create invoice line for non-line only once

issue3292
review1043003
(transplanted from 399d66f4e5262cffe86254af3f43074f2e43418d)
This commit is contained in:
Cédric Krier committed 2013-09-02 11:21:19 +02:00
1 parent 28f7f62fd2
commit 14ae4182e2
1 file changed
+1
+1
View File
@@ -1237,6 +1237,7 @@ class PurchaseLine(ModelSQL, ModelView):
res['note'] = line.note
if line.type != 'line':
if (line.purchase.invoice_method == 'order'
and not line.invoice_lines
and (all(l.quantity >= 0 for l in line.sale.lines
if l.type == 'line')
or all(l.quantity <= 0 for l in line.sale.lines