[FIX] delivery: debug loger with new ORM

Using the debug mode on carrier and validate a picking with a
carrier will block and run until request's timeout.

It happens because log_xml create a new cursor and a new environement.
So it should be flush before the ir.logging creation since it's in
another env.

closes odoo/odoo#40561

X-original-commit: cdc09f5b70ad200014ac38f314bf1ec53cd5b8ca
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
This commit is contained in:
Arnold Moyaux
2019-11-20 13:21:05 +00:00
committed by fw-bot
parent 3651ab082d
commit 3b7766ad83
@@ -204,6 +204,7 @@ class DeliveryCarrier(models.Model):
self.ensure_one()
if self.debug_logging:
self.flush()
db_name = self._cr.dbname
# Use a new cursor to avoid rollback that could be caused by an upper method