[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)
This commit is contained in:
Martin Trigaux
2018-10-02 11:51:15 +02:00
parent 718b0f8b63
commit c9837ac5dc
+1 -1
View File
@@ -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: