[IMP] osv: use iteration for expression negating
[IMP] osv: use iteration for expression negating

The current code when applying negative operator on an expression used
recursion which in extreme case is not best friend with python.

e.g: on instance with a lot of wharehouse, some simple action could lead
to a domain with lot of elements which could easiliy go over the python
maximum recursion limit.

This commit fixes this by replacing recursion with iteration.

We have a stack of negation flags and loop on each token of the domain
as follow :

- when we iterate on a leaf, it consumes the top negation flag,

- after a '!' operator, the top token negation is inversed,

- after an '&' or '|' operator, the top negation flag is duplicated on
  the top of the stack.

closes #9433
opw-653802

sysadminmatmoz/OCB,hassoon3/odoo,markeTIC/OCB,diagramsoftware/odoo,mustafat/odoo-1,leorochael/odoo,laslabs/odoo,NeovaHealth/odoo,sysadminmatmoz/OCB,draugiskisprendimai/odoo,MarcosCommunity/odoo,Endika/odoo,Endika/OpenUpgrade,leorochael/odoo,factorlibre/OCB,markeTIC/OCB,optima-ict/odoo,Endika/odoo,CatsAndDogsbvba/odoo,jfpla/odoo,microcom/odoo,leorochael/odoo,vnsofthe/odoo,sysadminmatmoz/OCB,hip-odoo/odoo,odootr/odoo,xzYue/odoo,shingonoide/odoo,hip-odoo/odoo,microcom/odoo,rubencabrera/odoo,spadae22/odoo,glovebx/odoo,provaleks/o8,rubencabrera/odoo,sergio-incaser/odoo,CatsAndDogsbvba/odoo,hip-odoo/odoo,spadae22/odoo,dfang/odoo,bplancher/odoo,BT-rmartin/odoo,sergio-incaser/odoo,Noviat/odoo,sergio-incaser/odoo,grap/OCB,MarcosCommunity/odoo,draugiskisprendimai/odoo,jiangzhixiao/odoo,MarcosCommunity/odoo,MarcosCommunity/odoo,draugiskisprendimai/odoo,synconics/odoo,diagramsoftware/odoo,alexcuellar/odoo,Noviat/odoo,laslabs/odoo,OpenUpgrade/OpenUpgrade,Daniel-CA/odoo,markeTIC/OCB,NeovaHealth/odoo,stephen144/odoo,ygol/odoo,Elico-Corp/odoo_OCB,CatsAndDogsbvba/odoo,funkring/fdoo,diagramsoftware/odoo,BT-ojossen/odoo,tvibliani/odoo,provaleks/o8,Endika/odoo,OpenUpgrade/OpenUpgrade,odootr/odoo,mustafat/odoo-1,glovebx/odoo,eino-makitalo/odoo,grap/OpenUpgrade,Daniel-CA/odoo,grap/OpenUpgrade,provaleks/o8,Adel-Magebinary/odoo,datenbetrieb/odoo,funkring/fdoo,spadae22/odoo,eino-makitalo/odoo,shingonoide/odoo,markeTIC/OCB,funkring/fdoo,Antiun/odoo,factorlibre/OCB,xzYue/odoo,datenbetrieb/odoo,tvibliani/odoo,mlaitinen/odoo,glovebx/odoo,alexcuellar/odoo,funkring/fdoo,alexcuellar/odoo,storm-computers/odoo,MarcosCommunity/odoo,OpenUpgrade/OpenUpgrade,hassoon3/odoo,laslabs/odoo,makinacorpus/odoo,makinacorpus/odoo,laslabs/odoo,tvibliani/odoo,laslabs/odoo,eino-makitalo/odoo,NeovaHealth/odoo,mlaitinen/odoo,dfang/odoo,ehirt/odoo,leorochael/odoo,NeovaHealth/odoo,BT-ojossen/odoo,makinacorpus/odoo,grap/OCB,jfpla/odoo,Endika/odoo,Daniel-CA/odoo,diagramsoftware/odoo,laslabs/odoo,leorochael/odoo,bplancher/odoo,sysadminmatmoz/OCB,factorlibre/OCB,microcom/odoo,alexcuellar/odoo,Endika/odoo,QianBIG/odoo,Nowheresly/odoo,odootr/odoo,ehirt/odoo,QianBIG/odoo,markeTIC/OCB,draugiskisprendimai/odoo,alexcuellar/odoo,diagramsoftware/odoo,mustafat/odoo-1,leorochael/odoo,eino-makitalo/odoo,alexcuellar/odoo,jfpla/odoo,Daniel-CA/odoo,ygol/odoo,Antiun/odoo,vnsofthe/odoo,OpenUpgrade/OpenUpgrade,QianBIG/odoo,draugiskisprendimai/odoo,NeovaHealth/odoo,Endika/OpenUpgrade,datenbetrieb/odoo,odootr/odoo,shingonoide/odoo,Endika/OpenUpgrade,shingonoide/odoo,draugiskisprendimai/odoo,jfpla/odoo,synconics/odoo,shingonoide/odoo,Noviat/odoo,funkring/fdoo,datenbetrieb/odoo,microcom/odoo,ygol/odoo,sergio-incaser/odoo,tvibliani/odoo,Adel-Magebinary/odoo,stephen144/odoo,grap/OCB,QianBIG/odoo,OpenUpgrade/OpenUpgrade,Endika/odoo,shingonoide/odoo,storm-computers/odoo,grap/OCB,spadae22/odoo,Elico-Corp/odoo_OCB,QianBIG/odoo,Nowheresly/odoo,ygol/odoo,Nowheresly/odoo,mlaitinen/odoo,microcom/odoo,mlaitinen/odoo,grap/OpenUpgrade,odootr/odoo,markeTIC/OCB,hip-odoo/odoo,shingonoide/odoo,Endika/odoo,sergio-incaser/odoo,Adel-Magebinary/odoo,microcom/odoo,ygol/odoo,leorochael/odoo,stephen144/odoo,ehirt/odoo,hassoon3/odoo,makinacorpus/odoo,eino-makitalo/odoo,ehirt/odoo,sysadminmatmoz/OCB,grap/OpenUpgrade,diagramsoftware/odoo,rubencabrera/odoo,factorlibre/OCB,Endika/OpenUpgrade,Elico-Corp/odoo_OCB,BT-rmartin/odoo,glovebx/odoo,BT-rmartin/odoo,Elico-Corp/odoo_OCB,glovebx/odoo,Daniel-CA/odoo,datenbetrieb/odoo,factorlibre/OCB,BT-rmartin/odoo,storm-computers/odoo,Endika/OpenUpgrade,odootr/odoo,makinacorpus/odoo,factorlibre/OCB,datenbetrieb/odoo,Adel-Magebinary/odoo,draugiskisprendimai/odoo,jfpla/odoo,hip-odoo/odoo,NeovaHealth/odoo,Adel-Magebinary/odoo,BT-rmartin/odoo,sysadminmatmoz/OCB,vnsofthe/odoo,dfang/odoo,tvibliani/odoo,Adel-Magebinary/odoo,OpenUpgrade/OpenUpgrade,BT-rmartin/odoo,mlaitinen/odoo,OpenUpgrade/OpenUpgrade,funkring/fdoo,spadae22/odoo,BT-rmartin/odoo,odootr/odoo,xzYue/odoo,Elico-Corp/odoo_OCB,grap/OCB,jiangzhixiao/odoo,sysadminmatmoz/OCB,xzYue/odoo,synconics/odoo,synconics/odoo,mustafat/odoo-1,diagramsoftware/odoo,Endika/OpenUpgrade,stephen144/odoo,optima-ict/odoo,vnsofthe/odoo,BT-ojossen/odoo,Nowheresly/odoo,Noviat/odoo,bplancher/odoo,ehirt/odoo,spadae22/odoo,BT-ojossen/odoo,rubencabrera/odoo,Adel-Magebinary/odoo,datenbetrieb/odoo,BT-ojossen/odoo,rubencabrera/odoo,dfang/odoo,mustafat/odoo-1,Elico-Corp/odoo_OCB,CatsAndDogsbvba/odoo,alexcuellar/odoo,ehirt/odoo,MarcosCommunity/odoo,sergio-incaser/odoo,provaleks/o8,bplancher/odoo,xzYue/odoo,Noviat/odoo,hassoon3/odoo,Antiun/odoo,vnsofthe/odoo,mlaitinen/odoo,bplancher/odoo,mlaitinen/odoo,vnsofthe/odoo,bplancher/odoo,CatsAndDogsbvba/odoo,Antiun/odoo,jiangzhixiao/odoo,tvibliani/odoo,hip-odoo/odoo,Noviat/odoo,BT-ojossen/odoo,CatsAndDogsbvba/odoo,dfang/odoo,ygol/odoo,mustafat/odoo-1,grap/OpenUpgrade,Antiun/odoo,MarcosCommunity/odoo,spadae22/odoo,eino-makitalo/odoo,provaleks/o8,synconics/odoo,ygol/odoo,glovebx/odoo,MarcosCommunity/odoo,synconics/odoo,xzYue/odoo,glovebx/odoo,storm-computers/odoo,jiangzhixiao/odoo,optima-ict/odoo,funkring/fdoo,provaleks/o8,storm-computers/odoo,Daniel-CA/odoo,tvibliani/odoo,synconics/odoo,hassoon3/odoo,grap/OpenUpgrade,optima-ict/odoo,mustafat/odoo-1,vnsofthe/odoo,stephen144/odoo,eino-makitalo/odoo,grap/OpenUpgrade,provaleks/o8,jiangzhixiao/odoo,Nowheresly/odoo,Antiun/odoo,Antiun/odoo,grap/OCB,factorlibre/OCB,CatsAndDogsbvba/odoo,makinacorpus/odoo,Noviat/odoo,Endika/OpenUpgrade,BT-ojossen/odoo,jiangzhixiao/odoo,jfpla/odoo,Daniel-CA/odoo,storm-computers/odoo,xzYue/odoo,makinacorpus/odoo,grap/OCB,rubencabrera/odoo,rubencabrera/odoo,stephen144/odoo,jiangzhixiao/odoo,optima-ict/odoo,markeTIC/OCB,jfpla/odoo,dfang/odoo,grap/OCB,ehirt/odoo,Nowheresly/odoo,NeovaHealth/odoo,QianBIG/odoo,Nowheresly/odoo,hassoon3/odoo,optima-ict/odoo