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])