[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:
@@ -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])
|
||||
|
||||
Reference in New Issue
Block a user