From 1a0d173b9af787a4acc515f153e3d5d78f358487 Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Fri, 30 Sep 2016 15:09:38 +0200 Subject: [PATCH] [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 --- addons/account/models/account_move.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/addons/account/models/account_move.py b/addons/account/models/account_move.py index 766826e10d8..4833c8cba7d 100644 --- a/addons/account/models/account_move.py +++ b/addons/account/models/account_move.py @@ -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])