Don't put the processing account to statement move line if account is filled

This commit is contained in:
Guillem Barba 2016-06-30 16:42:10 +02:00
parent fcb9d2e5d8
commit 6129520931
1 changed files with 2 additions and 1 deletions

View File

@ -35,7 +35,8 @@ class StatementMoveLine:
methods=['invoice'])
def on_change_payment(self):
changes = super(StatementMoveLine, self).on_change_payment()
if self.payment and not self.invoice and self.payment.processing_move:
if (self.payment and not self.invoice and self.payment.processing_move
and not self.account):
for line in self.payment.processing_move.lines:
if line.account != self.payment.line.account:
changes['account'] = line.account.id