From 0e97376921adc453a92caac78d8a2a63b9eb7775 Mon Sep 17 00:00:00 2001 From: "Antoine Vandevenne (anv)" Date: Wed, 16 Aug 2023 09:38:31 +0000 Subject: [PATCH] [FIX] tutorials/getting_started: fix typos in example model name Commit f36c612d13bd40bc6cd06445db05eee6a60bad40 changed the model name in Chapter 4 without updating the other occurences. closes odoo/documentation#5516 X-original-commit: b6f923d111cef4d6a1fd3c2f64ff0b3bfa9084f6 Signed-off-by: Antoine Vandevenne (anv) --- .../tutorials/getting_started/05_securityintro.rst | 2 +- .../tutorials/getting_started/06_firstui.rst | 6 +++--- .../tutorials/getting_started/08_relations.rst | 2 +- .../tutorials/getting_started/12_sprinkles.rst | 12 ++++++------ .../tutorials/getting_started/13_inheritance.rst | 4 ++-- .../tutorials/getting_started/14_other_module.rst | 4 ++-- 6 files changed, 15 insertions(+), 15 deletions(-) diff --git a/content/developer/tutorials/getting_started/05_securityintro.rst b/content/developer/tutorials/getting_started/05_securityintro.rst index 4d3fed756..80c8ccbd2 100644 --- a/content/developer/tutorials/getting_started/05_securityintro.rst +++ b/content/developer/tutorials/getting_started/05_securityintro.rst @@ -93,7 +93,7 @@ access) and a set of permissions: create, read, write and unlink\ [#unlink]_. Su rights are usually defined in a CSV file named ``ir.model.access.csv``. -Here is an example for our previous ``test.model``: +Here is an example for our previous `test_model`: .. code-block:: text diff --git a/content/developer/tutorials/getting_started/06_firstui.rst b/content/developer/tutorials/getting_started/06_firstui.rst index 03b2419af..f6b83c7d9 100644 --- a/content/developer/tutorials/getting_started/06_firstui.rst +++ b/content/developer/tutorials/getting_started/06_firstui.rst @@ -70,13 +70,13 @@ advanced topic. In our Real Estate example, we would like to link a menu to the model, so we are able to create a new record. The action can be viewed as the link between the menu and the model. -A basic action for our ``test.model`` is: +A basic action for our `test_model` is: .. code-block:: xml Test action - test.model + test_model tree,form @@ -135,7 +135,7 @@ A basic menu for our ``test_model_action`` is: The menu ``test_model_menu_action`` is linked to the action ``test_model_action``, and the action -is linked to the model ``test.model``. As previously mentioned, the action can be seen as the link +is linked to the model `test_model`. As previously mentioned, the action can be seen as the link between the menu and the model. However, menus always follow an architecture, and in practice there are three levels of menus: diff --git a/content/developer/tutorials/getting_started/08_relations.rst b/content/developer/tutorials/getting_started/08_relations.rst index e31409fc1..bad5e370f 100644 --- a/content/developer/tutorials/getting_started/08_relations.rst +++ b/content/developer/tutorials/getting_started/08_relations.rst @@ -217,7 +217,7 @@ A one2many is the inverse of a many2one. For example, we defined on our test model a link to the ``res.partner`` model thanks to the field ``partner_id``. We can define the inverse relation, i.e. the list of test models linked to our partner:: - test_ids = fields.One2many("test.model", "partner_id", string="Tests") + test_ids = fields.One2many("test_model", "partner_id", string="Tests") The first parameter is called the ``comodel`` and the second parameter is the field we want to inverse. diff --git a/content/developer/tutorials/getting_started/12_sprinkles.rst b/content/developer/tutorials/getting_started/12_sprinkles.rst index 06d245770..55d3e438b 100644 --- a/content/developer/tutorials/getting_started/12_sprinkles.rst +++ b/content/developer/tutorials/getting_started/12_sprinkles.rst @@ -50,18 +50,18 @@ a form view. For example: from odoo import fields, models class TestModel(models.Model): - _name = "test.model" + _name = "test_model" _description = "Test Model" description = fields.Char() - line_ids = fields.One2many("test.model.line", "model_id") + line_ids = fields.One2many("test_model_line", "model_id") class TestModelLine(models.Model): - _name = "test.model.line" + _name = "test_model_line" _description = "Test Model Line" - model_id = fields.Many2one("test.model") + model_id = fields.Many2one("test_model") field_1 = fields.Char() field_2 = fields.Char() field_3 = fields.Char() @@ -78,7 +78,7 @@ a form view. For example: -In the form view of the ``test.model``, we define a specific list view for ``test.model.line`` +In the form view of the `test_model`, we define a specific list view for `test_model_line` with fields ``field_1`` and ``field_2``. An example can be found @@ -166,7 +166,7 @@ It will be converted to an order_by_ clause in SQL. For example: from odoo import fields, models class TestModel(models.Model): - _name = "test.model" + _name = "test_model" _description = "Test Model" _order = "id desc" diff --git a/content/developer/tutorials/getting_started/13_inheritance.rst b/content/developer/tutorials/getting_started/13_inheritance.rst index bf1fe5ac0..e7914c765 100644 --- a/content/developer/tutorials/getting_started/13_inheritance.rst +++ b/content/developer/tutorials/getting_started/13_inheritance.rst @@ -40,7 +40,7 @@ Python inheritance:: from odoo import fields, models class TestModel(models.Model): - _name = "test.model" + _name = "test_model" _description = "Test Model" ... @@ -55,7 +55,7 @@ specific business logic:: from odoo import fields, models class TestModel(models.Model): - _name = "test.model" + _name = "test_model" _description = "Test Model" ... diff --git a/content/developer/tutorials/getting_started/14_other_module.rst b/content/developer/tutorials/getting_started/14_other_module.rst index 8e740c5b4..6a8dd188c 100644 --- a/content/developer/tutorials/getting_started/14_other_module.rst +++ b/content/developer/tutorials/getting_started/14_other_module.rst @@ -138,12 +138,12 @@ made human readable with the :class:`~odoo.fields.Command` namespace. This names a triplet command to execute on a set of records. The triplet was originally the only option to do these commands, but it is now standard to use the namespace instead. The format is to place them in a list which is executed sequentially. Here is a simple example to include a One2many -field ``line_ids`` at creation of a ``test.model``:: +field ``line_ids`` at creation of a ``test_model``:: from odoo import Command def inherited_action(self): - self.env["test.model"].create( + self.env["test_model"].create( { "name": "Test", "line_ids": [