TLDR: the context key `check_move_validity` should never be used
explicitly.
`check_move_validity` is a context key used to disable some important
integrity check in accounting: `debit=credit`, which is one of the most
fundamental rule.
It is possible to disable this in some cases, when creating and updating
lines one by one, since the constraint cannot be satisfied between each
line if the operations are not atomic.
A mechanism has been created for this, with `_check_balanced`. It is a
context manager using `_disable_recursion`, which will taint all
the contexts while inside of the context manager.
Putting any code changing lines one by one inside of that context
manager will then allow having a transient invalid state, but still
always check the validity at the end, when exiting the context.
That context key has been kept only in `point_of_sale` because a special
wizard is used there to be able to validate a session with an unbalanced
move, but a wizard is then in charge of balancing it. The check is then
done at that time.
closesodoo/odoo#146824
Signed-off-by: Brice Bartoletti (bib) <bib@odoo.com>