[FIX] http: don't flush() outside of a checked call
[FIX] http: don't flush() outside of a checked call

When a serialization error occurs in a given code context, the call is
retried.  However, currently the environment is flushed outside this
context, which may cause a serialization error that is not handled by a
retry.  Move the flush inside the checked call to catch all
serialization errors, and handle them properly.

X-original-commit: 6197bfb3b2d51873416780c96cd4cb538a1f219c
ygol/odoo,ygol/odoo,ygol/odoo,ygol/odoo,ygol/odoo,ygol/odoo,ygol/odoo