Create invoice line for non-line only once

issue3292
review1043002
(transplanted from 71fd4a013396386aaee4479c27c05178721b38d5)
This commit is contained in:
Cédric Krier committed 2013-09-02 11:19:37 +02:00
1 parent 719b616c63
commit e81a203360
1 file changed
+2 -1
+2 -1
View File
@@ -1207,8 +1207,10 @@ class SaleLine(ModelSQL, ModelView):
invoice_line.type = self.type
invoice_line.description = self.description
invoice_line.note = self.note
invoice_line.origin = self
if self.type != 'line':
if (self.sale.invoice_method == 'order'
and not self.invoice_lines
and ((all(l.quantity >= 0 for l in self.sale.lines
if l.type == 'line')
and invoice_type == 'out_invoice')
@@ -1265,7 +1267,6 @@ class SaleLine(ModelSQL, ModelView):
self.raise_user_error('missing_account_revenue_property', {
'sale': self.sale.rec_name,
})
invoice_line.origin = self
return [invoice_line]
@classmethod