[IMP] tutorials/js_framework: freeze GitHub links with line numbers

A few links were already outdated. Either the referenced code was no
longer on the same line, or the file didn't exist anymore.

This commit freezes all links targeting a specific line on the odoo/odoo
repository by selecting a specific commit.

X-original-commit: 6e746c851f
Part-of: odoo/documentation#4281
This commit is contained in:
Antoine Vandevenne (anv) 2023-04-11 15:05:22 +00:00
parent 89927ff965
commit 1ab6782608
5 changed files with 42 additions and 20 deletions

View File

@ -90,7 +90,8 @@ services, and components can import a service with the `useService()` hooks.
#. A button `Customers`, which opens a kanban view with all customers (this action already
exists, so you should use `its xml id
<{GITHUB_PATH}/odoo/addons/base/views/res_partner_views.xml#L513>`_).
<https://github.com/odoo/odoo/blob/1f4e583ba20a01f4c44b0a4ada42c4d3bb074273/
odoo/addons/base/views/res_partner_views.xml#L525>`_).
#. A button `New Orders`, which opens a list view with all orders created in the last 7 days.
#. A button `Cancelled Order`, which opens a list of all orders created in the last 7 days, but
already cancelled.
@ -155,7 +156,8 @@ Here is a short explanation on the various arguments:
- `Code: rpc service <{GITHUB_PATH}/addons/web/static/src/core/network/rpc_service.js>`_
- `Example: calling a route in onWillStart
<{GITHUB_PATH}/addons/lunch/static/src/views/search_model.js#L21>`_
<https://github.com/odoo/odoo/blob/1f4e583ba20a01f4c44b0a4ada42c4d3bb074273/
addons/lunch/static/src/views/search_model.js#L21>`_
4. Cache network calls, create a service
========================================
@ -190,7 +192,8 @@ outside of the `Dashboard` component. This is a nice use case for a service!
#. It should provide a function `loadStatistics` that, once called, performs the actual rpc, and
always return the same information.
#. Maybe use the `memoize
<{GITHUB_PATH}/addons/web/static/src/core/utils/functions.js#L11>`_ utility function from
<https://github.com/odoo/odoo/blob/1f4e583ba20a01f4c44b0a4ada42c4d3bb074273/
addons/web/static/src/core/utils/functions.js#L11>`_ utility function from
`@web/core/utils/functions`
#. Use this service in the `Dashboard` component.
#. Check that it works as expected
@ -213,7 +216,8 @@ chartjs code every time if they don't need it).
.. exercise::
#. Load chartjs, you can use the `loadJs
<{GITHUB_PATH}/addons/web/static/src/core/assets.js#L23>`_ function to load
<https://github.com/odoo/odoo/blob/1f4e583ba20a01f4c44b0a4ada42c4d3bb074273/
addons/web/static/src/core/assets.js#L23>`_ function to load
:file:`/web/static/lib/Chart/Chart.js`.
#. In a `Card` (from previous exercises), display a `pie chart
<https://www.chartjs.org/docs/2.8.0/charts/doughnut.html>`_ in the dashboard that displays the
@ -226,9 +230,11 @@ chartjs code every time if they don't need it).
.. seealso::
- `Example: lazy loading a js file
<{GITHUB_PATH}/addons/web/static/src/views/graph/graph_renderer.js#L57>`_
<https://github.com/odoo/odoo/blob/1f4e583ba20a01f4c44b0a4ada42c4d3bb074273/
addons/web/static/src/views/graph/graph_renderer.js#L57>`_
- `Example: rendering a chart in a component
<{GITHUB_PATH}/addons/web/static/src/views/graph/graph_renderer.js#L641>`_
<https://github.com/odoo/odoo/blob/1f4e583ba20a01f4c44b0a4ada42c4d3bb074273/
addons/web/static/src/views/graph/graph_renderer.js#L618>`_
6. Going further
================
@ -249,6 +255,8 @@ Here is a list of some small improvements you could try to do if you have the ti
.. seealso::
- `Example: use of env._t function
<{GITHUB_PATH}/addons/account/static/src/components/bills_upload/bills_upload.js#L64>`_
<https://github.com/odoo/odoo/blob/1f4e583ba20a01f4c44b0a4ada42c4d3bb074273/
addons/account/static/src/components/bills_upload/bills_upload.js#L64>`_
- `Code: translation code in web/
<{GITHUB_PATH}/addons/web/static/src/core/l10n/translation.js#L16>`_
<https://github.com/odoo/odoo/blob/1f4e583ba20a01f4c44b0a4ada42c4d3bb074273/
addons/web/static/src/core/l10n/translation.js#L16>`_

View File

@ -195,7 +195,8 @@ insert arbitrary components in the form view. Let us see how we can use it.
.. seealso::
- `Example: Using the tag <widget> in a form view
<{GITHUB_PATH}/addons/calendar/views/calendar_views.xml#L197>`_
<https://github.com/odoo/odoo/blob/1f4e583ba20a01f4c44b0a4ada42c4d3bb074273/
addons/calendar/views/calendar_views.xml#L197>`_
- `Example: Implementation of a widget (JS)
<{GITHUB_PATH}/addons/web/static/src/views/widgets/week_days/week_days.js>`_
- `Example: Implementation of a widget (XML)
@ -365,7 +366,8 @@ There is a service dedicated to calling models methods: `orm_service`, located i
- `Example: Extending a view (XML)
<{GITHUB_PATH}/addons/mass_mailing/static/src/views/mass_mailing_views.xml>`_
- `Example: Using a js_class attribute
<{GITHUB_PATH}/addons/mass_mailing/views/mailing_contact_views.xml#L44>`_
<https://github.com/odoo/odoo/blob/1f4e583ba20a01f4c44b0a4ada42c4d3bb074273/
addons/mass_mailing/views/mailing_contact_views.xml#L44>`_
- `Code: orm service <{GITHUB_PATH}/addons/web/static/src/core/orm_service.js>`_
- `Example: Using the orm service
<{GITHUB_PATH}/addons/account/static/src/components/open_move_widget/open_move_widget.js>`_

View File

@ -96,7 +96,8 @@ notifications and provide access to certain features.
- `Example: Adding some information to the "session info"
<{GITHUB_PATH}/addons/barcodes/models/ir_http.py>`_
- `Example: Reading the session information
<{GITHUB_PATH}/addons/barcodes/static/src/barcode_service.js#L5>`_
<https://github.com/odoo/odoo/blob/1f4e583ba20a01f4c44b0a4ada42c4d3bb074273/
addons/barcodes/static/src/barcode_service.js#L5>`_
3. Real life update
===================
@ -124,7 +125,8 @@ be done in various ways but, for this training, we choose to use the most *decla
.. seealso::
- `Documentation on reactivity <{OWL_PATH}/doc/reference/reactivity.md>`_
- `Example: Use of reactive in a service
<{GITHUB_PATH}/addons/web/static/src/core/debug/profiling/profiling_service.js#L30>`_
<https://github.com/odoo/odoo/blob/1f4e583ba20a01f4c44b0a4ada42c4d3bb074273/
addons/web/static/src/core/debug/profiling/profiling_service.js#L30>`_
4. Add a command to the command palette
=======================================
@ -145,7 +147,8 @@ by pressing `CTRL+K` in the Odoo interface.
.. seealso::
- `Example: Using the useCommand hook
<{GITHUB_PATH}/addons/web/static/src/core/debug/debug_menu.js#L15>`_
<https://github.com/odoo/odoo/blob/1f4e583ba20a01f4c44b0a4ada42c4d3bb074273/
addons/web/static/src/core/debug/debug_menu.js#L15>`_
- `Code: The command service
<{GITHUB_PATH}/addons/web/static/src/core/commands/command_service.js>`_
@ -207,7 +210,9 @@ these terms?".
:scale: 60%
.. seealso::
- `Code: The patch function <{GITHUB_PATH}/addons/web/static/src/core/utils/patch.js#L16>`_
- `Code: The patch function
<https://github.com/odoo/odoo/blob/1f4e583ba20a01f4c44b0a4ada42c4d3bb074273/
addons/web/static/src/core/utils/patch.js#L16>`_
- `Code: The ControlPanel component
<{GITHUB_PATH}/addons/web/static/src/search/control_panel/control_panel.js>`_
- `The Font Awesome website <https://fontawesome.com/>`_
@ -215,11 +220,14 @@ these terms?".
- `Code: ConfirmationDialog
<{GITHUB_PATH}/addons/web/static/src/core/confirmation_dialog/confirmation_dialog.js>`_
- `Example: Using the dialog service
<{GITHUB_PATH}/addons/board/static/src/board_controller.js#L88>`_
<https://github.com/odoo/odoo/blob/1f4e583ba20a01f4c44b0a4ada42c4d3bb074273/
addons/board/static/src/board_controller.js#L88>`_
- `Example: XPath with t-inherit-mode="primary"
<{GITHUB_PATH}/addons/account/static/src/components/account_move_form/account_move_form_notebook.xml#L4>`_
<https://github.com/odoo/odoo/blob/1f4e583ba20a01f4c44b0a4ada42c4d3bb074273/
addons/account/static/src/components/account_move_form/account_move_form_notebook.xml#L4>`_
- `Example: XPath with t-inherit-mode="extension"
<{GITHUB_PATH}/calendar/static/src/components/activity/activity.xml#L4>`_
<https://github.com/odoo/odoo/blob/1f4e583ba20a01f4c44b0a4ada42c4d3bb074273/
calendar/static/src/components/activity/activity.xml#L4>`_
6. Fetching orders from a customer
==================================
@ -308,4 +316,6 @@ now, there is no client action registered in the action registry.
.. seealso::
- :ref:`Documentation on assets <reference/assets>`
- `Code: LazyComponent <{GITHUB_PATH}/addons/web/static/src/core/assets.js#L255>`_
- `Code: LazyComponent
<https://github.com/odoo/odoo/blob/1f4e583ba20a01f4c44b0a4ada42c4d3bb074273/
addons/web/static/src/core/assets.js#L255>`_

View File

@ -135,7 +135,8 @@ customers with an active order.
- `Code: The fuzzylookup function <{GITHUB_PATH}/addons/web/static/src/core/utils/search.js>`_
- `Example: Using fuzzyLookup
<{GITHUB_PATH}/addons/web/static/tests/core/utils/search_test.js#L17>`_
<https://github.com/odoo/odoo/blob/1f4e583ba20a01f4c44b0a4ada42c4d3bb074273/
addons/web/static/tests/core/utils/search_test.js#L17>`_
7. Refactor the code to use `t-model`
=====================================

View File

@ -171,7 +171,8 @@ to learn how to structure code in Odoo. Also, this will scale better with changi
.. seealso::
`Code: The switchView function
<{GITHUB_PATH}/addons/web/static/src/webclient/actions/action_service.js#L1329>`_
<https://github.com/odoo/odoo/blob/1f4e583ba20a01f4c44b0a4ada42c4d3bb074273/
addons/web/static/src/webclient/actions/action_service.js#L1329>`_
8. Add an optional tooltip
==========================