[FIX] account: analytic account in write-off

The analytic account of the write-off move is not copied on the line
when doing a reconciliation.

opw-688635
This commit is contained in:
Nicolas Martinelli
2016-09-30 16:03:59 +02:00
parent da388aa192
commit 1a0d173b9a
+2
View File
@@ -898,6 +898,8 @@ class AccountMoveLine(models.Model):
vals['date'] = self._context.get('date_p') or time.strftime('%Y-%m-%d')
if 'name' not in vals:
vals['name'] = self._context.get('comment') or _('Write-Off')
if 'analytic_account_id' not in vals:
vals['analytic_account_id'] = self.env.context.get('analytic_id', False)
#compute the writeoff amount if not given
if 'credit' not in vals and 'debit' not in vals:
amount = sum([r.amount_residual for r in self])