Skip to content

Commit c2f3bd9

Browse files
committed
[IMP] orm: add warning about model extension
When a model is defined with `_inherit` using a list, Odoo will do a check with the class name to set the `_name` of the model being extended. This is different than the previous versions and can be misleading
1 parent 5b9155d commit c2f3bd9

File tree

1 file changed

+5
-0
lines changed
  • content/developer/reference/backend

1 file changed

+5
-0
lines changed

content/developer/reference/backend/orm.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1249,6 +1249,11 @@ will yield::
12491249

12501250
{'name': "A", 'description': "Extended"}
12511251

1252+
.. warning:: When :attr:`~odoo.models.Model._inherit` is set using a string,
1253+
this will also set the value of :attr:`~odoo.models.Model._name`.
1254+
In all the other cases the :attr:`~odoo.models.Model._name` is set by
1255+
the attribute itself or by the class name (i.e: ``class MyModel(models.Model)`` will be
1256+
translated into ``_name = 'my.model'``, even if not explicitly set)
12521257

12531258
.. note::
12541259

0 commit comments

Comments
 (0)