From 41f0f342279e78fbe6bd87fe57edd9f41ef825e8 Mon Sep 17 00:00:00 2001 From: vrenaville Date: Mon, 10 Jul 2017 13:54:03 +0200 Subject: [PATCH] [IMP] better use of with_context --- account_mass_reconcile/models/base_reconciliation.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/account_mass_reconcile/models/base_reconciliation.py b/account_mass_reconcile/models/base_reconciliation.py index b8809ce8..5692845b 100644 --- a/account_mass_reconcile/models/base_reconciliation.py +++ b/account_mass_reconcile/models/base_reconciliation.py @@ -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 )