Skip to content
Snippets Groups Projects
Unverified Commit 79519ce4 authored by Martin Trigaux's avatar Martin Trigaux
Browse files

[FIX] registry: load inheritS models too

When adding a field on a model, only the _inherit were checked, not the _inherits.

This commit fixes the following bug:
1. install `sale` (adding the field `sale_order_count` on `res.partner`)
   - field `sale_order_count` is created on `res.partner`
   - the ir.model.field is tagged with module `sale`

2. install `point_of_sale` (adding another field on `res.users`)
   - field `sale_order_count` is created on `res.users`
   - the ir.model.field is tagged with module `point_of_sale`

When installing sale, the model res.partner is returned in the list of impacted
models, on which _create_fields method is called but not res.users.

A direct consequence of this bug is that, the fields translations are in the
wrong module. May fix some uninstallation bugs too.

Closes #16104
parent 7416afed
Branches
Tags
No related merge requests found
......@@ -261,7 +261,7 @@ class Registry(Mapping):
model = cls._build_model(self, cr)
model_names.append(model._name)
return self.descendants(model_names, '_inherit')
return self.descendants(model_names, '_inherit', '_inherits')
def setup_models(self, cr, partial=False):
""" Complete the setup of models.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment