[IMP] better use of with_context

This commit is contained in:
vrenaville
2017-07-10 13:54:03 +02:00
parent 1a0f2ac877
commit 41f0f34227

View File

@@ -159,11 +159,10 @@ class MassReconcileBase(models.AbstractModel):
else:
writeoff_account = self.account_lost_id
line_rs = ml_obj.browse(line_ids)
ctx = dict(self._context)
if self.analytic_account_id:
ctx.update(
{'analytic_id': self.analytic_account_id.id})
line_rs.with_context(ctx).reconcile(
line_rs = line_rs.with_context(
analytic_id=self.analytic_account_id.id)
line_rs.reconcile(
writeoff_acc_id=writeoff_account,
writeoff_journal_id=self.journal_id
)