diff options
| author | Martin Trigaux <mat@odoo.com> | 2019-09-23 13:00:36 +0000 |
|---|---|---|
| committer | Martin Trigaux <mat@odoo.com> | 2019-09-24 07:33:09 +0000 |
| commit | d7a4085b00569eaf239dc92e34ff47ddf028afe4 (patch) | |
| tree | be872a00242392969ce03f93b574585a8b2da2a5 | |
| parent | 272638b1ac2db3e47ad211135aac1700283425cf (diff) | |
[FIX] base: improve model description verification
When a model inherit from another, it still must have a _description
specified if the _name is different
Before this commit, mail.test.cc inherited from mail.thread.cc without
specifying a _description but this was not raising any issue
| -rw-r--r-- | odoo/models.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/odoo/models.py b/odoo/models.py index 96faaa21289..564882bd88c 100644 --- a/odoo/models.py +++ b/odoo/models.py @@ -560,7 +560,8 @@ class BaseModel(MetaModel('DummyModel', (object,), {'_register': False})): for base in reversed(cls.__bases__): if not getattr(base, 'pool', None): # the following attributes are not taken from model classes - if not base._inherit and not base._description: + parents = [base._inherit] if base._inherit and isinstance(base._inherit, str) else (base._inherit or []) + if cls._name not in parents and not base._description: _logger.warning("The model %s has no _description", cls._name) cls._description = base._description or cls._description cls._table = base._table or cls._table |
