diff --git a/content/developer/howtos/translations.rst b/content/developer/howtos/translations.rst index a6fe7307ef..4622e75c61 100644 --- a/content/developer/howtos/translations.rst +++ b/content/developer/howtos/translations.rst @@ -122,7 +122,7 @@ of global variables. from odoo import models class IrHttp(models.AbstractModel): - _inherit = 'ir.http' + _inherit = ['ir.http'] @classmethod def _get_translation_frontend_modules_name(cls): diff --git a/content/developer/reference/backend/orm.rst b/content/developer/reference/backend/orm.rst index 978685a86d..82e2f8dad2 100644 --- a/content/developer/reference/backend/orm.rst +++ b/content/developer/reference/backend/orm.rst @@ -1123,7 +1123,7 @@ fields, methods and meta-information (defaults & al) from its base. class Inheritance1(models.Model): _name = 'inheritance.1' - _inherit = 'inheritance.0' + _inherit = ['inheritance.0'] _description = 'Inheritance One' def call(self): @@ -1161,8 +1161,8 @@ them (e.g. to change their default sort order):: name = fields.Char(default="A") - class Extension1(models.Model): - _inherit = 'extension.0' + class Extension0(models.Model): + _inherit = ['extension.0'] description = fields.Char(default="Extended") @@ -1263,12 +1263,16 @@ and overridden by the ones given in subclasses. For instance, the second class below only adds a tooltip on the field ``state``:: - class First(models.Model): - _name = 'foo' + class FirstFoo(models.Model): state = fields.Selection([...], required=True) - class Second(models.Model): - _inherit = 'foo' + class FirstFoo(models.Model): + _inherit = ['first.foo'] + state = fields.Selection(help="Blah blah blah") + + class WrongFirstFooClassName(models.Model): + _name = 'first.foo' # force the model name + _inherit = ['first.foo'] state = fields.Selection(help="Blah blah blah") .. _reference/exceptions: diff --git a/content/developer/reference/frontend/javascript_reference.rst b/content/developer/reference/frontend/javascript_reference.rst index e4d1749051..40c40cfa7e 100644 --- a/content/developer/reference/frontend/javascript_reference.rst +++ b/content/developer/reference/frontend/javascript_reference.rst @@ -473,7 +473,7 @@ returned dictionary. from odoo.http import request class IrHttp(models.AbstractModel): - _inherit = 'ir.http' + _inherit = ['ir.http'] def session_info(self): result = super(IrHttp, self).session_info() diff --git a/content/developer/reference/user_interface/view_architectures.rst b/content/developer/reference/user_interface/view_architectures.rst index ab79275480..3d96d9153e 100644 --- a/content/developer/reference/user_interface/view_architectures.rst +++ b/content/developer/reference/user_interface/view_architectures.rst @@ -3251,7 +3251,7 @@ Model Commons ------------- .. currentmodule:: odoo.addons.base.models.ir_ui_view -.. autoattribute:: Model._date_name +.. autoattribute:: Base._date_name :noindex: .. _reference/view_architectures/activity: diff --git a/content/developer/reference/user_interface/view_records.rst b/content/developer/reference/user_interface/view_records.rst index 41de75cd20..e595e43bc0 100644 --- a/content/developer/reference/user_interface/view_records.rst +++ b/content/developer/reference/user_interface/view_records.rst @@ -69,7 +69,7 @@ Fields View records expose a number of fields. -.. autoclass:: odoo.addons.base.models.ir_ui_view.View() +.. autoclass:: odoo.addons.base.models.ir_ui_view.IrUiView() .. attribute:: name @@ -363,8 +363,8 @@ specifies how the matched node should be modified. Model commons ============= -.. autoclass:: odoo.addons.base.models.ir_ui_view.View() +.. autoclass:: odoo.addons.base.models.ir_ui_view.Base() :noindex: - .. automethod:: Model.get_views - .. automethod:: Model.get_view + .. automethod:: Base.get_views + .. automethod:: Base.get_view diff --git a/content/developer/tutorials/server_framework_101/12_inheritance.rst b/content/developer/tutorials/server_framework_101/12_inheritance.rst index 4194546a3b..581736eb6f 100644 --- a/content/developer/tutorials/server_framework_101/12_inheritance.rst +++ b/content/developer/tutorials/server_framework_101/12_inheritance.rst @@ -134,7 +134,7 @@ existing model, which means we will use the first mechanism. For example:: from odoo import fields, models class InheritedModel(models.Model): - _inherit = "inherited.model" + _inherit = ["inherited.model"] new_field = fields.Char(string="New Field") diff --git a/content/developer/tutorials/server_framework_101/13_other_module.rst b/content/developer/tutorials/server_framework_101/13_other_module.rst index f32e4a4f76..50daa0a83b 100644 --- a/content/developer/tutorials/server_framework_101/13_other_module.rst +++ b/content/developer/tutorials/server_framework_101/13_other_module.rst @@ -67,7 +67,7 @@ module for the ``estate.property`` model. For now, the overridden action will si from odoo import models class InheritedModel(models.Model): - _inherit = "inherited.model" + _inherit = ["inherited.model"] def inherited_action(self): return super().inherited_action() diff --git a/content/developer/tutorials/website.rst b/content/developer/tutorials/website.rst index d8ff8050e8..eaca1d6b04 100644 --- a/content/developer/tutorials/website.rst +++ b/content/developer/tutorials/website.rst @@ -801,9 +801,8 @@ scheduling changes or discussions between teachers and assistants: .. code-block:: python :caption: ``academy/models.py`` - class Courses(models.Model): - _name = 'academy.courses' - _inherit = 'mail.thread' + class AcademyCourses(models.Model): + _inherit = ['mail.thread'] name = fields.Char() teacher_id = fields.Many2one('academy.teachers', string="Teacher")