Skip to content

Commit a9bc16b

Browse files
boan-odooAntoineVDV
andcommitted
[IMP] rdtraining: add links from enterprise wiki
Select links and pieces of information from Odoo Enterprise wiki were copied over at the end Chap. 2 of the functional training. These would be useful to have during the tutorial instead of at the end of it. closes #1473 Signed-off-by: Antoine Vandevenne (anv) <[email protected]> Co-authored-by: Antoine Vandevenne (anv) <[email protected]>
1 parent 43cea7a commit a9bc16b

File tree

5 files changed

+103
-35
lines changed

5 files changed

+103
-35
lines changed

content/developer/howtos/rdtraining.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,16 @@ Advanced topics
6363

6464
rdtraining/B_acl_irrules
6565
rdtraining/C_data
66+
rdtraining/D_mixins
6667
rdtraining/E_unittest
6768
rdtraining/J_reports
6869
rdtraining/K_dashboard
70+
rdtraining/N_security
6971

7072
* :doc:`rdtraining/B_acl_irrules`
7173
* :doc:`rdtraining/C_data`
74+
* :doc:`rdtraining/D_mixins`
7275
* :doc:`rdtraining/E_unittest`
7376
* :doc:`rdtraining/J_reports`
7477
* :doc:`rdtraining/K_dashboard`
78+
* :doc:`rdtraining/N_security`

content/developer/howtos/rdtraining/02_setup.rst

Lines changed: 70 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,23 @@ Fetch the sources & configure git
2121
Install and configure git
2222
-------------------------
2323

24-
The very first step of the installation process is to install the `git version control system <https://git-scm.com/>`__
25-
because the Odoo source code is managed on GitHub. Once installed, you can set your name and email:
24+
The very first step of the installation process is to install the `git version control system <https://git-scm.com/>`_
25+
because the Odoo source code is managed on GitHub.
26+
27+
Git can be installed on `Linux <https://git-scm.com/download/linux>`_, `Windows
28+
<https://git-scm.com/download/win>`_ or `MacOS <https://git-scm.com/download/mac>`_.
29+
30+
If you're using the laptop provided to you by Odoo, Git should already be installed. If it is not,
31+
you can install it with:
2632

2733
.. code-block:: console
2834
2935
$ sudo apt install git
36+
37+
Once installed, you can set your name and email:
38+
39+
.. code-block:: console
40+
3041
$ git config --global user.name "Your full name"
3142
$ git config --global user.email "[email protected]"
3243
@@ -43,7 +54,7 @@ authentication will allow you to connect to GitHub without supplying your userna
4354
password every time.
4455

4556

46-
The following instructions are based on the official `GitHub documentation <https://docs.github.com/en/github/authenticating-to-github/connecting-to-github-with-ssh>`__.
57+
The following instructions are based on the official `GitHub documentation <https://docs.github.com/en/github/authenticating-to-github/connecting-to-github-with-ssh>`_.
4758

4859

4960
Here is a step-by-step procedure:
@@ -104,9 +115,9 @@ Configure development repository
104115
--------------------------------
105116

106117
To contribute to Odoo's development you will need to
107-
`fork the repository <https://guides.github.com/activities/forking/>`__, create a branch containing
118+
`fork the repository <https://guides.github.com/activities/forking/>`_, create a branch containing
108119
your code in the fork and submit a
109-
`Pull Request <https://docs.github.com/en/github/getting-started-with-github/github-glossary#pull-request>`__
120+
`Pull Request <https://docs.github.com/en/github/getting-started-with-github/github-glossary#pull-request>`_
110121
to the Odoo repository.
111122

112123
If you are lucky enough to work at Odoo, the forks already exist. They are called
@@ -296,9 +307,9 @@ Log in to Odoo
296307
--------------
297308

298309
Open `http://localhost:8069/` on your browser. We recommend you use:
299-
`Firefox <https://www.mozilla.org/fr/firefox/new/>`__,
300-
`Chrome <https://www.google.com/intl/fr/chrome/>`__
301-
(`Chromium <https://www.chromium.org/Home>`__ the open source equivalent) or any other browser with
310+
`Firefox <https://www.mozilla.org/fr/firefox/new/>`_,
311+
`Chrome <https://www.google.com/intl/fr/chrome/>`_
312+
(`Chromium <https://www.chromium.org/Home>`_ the open source equivalent) or any other browser with
302313
development tools.
303314

304315
To log in as the administrator user, you can use the following credentials:
@@ -313,7 +324,7 @@ The Developer or Debug Mode gives you access to additional (advanced) tools.
313324

314325
This is useful for training and we assume that the user is in developer mode for the rest of the tutorials.
315326

316-
To activate the developer or debug mode you can follow the steps `here <https://www.odoo.com/documentation/user/general/developer_mode/activate.html>`__.
327+
To activate the developer or debug mode you can follow the steps `here <https://www.odoo.com/documentation/user/general/developer_mode/activate.html>`_.
317328

318329
Extra tools
319330
===========
@@ -360,7 +371,7 @@ Administrator tools for PostgreSQL
360371
-----------------------------------
361372

362373
You can manage your PostgreSQL databases using the command line as demonstrated earlier or using
363-
a GUI application such as `pgAdmin <https://www.pgadmin.org/download/pgadmin-4-apt/>`__ or `DBeaver <https://dbeaver.io/>`__.
374+
a GUI application such as `pgAdmin <https://www.pgadmin.org/download/pgadmin-4-apt/>`_ or `DBeaver <https://dbeaver.io/>`_.
364375

365376
To connect the GUI application to your database we recommend you connect using the Unix socket.
366377

@@ -375,8 +386,8 @@ Python Debugging
375386
When facing a bug or trying to understand how the code works, simply printing things out can
376387
go a long way, but a proper debugger can save a lot of time.
377388

378-
You can use a classic Python library debugger (`pdb <https://docs.python.org/3/library/pdb.html>`__,
379-
`pudb <https://pypi.org/project/pudb/>`__ or `ipdb <https://pypi.org/project/ipdb/>`__) or you can
389+
You can use a classic Python library debugger (`pdb <https://docs.python.org/3/library/pdb.html>`_,
390+
`pudb <https://pypi.org/project/pudb/>`_ or `ipdb <https://pypi.org/project/ipdb/>`_) or you can
380391
use your editor's debugger. To avoid difficult configurations in the beginning, it is
381392
easier if you use a library debugger.
382393

@@ -460,5 +471,51 @@ Here is a list of commands:
460471
limit_time_cpu = 9999
461472
limit_time_real = 9999
462473
463-
Now that your server is running, it's time to start
474+
Additional resources
475+
--------------------
476+
477+
Below are links to resources that could prove helpful during this tutorial.
478+
479+
Git
480+
~~~
481+
482+
- Atlassian has a set of `excellent tutorials <https://www.atlassian.com/git/tutorials/>`_.
483+
Particularly, how to `rewrite the history
484+
<https://www.atlassian.com/git/tutorials/rewriting-history>`_.
485+
- If the Atlassian tutorial does not work for you, W3schools offers a `very nice alternative
486+
<https://www.w3schools.com/git/>`_.
487+
- To visualize the effect of git commands on the commits graphs, play with this `interactive
488+
tutorial <https://learngitbranching.js.org/>`_.
489+
- If you want to read more about Github, their `documentation
490+
<https://docs.github.com/en/get-started/quickstart/hello-world>`_ includes a comprehensive
491+
introduction.
492+
493+
Python
494+
~~~~~~
495+
496+
- Don't forget about `Python official documentation <https://docs.python.org/3/>`_
497+
(and make sure to select the correct version at the top of the page!).
498+
- `The Hitchhiker's Guide <https://docs.python-guide.org/>`_ will teach you the good practices of
499+
Python.
500+
- If you have good experience of similar languages or just need a quick recall,
501+
`this guide <https://learnxinyminutes.com/docs/python3/>`_ is made for you.
502+
503+
Javascript
504+
~~~~~~~~~~
505+
506+
- You should find a tutorial that suits your level in this `"re-introduction" to JavaScript
507+
<https://developer.mozilla.org/en-US/docs/Web/JavaScript/A_re-introduction_to_JavaScript>`_.
508+
- If you just need a quick recall, `this one <https://learnxinyminutes.com/docs/javascript/>`_
509+
will do the trick.
510+
511+
(Postgre)SQL
512+
~~~~~~~~~~~~
513+
514+
- If you are not familiar with PostgreSQL, `these exercises <https://www.pgexercises.com/>`_
515+
will teach you better than any long documentation.
516+
- Even though you shouldn't have to interact with it, you might be interested to know
517+
that Odoo uses `psycopg2 <https://www.psycopg.org/docs/usage.html>`_ to interact
518+
with its SQL backend.
519+
520+
Back to the training! Now that your server is running, it's time to start
464521
:ref:`writing your own application <howto/rdtraining/03_newapp>`!

content/developer/howtos/rdtraining/16_guidelines_pr.rst

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -139,22 +139,6 @@ commits you can just copy/paste your commit messages as the PR message.
139139

140140
.. image:: 16_guidelines_pr/media/pr_message.png
141141

142-
Additional Info for Odoo Staff
143-
==============================
144-
145-
Now that you know the basics, here are some more useful pages if you haven't seen them already:
146-
147-
- Our `welcome <https://github.com/odoo/enterprise/wiki/Welcome>`__ page has extra info about
148-
working at Odoo as well as additional
149-
`tutorials <https://github.com/odoo/enterprise/wiki/Welcome#3-technical-training>`__ that are
150-
both language and Odoo specific.
151-
- Once you are ready to start doing tasks, it is important to note that Odoo follows a
152-
`rebasing workflow instead of merging <https://www.atlassian.com/git/tutorials/merging-vs-rebasing>`__
153-
for your PRs.
154-
`This cheatsheet <https://github.com/odoo/enterprise/wiki/GIT-Cheatsheet#pull-request-flow>`__ describes
155-
how to do this flow. If you want to become more of a rebasing master, then
156-
`this tutorial <https://www.atlassian.com/git/tutorials/rewriting-history>`__ is extra useful.
157-
158142
Test on the runbot
159143
==================
160144

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
1-
:orphan:
2-
31
.. _howto/rdtraining/D_mixins:
42

53
==================
64
Advanced D: Mixins
75
==================
86

9-
Hopefully, this topic will be written soon :-)
7+
If you need to interface with common Odoo features such as the chatter, you can rely on
8+
:doc:`mixins <../../reference/backend/mixins>`.
9+
They are Odoo models exposing useful methods through inheritance.
10+
11+
To learn and play with mixins, visit `this repository <https://github.com/tivisse/odoodays-2018/>`_.
12+
This module for a plant nursery is training material developed for the OXP 2018. You don't need to
13+
code it on your side. But you can check the presentations in the :file:`/static/pdf` directory and
14+
play with the module to discover some magic features in Odoo.
Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,27 @@
1-
:orphan:
2-
31
.. _howto/rdtraining/N_security:
42

53
====================
64
Advanced N: Security
75
====================
86

9-
Hopefully, this topic will be written soon :-)
7+
Every day we hear about data leaks and attacks in the newspapers.
8+
We expect you to be aware and careful about how to avoid security breaches in your future
9+
developments.
10+
11+
You already defined new models in your training. Did you check the access rights and define record
12+
rules on it ? Are you sure your module is not an open door to SQL injections ? Did you use getattr
13+
or t-raw in your code?
14+
15+
- No or wrong access rules on models.
16+
- Introduction of public methods that should actually be private.
17+
- Wrong manipulation of access tokens.
18+
- No or wrong `ir.rules` (restriction rules) on models.
19+
- Introduction of SQL injections.
20+
- etc.
21+
22+
Please check this `presentation from Olivier Dony (odo)
23+
<https://docs.google.com/presentation/d/1oDINxPtHWz31V8-2W0h2u2ubaKgz9lmbyfx9DJI4lTw/edit>`_ about
24+
common mistakes that you should **absolutely** avoid in your future developments.
25+
Also, please always use this `security checklist
26+
<https://docs.google.com/presentation/d/1oDINxPtHWz31V8-2W0h2u2ubaKgz9lmbyfx9DJI4lTw/edit#slide=id.g2faad955b1_0_6>`_
27+
to double-check your development and avoid further embarrassing issues.

0 commit comments

Comments
 (0)