From 7bcff7eb505cd365eeb3c5d49efc6b6f876de45a Mon Sep 17 00:00:00 2001 From: Guewen Baconnier Date: Mon, 10 Dec 2018 15:08:19 +0100 Subject: [PATCH] Fix avoid_quick_create with multiprocess When starting Odoo in multiprocess, a change to the field IrModel.avoid_quick_create would be active only on the current worker. Otherwise, it would be active after a restart. The proposed change is to signal a registry change, forcing the other workers to reload a registry and then be aware of the change. --- base_optional_quick_create/models/ir_model.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/base_optional_quick_create/models/ir_model.py b/base_optional_quick_create/models/ir_model.py index 014e2721f..1a03f2b3a 100644 --- a/base_optional_quick_create/models/ir_model.py +++ b/base_optional_quick_create/models/ir_model.py @@ -51,4 +51,6 @@ class IrModel(models.Model): def write(self, vals): res = super(IrModel, self).write(vals) self._patch_quick_create() + if 'avoid_quick_create' in vals: + self.pool.signal_registry_change() return res