@@ -1227,18 +1227,20 @@ When using :attr:`~odoo.models.Model._inherit` but leaving out
12271227:attr: `~odoo.models.Model._name `, the new model replaces the existing one,
12281228essentially extending it in-place. This is useful to add new fields or methods
12291229to existing models (created in other modules), or to customize or reconfigure
1230- them (e.g. to change their default sort order)::
1230+ them (e.g. to change their default sort order)
1231+
1232+ .. code-block :: python
12311233
12321234 class Extension0 (models .Model ):
1233- _name = 'extension.0'
1234- _description = 'Extension zero'
1235+ _name = ' extension.0'
1236+ _description = ' Extension zero'
12351237
1236- name = fields.Char(default="A")
1238+ name = fields.Char(default = " A" )
12371239
12381240 class Extension0 (models .Model ):
1239- _inherit = [ 'extension.0']
1241+ _inherit = ' extension.0'
12401242
1241- description = fields.Char(default="Extended")
1243+ description = fields.Char(default = " Extended" )
12421244
12431245 .. code-block :: python3
12441246
@@ -1272,7 +1274,9 @@ model.
12721274
12731275The main difference is in the meaning. When using Delegation, the model
12741276**has one ** instead of **is one **, turning the relationship in a composition
1275- instead of inheritance::
1277+ instead of inheritance
1278+
1279+ .. code-block :: python
12761280
12771281 class Screen (models .Model ):
12781282 _name = ' delegation.screen'
@@ -1340,7 +1344,9 @@ In that case, the attributes of the field are taken from the parent class
13401344and overridden by the ones given in subclasses.
13411345
13421346For instance, the second class below only adds a tooltip on the field
1343- ``state ``::
1347+ ``state ``
1348+
1349+ .. code-block :: python
13441350
13451351 class FirstFoo (models .Model ):
13461352 state = fields.Selection([... ], required = True )
0 commit comments