Comment 5 for bug 740361

Revision history for this message
Raphaƫl Valyi - http://www.akretion.com (rvalyi) wrote : Re: [6.0.1][account] slow large invoice validation because validate is called for every line

Guys, to support my customers, I created a small ugly patch (attached). Basically I've seen that after the validate method is called once, we have an 'invoice' key in the context. I use that criterion to skip the validation for the next invoice lines.

This is very ugly and likely to be brittle if that invoice key is removed (but then it will just be as inefficient as today, not worse).

After applying this workaround, the move validation is called 'only' twice per invoice, that's still one useless call, but at least if you have an invoice with dozens of lines you will still save dozens of call to the exact same stupid validation.

So I call that an ugly work around that you can try at home if you are over 18, this doesn't seem like a proper long term fix, see my first comments about the problem if you want to elaborate a true solution to this bug.

Hope this helps. Please consider this is an important bug for 6.1. If you want to use OpenERP in companies larger than small SMB's you need to avoid this kind of bugs by design. Here I have a customer with only ~20 employees and he would almost dismiss from OpenERP without such a patch.