Skip to content

Commit

Permalink
[FIX] account: analytic account in write-off
Browse files Browse the repository at this point in the history
The analytic account of the write-off move is not copied on the line
when doing a reconciliation.

opw-688635
  • Loading branch information
nim-odoo committed Sep 30, 2016
1 parent da388aa commit 1a0d173
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions addons/account/models/account_move.py
Original file line number Diff line number Diff line change
Expand Up @@ -898,6 +898,8 @@ def _create_writeoff(self, vals):
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])
Expand Down

0 comments on commit 1a0d173

Please sign in to comment.