Keep lines order when creating invoice lines

The itervalues introduced in changeset 7d28de2f84e4 doesn't keep the order of
the lines so it must loop over the lines to keep the order.

issue4794
review23431002
This commit is contained in:
Cédric Krier committed 2015-09-28 21:34:13 +02:00
1 parent b3d95740f2
commit 3841b13cdd
1 file changed
+3 -1
+3 -1
View File
@@ -708,7 +708,9 @@ class Purchase(Workflow, ModelSQL, ModelView, TaxableMixin):
return
invoice = self._get_invoice_purchase(invoice_type)
invoice.lines = list(chain.from_iterable(invoice_lines.itervalues()))
invoice.lines = list(chain.from_iterable(
invoice_lines[l.id] for l in self.lines
if l.id in invoice_lines))
invoice.save()
Invoice.update_taxes([invoice])