[PERF] stock: states 'not it' values changed to 'in' opposite.
[PERF] stock: states 'not it' values changed to 'in' opposite.

Purpose: databases with lots of stock moves (3M+) can experience
slowness
 when computing quantities on hand and forecasted.

Before this commit, the domains built to compute those quantities from
stock_move contained (state not in [done, cancel, draft]). Done and
cancel states represent around 95-99% of stock_moves in a normal
instance. So selecting all stock_moves then removing done and cancel
 ones if truly less efficient than taking directly the 'waiting',
'assigned', ... moves especially that the state in indexed in database.

After this commit, the domain is build with :
(state in [...]) with other state than 'done, 'cancel' and draft.

This commit is related to the PR 23030. Thanks to all people that have
took part of the conversation and florian-dacosta for the commit

ygol/odoo,ygol/odoo,ygol/odoo,ygol/odoo,ygol/odoo,ygol/odoo,ygol/odoo