Reviewers: ,


Please review this at http://codereview.tryton.org/927002/

Affected files:
  M move.py


Index: move.py
===================================================================

--- a/move.py
+++ b/move.py
@@ -355,11 +355,9 @@
                     move.period.post_move_sequence_used.id)
             cls.write([move], values)
 
-            if len(move.lines) == 1:
-                line, = move.lines
-                if ((line.debit == line.credit == Decimal('0'))
-                        and line.account.reconcile):
-                    Line.reconcile([line])
+            Line.reconcile([l for l in move.lines
+                    if ((line.debit == line.credit == Decimal('0'))
+                        and line.account.reconcile)])
 
     @classmethod
     @ModelView.button
@@ -1334,6 +1332,9 @@
         Period = pool.get('account.period')
         Date = pool.get('ir.date')
 
+        if not lines:
+            return
+
         for line in lines:
             if line.reconciliation:
                 cls.raise_user_error('already_reconciled',

Reply via email to