You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Issue -->
The final step of the `_action_merge` method updates the `code` field of the
account onto which the other accounts are merged. During the write call on
`code`, a dependent field `always_tax_exigible` on `account.move` gets added
to the compute chain. This causes a fetch of all `account.move` records related
to journal items related to the account that is getting updated. This can lead
to a MemoryError on databases with large `account.move` tables.
Solution -->
We delegate the write of the `code` field to SQL.
In the account merge wizard, accounts that can be grouped are grouped by the
keys --> `'account_type', 'non_trade', 'currency_id', 'reconcile', 'deprecated','name'`.
Therefore, the `account_type` does not change after the merge. We can safely
assume that any fields dependent on `account_type` do not need recomputation and
hence, bypass the ORM for this update.
Additional change -->
Disable the prefetcher in the write call in `account.account` to optimize
memory usage on databases with a large number of journal items/journal entries
when writing on `code` or `account_type` in general.
opw-4839985
closesodoo#218349
X-original-commit: 8c5bfff
Signed-off-by: Thomas Becquevort (thbe) <[email protected]>
0 commit comments