Reviewers: ,


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

Affected files:
  M invoice.py


Index: invoice.py
===================================================================
--- a/invoice.py
+++ b/invoice.py
@@ -1094,6 +1094,8 @@
         journal = journal_obj.browse(journal_id)

         if invoice.type in ('out_invoice', 'in_credit_note'):
+            if not journal.debit_account:
+                self.raise_user_error('missing_debit_account')
             lines.append({
                 'name': description,
                 'account': invoice.account.id,
@@ -1114,8 +1116,6 @@
             })
             if invoice.account.id == journal.debit_account.id:
                 self.raise_user_error('same_debit_account')
-            if not journal.debit_account:
-                self.raise_user_error('missing_debit_account')
         else:
             lines.append({
                 'name': description,


--
[email protected] mailing list

Reply via email to