From c9837ac5dcb10aaded7d1c9117d6b795da846412 Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Tue, 2 Oct 2018 11:06:52 +0200 Subject: [PATCH] [FIX] base: compare on original module Introduced at 574f4c3d model._module has for value of the last module extending the model. This means that, when a module B inherit from a model defined in a module A (e.g to add a field on the model), an external id, tagged with module B, will be created for each field of the model, including the one defined only in A. The intention of the patch at 574f4c3d was to include the automatic fields (i.e. LOG_ACCESS_COLUMNS) into the condition. Without that condition, the fields such as create_date were deleted when upgrading a module (not defined in any module) --- odoo/addons/base/models/ir_model.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/odoo/addons/base/models/ir_model.py b/odoo/addons/base/models/ir_model.py index a6327824914..bfe55e30486 100644 --- a/odoo/addons/base/models/ir_model.py +++ b/odoo/addons/base/models/ir_model.py @@ -818,7 +818,7 @@ class IrModelFields(models.Model): keys = [key for key in new_vals if old_vals[key] != new_vals[key]] self.pool.post_init(record.modified, keys) old_vals.update(new_vals) - if module and (module == model._module or module in field._modules): + if module and (module == model._original_module or module in field._modules): to_xmlids.append(name) if to_insert: