You use invoice.account_id as a move line filter. I suggest instead that you check for each move if the account is a "receivable" or "payable" account. This is more consistent and allows other modules to split receivables/payables in more than one account (say "Receivables/Credit Card" for credit card payments, "Receivables/Cheque" for cheque payments.
Dukai,
You use invoice.account_id as a move line filter. I suggest instead that you check for each move if the account is a "receivable" or "payable" account. This is more consistent and allows other modules to split receivables/ payables in more than one account (say "Receivables/Credit Card" for credit card payments, "Receivables/ Cheque" for cheque payments.