From d7a4085b00569eaf239dc92e34ff47ddf028afe4 Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Mon, 23 Sep 2019 13:00:36 +0000 Subject: [PATCH] [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 --- odoo/models.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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