mirror of
https://github.com/OCA/account-reconcile.git
synced 2025-01-20 12:27:39 +02:00
[IMP] better use of with_context
This commit is contained in:
@@ -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
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user