[IMP] account_reconciliation_widget: Skip business models synchronization on reconcile

There's no need to synchronize business models (payments and statement
lines) when the reconcile is done, as the only value written in
the journal item is `full_reconcile_id`.

This way, we speed up the reconciliation process through the widget.
This commit is contained in:
Pedro M. Baeza
2023-06-17 08:33:11 +02:00
parent 1a58cfea11
commit 1ab3fd48d9

View File

@@ -1158,10 +1158,11 @@ class AccountReconciliation(models.AbstractModel):
""" """
if len(move_line_ids) < 1 or len(move_line_ids) + len(new_mv_line_dicts) < 2: if len(move_line_ids) < 1 or len(move_line_ids) + len(new_mv_line_dicts) < 2:
raise UserError(_("A reconciliation must involve at least 2 move lines.")) raise UserError(_("A reconciliation must involve at least 2 move lines."))
AccountMoveLine = self.env["account.move.line"].with_context(
account_move_line = self.env["account.move.line"].browse(move_line_ids) skip_account_move_synchronization=True
writeoff_lines = self.env["account.move.line"] )
account_move_line = AccountMoveLine.browse(move_line_ids)
writeoff_lines = AccountMoveLine
# Create writeoff move lines # Create writeoff move lines
if len(new_mv_line_dicts) > 0: if len(new_mv_line_dicts) > 0:
company_currency = account_move_line[0].account_id.company_id.currency_id company_currency = account_move_line[0].account_id.company_id.currency_id