documentation/locale/vi/LC_MESSAGES/developer.po

40506 lines
1.9 MiB
Plaintext
Raw Permalink Normal View History

# SOME DESCRIPTIVE TITLE.
# Copyright (C) Odoo S.A.
# This file is distributed under the same license as the Odoo package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: Odoo 17.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-03-08 12:48+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: ../../content/developer.rst:9
msgid "Developer"
msgstr ""
#: ../../content/developer.rst:11
msgid "Learn through tutorials and get help using reference guides."
msgstr ""
#: ../../content/developer/glossary.rst:5
msgid "Glossary"
msgstr ""
#: ../../content/developer/glossary.rst:8
msgid "external id"
msgstr ""
#: ../../content/developer/glossary.rst:9
msgid "external identifier"
msgstr ""
#: ../../content/developer/glossary.rst:10
msgid "external identifiers"
msgstr ""
#: ../../content/developer/glossary.rst:12
msgid "string identifier stored in ``ir.model.data``, can be used to refer to a record regardless of its database identifier during data imports or export/import roundtrips."
msgstr ""
#: ../../content/developer/glossary.rst:16
msgid "External identifiers are in the form :samp:`{module}.{id}` (e.g. ``account.invoice_graph``). From within a module, the :samp:`{module}.` prefix can be left out."
msgstr ""
#: ../../content/developer/glossary.rst:20
msgid "Sometimes referred to as \"xml id\" or ``xml_id`` as XML-based :ref:`reference/data` make extensive use of them."
msgstr ""
#: ../../content/developer/glossary.rst:22
msgid "format string"
msgstr ""
#: ../../content/developer/glossary.rst:24
msgid "inspired by `jinja variables`_, format strings allow more easily mixing literal content and computed content (expressions): content between ``{{`` and ``}}`` is interpreted as an expression and evaluated, other content is interpreted as literal strings and displayed as-is"
msgstr ""
#: ../../content/developer/glossary.rst:29
msgid "GIS"
msgstr ""
#: ../../content/developer/glossary.rst:30
msgid "Geographic Information System"
msgstr ""
#: ../../content/developer/glossary.rst:32
msgid "any computer system or subsystem to capture, store, manipulate, analyze, manage or present spatial and geographical data."
msgstr ""
#: ../../content/developer/glossary.rst:34
msgid "minified"
msgstr ""
#: ../../content/developer/glossary.rst:35
msgid "minification"
msgstr ""
#: ../../content/developer/glossary.rst:37
msgid "process of removing extraneous/non-necessary sections of files (comments, whitespace) and possibly recompiling them using equivalent but shorter structures (`ternary operator`_ instead of ``if/else``) in order to reduce network traffic"
msgstr ""
#: ../../content/developer/howtos.rst:6
msgid "How-to guides"
msgstr ""
#: ../../content/developer/howtos/accounting_localization.rst:4
msgid "Accounting localization"
msgstr ""
#: ../../content/developer/howtos/accounting_localization.rst:8
msgid "This tutorial requires knowledge about how to build a module in Odoo (see :doc:`../tutorials/getting_started`)."
msgstr ""
#: ../../content/developer/howtos/accounting_localization.rst:13
msgid "Installation procedure"
msgstr ""
#: ../../content/developer/howtos/accounting_localization.rst:15
msgid "On installing the `account <https://github.com/odoo/odoo/blob/17.0/addons/account>`_ module, the localization module corresponding to the country code of the company is installed automatically. In case of no country code set or no localization module found, the `l10n_generic_coa <https://github.com/odoo/odoo/blob/17.0/addons/l10n_generic_coa>`_ (US) localization module is installed by default. Check `post init hook <https://github.com/odoo/odoo/blob/17.0/addons/account/__init__.py>`_ for details."
msgstr ""
#: ../../content/developer/howtos/accounting_localization.rst:19
msgid "For example, `l10n_ch <https://github.com/odoo/odoo/blob/17.0/addons/l10n_ch>`_ will be installed if the company has ``Switzerland`` as country."
msgstr ""
#: ../../content/developer/howtos/accounting_localization.rst:22
msgid "Building a localization module"
msgstr ""
#: ../../content/developer/howtos/accounting_localization.rst:24
msgid "The structure of a basic ``l10n_XX`` module may be described with the following :file:`__manifest__.py` file:"
msgstr ""
#: ../../content/developer/howtos/accounting_localization.rst:45
msgid "Your worktree should look like this"
msgstr ""
#: ../../content/developer/howtos/accounting_localization.rst:67
msgid "In the first file :file:`models/template_xx.py`, we set the name for the chart of accounts along with some basic fields."
msgstr ""
#: ../../content/developer/howtos/accounting_localization.rst:70
msgid ":doc:`Chart Template References </developer/reference/standard_modules/account>`"
msgstr ""
#: ../../content/developer/howtos/accounting_localization.rst:73
msgid "`addons/l10n_be/models/template_be.py <https://github.com/odoo/odoo/blob/17.0/addons/l10n_be/models/template_be.py>`_"
msgstr ""
#: ../../content/developer/howtos/accounting_localization.rst:83
msgid "Chart of Accounts"
msgstr ""
#: ../../content/developer/howtos/accounting_localization.rst:86
msgid "Account tags"
msgstr ""
#: ../../content/developer/howtos/accounting_localization.rst:89
msgid ":ref:`Account Tag References <reference/account_account_tag>`"
msgstr ""
#: ../../content/developer/howtos/accounting_localization.rst:91
msgid "Tags are a way to sort accounts. For example, imagine you want to create a financial report having multiple lines but you have no way to find a rule to dispatch the accounts according to their ``code``. The solution is the usage of tags, one for each report line, to filter accounts like you want."
msgstr ""
#: ../../content/developer/howtos/accounting_localization.rst:95
msgid "Put the tags in the :file:`data/account_account_tag_data.xml` file."
msgstr ""
#: ../../content/developer/howtos/accounting_localization.rst:98
msgid "`addons/l10n_lt/data/template/account.account-lt.csv <https://github.com/odoo/odoo/blob/17.0/addons/l10n_lt/data/template/account.account-lt.csv>`_"
msgstr ""
#: ../../content/developer/howtos/accounting_localization.rst:106
msgid "Accounts"
msgstr ""
#: ../../content/developer/howtos/accounting_localization.rst:109
msgid ":ref:`Account References <reference/account_account>`"
msgstr ""
#: ../../content/developer/howtos/accounting_localization.rst:110
msgid ":doc:`/applications/finance/accounting/get_started/chart_of_accounts`"
msgstr ""
#: ../../content/developer/howtos/accounting_localization.rst:112
msgid "Obviously, :guilabel:`Chart of Accounts` cannot exist without :guilabel:`Accounts`. You need to specify them in :file:`data/account.account.template.csv`."
msgstr ""
#: ../../content/developer/howtos/accounting_localization.rst:115
msgid "`addons/l10n_ch/data/template/account.account-ch.csv <https://github.com/odoo/odoo/blob/17.0/addons/l10n_ch/data/template/account.account-ch.csv>`_"
msgstr ""
#: ../../content/developer/howtos/accounting_localization.rst:124
msgid "Avoid the usage of `asset_cash` ``account_type``! Indeed, the bank & cash accounts are created directly at the installation of the localization module and then, are linked to an ``account.journal``."
msgstr ""
#: ../../content/developer/howtos/accounting_localization.rst:126
msgid "Only one account of type payable/receivable is enough for the generic case. We need to define a PoS receivable account as well however. (linked in the CoA)"
msgstr ""
#: ../../content/developer/howtos/accounting_localization.rst:127
msgid "Don't create too many accounts: 200-300 is enough. But mostly, we try to find a good balance where the CoA needs minimal adapting for most companies afterwards."
msgstr ""
#: ../../content/developer/howtos/accounting_localization.rst:131
msgid "Account groups"
msgstr ""
#: ../../content/developer/howtos/accounting_localization.rst:134
msgid ":ref:`Account Group References <reference/account_group>`"
msgstr ""
#: ../../content/developer/howtos/accounting_localization.rst:136
msgid "Account groups allow describing the hierarchical structure of the chart of accounts. The filter needs to be activated in the report and then when you decollapse into journal entries it will show the parents of the account."
msgstr ""
#: ../../content/developer/howtos/accounting_localization.rst:138
msgid "It works with the prefix *start*/*end*, so every account where the code starts with something between *start* and *end* will have this ``account.group`` as the parent group. Furthermore, the account groups can have a parent account group as well to form the hierarchy."
msgstr ""
#: ../../content/developer/howtos/accounting_localization.rst:142
msgid "`addons/l10n_il/data/template/account.group-il.csv <https://github.com/odoo/odoo/blob/17.0/addons/l10n_il/data/template/account.group-il.csv>`_"
msgstr ""
#: ../../../odoo/addons/l10n_il/data/template/account.group-il.csv:1
#: ../../content/developer/howtos/website_themes/building_blocks.rst:444
#: ../../content/developer/howtos/website_themes/building_blocks.rst:469
#: ../../content/developer/howtos/website_themes/building_blocks.rst:500
#: ../../content/developer/howtos/website_themes/layout.rst:71
#: ../../content/developer/reference/backend/data/res.country.state.csv:1
msgid "id"
msgstr ""
#: ../../../odoo/addons/l10n_il/data/template/account.group-il.csv:1
msgid "code_prefix_start"
msgstr ""
#: ../../../odoo/addons/l10n_il/data/template/account.group-il.csv:1
msgid "code_prefix_end"
msgstr ""
#: ../../../odoo/addons/l10n_il/data/template/account.group-il.csv:1
#: ../../content/developer/howtos/website_themes/building_blocks.rst:446
#: ../../content/developer/howtos/website_themes/building_blocks.rst:471
#: ../../content/developer/howtos/website_themes/building_blocks.rst:502
#: ../../content/developer/howtos/website_themes/layout.rst:75
#: ../../content/developer/howtos/website_themes/navigation.rst:58
#: ../../content/developer/howtos/website_themes/pages.rst:139
#: ../../content/developer/howtos/website_themes/pages.rst:203
#: ../../content/developer/howtos/website_themes/shapes.rst:134
#: ../../content/developer/howtos/website_themes/theming.rst:121
#: ../../content/developer/tutorials/define_module_data.rst:177
#: ../../content/developer/tutorials/getting_started/04_basicmodel.rst:189
#: ../../content/developer/tutorials/getting_started/04_basicmodel.rst:262
#: ../../content/developer/tutorials/getting_started/08_relations.rst:73
#: ../../content/developer/tutorials/getting_started/08_relations.rst:180
#: ../../../odoo/addons/account/models/account_account.py:docstring of odoo.addons.account.models.account_account.AccountAccount.account_type:0
#: ../../../odoo/addons/account/models/account_account.py:docstring of odoo.addons.account.models.account_account.AccountAccount.code:0
#: ../../../odoo/addons/account/models/account_account.py:docstring of odoo.addons.account.models.account_account.AccountAccount.currency_id:0
#: ../../../odoo/addons/account/models/account_account.py:docstring of odoo.addons.account.models.account_account.AccountAccount.name:0
#: ../../../odoo/addons/account/models/account_account.py:docstring of odoo.addons.account.models.account_account.AccountAccount.note:0
#: ../../../odoo/addons/account/models/account_account.py:docstring of odoo.addons.account.models.account_account.AccountAccount.reconcile:0
#: ../../../odoo/addons/account/models/account_account.py:docstring of odoo.addons.account.models.account_account.AccountAccount.tag_ids:0
#: ../../../odoo/addons/account/models/account_account.py:docstring of odoo.addons.account.models.account_account.AccountAccount.tax_ids:0
#: ../../../odoo/addons/account/models/account_account.py:docstring of odoo.addons.account.models.account_account.AccountGroup.code_prefix_end:0
#: ../../../odoo/addons/account/models/account_account.py:docstring of odoo.addons.account.models.account_account.AccountGroup.code_prefix_start:0
#: ../../../odoo/addons/account/models/account_account.py:docstring of odoo.addons.account.models.account_account.AccountGroup.name:0
#: ../../../odoo/addons/account/models/account_account.py:docstring of odoo.addons.account.models.account_account.AccountGroup.parent_id:0
#: ../../../odoo/addons/account/models/account_account_tag.py:docstring of odoo.addons.account.models.account_account_tag.AccountAccountTag.active:0
#: ../../../odoo/addons/account/models/account_account_tag.py:docstring of odoo.addons.account.models.account_account_tag.AccountAccountTag.applicability:0
#: ../../../odoo/addons/account/models/account_account_tag.py:docstring of odoo.addons.account.models.account_account_tag.AccountAccountTag.color:0
#: ../../../odoo/addons/account/models/account_account_tag.py:docstring of odoo.addons.account.models.account_account_tag.AccountAccountTag.country_id:0
#: ../../../odoo/addons/account/models/account_account_tag.py:docstring of odoo.addons.account.models.account_account_tag.AccountAccountTag.name:0
#: ../../../odoo/addons/account/models/account_account_tag.py:docstring of odoo.addons.account.models.account_account_tag.AccountAccountTag.tax_negate:0
#: ../../../odoo/addons/account/models/account_report.py:docstring of odoo.addons.account.models.account_report.AccountReport.availability_condition:0
#: ../../../odoo/addons/account/models/account_report.py:docstring of odoo.addons.account.models.account_report.AccountReport.column_ids:0
#: ../../../odoo/addons/account/models/account_report.py:docstring of odoo.addons.account.models.account_report.AccountReport.country_id:0
#: ../../../odoo/addons/account/models/account_report.py:docstring of odoo.addons.account.models.account_report.AccountReport.default_opening_date_filter:0
#: ../../../odoo/addons/account/models/account_report.py:docstring of odoo.addons.account.models.account_report.AccountReport.filter_account_type:0
#: ../../../odoo/addons/account/models/account_report.py:docstring of odoo.addons.account.models.account_report.AccountReport.filter_analytic:0
#: ../../../odoo/addons/account/models/account_report.py:docstring of odoo.addons.account.models.account_report.AccountReport.filter_date_range:0
#: ../../../odoo/addons/account/models/account_report.py:docstring of odoo.addons.account.models.account_report.AccountReport.filter_fiscal_position:0
#: ../../../odoo/addons/account/models/account_report.py:docstring of odoo.addons.account.models.account_report.AccountReport.filter_growth_comparison:0
#: ../../../odoo/addons/account/models/account_report.py:docstring of odoo.addons.account.models.account_report.AccountReport.filter_hierarchy:0
#: ../../../odoo/addons/account/models/account_report.py:docstring of odoo.addons.account.models.account_report.AccountReport.filter_journals:0
#: ../../../odoo/addons/account/models/account_report.py:docstring of odoo.addons.account.models.account_report.AccountReport.filter_multi_company:0
#: ../../../odoo/addons/account/models/account_report.py:docstring of odoo.addons.account.models.account_report.AccountReport.filter_partner:0
#: ../../../odoo/addons/account/models/account_report.py:docstring of odoo.addons.account.models.account_report.AccountReport.filter_period_comparison:0
#: ../../../odoo/addons/account/models/account_report.py:docstring of odoo.addons.account.models.account_report.AccountReport.filter_show_draft:0
#: ../../../odoo/addons/account/models/account_report.py:docstring of odoo.addons.account.models.account_report.AccountReport.filter_unfold_all:0
#: ../../../odoo/addons/account/models/account_report.py:docstring of odoo.addons.account.models.account_report.AccountReport.filter_unreconciled:0
#: ../../../odoo/addons/account/models/account_report.py:docstring of odoo.addons.account.models.account_report.AccountReport.line_ids:0
#: ../../../odoo/addons/account/models/account_report.py:docstring of odoo.addons.account.models.account_report.AccountReport.load_more_limit:0
#: ../../../odoo/addons/account/models/account_report.py:docstring of odoo.addons.account.models.account_report.AccountReport.name:0
#: ../../../odoo/addons/account/models/account_report.py:docstring of odoo.addons.account.models.account_report.AccountReport.only_tax_exigible:0
#: ../../../odoo/addons/account/models/account_report.py:docstring of odoo.addons.account.models.account_report.AccountReport.root_report_id:0
#: ../../../odoo/addons/account/models/account_report.py:docstring of odoo.addons.account.models.account_report.AccountReport.search_bar:0
#: ../../../odoo/addons/account/models/account_report.py:docstring of odoo.addons.account.models.account_report.AccountReportLine.action_id:0
#: ../../../odoo/addons/account/models/account_report.py:docstring of odoo.addons.account.models.account_report.AccountReportLine.children_ids:0
#: ../../../odoo/addons/account/models/account_report.py:docstring of odoo.addons.account.models.account_report.AccountReportLine.expression_ids:0
#: ../../../odoo/addons/account/models/account_report.py:docstring of odoo.addons.account.models.account_report.AccountReportLine.foldable:0
#: ../../../odoo/addons/account/models/account_report.py:docstring of odoo.addons.account.models.account_report.AccountReportLine.hide_if_zero:0
#: ../../../odoo/addons/account/models/account_report.py:docstring of odoo.addons.account.models.account_report.AccountReportLine.hierarchy_level:0
#: ../../../odoo/addons/account/models/account_report.py:docstring of odoo.addons.account.models.account_report.AccountReportLine.name:0
#: ../../../odoo/addons/account/models/account_report.py:docstring of odoo.addons.account.models.account_report.AccountReportLine.parent_id:0
#: ../../../odoo/addons/account/models/account_report.py:docstring of odoo.addons.account.models.account_report.AccountReportLine.print_on_new_page:0
#: ../../../odoo/addons/account/models/account_report.py:docstring of odoo.addons.account.models.account_report.AccountReportLine.report_id:0
#: ../../../odoo/addons/account/models/account_tax.py:docstring of odoo.addons.account.models.account_tax.AccountTax.active:0
#: ../../../odoo/addons/account/models/account_tax.py:docstring of odoo.addons.account.models.account_tax.AccountTax.amount:0
#: ../../../odoo/addons/account/models/account_tax.py:docstring of odoo.addons.account.models.account_tax.AccountTax.amount_type:0
#: ../../../odoo/addons/account/models/account_tax.py:docstring of odoo.addons.account.models.account_tax.AccountTax.analytic:0
#: ../../../odoo/addons/account/models/account_tax.py:docstring of odoo.addons.account.models.account_tax.AccountTax.cash_basis_transition_account_id:0
#: ../../../odoo/addons/account/models/account_tax.py:docstring of odoo.addons.account.models.account_tax.AccountTax.children_tax_ids:0
#: ../../../odoo/addons/account/models/account_tax.py:docstring of odoo.addons.account.models.account_tax.AccountTax.description:0
#: ../../../odoo/addons/account/models/account_tax.py:docstring of odoo.addons.account.models.account_tax.AccountTax.include_base_amount:0
#: ../../../odoo/addons/account/models/account_tax.py:docstring of odoo.addons.account.models.account_tax.AccountTax.invoice_repartition_line_ids:0
#: ../../../odoo/addons/account/models/account_tax.py:docstring of odoo.addons.account.models.account_tax.AccountTax.is_base_affected:0
#: ../../../odoo/addons/account/models/account_tax.py:docstring of odoo.addons.account.models.account_tax.AccountTax.name:0
#: ../../../odoo/addons/account/models/account_tax.py:docstring of odoo.addons.account.models.account_tax.AccountTax.price_include:0
#: ../../../odoo/addons/account/models/account_tax.py:docstring of odoo.addons.account.models.account_tax.AccountTax.refund_repartition_line_ids:0
#: ../../../odoo/addons/account/models/account_tax.py:docstring of odoo.addons.account.models.account_tax.AccountTax.sequence:0
#: ../../../odoo/addons/account/models/account_tax.py:docstring of odoo.addons.account.models.account_tax.AccountTax.tax_exigibility:0
#: ../../../odoo/addons/account/models/account_tax.py:docstring of odoo.addons.account.models.account_tax.AccountTax.tax_group_id:0
#: ../../../odoo/addons/account/models/account_tax.py:docstring of odoo.addons.account.models.account_tax.AccountTax.tax_scope:0
#: ../../../odoo/addons/account/models/account_tax.py:docstring of odoo.addons.account.models.account_tax.AccountTax.type_tax_use:0
#: ../../../odoo/addons/account/models/account_tax.py:docstring of odoo.addons.account.models.account_tax.AccountTaxRepartitionLine.account_id:0
#: ../../../odoo/addons/account/models/account_tax.py:docstring of odoo.addons.account.models.account_tax.AccountTaxRepartitionLine.document_type:0
#: ../../../odoo/addons/account/models/account_tax.py:docstring of odoo.addons.account.models.account_tax.AccountTaxRepartitionLine.factor_percent:0
#: ../../../odoo/addons/account/models/account_tax.py:docstring of odoo.addons.account.models.account_tax.AccountTaxRepartitionLine.repartition_type:0
#: ../../../odoo/addons/account/models/account_tax.py:docstring of odoo.addons.account.models.account_tax.AccountTaxRepartitionLine.tag_ids:0
#: ../../../odoo/addons/account/models/account_tax.py:docstring of odoo.addons.account.models.account_tax.AccountTaxRepartitionLine.tax_id:0
#: ../../../odoo/addons/account/models/account_tax.py:docstring of odoo.addons.account.models.account_tax.AccountTaxRepartitionLine.use_in_tax_closing:0
#: ../../../odoo/addons/account/models/partner.py:docstring of odoo.addons.account.models.partner.AccountFiscalPosition.account_ids:0
#: ../../../odoo/addons/account/models/partner.py:docstring of odoo.addons.account.models.partner.AccountFiscalPosition.auto_apply:0
#: ../../../odoo/addons/account/models/partner.py:docstring of odoo.addons.account.models.partner.AccountFiscalPosition.country_group_id:0
#: ../../../odoo/addons/account/models/partner.py:docstring of odoo.addons.account.models.partner.AccountFiscalPosition.country_id:0
#: ../../../odoo/addons/account/models/partner.py:docstring of odoo.addons.account.models.partner.AccountFiscalPosition.name:0
#: ../../../odoo/addons/account/models/partner.py:docstring of odoo.addons.account.models.partner.AccountFiscalPosition.note:0
#: ../../../odoo/addons/account/models/partner.py:docstring of odoo.addons.account.models.partner.AccountFiscalPosition.sequence:0
#: ../../../odoo/addons/account/models/partner.py:docstring of odoo.addons.account.models.partner.AccountFiscalPosition.state_ids:0
#: ../../../odoo/addons/account/models/partner.py:docstring of odoo.addons.account.models.partner.AccountFiscalPosition.tax_ids:0
#: ../../../odoo/addons/account/models/partner.py:docstring of odoo.addons.account.models.partner.AccountFiscalPosition.vat_required:0
#: ../../../odoo/addons/account/models/partner.py:docstring of odoo.addons.account.models.partner.AccountFiscalPosition.zip_from:0
#: ../../../odoo/addons/account/models/partner.py:docstring of odoo.addons.account.models.partner.AccountFiscalPosition.zip_to:0
#: ../../content/developer/reference/backend/data/res.country.state.csv:1
msgid "name"
msgstr ""
#: ../../../odoo/addons/l10n_il/data/template/account.group-il.csv:1
msgid "name@he_IL"
msgstr ""
#: ../../../odoo/addons/l10n_il/data/template/account.group-il.csv:1
msgid "il_group_100100"
msgstr ""
#: ../../../odoo/addons/l10n_il/data/template/account.group-il.csv:1
msgid "100100"
msgstr ""
#: ../../../odoo/addons/l10n_il/data/template/account.group-il.csv:1
msgid "100499"
msgstr ""
#: ../../../odoo/addons/l10n_il/data/template/account.group-il.csv:1
msgid "Fixed Assets"
msgstr ""
#: ../../../odoo/addons/l10n_il/data/template/account.group-il.csv:1
msgid "רכוש קבוע"
msgstr ""
#: ../../../odoo/addons/l10n_il/data/template/account.group-il.csv:1
msgid "il_group_101110"
msgstr ""
#: ../../../odoo/addons/l10n_il/data/template/account.group-il.csv:1
msgid "101110"
msgstr ""
#: ../../../odoo/addons/l10n_il/data/template/account.group-il.csv:1
msgid "101400"
msgstr ""
#: ../../../odoo/addons/l10n_il/data/template/account.group-il.csv:1
msgid "Current Assets"
msgstr ""
#: ../../../odoo/addons/l10n_il/data/template/account.group-il.csv:1
msgid "רכוש שוטף"
msgstr ""
#: ../../../odoo/addons/l10n_il/data/template/account.group-il.csv:1
msgid "il_group_101401"
msgstr ""
#: ../../../odoo/addons/l10n_il/data/template/account.group-il.csv:1
msgid "101401"
msgstr ""
#: ../../../odoo/addons/l10n_il/data/template/account.group-il.csv:1
msgid "101799"
msgstr ""
#: ../../../odoo/addons/l10n_il/data/template/account.group-il.csv:1
msgid "Bank And Cash"
msgstr ""
#: ../../../odoo/addons/l10n_il/data/template/account.group-il.csv:1
msgid "בנק ומזומנים"
msgstr ""
#: ../../../odoo/addons/l10n_il/data/template/account.group-il.csv:1
msgid "il_group_111000"
msgstr ""
#: ../../../odoo/addons/l10n_il/data/template/account.group-il.csv:1
msgid "111000"
msgstr ""
#: ../../../odoo/addons/l10n_il/data/template/account.group-il.csv:1
msgid "111999"
msgstr ""
#: ../../../odoo/addons/l10n_il/data/template/account.group-il.csv:1
msgid "Current Liabilities"
msgstr ""
#: ../../../odoo/addons/l10n_il/data/template/account.group-il.csv:1
msgid "התחייבויות שוטפות"
msgstr ""
#: ../../../odoo/addons/l10n_il/data/template/account.group-il.csv:1
msgid "il_group_112000"
msgstr ""
#: ../../../odoo/addons/l10n_il/data/template/account.group-il.csv:1
msgid "112000"
msgstr ""
#: ../../../odoo/addons/l10n_il/data/template/account.group-il.csv:1
msgid "112210"
msgstr ""
#: ../../../odoo/addons/l10n_il/data/template/account.group-il.csv:1
msgid "Non-current Liabilities"
msgstr ""
#: ../../../odoo/addons/l10n_il/data/template/account.group-il.csv:1
msgid "התחייבויות לא שוטפות"
msgstr ""
#: ../../../odoo/addons/l10n_il/data/template/account.group-il.csv:1
msgid "il_group_200000"
msgstr ""
#: ../../../odoo/addons/l10n_il/data/template/account.group-il.csv:1
msgid "200000"
msgstr ""
#: ../../../odoo/addons/l10n_il/data/template/account.group-il.csv:1
msgid "200199"
msgstr ""
#: ../../../odoo/addons/l10n_il/data/template/account.group-il.csv:1
msgid "Sales Income"
msgstr ""
#: ../../../odoo/addons/l10n_il/data/template/account.group-il.csv:1
msgid "הכנסות ממכירות"
msgstr ""
#: ../../../odoo/addons/l10n_il/data/template/account.group-il.csv:1
msgid "il_group_200200"
msgstr ""
#: ../../../odoo/addons/l10n_il/data/template/account.group-il.csv:1
msgid "200200"
msgstr ""
#: ../../../odoo/addons/l10n_il/data/template/account.group-il.csv:1
msgid "200300"
msgstr ""
#: ../../../odoo/addons/l10n_il/data/template/account.group-il.csv:1
msgid "Other Income"
msgstr ""
#: ../../../odoo/addons/l10n_il/data/template/account.group-il.csv:1
msgid "הכנסות אחרות"
msgstr ""
#: ../../../odoo/addons/l10n_il/data/template/account.group-il.csv:1
msgid "il_group_201000"
msgstr ""
#: ../../../odoo/addons/l10n_il/data/template/account.group-il.csv:1
msgid "201000"
msgstr ""
#: ../../../odoo/addons/l10n_il/data/template/account.group-il.csv:1
msgid "201299"
msgstr ""
#: ../../../odoo/addons/l10n_il/data/template/account.group-il.csv:1
msgid "Cost of Goods"
msgstr ""
#: ../../../odoo/addons/l10n_il/data/template/account.group-il.csv:1
msgid "עלות המכר"
msgstr ""
#: ../../../odoo/addons/l10n_il/data/template/account.group-il.csv:1
msgid "il_group_202000"
msgstr ""
#: ../../../odoo/addons/l10n_il/data/template/account.group-il.csv:1
msgid "202000"
msgstr ""
#: ../../../odoo/addons/l10n_il/data/template/account.group-il.csv:1
msgid "220900"
msgstr ""
#: ../../../odoo/addons/l10n_il/data/template/account.group-il.csv:1
msgid "Expenses"
msgstr ""
#: ../../../odoo/addons/l10n_il/data/template/account.group-il.csv:1
msgid "הוצאות"
msgstr ""
#: ../../../odoo/addons/l10n_il/data/template/account.group-il.csv:1
msgid "il_group_300000"
msgstr ""
#: ../../../odoo/addons/l10n_il/data/template/account.group-il.csv:1
msgid "300000"
msgstr ""
#: ../../../odoo/addons/l10n_il/data/template/account.group-il.csv:1
msgid "399999"
msgstr ""
#: ../../../odoo/addons/l10n_il/data/template/account.group-il.csv:1
msgid "Capital And Shares"
msgstr ""
#: ../../../odoo/addons/l10n_il/data/template/account.group-il.csv:1
msgid "הון ומניות"
msgstr ""
#: ../../content/developer/howtos/accounting_localization.rst:151
#: ../../content/developer/reference/standard_modules/account/account_tax.rst:5
msgid "Taxes"
msgstr ""
#: ../../content/developer/howtos/accounting_localization.rst:154
msgid ":ref:`Tax References <reference/account_tax>`"
msgstr ""
#: ../../content/developer/howtos/accounting_localization.rst:155
msgid ":doc:`/applications/finance/accounting/taxes/`"
msgstr ""
#: ../../content/developer/howtos/accounting_localization.rst:157
msgid "To add taxes you first need to specify tax groups. You normally need just one tax group for every tax rate, except for the 0% as you need to often distinguish between exempt, 0%, not subject, ... taxes. This model only has two required fields: `name` and `country`. Create the file :file:`data/template/account.tax.group-xx.csv` and list the groups."
msgstr ""
#: ../../content/developer/howtos/accounting_localization.rst:161
msgid "`addons/l10n_uk/data/template/account.tax.group-uk.csv <https://github.com/odoo/odoo/blob/17.0/addons/l10n_uk/data/template/account.tax.group-uk.csv>`_"
msgstr ""
#: ../../content/developer/howtos/accounting_localization.rst:168
msgid "Now you can add the taxes via :file:`data/template/account.tax-xx.csv` file. The first tax you define that is purchase/sale also becomes the default purchase/sale tax for your products."
msgstr ""
#: ../../content/developer/howtos/accounting_localization.rst:172
msgid "`addons/l10n_ae/data/template/account.tax-ae.csv <https://github.com/odoo/odoo/blob/17.0/addons/l10n_ae/data/template/account.tax-ae.csv>`_"
msgstr ""
#: ../../content/developer/howtos/accounting_localization.rst:181
msgid "Tax Report"
msgstr ""
#: ../../content/developer/howtos/accounting_localization.rst:187
msgid "The tax report is declared in the :guilabel:`Invoicing` (`account`) app, but the report is only accessible when :guilabel:`Accounting` (`account_accountant`) is installed."
msgstr ""
#: ../../content/developer/howtos/accounting_localization.rst:190
#: ../../content/developer/howtos/accounting_localization.rst:302
msgid ":doc:`/developer/reference/standard_modules/account/account_report_line`"
msgstr ""
#: ../../content/developer/howtos/accounting_localization.rst:191
msgid ":doc:`/applications/finance/accounting/reporting/tax_returns`"
msgstr ""
#: ../../content/developer/howtos/accounting_localization.rst:193
msgid "In the previous section, you noticed the fields `invoice_repartition_line_ids` or `refund_repartition_line_ids` and probably understood nothing about them. Good news: you are not alone on this incomprehension. Bad news: you have to figure it out a bit. The topic is complicated. Indeed:"
msgstr ""
#: ../../content/developer/howtos/accounting_localization.rst:198
msgid "The simple version is that, in the tax template, you indicate in the invoice/refund repartition lines whether the base or a percentage of the tax needs to be reported in which report line (through the *minus/plus_report_line_ids* fields). It becomes clear also when you check the tax configuration in the Odoo interface (or check the docs :ref:`Tax References <reference/account_tax>`, :ref:`Tax Repartition References <reference/account_tax_repartition>`)."
msgstr ""
#: ../../content/developer/howtos/accounting_localization.rst:201
msgid "So, once you have properly configured taxes, you just need to add the :file:`data/account_tax_report_data.xml` file with a record for your `account.report`. For it to be considered as a tax report, you need to provide it with the right `root_report_id`."
msgstr ""
#: ../../content/developer/howtos/accounting_localization.rst:215
msgid "... followed by the declaration of its lines, as `account.report.line` records."
msgstr ""
#: ../../content/developer/howtos/accounting_localization.rst:218
msgid "`addons/l10n_au/data/account_tax_report_data.xml <https://github.com/odoo/odoo/blob/17.0/addons/l10n_au/data/account_tax_report_data.xml>`_"
msgstr ""
#: ../../content/developer/howtos/accounting_localization.rst:229
msgid "Fiscal positions"
msgstr ""
#: ../../content/developer/howtos/accounting_localization.rst:232
msgid ":ref:`Fiscal Position References <reference/account_fiscal_position>`"
msgstr ""
#: ../../content/developer/howtos/accounting_localization.rst:233
msgid ":doc:`/applications/finance/accounting/taxes/fiscal_positions`"
msgstr ""
#: ../../content/developer/howtos/accounting_localization.rst:235
msgid "Specify fiscal positions in the :file:`data/template/account.fiscal.position-xx.csv` file."
msgstr ""
#: ../../content/developer/howtos/accounting_localization.rst:238
msgid "`addons/l10n_es/data/template/account.fiscal.position-es_common.csv <https://github.com/odoo/odoo/blob/17.0/addons/l10n_es/data/template/account.fiscal.position-es_common.csv>`_"
msgstr ""
#: ../../content/developer/howtos/accounting_localization.rst:246
msgid "Final steps"
msgstr ""
#: ../../content/developer/howtos/accounting_localization.rst:248
msgid "Finally, you may add a demo company, so the localization can easily be tested in demo mode."
msgstr ""
#: ../../content/developer/howtos/accounting_localization.rst:251
msgid "`addons/l10n_ch/demo/demo_company.xml <https://github.com/odoo/odoo/blob/17.0/addons/l10n_ch/demo/demo_company.xml>`_"
msgstr ""
#: ../../content/developer/howtos/accounting_localization.rst:260
msgid "Accounting reports"
msgstr ""
#: ../../content/developer/howtos/accounting_localization.rst:267
msgid ":doc:`/applications/finance/accounting/reporting`"
msgstr ""
#: ../../content/developer/howtos/accounting_localization.rst:269
msgid "Accounting reports should be added via a separate module `l10n_XX_reports` that should go to the `enterprise repository <https://github.com/odoo/enterprise/blob/17.0>`_."
msgstr ""
#: ../../content/developer/howtos/accounting_localization.rst:271
msgid "Basic :file:`__manifest__.py` file for such a module looks as following:"
msgstr ""
#: ../../content/developer/howtos/accounting_localization.rst:292
msgid "Functional overview of financial reports is here: :doc:`/applications/finance/accounting/reporting`."
msgstr ""
#: ../../content/developer/howtos/accounting_localization.rst:294
msgid "Some good examples:"
msgstr ""
#: ../../content/developer/howtos/accounting_localization.rst:296
msgid "`l10n_ch_reports/data/account_financial_html_report_data.xml <https://github.com/odoo/enterprise/blob/17.0/l10n_ch_reports/data/account_financial_html_report_data.xml>`_"
msgstr ""
#: ../../content/developer/howtos/accounting_localization.rst:297
msgid "`l10n_be_reports/data/account_financial_html_report_data.xml <https://github.com/odoo/enterprise/blob/17.0/l10n_be_reports/data/account_financial_html_report_data.xml>`_"
msgstr ""
#: ../../content/developer/howtos/accounting_localization.rst:299
msgid "You can check the meaning of the fields here:"
msgstr ""
#: ../../content/developer/howtos/accounting_localization.rst:301
msgid ":doc:`/developer/reference/standard_modules/account/account_report`"
msgstr ""
#: ../../content/developer/howtos/accounting_localization.rst:304
msgid "If you gave a `root_report_id` to your report, it is now available in its variant selector. If not, you still need to add a menu item for it. A default menu item can be created from the form view of the report by clicking on :menuselection:`Actions --> Create Menu Item`. You will then need to refresh the page to see it. Alternatively, to create a dedicated section for a totally new report in the :guilabel:`Reporting` menu, you need to create a new `ir.ui.menu` record (usually in the main `l10n_XX` module) and a new `ir.actions.client` (usually in the new report XML file) that calls the `account.report` with the new **report id**. Then, set the new menu as `parent_id` field in the action model."
msgstr ""
#: ../../content/developer/howtos/accounting_localization.rst:314
msgid "`ir.ui.menu creation <https://github.com/odoo/odoo/blob/17.0/addons/l10n_be/data/menuitem_data.xml>`_"
msgstr ""
#: ../../content/developer/howtos/accounting_localization.rst:315
msgid "`ir.actions.client and menu item creation <https://github.com/odoo/enterprise/blob/17.0/l10n_be_reports/data/partner_vat_listing.xml>`_"
msgstr ""
#: ../../content/developer/howtos/company.rst:6
msgid "Multi-company Guidelines"
msgstr ""
#: ../../content/developer/howtos/company.rst:10
msgid "This tutorial requires good knowledge of Odoo. Please refer to the :doc:`../tutorials/getting_started` tutorial first if needed."
msgstr ""
#: ../../content/developer/howtos/company.rst:13
msgid "As of version 13.0, a user can be logged in to multiple companies at once. This allows the user to access information from multiple companies, but also to create/edit records in a multi-company environment."
msgstr ""
#: ../../content/developer/howtos/company.rst:17
msgid "If not managed correctly, it may be the source of a lot of inconsistent multi-company behaviors. For instance, a user logged in to both companies A and B could create a sales order in company A and add products belonging to company B to it. It is only when the user logs out from company B that access errors will occur for the sales order."
msgstr ""
#: ../../content/developer/howtos/company.rst:22
msgid "To correctly manage multi-company behaviors, Odoo's ORM provides multiple features:"
msgstr ""
#: ../../content/developer/howtos/company.rst:24
msgid ":ref:`Company-dependent fields <howto/company/company_dependent>`"
msgstr ""
#: ../../content/developer/howtos/company.rst:25
msgid ":ref:`Multi-company consistency <howto/company/check_company>`"
msgstr ""
#: ../../content/developer/howtos/company.rst:26
msgid ":ref:`Default company <howto/company/default_company>`"
msgstr ""
#: ../../content/developer/howtos/company.rst:27
msgid ":ref:`Views <howto/company/views>`"
msgstr ""
#: ../../content/developer/howtos/company.rst:28
msgid ":ref:`Security rules <howto/company/security>`"
msgstr ""
#: ../../content/developer/howtos/company.rst:33
msgid "Company-dependent fields"
msgstr ""
#: ../../content/developer/howtos/company.rst:35
msgid "When a record is available from multiple companies, we must expect that different values will be assigned to a given field depending on the company from which the value is set."
msgstr ""
#: ../../content/developer/howtos/company.rst:38
msgid "For the field of the same record to support several values, it must be defined with the attribute `company_dependent` set to `True`."
msgstr ""
#: ../../content/developer/howtos/company.rst:57
msgid "The `_compute_display_info` method is decorated with `depends_context('company')` (see :attr:`~odoo.api.depends_context`) to ensure that the computed field is recomputed depending on the current company (`self.env.company`)."
msgstr ""
#: ../../content/developer/howtos/company.rst:61
msgid "When a company-dependent field is read, the current company is used to retrieve its value. In other words, if a user is logged in to companies A and B with A as the main company and creates a record for company B, the value of company-dependent fields will be that of company A."
msgstr ""
#: ../../content/developer/howtos/company.rst:65
msgid "To read the values of company-dependent fields set by another company than the current one, we need to ensure the company we are using is the correct one. This can be done with :meth:`~odoo.models.Model.with_company`, which updates the current company."
msgstr ""
#: ../../content/developer/howtos/company.rst:80
msgid "Whenever you are computing/creating/... things that may behave differently in different companies, you should make sure whatever you are doing is done in the right company. It doesn't cost much to always use `with_company` to avoid problems later."
msgstr ""
#: ../../content/developer/howtos/company.rst:101
msgid "Multi-company consistency"
msgstr ""
#: ../../content/developer/howtos/company.rst:103
msgid "When a record is made shareable between several companies by the means of a `company_id` field, we must take care that it cannot be linked to the record of another company through a relational field. For instance, we do not want to have a sales order and its invoice belonging to different companies."
msgstr ""
#: ../../content/developer/howtos/company.rst:107
msgid "To ensure this multi-company consistency, you must:"
msgstr ""
#: ../../content/developer/howtos/company.rst:109
msgid "Set the class attribute `_check_company_auto` to `True`."
msgstr ""
#: ../../content/developer/howtos/company.rst:110
msgid "Define relational fields with the attribute `check_company` set to `True` if their model has a `company_id` field."
msgstr ""
#: ../../content/developer/howtos/company.rst:113
msgid "On each :meth:`~odoo.models.Model.create` and :meth:`~odoo.models.Model.write`, automatic checks will be triggered to ensure the multi-company consistency of the record."
msgstr ""
#: ../../content/developer/howtos/company.rst:127
msgid "The field `company_id` must not be defined with `check_company=True`."
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel._check_company:1
msgid "Check the companies of the values of the given field names."
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:0
#: ../../content/developer/reference/frontend/framework_overview.rst:0
#: ../../content/developer/reference/frontend/qweb.rst:0
#: ../../content/developer/reference/upgrade_scripts.rst:0
#: ../../content/developer/reference/upgrade_utils.rst:0
#: ../../../odoo/addons/payment/models/payment_method.py:docstring of odoo.addons.payment.models.payment_method.PaymentMethod._get_compatible_payment_methods:0
#: ../../../odoo/addons/payment/models/payment_method.py:docstring of odoo.addons.payment.models.payment_method.PaymentMethod._get_from_code:0
#: ../../../odoo/addons/payment/models/payment_provider.py:docstring of odoo.addons.payment.models.payment_provider.PaymentProvider._get_compatible_providers:0
#: ../../../odoo/addons/payment/models/payment_provider.py:docstring of odoo.addons.payment.models.payment_provider.PaymentProvider._get_redirect_form_view:0
#: ../../../odoo/addons/payment/models/payment_provider.py:docstring of odoo.addons.payment.models.payment_provider.PaymentProvider._is_tokenization_required:0
#: ../../../odoo/addons/payment/models/payment_provider.py:docstring of odoo.addons.payment.models.payment_provider.PaymentProvider._should_build_inline_form:0
#: ../../../odoo/addons/payment/models/payment_token.py:docstring of odoo.addons.payment.models.payment_token.PaymentToken._build_display_name:0
#: ../../../odoo/addons/payment/models/payment_token.py:docstring of odoo.addons.payment.models.payment_token.PaymentToken._get_available_tokens:0
#: ../../../odoo/addons/payment/models/payment_token.py:docstring of odoo.addons.payment.models.payment_token.PaymentToken._get_specific_create_values:0
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._compute_reference:0
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._compute_reference_prefix:0
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._get_specific_create_values:0
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._get_specific_processing_values:0
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._get_specific_rendering_values:0
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._get_tx_from_notification_data:0
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._handle_notification_data:0
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._process_notification_data:0
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._send_capture_request:0
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._send_refund_request:0
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._send_void_request:0
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._set_authorized:0
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._set_canceled:0
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._set_done:0
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._set_error:0
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._set_pending:0
#: ../../../odoo/odoo/addons/base/models/ir_ui_view.py:docstring of odoo.addons.base.models.ir_ui_view.Model.get_view:0
#: ../../../odoo/odoo/addons/base/models/ir_ui_view.py:docstring of odoo.addons.base.models.ir_ui_view.Model.get_views:0
#: ../../../odoo/odoo/api.py:docstring of odoo.api.Environment.invalidate_all:0
#: ../../../odoo/odoo/api.py:docstring of odoo.api.Environment.ref:0
#: ../../../odoo/odoo/api.py:docstring of odoo.api.ondelete:0
#: ../../../odoo/odoo/api.py:docstring of odoo.api.returns:0
#: ../../../odoo/odoo/exceptions.py:docstring of odoo.exceptions.RedirectWarning:0
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Binary:0
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Char:0
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Date.context_today:0
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Date.to_date:0
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Date.to_string:0
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Datetime.context_timestamp:0
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Datetime.to_datetime:0
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Datetime.to_string:0
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Field:0
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Float:0
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Html:0
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Image:0
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Many2many:0
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Many2one:0
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Many2oneReference:0
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Monetary:0
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.One2many:0
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Selection:0
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Text:0
#: ../../../odoo/odoo/fields.py:docstring of odoo.tools.date_utils.add:0
#: ../../../odoo/odoo/fields.py:docstring of odoo.tools.date_utils.end_of:0
#: ../../../odoo/odoo/fields.py:docstring of odoo.tools.date_utils.start_of:0
#: ../../../odoo/odoo/fields.py:docstring of odoo.tools.date_utils.subtract:0
#: ../../../odoo/odoo/http.py:docstring of odoo.http.HttpDispatcher.handle_error:0
#: ../../../odoo/odoo/http.py:docstring of odoo.http.JsonRPCDispatcher.handle_error:0
#: ../../../odoo/odoo/http.py:docstring of odoo.http.Request.csrf_token:0
#: ../../../odoo/odoo/http.py:docstring of odoo.http.Request.make_json_response:0
#: ../../../odoo/odoo/http.py:docstring of odoo.http.Request.make_response:0
#: ../../../odoo/odoo/http.py:docstring of odoo.http.Request.render:0
#: ../../../odoo/odoo/http.py:docstring of odoo.http.Request.update_env:0
#: ../../../odoo/odoo/http.py:docstring of odoo.http.Request.validate_csrf:0
#: ../../../odoo/odoo/http.py:docstring of odoo.http.Response:0
#: ../../../odoo/odoo/http.py:docstring of odoo.http.Response.load:0
#: ../../../odoo/odoo/http.py:docstring of odoo.http.route:0
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel._check_company:0
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel._populate:0
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel._read_group:0
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.browse:0
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.copy:0
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.create:0
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.default_get:0
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.fetch:0
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.fields_get:0
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.filtered:0
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.filtered_domain:0
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.flush_model:0
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.flush_recordset:0
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.grouped:0
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.invalidate_model:0
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.invalidate_recordset:0
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.mapped:0
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.modified:0
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.name_create:0
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.name_search:0
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.read:0
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.read_group:0
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.search:0
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.search_count:0
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.search_fetch:0
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.sorted:0
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.with_company:0
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.with_env:0
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.write:0
#: ../../../odoo/odoo/tests/common.py:docstring of odoo.tests.common.BaseCase.browse_ref:0
#: ../../../odoo/odoo/tests/common.py:docstring of odoo.tests.common.BaseCase.ref:0
#: ../../../odoo/odoo/tests/form.py:docstring of odoo.tests.form.Form:0
#: ../../../odoo/odoo/tools/populate.py:docstring of odoo.tools.populate.cartesian:0
#: ../../../odoo/odoo/tools/populate.py:docstring of odoo.tools.populate.compute:0
#: ../../../odoo/odoo/tools/populate.py:docstring of odoo.tools.populate.iterate:0
#: ../../../odoo/odoo/tools/populate.py:docstring of odoo.tools.populate.randint:0
#: ../../../odoo/odoo/tools/populate.py:docstring of odoo.tools.populate.randomize:0
#: ../../../odoo/odoo/tools/profiler.py:docstring of odoo.tools.profiler.PeriodicCollector:0
#: ../../../odoo/odoo/tools/profiler.py:docstring of odoo.tools.profiler.Profiler.__init__:0
msgid "Parameters"
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel._check_company:3
msgid "names of relational fields to check"
msgstr ""
#: ../../../odoo/odoo/addons/base/models/ir_ui_view.py:docstring of odoo.addons.base.models.ir_ui_view.Model.get_view:0
#: ../../../odoo/odoo/api.py:docstring of odoo.api.Environment.companies:0
#: ../../../odoo/odoo/api.py:docstring of odoo.api.Environment.company:0
#: ../../../odoo/odoo/api.py:docstring of odoo.api.Environment.ref:0
#: ../../../odoo/odoo/http.py:docstring of odoo.http.Response.load:0
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel._check_company:0
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel._read_group:0
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.create:0
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.ensure_one:0
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.fetch:0
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.read:0
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.read_group:0
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.search:0
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.search_fetch:0
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.unlink:0
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.write:0
#: ../../../odoo/odoo/tests/form.py:docstring of odoo.tests.form.Form.save:0
#: ../../../odoo/odoo/tests/form.py:docstring of odoo.tests.form.O2MProxy.edit:0
#: ../../../odoo/odoo/tests/form.py:docstring of odoo.tests.form.O2MProxy.new:0
#: ../../../odoo/odoo/tests/form.py:docstring of odoo.tests.form.O2MProxy.remove:0
msgid "Raises"
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel._check_company:4
msgid "if the `company_id` of the value of any field is not in `[False, self.company_id]` (or `self` if :class:`~odoo.addons.base.models.res_company`)."
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel._check_company:8
msgid "For :class:`~odoo.addons.base.models.res_users` relational fields, verifies record company is in `company_ids` fields."
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel._check_company:11
msgid "User with main company A, having access to company A and B, could be assigned or linked to records in company B."
msgstr ""
#: ../../content/developer/howtos/company.rst:132
msgid "The `check_company` feature performs a strict check! It means that if a record has no `company_id` (i.e., the field is not required), it cannot be linked to a record whose `company_id` is set."
msgstr ""
#: ../../content/developer/howtos/company.rst:138
msgid "When no domain is defined on the field and `check_company` is set to `True`, a default domain is added: `['|', '('company_id', '=', False), ('company_id', '=', company_id)]`"
msgstr ""
#: ../../content/developer/howtos/company.rst:144
msgid "Default company"
msgstr ""
#: ../../content/developer/howtos/company.rst:146
msgid "When the field `company_id` is made required on a model, a good practice is to set a default company. It eases the setup flow for the user or even guarantees its validity when the company is hidden from view. Indeed, the company is usually hidden if the user does not have access to multiple companies (i.e., when the user does not have the group `base.group_multi_company`)."
msgstr ""
#: ../../content/developer/howtos/company.rst:168
#: ../../content/developer/howtos/upgrade_custom_db.rst:129
#: ../../content/developer/howtos/website_themes/setup.rst:75
#: ../../content/developer/howtos/website_themes/theming.rst:496
#: ../../content/developer/reference/frontend/javascript_reference.rst:1154
msgid "Views"
msgstr ""
#: ../../content/developer/howtos/company.rst:170
msgid "As stated in :ref:`above <howto/company/default_company>`, the company is usually hidden from view if the user does not have access to multiple companies. This is assessed with the group `base.group_multi_company`."
msgstr ""
#: ../../content/developer/howtos/company.rst:197
msgid "Security rules"
msgstr ""
#: ../../content/developer/howtos/company.rst:199
msgid "When working with records shared across companies or restricted to a single company, we must take care that a user does not have access to records belonging to other companies."
msgstr ""
#: ../../content/developer/howtos/company.rst:202
msgid "This is achieved with security rules based on `company_ids`, which contain the current companies of the user (the companies the user checked in the multi-company widget)."
msgstr ""
#: ../../content/developer/howtos/company.rst:229
#: ../../content/developer/howtos/translations.rst:19
#: ../../content/developer/howtos/website_themes/building_blocks.rst:77
#: ../../content/developer/howtos/website_themes/building_blocks.rst:332
#: ../../content/developer/howtos/website_themes/layout.rst:547
#: ../../content/developer/howtos/website_themes/pages.rst:130
#: ../../content/developer/howtos/website_themes/pages.rst:194
#: ../../content/developer/howtos/website_themes/shapes.rst:125
#: ../../content/developer/reference/backend/actions.rst:173
#: ../../content/developer/reference/backend/orm.rst:639
#: ../../content/developer/reference/backend/orm.rst:641
#: ../../content/developer/reference/backend/orm.rst:837
#: ../../content/developer/reference/backend/orm.rst:996
#: ../../content/developer/reference/backend/security.rst:28
#: ../../content/developer/reference/backend/security.rst:186
#: ../../content/developer/reference/frontend/qweb.rst:422
#: ../../content/developer/reference/frontend/qweb.rst:739
#: ../../content/developer/reference/user_interface/view_architectures.rst:223
#: ../../content/developer/reference/user_interface/view_architectures.rst:2661
#: ../../content/developer/reference/user_interface/view_architectures.rst:2682
#: ../../content/developer/reference/user_interface/view_records.rst:217
#: ../../content/developer/tutorials/web.rst:134
#: ../../content/developer/tutorials/web.rst:1872
#: ../../content/developer/tutorials/website.rst:495
#: ../../../odoo/odoo/api.py:docstring of odoo.api:3
msgid "Todo"
msgstr ""
#: ../../content/developer/howtos/company.rst:229
msgid "check_company on company_dependent fields."
msgstr ""
#: ../../content/developer/howtos/connect_device.rst:3
msgid "Connect with a device"
msgstr ""
#: ../../content/developer/howtos/connect_device.rst:5
msgid "IoT Drivers allow any Odoo module to communicate in real-time with any device connected to the IoT Box. Communication with the IoT Box goes both ways, so the Odoo client can send commands to and receive information from any of the supported devices."
msgstr ""
#: ../../content/developer/howtos/connect_device.rst:10
msgid "To add support for a device, all we need is:"
msgstr ""
#: ../../content/developer/howtos/connect_device.rst:12
msgid "an `Interface`, to detect connected devices of a specific type"
msgstr ""
#: ../../content/developer/howtos/connect_device.rst:13
msgid "a `Driver`, to communicate with an individual device"
msgstr ""
#: ../../content/developer/howtos/connect_device.rst:15
msgid "At each boot, the IoT Box will load all of the Interfaces and Drivers that can be located on the connected Odoo instance. Each module can contain an `iot_handlers` directory that will be copied to the IoT Box. The structure of this directory is the following"
msgstr ""
#: ../../content/developer/howtos/connect_device.rst:34
msgid "Detect Devices"
msgstr ""
#: ../../content/developer/howtos/connect_device.rst:36
msgid "Devices connected to the IoT Box are detected through `Interfaces`. There is an Interface for each supported connection type (USB, Bluetooth, Video, Printers, Serial, etc.). The interface maintains a list of detected devices and associates them with the right Driver."
msgstr ""
#: ../../content/developer/howtos/connect_device.rst:41
msgid "Supported devices will appear both on the IoT Box Homepage that you can access through its IP address and in the IoT module of the connected Odoo instance."
msgstr ""
#: ../../content/developer/howtos/connect_device.rst:45
msgid "Interface"
msgstr ""
#: ../../content/developer/howtos/connect_device.rst:47
msgid "The role of the Interface is to maintain a list of devices connected through a determined connection type. Creating a new interface requires"
msgstr ""
#: ../../content/developer/howtos/connect_device.rst:50
msgid "Extending the `Interface` class"
msgstr ""
#: ../../content/developer/howtos/connect_device.rst:51
msgid "Setting the `connection_type` class attribute"
msgstr ""
#: ../../content/developer/howtos/connect_device.rst:52
msgid "Implementing the `get_devices` method, that should return a dictionary containing data about each detected device. This data will be given as argument to the constructors and `supported` method of the Drivers."
msgstr ""
#: ../../content/developer/howtos/connect_device.rst:57
msgid "Setting the `_loop_delay` attribute will modify the interval between calls to `get_devices`. By default, this interval is set to 3 seconds."
msgstr ""
#: ../../content/developer/howtos/connect_device.rst:74
msgid "Driver"
msgstr ""
#: ../../content/developer/howtos/connect_device.rst:76
msgid "Once the interface has retrieved the list of detected devices, it will loop through all of the Drivers that have the same `connection_type` attribute and test their respective `supported` method on all detected devices. If the supported method of a Driver returns `True`, an instance of this Driver will be created for the corresponding device."
msgstr ""
#: ../../content/developer/howtos/connect_device.rst:83
msgid "`supported` methods of drivers are given a priority order. The `supported` method of a child class will always be tested before the one of its parent. This priority can be adjusted by modifying the `priority` attribute of the Driver."
msgstr ""
#: ../../content/developer/howtos/connect_device.rst:88
msgid "Creating a new Driver requires:"
msgstr ""
#: ../../content/developer/howtos/connect_device.rst:90
msgid "Extending `Driver`"
msgstr ""
#: ../../content/developer/howtos/connect_device.rst:91
msgid "Setting the `connection_type` class attribute."
msgstr ""
#: ../../content/developer/howtos/connect_device.rst:92
msgid "Setting the `device_type`, `device_connection` and `device_name` attributes."
msgstr ""
#: ../../content/developer/howtos/connect_device.rst:93
msgid "Defining the `supported` method"
msgstr ""
#: ../../content/developer/howtos/connect_device.rst:113
msgid "Communicate With Devices"
msgstr ""
#: ../../content/developer/howtos/connect_device.rst:115
msgid "Once your new device is detected and appears in the IoT module, the next step is to communicate with it. Since the box only has a local IP address, it can only be reached from the same local network. Communication, therefore, needs to happen on the browser-side, in JavaScript."
msgstr ""
#: ../../content/developer/howtos/connect_device.rst:120
msgid "The process depends on the direction of the communication: - From the browser to the box, through `Actions`_ - From the box to the browser, through `Longpolling`_"
msgstr ""
#: ../../content/developer/howtos/connect_device.rst:124
msgid "Both channels are accessed from the same JS object, the `DeviceProxy`, which is instantiated using the IP of the IoT Box and the device identifier."
msgstr ""
#: ../../content/developer/howtos/connect_device.rst:137
#: ../../content/developer/howtos/website_themes/forms.rst:33
#: ../../content/developer/reference/backend/actions.rst:3
#: ../../content/developer/tutorials/getting_started/06_firstui.rst:47
msgid "Actions"
msgstr ""
#: ../../content/developer/howtos/connect_device.rst:139
msgid "Actions are used to tell a selected device to execute a specific action, such as taking a picture, printing a receipt, etc."
msgstr ""
#: ../../content/developer/howtos/connect_device.rst:143
msgid "It must be noted that no “answer” will be sent by the box on this route, only the request status. The answer to the action, if any, has to be retrieved via the longpolling."
msgstr ""
#: ../../content/developer/howtos/connect_device.rst:147
msgid "An action can be performed on the DeviceProxy Object."
msgstr ""
#: ../../content/developer/howtos/connect_device.rst:153
msgid "In your driver, define an `action` method that will be executed when called from an Odoo module. It takes the data given during the call as argument."
msgstr ""
#: ../../content/developer/howtos/connect_device.rst:162
msgid "Longpolling"
msgstr ""
#: ../../content/developer/howtos/connect_device.rst:164
msgid "When any module in Odoo wants to read data from a specific device, it creates a listener identified by the IP/domain of the box and the device identifier and passes it a callback function to be called every time the device status changes. The callback is called with the new data as argument."
msgstr ""
#: ../../content/developer/howtos/connect_device.rst:177
msgid "In the Driver, an event is released by calling the `device_changed` function from the `event_manager`. All callbacks set on the listener will then be called with `self.data` as argument."
msgstr ""
#: ../../content/developer/howtos/create_reports.rst:3
msgid "Create customized reports"
msgstr ""
#: ../../content/developer/howtos/create_reports.rst:5
msgid "SQL views are a technique for creating customized reports to show data that cannot be shown with existing models' fields and views. In other words, this technique helps avoid unnecessary creation and calculation of additional fields solely for data analysis purposes."
msgstr ""
#: ../../content/developer/howtos/create_reports.rst:11
msgid "Create a model"
msgstr ""
#: ../../content/developer/howtos/create_reports.rst:13
msgid "A SQL view is created in a similar manner as a standard model:"
msgstr ""
#: ../../content/developer/howtos/create_reports.rst:26
msgid "Where the attributes:"
msgstr ""
#: ../../content/developer/howtos/create_reports.rst:28
msgid "`_auto = False` indicates that we do not want to store the model in the database"
msgstr ""
#: ../../content/developer/howtos/create_reports.rst:29
msgid "`_rec_name` indicates which of the model's fields represents a record's name (i.e. the name that will be used in the navigation breadcrumb when opening a record's form view)"
msgstr ""
#: ../../content/developer/howtos/create_reports.rst:32
msgid "and its fields are defined in the same way as a standard model, except every field is marked as `readonly=True`."
msgstr ""
#: ../../content/developer/howtos/create_reports.rst:36
msgid "Don't forget to add your new model to your security file."
msgstr ""
#: ../../content/developer/howtos/create_reports.rst:39
msgid "Populate the model"
msgstr ""
#: ../../content/developer/howtos/create_reports.rst:41
msgid "There are 2 ways to populate a SQL view's table:"
msgstr ""
#: ../../content/developer/howtos/create_reports.rst:43
msgid "override the `BaseModel.init()` method,"
msgstr ""
#: ../../content/developer/howtos/create_reports.rst:44
msgid "set the `_table_query` property."
msgstr ""
#: ../../content/developer/howtos/create_reports.rst:46
msgid "Regardless of which way is used, a SQL query will be executed to populate the model. Therefore, any SQL commands can be used to collect and/or calculate the data needed and you are expected to keep in mind that you are bypassing the ORM (i.e. it is a good idea to read through :ref:`reference/security` if you haven't already). The columns returned from the `SELECT` will populate the model's fields, so ensure that your column names match your field names, or use alias names that match."
msgstr ""
#: ../../content/developer/howtos/create_reports.rst:55
msgid "Overriding `BaseModel.init()`"
msgstr ""
#: ../../content/developer/howtos/create_reports.rst:57
msgid "In most cases, overriding the `BaseModel.init()` method is the standard and better option to use. It requires the import of `tools` and is typically written as follows:"
msgstr ""
#: ../../content/developer/howtos/create_reports.rst:71
msgid "`tools.drop_view_if_exists` ensures that a conflicting view is not created when the SQL query is executed. It is standard to separate the different parts of the query to allow for easier model extension. Exactly how the query is split up across methods is not standardized, but at minimum, the `_select` and `_from` methods are common, and of course, all these methods will return strings."
msgstr ""
#: ../../content/developer/howtos/create_reports.rst:78
msgid "`Example: a SQL view using an override of BaseModel.init() <https://github.com/odoo/odoo/blob/17.0/addons/project/report/project_report.py>`_"
msgstr ""
#: ../../content/developer/howtos/create_reports.rst:81
msgid "Using `_table_query`"
msgstr ""
#: ../../content/developer/howtos/create_reports.rst:83
msgid "The ``_table_query`` property is used when the view depends on the context. It is typically written as follows:"
msgstr ""
#: ../../content/developer/howtos/create_reports.rst:92
msgid "and follows the same `_select` and `_from` methods standards as `BaseModel.init()`."
msgstr ""
#: ../../content/developer/howtos/create_reports.rst:94
msgid "An example of when the property should be used instead of overriding `BaseModel.init()` is in a multi-company and multi-currency environment where currency related amounts need to be converted using currency exchange rates when the user switches between companies."
msgstr ""
#: ../../content/developer/howtos/create_reports.rst:99
msgid "`Example: a SQL view using _table_query <https://github.com/odoo/odoo/blob/17.0/addons/account/report/account_invoice_report.py>`_"
msgstr ""
#: ../../content/developer/howtos/create_reports.rst:103
msgid "Use the model"
msgstr ""
#: ../../content/developer/howtos/create_reports.rst:105
msgid "Views and menu items for your SQL views are created and used in the same way as any other Odoo model. You are all set to start using your SQL view. Have fun!"
msgstr ""
#: ../../content/developer/howtos/create_reports.rst:109
msgid "Extra tips"
msgstr ""
#: ../../content/developer/howtos/create_reports.rst:112
msgid "A common mistake in SQL views is not considering the duplication of certain data due to table JOINs. This can lead to miscounting when using a field's `group_operator` and/or the pivot view. It is best to test your SQL view with sufficient data to ensure the resulting field values are as you expect."
msgstr ""
#: ../../content/developer/howtos/create_reports.rst:118
msgid "If you have a field that you do not want as a measure (i.e., in your pivot or graph views), add `store=False` to it, and it will not show."
msgstr ""
#: ../../content/developer/howtos/javascript_client_action.rst:6
msgid "Create a client action"
msgstr ""
#: ../../content/developer/howtos/javascript_client_action.rst:8
msgid "A client action triggers an action that is entirely implemented in the client side. One of the benefits of using a client action is the ability to create highly customized interfaces with ease. A client action is typically defined by an OWL component; we can also use the web framework and use services, core components, hooks,..."
msgstr ""
#: ../../content/developer/howtos/javascript_client_action.rst:13
msgid "Create the :ref:`client action <reference/actions/client>`, don't forget to make it accessible."
msgstr ""
#: ../../content/developer/howtos/javascript_client_action.rst:23
msgid "Create a component that represents the client action."
msgstr ""
#: ../../content/developer/howtos/javascript_client_action.rst:25
msgid ":file:`my_client_action.js`"
msgstr ""
#: ../../content/developer/howtos/javascript_client_action.rst:40
msgid ":file:`my_client_action.xml`"
msgstr ""
#: ../../content/developer/howtos/javascript_field.rst:4
msgid "Customize a field"
msgstr ""
#: ../../content/developer/howtos/javascript_field.rst:7
msgid "Subclass an existing field component"
msgstr ""
#: ../../content/developer/howtos/javascript_field.rst:9
msgid "Let's take an example where we want to extends the `BooleanField` to create a boolean field displaying \"Late!\" in red whenever the checkbox is checked."
msgstr ""
#: ../../content/developer/howtos/javascript_field.rst:12
msgid "Create a new widget component extending the desired field component."
msgstr ""
#: ../../content/developer/howtos/javascript_field.rst:14
#: ../../content/developer/howtos/javascript_field.rst:45
msgid ":file:`late_order_boolean_field.js`"
msgstr ""
#: ../../content/developer/howtos/javascript_field.rst:26
msgid "Create the field template."
msgstr ""
#: ../../content/developer/howtos/javascript_field.rst:28
msgid "The component uses a new template with the name `my_module.LateOrderBooleanField`. Create it by inheriting the current template of the `BooleanField`."
msgstr ""
#: ../../content/developer/howtos/javascript_field.rst:31
msgid ":file:`late_order_boolean_field.xml`"
msgstr ""
#: ../../content/developer/howtos/javascript_field.rst:43
msgid "Register the component to the fields registry."
msgstr ""
#: ../../content/developer/howtos/javascript_field.rst:50
#: ../../content/developer/howtos/javascript_field.rst:103
msgid "Add the widget in the view arch as an attribute of the field."
msgstr ""
#: ../../content/developer/howtos/javascript_field.rst:57
msgid "Create a new field component"
msgstr ""
#: ../../content/developer/howtos/javascript_field.rst:59
msgid "Assume that we want to create a field that displays a simple text in red."
msgstr ""
#: ../../content/developer/howtos/javascript_field.rst:61
msgid "Create a new Owl component representing our new field"
msgstr ""
#: ../../content/developer/howtos/javascript_field.rst:63
#: ../../content/developer/howtos/javascript_field.rst:96
msgid ":file:`my_text_field.js`"
msgstr ""
#: ../../content/developer/howtos/javascript_field.rst:90
msgid "The imported `standardFieldProps` contains the standard props passed by the `View` such as the `update` function to update the value, the `type` of the field in the model, the `readonly` boolean, and others."
msgstr ""
#: ../../content/developer/howtos/javascript_field.rst:94
msgid "In the same file, register the component to the fields registry."
msgstr ""
#: ../../content/developer/howtos/javascript_field.rst:101
msgid "This maps the widget name in the arch to its actual component."
msgstr ""
#: ../../content/developer/howtos/javascript_view.rst:3
msgid "Customize a view type"
msgstr ""
#: ../../content/developer/howtos/javascript_view.rst:6
msgid "Subclass an existing view"
msgstr ""
#: ../../content/developer/howtos/javascript_view.rst:8
msgid "Assume we need to create a custom version of a generic view. For example, a kanban view with some extra ribbon-like widget on top (to display some specific custom information). In that case, this can be done in a few steps:"
msgstr ""
#: ../../content/developer/howtos/javascript_view.rst:12
msgid "Extend the kanban controller/renderer/model and register it in the view registry."
msgstr ""
#: ../../content/developer/howtos/javascript_view.rst:14
msgid ":file:`custom_kanban_controller.js`"
msgstr ""
#: ../../content/developer/howtos/javascript_view.rst:39
msgid "In our custom kanban, we defined a new template. We can either inherit the kanban controller template and add our template pieces or we can define a completely new template."
msgstr ""
#: ../../content/developer/howtos/javascript_view.rst:42
msgid ":file:`custom_kanban_controller.xml`"
msgstr ""
#: ../../content/developer/howtos/javascript_view.rst:56
msgid "Use the view with the `js_class` attribute in arch."
msgstr ""
#: ../../content/developer/howtos/javascript_view.rst:68
msgid "The possibilities for extending views are endless. While we have only extended the controller here, you can also extend the renderer to add new buttons, modify how records are presented, or customize the dropdown, as well as extend other components such as the model and `buttonTemplate`."
msgstr ""
#: ../../content/developer/howtos/javascript_view.rst:73
msgid "Create a new view from scratch"
msgstr ""
#: ../../content/developer/howtos/javascript_view.rst:75
msgid "Creating a new view is an advanced topic. This guide highlight only the essential steps."
msgstr ""
#: ../../content/developer/howtos/javascript_view.rst:77
msgid "Create the controller."
msgstr ""
#: ../../content/developer/howtos/javascript_view.rst:79
msgid "The primary role of a controller is to facilitate the coordination between various components of a view, such as the Renderer, Model, and Layout."
msgstr ""
#: ../../content/developer/howtos/javascript_view.rst:82
msgid ":file:`beautiful_controller.js`"
msgstr ""
#: ../../content/developer/howtos/javascript_view.rst:116
msgid "The template of the Controller displays the control panel with Layout and also the renderer."
msgstr ""
#: ../../content/developer/howtos/javascript_view.rst:119
msgid ":file:`beautiful_controller.xml`"
msgstr ""
#: ../../content/developer/howtos/javascript_view.rst:131
msgid "Create the renderer."
msgstr ""
#: ../../content/developer/howtos/javascript_view.rst:133
msgid "The primary function of a renderer is to generate a visual representation of data by rendering the view that includes records."
msgstr ""
#: ../../content/developer/howtos/javascript_view.rst:136
msgid ":file:`beautiful_renderer.js`"
msgstr ""
#: ../../content/developer/howtos/javascript_view.rst:144
msgid ":file:`beautiful_renderer.xml`"
msgstr ""
#: ../../content/developer/howtos/javascript_view.rst:157
msgid "Create the model."
msgstr ""
#: ../../content/developer/howtos/javascript_view.rst:159
msgid "The role of the model is to retrieve and manage all the necessary data in the view."
msgstr ""
#: ../../content/developer/howtos/javascript_view.rst:161
msgid ":file:`beautiful_model.js`"
msgstr ""
#: ../../content/developer/howtos/javascript_view.rst:192
msgid "For advanced cases, instead of creating a model from scratch, it is also possible to use `RelationalModel`, which is used by other views."
msgstr ""
#: ../../content/developer/howtos/javascript_view.rst:195
msgid "Create the arch parser."
msgstr ""
#: ../../content/developer/howtos/javascript_view.rst:197
msgid "The role of the arch parser is to parse the arch view so the view has access to the information."
msgstr ""
#: ../../content/developer/howtos/javascript_view.rst:199
msgid ":file:`beautiful_arch_parser.js`"
msgstr ""
#: ../../content/developer/howtos/javascript_view.rst:216
msgid "Create the view and combine all the pieces together, then register the view in the views registry."
msgstr ""
#: ../../content/developer/howtos/javascript_view.rst:219
msgid ":file:`beautiful_view.js`"
msgstr ""
#: ../../content/developer/howtos/javascript_view.rst:256
msgid "Declare the :ref:`view <reference/view_records/structure>` in the arch."
msgstr ""
#: ../../content/developer/howtos/scss_tips.rst:3
msgid "Write lean easy-to-maintain CSS"
msgstr ""
#: ../../content/developer/howtos/scss_tips.rst:5
msgid "There are many ways to lean and simplify SCSS. The first step is to establish if custom code is needed at all."
msgstr ""
#: ../../content/developer/howtos/scss_tips.rst:8
msgid "Odoo's webclient has been designed to be modular, meaning that (potentially all) classes can be shared across views. Check the code before creating a new class. Chances are that there is already a class or an HTML tag doing exactly what you're looking for."
msgstr ""
#: ../../content/developer/howtos/scss_tips.rst:12
msgid "On top of that, Odoo relies on `Bootstrap <https://getbootstrap.com/docs/5.1/getting-started/introduction/>`_ (BS), one of the most complete CSS frameworks available. The framework has been customized in order to match Odoo's design (both community and enterprise versions), meaning that you can use any BS class directly in Odoo and achieve a visual result that is consistent with our UI."
msgstr ""
#: ../../content/developer/howtos/scss_tips.rst:19
msgid "The fact that a class achieves the desired visual result doesn't necessarily mean that it's the right one for the job. Be aware of classes triggering JS behaviors, for example."
msgstr ""
#: ../../content/developer/howtos/scss_tips.rst:21
msgid "Be careful about class semantics. Applying a **button class** to a **title** is not only semantically wrong, it may also lead to migration issues and visual inconsistencies."
msgstr ""
#: ../../content/developer/howtos/scss_tips.rst:24
msgid "The following sections describe tips to strip-down SCSS lines **when custom-code is the only way to go**."
msgstr ""
#: ../../content/developer/howtos/scss_tips.rst:30
msgid "Browser defaults"
msgstr ""
#: ../../content/developer/howtos/scss_tips.rst:32
msgid "By default, each browser renders content using a *user agent stylesheet*. To overcome inconsistencies between browsers, some of these rules are overridden by `Bootstrap Reboot <https://getbootstrap.com/docs/5.1/content/reboot/>`_."
msgstr ""
#: ../../content/developer/howtos/scss_tips.rst:36
msgid "At this stage all \"browser-specific-decoration\" rules have been stripped away, but a big chunk of rules defining basic layout information is maintained (or reinforced by *Reboot* for consistency reasons)."
msgstr ""
#: ../../content/developer/howtos/scss_tips.rst:40
msgid "You can rely on these rules."
msgstr ""
#: ../../content/developer/howtos/scss_tips.rst:44
msgid "Applying `display: block;` to a `<div/>` is normally not necessary."
msgstr ""
#: ../../content/developer/howtos/scss_tips.rst:55
msgid "In this instance, you may opt to switching the HTML tag rather than adding a new CSS rule."
msgstr ""
#: ../../content/developer/howtos/scss_tips.rst:65
msgid "Here's a non-comprehensive list of default rules:"
msgstr ""
#: ../../content/developer/howtos/scss_tips.rst:70
msgid "Tag / Attribute"
msgstr ""
#: ../../content/developer/howtos/scss_tips.rst:71
msgid "Defaults"
msgstr ""
#: ../../content/developer/howtos/scss_tips.rst:72
msgid "`<div/>`, `<section/>`, `<header/>`, `<footer/>`..."
msgstr ""
#: ../../content/developer/howtos/scss_tips.rst:73
msgid "`display: block`"
msgstr ""
#: ../../content/developer/howtos/scss_tips.rst:74
msgid "`<span/>`, `<a/>`, `<em/>`, `<b/>`..."
msgstr ""
#: ../../content/developer/howtos/scss_tips.rst:75
msgid "`display: inline`"
msgstr ""
#: ../../content/developer/howtos/scss_tips.rst:76
msgid "`<button/>`, `<label/>`, `<output/>`..."
msgstr ""
#: ../../content/developer/howtos/scss_tips.rst:77
msgid "`display: inline-block`"
msgstr ""
#: ../../content/developer/howtos/scss_tips.rst:78
msgid "`<img/>`, `<svg/>`"
msgstr ""
#: ../../content/developer/howtos/scss_tips.rst:79
msgid "`vertical-align: middle`"
msgstr ""
#: ../../content/developer/howtos/scss_tips.rst:80
msgid "`<summary/>`, `[role=\"button\"]`"
msgstr ""
#: ../../content/developer/howtos/scss_tips.rst:81
msgid "`cursor: pointer;`"
msgstr ""
#: ../../content/developer/howtos/scss_tips.rst:82
msgid "`<q/>`"
msgstr ""
#: ../../content/developer/howtos/scss_tips.rst:0
msgid "`:before {content: open-quote}`"
msgstr ""
#: ../../content/developer/howtos/scss_tips.rst:0
msgid "`:after {content: close-quote}`"
msgstr ""
#: ../../content/developer/howtos/scss_tips.rst:85
#: ../../content/developer/howtos/scss_tips.rst:86
#: ../../content/developer/howtos/upgrade_custom_db.rst:111
#: ../../content/developer/howtos/website_themes/shapes.rst:139
msgid "..."
msgstr ""
#: ../../content/developer/howtos/scss_tips.rst:89
msgid "`Bootstrap Reboot on GitHub <https://github.com/twbs/bootstrap/blob/1a6fdfae6b/scss/_reboot.scss>`_"
msgstr ""
#: ../../content/developer/howtos/scss_tips.rst:95
msgid "HTML tags"
msgstr ""
#: ../../content/developer/howtos/scss_tips.rst:97
msgid "It may seem obvious, but the simplest and most **consistent** way of making text look like a title is to use a header tag (`<h1>`, `<h2>`, ...). Besides reboot rules, mostly all tags carry decorative styles defined by Odoo."
msgstr ""
#: ../../content/developer/howtos/scss_tips.rst:106
msgid "Don't"
msgstr ""
#: ../../content/developer/howtos/scss_tips.rst:138
msgid "Do"
msgstr ""
#: ../../content/developer/howtos/scss_tips.rst:163
msgid "Besides reducing the amount of code, a modular-design approach (use classes, tags, mixins...) keeps the visual result consistent and easily **maintainable**."
msgstr ""
#: ../../content/developer/howtos/scss_tips.rst:166
msgid "Following the last example, if Odoo titles' design changes, these changes will be applied in the `o_module_custom_title` element too since it's using an `<h5>` tag."
msgstr ""
#: ../../content/developer/howtos/scss_tips.rst:172
msgid "Utility classes"
msgstr ""
#: ../../content/developer/howtos/scss_tips.rst:174
msgid "Our framework defines a multitude of utility classes designed to cover almost all layout/design/interaction needs. The simple fact that a class already exists justifies its use over custom CSS whenever possible."
msgstr ""
#: ../../content/developer/howtos/scss_tips.rst:178
msgid "Take the example of `position-relative`."
msgstr ""
#: ../../content/developer/howtos/scss_tips.rst:186
msgid "Since a utility-class is defined, any CSS line with the declaration `position: relative` is **potentially** redundant."
msgstr ""
#: ../../content/developer/howtos/scss_tips.rst:189
msgid "Odoo relies on the default `Bootstrap utility-classes <https://getbootstrap.com/docs/5.1/utilities/background/>`_ stack and defines its own using `Bootstrap API <https://getbootstrap.com/docs/5.1/utilities/api/>`_."
msgstr ""
#: ../../content/developer/howtos/scss_tips.rst:194
msgid "`Bootstrap utility classes <https://getbootstrap.com/docs/5.1/utilities/api/>`_"
msgstr ""
#: ../../content/developer/howtos/scss_tips.rst:195
msgid "`Odoo custom utilities on github <https://github.com/odoo/odoo/blob/17.0/addons/web/static/src/scss/utilities_custom.scss>`_"
msgstr ""
#: ../../content/developer/howtos/scss_tips.rst:201
msgid "Handling utility-classes verbosity"
msgstr ""
#: ../../content/developer/howtos/scss_tips.rst:203
msgid "The downside of utility-classes is the potential lack of readability."
msgstr ""
#: ../../content/developer/howtos/scss_tips.rst:214
msgid "To overcome the issue you may combine different approaches:"
msgstr ""
#: ../../content/developer/howtos/scss_tips.rst:216
msgid "in Qweb attributes, only use classes to be toggled *on-the-fly*;"
msgstr ""
#: ../../content/developer/howtos/scss_tips.rst:217
msgid "use new lines for each attribute;"
msgstr ""
#: ../../content/developer/howtos/scss_tips.rst:218
msgid "order classes using the convention `[odoo component] [bootstrap component] [css declaration order]`."
msgstr ""
#: ../../content/developer/howtos/scss_tips.rst:233
msgid ":ref:`Odoo CSS properties order <contributing/coding_guidelines/scss/properties_order>`"
msgstr ""
#: ../../content/developer/howtos/standalone_owl_application.rst:3
msgid "Create a standalone Owl application"
msgstr ""
#: ../../content/developer/howtos/standalone_owl_application.rst:5
msgid "For any number of reasons, you may want to have a standalone Owl application that isn't a part of the web client. One example in Odoo is the self-ordering application, that lets customers order food from their phone. In this chapter we will go into what's required to achieve something like this."
msgstr ""
#: ../../content/developer/howtos/standalone_owl_application.rst:10
#: ../../content/developer/reference/extract_api.rst:22
#: ../../content/developer/reference/frontend/javascript_reference.rst:17
#: ../../content/developer/reference/frontend/services.rst:144
#: ../../content/developer/reference/frontend/services.rst:182
#: ../../content/developer/reference/frontend/services.rst:362
#: ../../content/developer/reference/frontend/services.rst:408
#: ../../content/developer/reference/frontend/services.rst:522
#: ../../content/developer/reference/frontend/services.rst:612
#: ../../content/developer/reference/frontend/services.rst:708
#: ../../content/developer/reference/frontend/services.rst:759
#: ../../content/developer/reference/frontend/services.rst:834
#: ../../content/developer/reference/user_interface/scss_inheritance.rst:6
msgid "Overview"
msgstr ""
#: ../../content/developer/howtos/standalone_owl_application.rst:12
msgid "To have a standalone Owl app, a few things are required:"
msgstr ""
#: ../../content/developer/howtos/standalone_owl_application.rst:14
msgid "a root component for the application"
msgstr ""
#: ../../content/developer/howtos/standalone_owl_application.rst:15
msgid "an assets bundle that contains the setup code"
msgstr ""
#: ../../content/developer/howtos/standalone_owl_application.rst:16
msgid "a QWeb view that calls the assets bundle"
msgstr ""
#: ../../content/developer/howtos/standalone_owl_application.rst:17
msgid "a controller that renders the view"
msgstr ""
#: ../../content/developer/howtos/standalone_owl_application.rst:20
msgid "1. Root component"
msgstr ""
#: ../../content/developer/howtos/standalone_owl_application.rst:22
msgid "To keep things simple, let's start with a very straightforward component that just renders \"Hello, World!\". This will let us know at a glance if our setup is working."
msgstr ""
#: ../../content/developer/howtos/standalone_owl_application.rst:25
msgid "First, create the template in :file:`/your_module/static/src/standalone_app/root.xml`."
msgstr ""
#: ../../content/developer/howtos/standalone_owl_application.rst:36
msgid "Then create the JavaScript file for that component in :file:`/your_module/static/src/standalone_app/root.js`."
msgstr ""
#: ../../content/developer/howtos/standalone_owl_application.rst:48
msgid "It's generally a good idea to have the application setup code that mounts the component in a separate file. Create the JavaScript file that will mount the app in :file:`/your_module/static/src/standalone_app/app.js`."
msgstr ""
#: ../../content/developer/howtos/standalone_owl_application.rst:60
msgid "The `mountComponent` utility function will take care of creating the Owl application and configuring it correctly: it will create an environment, start the :ref:`services<frontend/services>`, make sure the app is translated and give the app access to the templates from your assets bundle, among other things."
msgstr ""
#: ../../content/developer/howtos/standalone_owl_application.rst:66
msgid ":ref:`Owl components reference<frontend/components>`."
msgstr ""
#: ../../content/developer/howtos/standalone_owl_application.rst:70
msgid "2. Creating an assets bundle containing our code"
msgstr ""
#: ../../content/developer/howtos/standalone_owl_application.rst:72
msgid "In the manifest of your module, create a new :ref:`assets bundle<reference/assets_bundle>`. It should include the `web._assets_core` bundle, which contains the Odoo JavaScript framework and the core libraries it needs (e.g. Owl and luxon), after which you can have a glob that adds all the files for your application in the bundle."
msgstr ""
#: ../../content/developer/howtos/standalone_owl_application.rst:94
msgid "The other lines are bundles and scss files that are required to make Bootstrap work. They are mandatory, as the components of the web framework use bootstrap classes for their styling and layout."
msgstr ""
#: ../../content/developer/howtos/standalone_owl_application.rst:99
msgid "Make sure that the files for your standalone app are only added to this bundle, if you already have a definition for `web.assets_backend` or `web.assets_frontend` and they have globs, make sure these globs don't match the files for your standalone app, otherwise the startup code for your app will conflict with the existing startup code in those bundles."
msgstr ""
#: ../../content/developer/howtos/standalone_owl_application.rst:105
msgid ":ref:`Module manifest reference<reference/module/manifest>`."
msgstr ""
#: ../../content/developer/howtos/standalone_owl_application.rst:108
msgid "3. XML view that calls the assets bundle"
msgstr ""
#: ../../content/developer/howtos/standalone_owl_application.rst:110
msgid "Now that we have created our assets bundle, we need to create a :ref:`QWeb view <reference/view_architectures/qweb>` that uses that assets bundle."
msgstr ""
#: ../../content/developer/howtos/standalone_owl_application.rst:134
msgid "This template only does two things: it initializes the `odoo` global variable, then calls the assets bundle we just defined. Initializing the `odoo` global variable is a necessary step. This variable should be an object that contains the following:"
msgstr ""
#: ../../content/developer/howtos/standalone_owl_application.rst:138
msgid "The CSRF token, which is required to interact with HTTP controllers in many cases."
msgstr ""
#: ../../content/developer/howtos/standalone_owl_application.rst:139
msgid "The debug value, which is used in many places to add additional logging or developer-friendly checks."
msgstr ""
#: ../../content/developer/howtos/standalone_owl_application.rst:140
msgid "`__session_info__`, that contains information from the server that is always needed and for which we don't want to perform an additional request. More on this in the next section."
msgstr ""
#: ../../content/developer/howtos/standalone_owl_application.rst:144
msgid "4. Controller that renders the view"
msgstr ""
#: ../../content/developer/howtos/standalone_owl_application.rst:146
msgid "Now that we have the view, we need to make it accessible to the user. For that purpose, we will create an :ref:`HTTP controller<reference/controllers>` that renders that view and returns it to the user."
msgstr ""
#: ../../content/developer/howtos/standalone_owl_application.rst:163
msgid "Notice how we're giving the template `session_info`. We get it from the `get_frontend_session_info` method, and it will end up containing information used by the web framework, such as the current user's ID if they are logged in, the server version, the Odoo edition, etc."
msgstr ""
#: ../../content/developer/howtos/standalone_owl_application.rst:167
msgid "At this point, if you open the url `/your_module/standalone_app` in your brower, you should see a blank page with the text \"Hello, World!\". At this point, you can start actually writing the code for your app."
msgstr ""
#: ../../content/developer/howtos/translations.rst:5
msgid "Translating Modules"
msgstr ""
#: ../../content/developer/howtos/translations.rst:7
msgid "This section explains how to provide translation abilities to your module."
msgstr ""
#: ../../content/developer/howtos/translations.rst:9
msgid "If you want to contribute to the translation of Odoo itself, please refer to the `Odoo Wiki page <https://github.com/odoo/odoo/wiki/Translations>`_."
msgstr ""
#: ../../content/developer/howtos/translations.rst:13
msgid "Exporting translatable term"
msgstr ""
#: ../../content/developer/howtos/translations.rst:15
msgid "A number of terms in your modules are implicitly translatable. As a result, even if you haven't done any specific work towards translation, you can export your module's translatable terms and may find content to work with."
msgstr ""
#: ../../content/developer/howtos/translations.rst:19
msgid "needs technical features"
msgstr ""
#: ../../content/developer/howtos/translations.rst:21
msgid "Translations export is performed via the administration interface by logging into the backend interface and opening :menuselection:`Settings --> Translations --> Import / Export --> Export Translations`"
msgstr ""
#: ../../content/developer/howtos/translations.rst:25
msgid "leave the language to the default (new language/empty template)"
msgstr ""
#: ../../content/developer/howtos/translations.rst:26
msgid "select the `PO File`_ format"
msgstr ""
#: ../../content/developer/howtos/translations.rst:27
msgid "select your module"
msgstr ""
#: ../../content/developer/howtos/translations.rst:28
msgid "click :guilabel:`Export` and download the file"
msgstr ""
#: ../../content/developer/howtos/translations.rst:34
msgid "This gives you a file called :file:`{yourmodule}.pot` which should be moved to the :file:`{yourmodule}/i18n/` directory. The file is a *PO Template* which simply lists translatable strings and from which actual translations (PO files) can be created. PO files can be created using msginit_, with a dedicated translation tool like POEdit_ or by simply copying the template to a new file called :file:`{language}.po`. Translation files should be put in :file:`{yourmodule}/i18n/`, next to :file:`{yourmodule}.pot`, and will be automatically loaded by Odoo when the corresponding language is installed (via :menuselection:`Settings --> Translations --> Languages`)"
msgstr ""
#: ../../content/developer/howtos/translations.rst:44
msgid "translations for all loaded languages are also installed or updated when installing or updating a module"
msgstr ""
#: ../../content/developer/howtos/translations.rst:48
msgid "Implicit exports"
msgstr ""
#: ../../content/developer/howtos/translations.rst:50
msgid "Odoo automatically exports translatable strings from \"data\"-type content:"
msgstr ""
#: ../../content/developer/howtos/translations.rst:52
msgid "in non-QWeb views, all text nodes are exported as well as the content of the ``string``, ``help``, ``sum``, ``confirm`` and ``placeholder`` attributes"
msgstr ""
#: ../../content/developer/howtos/translations.rst:55
msgid "QWeb templates (both server-side and client-side), all text nodes are exported except inside ``t-translation=\"off\"`` blocks, the content of the ``title``, ``alt``, ``label`` and ``placeholder`` attributes are also exported"
msgstr ""
#: ../../content/developer/howtos/translations.rst:59
msgid "for :class:`~odoo.fields.Field`, unless their model is marked with ``_translate = False``:"
msgstr ""
#: ../../content/developer/howtos/translations.rst:62
msgid "their ``string`` and ``help`` attributes are exported"
msgstr ""
#: ../../content/developer/howtos/translations.rst:63
msgid "if ``selection`` is present and a list (or tuple), it's exported"
msgstr ""
#: ../../content/developer/howtos/translations.rst:64
msgid "if their ``translate`` attribute is set to ``True``, all of their existing values (across all records) are exported"
msgstr ""
#: ../../content/developer/howtos/translations.rst:66
msgid "help/error messages of :attr:`~odoo.models.Model._constraints` and :attr:`~odoo.models.Model._sql_constraints` are exported"
msgstr ""
#: ../../content/developer/howtos/translations.rst:70
msgid "Explicit exports"
msgstr ""
#: ../../content/developer/howtos/translations.rst:72
msgid "When it comes to more \"imperative\" situations in Python code or Javascript code, Odoo cannot automatically export translatable terms so they must be marked explicitly for export. This is done by wrapping a literal string in a function call."
msgstr ""
#: ../../content/developer/howtos/translations.rst:77
msgid "In Python, the wrapping function is :func:`odoo._`::"
msgstr ""
#: ../../content/developer/howtos/translations.rst:81
msgid "In JavaScript, the wrapping function is generally :js:func:`odoo.web._t`:"
msgstr ""
#: ../../content/developer/howtos/translations.rst:89
msgid "Only literal strings can be marked for exports, not expressions or variables. For situations where strings are formatted, this means the format string must be marked, not the formatted string"
msgstr ""
#: ../../content/developer/howtos/translations.rst:93
msgid "The lazy version of `_` and `_t` is :func:`odoo._lt` in python and :js:func:`odoo.web._lt` in javascript. The translation lookup is executed only at rendering and can be used to declare translatable properties in class methods of global variables."
msgstr ""
#: ../../content/developer/howtos/translations.rst:100
msgid "Translations of a module are **not** exposed to the front end by default and thus are not accessible from JavaScript. In order to achieve that, the module name has to be either prefixed with `website` (just like `website_sale`, `website_event` etc.) or explicitly register by implementing :func:`_get_translation_frontend_modules_name` for the `ir.http` model."
msgstr ""
#: ../../content/developer/howtos/translations.rst:106
msgid "This could look like the following::"
msgstr ""
#: ../../content/developer/howtos/translations.rst:119
msgid "Variables"
msgstr ""
#: ../../content/developer/howtos/translations.rst:121
msgid "**Don't** the extract may work but it will not translate the text correctly::"
msgstr ""
#: ../../content/developer/howtos/translations.rst:125
msgid "**Do** set the dynamic variables as a parameter of the translation lookup (this will fallback on source in case of missing placeholder in the translation)::"
msgstr ""
#: ../../content/developer/howtos/translations.rst:132
msgid "Blocks"
msgstr ""
#: ../../content/developer/howtos/translations.rst:134
msgid "**Don't** split your translation in several blocks or multiples lines::"
msgstr ""
#: ../../content/developer/howtos/translations.rst:144
msgid "**Do** keep in one block, giving the full context to translators::"
msgstr ""
#: ../../content/developer/howtos/translations.rst:155
msgid "Plural"
msgstr ""
#: ../../content/developer/howtos/translations.rst:157
msgid "**Don't** pluralize terms the English-way::"
msgstr ""
#: ../../content/developer/howtos/translations.rst:163
msgid "**Do** keep in mind every language has different plural forms::"
msgstr ""
#: ../../content/developer/howtos/translations.rst:171
msgid "Read vs Run Time"
msgstr ""
#: ../../content/developer/howtos/translations.rst:173
msgid "**Don't** invoke translation lookup at server launch::"
msgstr ""
#: ../../content/developer/howtos/translations.rst:186
msgid "**Don't** invoke translation lookup when the javascript file is read::"
msgstr ""
#: ../../content/developer/howtos/translations.rst:197
msgid "**Do** use lazy translation lookup method::"
msgstr ""
#: ../../content/developer/howtos/translations.rst:211
msgid "or **do** evaluate dynamically the translatable content::"
msgstr ""
#: ../../content/developer/howtos/translations.rst:220
msgid "**Do** in the case where the translation lookup is done when the JS file is *read*, use `_lt` instead of `_t` to translate the term when it is *used*::"
msgstr ""
#: ../../content/developer/howtos/upgrade_custom_db.rst:3
msgid "Upgrade a customized database"
msgstr ""
#: ../../content/developer/howtos/upgrade_custom_db.rst:5
msgid "Upgrading to a new version of Odoo can be challenging, especially if the database you work on contains custom modules. This page intent is to explain the technical process of upgrading a database with customized modules. Refer to :doc:`Upgrade documentation </administration/upgrade>` for guidance on how to upgrade a database without customized modules."
msgstr ""
#: ../../content/developer/howtos/upgrade_custom_db.rst:10
msgid "We consider a custom module, any module that extends the standard code of Odoo and that was not built with the Studio app. Before upgrading such a module, or before requesting its upgrade, have a look at the :ref:`upgrade/sla` to make sure who's responsible for it."
msgstr ""
#: ../../content/developer/howtos/upgrade_custom_db.rst:14
msgid "While working on what we refer to as the **custom upgrade** of your database, keep in mind the goals of an upgrade:"
msgstr ""
#: ../../content/developer/howtos/upgrade_custom_db.rst:17
msgid "Stay supported"
msgstr ""
#: ../../content/developer/howtos/upgrade_custom_db.rst:18
msgid "Get the latest features"
msgstr ""
#: ../../content/developer/howtos/upgrade_custom_db.rst:19
msgid "Enjoy the performance improvement"
msgstr ""
#: ../../content/developer/howtos/upgrade_custom_db.rst:20
msgid "Reduce the technical debt"
msgstr ""
#: ../../content/developer/howtos/upgrade_custom_db.rst:21
msgid "Benefit from security improvements"
msgstr ""
#: ../../content/developer/howtos/upgrade_custom_db.rst:23
msgid "With every new version of Odoo, changes are introduced. These changes can impact modules on which customization have been developed. This is the reason why upgrading a database that contains custom modules requires additional steps in order to upgrade the source code."
msgstr ""
#: ../../content/developer/howtos/upgrade_custom_db.rst:27
msgid "These are the steps to follow to upgrade customized databases:"
msgstr ""
#: ../../content/developer/howtos/upgrade_custom_db.rst:29
msgid ":ref:`Stop the devolopments and challenge them <upgrade_custom/stop_developments>`."
msgstr ""
#: ../../content/developer/howtos/upgrade_custom_db.rst:30
msgid ":ref:`Request an upgraded database <upgrade_custom/request_upgrade>`."
msgstr ""
#: ../../content/developer/howtos/upgrade_custom_db.rst:31
msgid ":ref:`Make your module installable on an empty database <upgrade_custom/empty_database>`."
msgstr ""
#: ../../content/developer/howtos/upgrade_custom_db.rst:32
msgid ":ref:`Make your module installable on the upgraded database <upgrade_custom/upgraded_database>`."
msgstr ""
#: ../../content/developer/howtos/upgrade_custom_db.rst:33
msgid ":ref:`Test extensively and do a rehearsal <upgrade_custom/testing_rehearsal>`."
msgstr ""
#: ../../content/developer/howtos/upgrade_custom_db.rst:34
msgid ":ref:`Upgrade the production database <upgrade_custom/production>`."
msgstr ""
#: ../../content/developer/howtos/upgrade_custom_db.rst:39
msgid "Step 1: Stop the developments"
msgstr ""
#: ../../content/developer/howtos/upgrade_custom_db.rst:41
msgid "Starting an upgrade requires commitment and development resources. If developments keep being made at the same time, those features will need to be re-upgraded and tested every time you change them. This is why we recommend a complete freeze of the codebase when starting the upgrade process. Needless to say, bug fixing is exempt from this recommendation."
msgstr ""
#: ../../content/developer/howtos/upgrade_custom_db.rst:46
msgid "Once you have stopped development, it is a good practice to assess the developments made and compare them with the features introduced between your current version and the version you are targeting. Challenge the developments as much as possible and find functional workarounds. Removing redundancy between your developments and the standard version of Odoo will lead to an eased upgrade process and reduce technical debt."
msgstr ""
#: ../../content/developer/howtos/upgrade_custom_db.rst:53
msgid "You can find information on the changes between versions in the `Release Notes <https:/odoo.com/page/release-notes>`_."
msgstr ""
#: ../../content/developer/howtos/upgrade_custom_db.rst:59
msgid "Step 2: Request an upgraded database"
msgstr ""
#: ../../content/developer/howtos/upgrade_custom_db.rst:61
msgid "Once the developments have stopped for the custom modules and the implemented features have been challenged to remove redundancy and unnecessary code, the next step is to request an upgraded test database. To do so, follow the steps mentioned in :ref:`upgrade/request-test-database`, depending on the hosting type of your database."
msgstr ""
#: ../../content/developer/howtos/upgrade_custom_db.rst:66
msgid "The purpose of this stage is not to start working with the custom modules in the upgraded database, but to make sure the standard upgrade process works seamlessly, and the test database is delivered properly. If that's not the case, and the upgrade request fails, request the assistance of Odoo via the `support page <https://odoo.com/help?stage=migration>`_ by selecting the option related to testing the upgrade."
msgstr ""
#: ../../content/developer/howtos/upgrade_custom_db.rst:75
msgid "Step 3: Empty database"
msgstr ""
#: ../../content/developer/howtos/upgrade_custom_db.rst:77
msgid "Before working on an upgraded test database, we recommend to make the custom developments work on an empty database in the targeted version of your upgrade. This ensures that the customization is compatible with the new version of Odoo, allows to analyze how it behaves and interacts with the new features, and guarantees that they will not cause any issues when upgrading the database."
msgstr ""
#: ../../content/developer/howtos/upgrade_custom_db.rst:82
msgid "Making the custom modules work in an empty database also helps avoid changes and wrong configurations that might be present in the production database (like studio customization, customized website pages, email templates or translations). They are not intrinsically related to the custom modules and that can raise unwanted issues in this stage of the upgrade process."
msgstr ""
#: ../../content/developer/howtos/upgrade_custom_db.rst:87
msgid "To make custom modules work on an empty database we advise to follow these steps:"
msgstr ""
#: ../../content/developer/howtos/upgrade_custom_db.rst:89
msgid ":ref:`upgrade_custom/empty_database/modules_installable`"
msgstr ""
#: ../../content/developer/howtos/upgrade_custom_db.rst:90
msgid ":ref:`upgrade_custom/empty_database/test_fixes`"
msgstr ""
#: ../../content/developer/howtos/upgrade_custom_db.rst:91
msgid ":ref:`upgrade_custom/empty_database/clean_code`"
msgstr ""
#: ../../content/developer/howtos/upgrade_custom_db.rst:92
msgid ":ref:`Make standard tests run successfully <upgrade_custom/empty_database/standard_test>`"
msgstr ""
#: ../../content/developer/howtos/upgrade_custom_db.rst:97
msgid "Make custom modules installable"
msgstr ""
#: ../../content/developer/howtos/upgrade_custom_db.rst:99
msgid "The first step is to make the custom modules installable in the new Odoo version. This means, starting by ensuring there are no tracebacks or warnings during their installation. For this, install the custom modules, one by one, in an empty database of the new Odoo version and fix the tracebacks and warnings that arise from that."
msgstr ""
#: ../../content/developer/howtos/upgrade_custom_db.rst:104
msgid "This process will help detect issues during the installation of the modules. For example:"
msgstr ""
#: ../../content/developer/howtos/upgrade_custom_db.rst:106
msgid "Invalid module dependencies."
msgstr ""
#: ../../content/developer/howtos/upgrade_custom_db.rst:107
msgid "Syntax change: assets declaration, OWL updates, attrs."
msgstr ""
#: ../../content/developer/howtos/upgrade_custom_db.rst:108
msgid "References to standard fields, models, views not existing anymore or renamed."
msgstr ""
#: ../../content/developer/howtos/upgrade_custom_db.rst:109
msgid "Xpath that moved or were removed from views."
msgstr ""
#: ../../content/developer/howtos/upgrade_custom_db.rst:110
msgid "Methods renamed or removed."
msgstr ""
#: ../../content/developer/howtos/upgrade_custom_db.rst:116
msgid "Test and fixes"
msgstr ""
#: ../../content/developer/howtos/upgrade_custom_db.rst:118
msgid "Once there are no more tracebacks when installing the modules, the next step is to test them. Even if the custom modules are installable on an empty database, this does not guarantee there are no errors during their execution. Because of this, we encourage to test thoroughly all the customization to make sure everything is working as expected."
msgstr ""
#: ../../content/developer/howtos/upgrade_custom_db.rst:123
msgid "This process will help detect further issues that are not identified during the module installation and can only be detected in runtime. For example, deprecated calls to standard python or OWL functions, non-existing references to standard fields, etc."
msgstr ""
#: ../../content/developer/howtos/upgrade_custom_db.rst:127
msgid "We recommend to test all the customization, especially the following elements:"
msgstr ""
#: ../../content/developer/howtos/upgrade_custom_db.rst:130
msgid "Email templates"
msgstr ""
#: ../../content/developer/howtos/upgrade_custom_db.rst:131
msgid "Reports"
msgstr ""
#: ../../content/developer/howtos/upgrade_custom_db.rst:132
msgid "Server actions and automated actions"
msgstr ""
#: ../../content/developer/howtos/upgrade_custom_db.rst:133
msgid "Changes in the standard workflows"
msgstr ""
#: ../../content/developer/howtos/upgrade_custom_db.rst:134
#: ../../content/developer/tutorials/backend.rst:716
msgid "Computed fields"
msgstr ""
#: ../../content/developer/howtos/upgrade_custom_db.rst:136
msgid "We also encourage to write automated tests to save time during the testing iterations, increase the test coverage, and ensure that the changes and fixes introduced do not break the existing flows. If there are tests already implemented in the customization, make sure they are upgraded to the new Odoo version and run successfully, fixing issues that might be present."
msgstr ""
#: ../../content/developer/howtos/upgrade_custom_db.rst:144
msgid "Clean the code"
msgstr ""
#: ../../content/developer/howtos/upgrade_custom_db.rst:146
msgid "At this stage of the upgrade process, we also suggest to clean the code as much as possible. This includes:"
msgstr ""
#: ../../content/developer/howtos/upgrade_custom_db.rst:149
msgid "Remove redundant and unnecessary code."
msgstr ""
#: ../../content/developer/howtos/upgrade_custom_db.rst:150
msgid "Remove features that are now part of Odoo standard, as described in :ref:`upgrade_custom/stop_developments`."
msgstr ""
#: ../../content/developer/howtos/upgrade_custom_db.rst:152
msgid "Clean commented code if it is not needed anymore."
msgstr ""
#: ../../content/developer/howtos/upgrade_custom_db.rst:153
msgid "Refactor the code (functions, fields, views, reports, etc.) if needed."
msgstr ""
#: ../../content/developer/howtos/upgrade_custom_db.rst:158
msgid "Standard tests"
msgstr ""
#: ../../content/developer/howtos/upgrade_custom_db.rst:160
msgid "Once the previous steps are completed, we advise to make sure all standard tests associated to the dependencies of the custom module pass. Standard tests ensure the validation of the code logic and prevent data corruption. They will help you identify bugs or unwanted behavior before you work on your database."
msgstr ""
#: ../../content/developer/howtos/upgrade_custom_db.rst:165
msgid "In case there are standard test failing, we suggest to analyze the reason for their failure:"
msgstr ""
#: ../../content/developer/howtos/upgrade_custom_db.rst:167
msgid "The customization changes the standard workflow: Adapt the standard test to your workflow."
msgstr ""
#: ../../content/developer/howtos/upgrade_custom_db.rst:168
msgid "The customization did not take into account a special flow: Adapt your customization to ensure it works for all the standard workflows."
msgstr ""
#: ../../content/developer/howtos/upgrade_custom_db.rst:175
msgid "Step 4: Upgraded database"
msgstr ""
#: ../../content/developer/howtos/upgrade_custom_db.rst:177
msgid "Once the custom modules are installable and working properly in an empty database, it is time to make them work on an :ref:`upgraded database <upgrade/request-test-database>`."
msgstr ""
#: ../../content/developer/howtos/upgrade_custom_db.rst:180
msgid "To make sure the custom code is working flawlessly in the new version, follow these steps:"
msgstr ""
#: ../../content/developer/howtos/upgrade_custom_db.rst:182
msgid ":ref:`upgrade_custom/upgraded_database/migrate_data`"
msgstr ""
#: ../../content/developer/howtos/upgrade_custom_db.rst:183
msgid ":ref:`upgrade_custom/upgraded_database/test_custom`"
msgstr ""
#: ../../content/developer/howtos/upgrade_custom_db.rst:188
msgid "Migrate the data"
msgstr ""
#: ../../content/developer/howtos/upgrade_custom_db.rst:190
msgid "During the upgrade of the custom modules, you might have to use :doc:`upgrade scripts <../reference/upgrade_scripts>` to reflect changes from the source code to their corresponding data. Together with the upgrade scripts, you can also make use of the :doc:`../reference/upgrade_utils` and its helper functions."
msgstr ""
#: ../../content/developer/howtos/upgrade_custom_db.rst:195
msgid "Any technical data that was renamed during the upgrade of the custom code (models, fields, external identifiers) should be renamed using upgrade scripts to avoid data loss during the module upgrade. See also: :meth:`rename_field`, :meth:`rename_model`, :meth:`rename_xmlid`."
msgstr ""
#: ../../content/developer/howtos/upgrade_custom_db.rst:198
msgid "Data from standard models removed from the source code of the newer Odoo version and from the database during the standard upgrade process might need to be recovered from the old model table if it is still present."
msgstr ""
#: ../../content/developer/howtos/upgrade_custom_db.rst:203
msgid "Custom fields for model ``sale.subscription`` are not automatically migrated from Odoo 15 to Odoo 16 (when the model was merged into ``sale.order``). In this case, a SQL query can be executed on an upgrade script to move the data from one table to the other. Take into account that all columns/fields must already exist, so consider doing this in a ``post-`` script (See :ref:`upgrade-scripts/phases`)."
msgstr ""
#: ../../content/developer/howtos/upgrade_custom_db.rst:223
msgid "Check the documentation for more information on :doc:`../reference/upgrade_scripts`."
msgstr ""
#: ../../content/developer/howtos/upgrade_custom_db.rst:225
msgid "Upgrade scripts can also be used to:"
msgstr ""
#: ../../content/developer/howtos/upgrade_custom_db.rst:227
msgid "Ease the processing time of an upgrade. For example, to store the value of computed stored fields on models with an excessive number of records by using SQL queries."
msgstr ""
#: ../../content/developer/howtos/upgrade_custom_db.rst:229
msgid "Recompute fields in case the computation of their value has changed. See also :meth:`recompute_fields`."
msgstr ""
#: ../../content/developer/howtos/upgrade_custom_db.rst:231
msgid "Uninstall unwanted custom modules. See also :meth:`remove_module`."
msgstr ""
#: ../../content/developer/howtos/upgrade_custom_db.rst:232
msgid "Correct faulty data or wrong configurations."
msgstr ""
#: ../../content/developer/howtos/upgrade_custom_db.rst:235
msgid "Running and testing upgrade scripts"
msgstr ""
#: ../../content/developer/howtos/upgrade_custom_db.rst:239
msgid "Odoo Online"
msgstr ""
#: ../../content/developer/howtos/upgrade_custom_db.rst:241
msgid "As the instalation of custom modules containing Python files is not allowed on Odoo Online databases, it is not possible to run upgrade scripts on this platform."
msgstr ""
#: ../../content/developer/howtos/upgrade_custom_db.rst:244
#: ../../content/developer/howtos/website_themes/going_live.rst:34
#: ../../content/developer/howtos/website_themes/setup.rst:121
msgid "Odoo.sh"
msgstr ""
#: ../../content/developer/howtos/upgrade_custom_db.rst:246
msgid "As explained on the `Odoo.sh` tab of :ref:`upgrade/request-test-database`, Odoo.sh is integrated with the upgrade platform."
msgstr ""
#: ../../content/developer/howtos/upgrade_custom_db.rst:249
msgid "Once the upgrade of a staging branch is on \"Update on commit\" mode, each time a commit is pushed on the branch, the upgraded backup is restored and all the custom modules are updated. This update includes the execution of the upgrade scripts."
msgstr ""
#: ../../content/developer/howtos/upgrade_custom_db.rst:253
msgid "When upgrading the production database, the execution of the upgrade scripts is also part of the update of the custom modules done by the platform when the upgraded database is restored."
msgstr ""
#: ../../content/developer/howtos/upgrade_custom_db.rst:256
msgid "On-premise"
msgstr ""
#: ../../content/developer/howtos/upgrade_custom_db.rst:258
msgid "Once you receive the upgraded dump of the database from the `Upgrade platform <https://upgrade.odoo.com>`_, deploy the database and update all the custom modules by invoking the command :doc:`odoo-bin </developer/reference/cli>` in the shell. To update the custom modules, use the option: `-u <modules>, --update <modules>`."
msgstr ""
#: ../../content/developer/howtos/upgrade_custom_db.rst:265
msgid "As mentioned in the :doc:`CLI documentation </developer/reference/cli>`, the command used to call the CLI depends on how you installed Odoo."
msgstr ""
#: ../../content/developer/howtos/upgrade_custom_db.rst:271
msgid "Test the custom modules"
msgstr ""
#: ../../content/developer/howtos/upgrade_custom_db.rst:273
msgid "To make sure the custom modules work properly with your data in the upgraded database, they need to be tested as well. This helps ensure both the standard and the custom data stored in the database are consistent and that nothing was lost during the upgrade process."
msgstr ""
#: ../../content/developer/howtos/upgrade_custom_db.rst:277
msgid "Things to pay attention to:"
msgstr ""
#: ../../content/developer/howtos/upgrade_custom_db.rst:279
msgid "Views not working: During the upgrade, if a view causes issues because of its content, it gets disabled. You can find the information on disabled views on the :ref:`Upgrade report <upgrade/upgrade_report>`. This view needs to be activated again (or removed if not useful anymore). To achieve this, we recommend the use of upgrade scripts."
msgstr ""
#: ../../content/developer/howtos/upgrade_custom_db.rst:283
msgid ":doc:`Module data <../tutorials/define_module_data>` not updated: Custom records that have the ``noupdate`` flag are not updated when upgrading the module in the new database. For the custom data that needs to be updated due to changes in the new version, we recommend to use upgrade scripts to do so. See also: :meth:`update_record_from_xml`."
msgstr ""
#: ../../content/developer/howtos/upgrade_custom_db.rst:291
msgid "Step 5: Testing and rehearsal"
msgstr ""
#: ../../content/developer/howtos/upgrade_custom_db.rst:293
msgid "When the custom modules are working properly in the upgraded database, it is crucial to do another round of testing to assess the database usability and detect any issues that might have gone unnoticed in previous tests. For further information about testing the upgraded database, check :ref:`upgrade/test_your_db`."
msgstr ""
#: ../../content/developer/howtos/upgrade_custom_db.rst:298
msgid "As mentioned in :ref:`upgrade/upgrade-prod`, both standard upgrade scripts and your database are constantly evolving. Therefore it is highly recommended to frequently request new upgraded test databases and ensure that the upgrade process is still successful."
msgstr ""
#: ../../content/developer/howtos/upgrade_custom_db.rst:302
msgid "In addition to that, make a full rehearsal of the upgrade process the day before upgrading the production database to avoid undesired behavior during the upgrade and to detect any issue that might have occurred with the migrated data."
msgstr ""
#: ../../content/developer/howtos/upgrade_custom_db.rst:309
msgid "Step 6: Production upgrade"
msgstr ""
#: ../../content/developer/howtos/upgrade_custom_db.rst:311
msgid "Once you are confident about upgrading your production database, follow the process described on :ref:`upgrade/upgrade-prod`, depending on the hosting type of your database."
msgstr ""
#: ../../content/developer/howtos/web_services.rst:3
msgid "Web Services"
msgstr ""
#: ../../content/developer/howtos/web_services.rst:5
msgid "The web-service module offers a common interface for all web services:"
msgstr ""
#: ../../content/developer/howtos/web_services.rst:7
msgid "XML-RPC"
msgstr ""
#: ../../content/developer/howtos/web_services.rst:8
msgid "JSON-RPC"
msgstr ""
#: ../../content/developer/howtos/web_services.rst:10
msgid "Business objects can also be accessed via the distributed object mechanism. They can all be modified via the client interface with contextual views."
msgstr ""
#: ../../content/developer/howtos/web_services.rst:14
msgid "Odoo is accessible through XML-RPC/JSON-RPC interfaces, for which libraries exist in many languages."
msgstr ""
#: ../../content/developer/howtos/web_services.rst:18
msgid "XML-RPC Library"
msgstr ""
#: ../../content/developer/howtos/web_services.rst:20
msgid "The following example is a Python 3 program that interacts with an Odoo server with the library ``xmlrpc.client``::"
msgstr ""
#: ../../content/developer/howtos/web_services.rst:39
msgid "Add a new service to the client"
msgstr ""
#: ../../content/developer/howtos/web_services.rst:41
msgid "Write a Python program able to send XML-RPC requests to a PC running Odoo (yours, or your instructor's). This program should display all the sessions, and their corresponding number of seats. It should also create a new session for one of the courses."
msgstr ""
#: ../../content/developer/howtos/web_services.rst:77
msgid "Instead of using a hard-coded course id, the code can look up a course by name::"
msgstr ""
#: ../../content/developer/howtos/web_services.rst:88
msgid ":doc:`../reference/external_api`: The in-depth tutorial on XML-RPC, with examples spanning multiple programming languages."
msgstr ""
#: ../../content/developer/howtos/web_services.rst:91
msgid "JSON-RPC Library"
msgstr ""
#: ../../content/developer/howtos/web_services.rst:93
msgid "The following example is a Python 3 program that interacts with an Odoo server with the standard Python libraries ``urllib.request`` and ``json``. This example assumes the **Productivity** app (``note``) is installed::"
msgstr ""
#: ../../content/developer/howtos/web_services.rst:137
msgid "Examples can be easily adapted from XML-RPC to JSON-RPC."
msgstr ""
#: ../../content/developer/howtos/web_services.rst:141
msgid "There are a number of high-level APIs in various languages to access Odoo systems without *explicitly* going through XML-RPC or JSON-RPC, such as:"
msgstr ""
#: ../../content/developer/howtos/web_services.rst:144
msgid "https://github.com/akretion/ooor"
msgstr ""
#: ../../content/developer/howtos/web_services.rst:145
msgid "https://github.com/OCA/odoorpc"
msgstr ""
#: ../../content/developer/howtos/web_services.rst:146
msgid "https://github.com/nicolas-van/openerp-client-lib"
msgstr ""
#: ../../content/developer/howtos/web_services.rst:147
msgid "http://pythonhosted.org/OdooRPC"
msgstr ""
#: ../../content/developer/howtos/web_services.rst:148
msgid "https://github.com/abhishek-jaiswal/php-openerp-lib"
msgstr ""
#: ../../content/developer/howtos/website_themes.rst:7
msgid "Website themes"
msgstr ""
#: ../../content/developer/howtos/website_themes.rst:-1
msgid "Artistic illustration of \"Web design\""
msgstr ""
#: ../../content/developer/howtos/website_themes.rst:13
msgid "The Odoo Website Builder is an excellent tool for creating a website fully integrated with other Odoo apps. Using the theme's options and building blocks is easy and allows you to personalize your web presence the way you want. However, you can take things even further."
msgstr ""
#: ../../content/developer/howtos/website_themes.rst:17
msgid "In this documentation, you will learn to completely customize your website without touching Odoo's core files, and this way, preserve the editing options of the Website Builder."
msgstr ""
#: ../../content/developer/howtos/website_themes.rst:20
msgid "The information compiled in this documentation is based on our past experiences - both failures and successes. We invite you to use it as a base to build your own website and adapt it to your needs."
msgstr ""
#: ../../content/developer/howtos/website_themes/animations.rst:3
msgid "Animations"
msgstr ""
#: ../../content/developer/howtos/website_themes/animations.rst:5
msgid "Eye-catching animations can bring your website to life."
msgstr ""
#: ../../content/developer/howtos/website_themes/animations.rst:8
msgid "On appearance"
msgstr ""
#: ../../content/developer/howtos/website_themes/animations.rst:10
msgid "In standard, you can add animations to columns when they appear, thanks to the Website Builder. Odoo detects when your element is in the viewport and launches the animation. A large selection of animations is available:"
msgstr ""
#: ../../content/developer/howtos/website_themes/animations.rst:14
msgid "Fade in"
msgstr ""
#: ../../content/developer/howtos/website_themes/animations.rst:15
msgid "Bounce in"
msgstr ""
#: ../../content/developer/howtos/website_themes/animations.rst:16
msgid "Rotate in"
msgstr ""
#: ../../content/developer/howtos/website_themes/animations.rst:17
msgid "Zoom in"
msgstr ""
#: ../../content/developer/howtos/website_themes/animations.rst:18
#: ../../content/developer/howtos/website_themes/setup.rst:55
msgid "…"
msgstr ""
#: ../../content/developer/howtos/website_themes/animations.rst:20
msgid "You can easily define an animation on a column in your custom theme. You need to add two classes: `o_animate` and `o_anim_fade_in`. The second class changes depending on the type of animation you want to use."
msgstr ""
#: ../../content/developer/howtos/website_themes/animations.rst:24
msgid "Add the `o_animate_both_scroll` class to launch the animation every time the column appears on the screen. The animation is only launched once by default."
msgstr ""
#: ../../content/developer/howtos/website_themes/animations.rst:27
msgid "You can also define an `animation-duration` and an `animation-delay` directly in the `style` attribute."
msgstr ""
#: ../../content/developer/howtos/website_themes/animations.rst:30
#: ../../content/developer/howtos/website_themes/gradients.rst:16
#: ../../content/developer/howtos/website_themes/shapes.rst:20
#: ../../content/developer/howtos/website_themes/shapes.rst:208
#: ../../content/developer/howtos/website_themes/theming.rst:246
#: ../../content/developer/howtos/website_themes/theming.rst:370
#: ../../content/developer/howtos/website_themes/theming.rst:463
msgid "**Use**"
msgstr ""
#: ../../content/developer/howtos/website_themes/animations.rst:-1
msgid "Animation options"
msgstr ""
#: ../../content/developer/howtos/website_themes/animations.rst:43
msgid "`Website Animate <https://github.com/odoo/odoo/blob/34c0c9c1ae00aba391932129d4cefd027a9c6bbd/addons/website/static/src/scss/website.scss#L1638>`_"
msgstr ""
#: ../../content/developer/howtos/website_themes/building_blocks.rst:3
msgid "Building blocks"
msgstr ""
#: ../../content/developer/howtos/website_themes/building_blocks.rst:5
msgid "Building blocks, also known as snippets, are how users design and layout pages. They are important XML elements of your design."
msgstr ""
#: ../../content/developer/howtos/website_themes/building_blocks.rst:8
msgid "The building blocks are classified into four categories:"
msgstr ""
#: ../../content/developer/howtos/website_themes/building_blocks.rst:10
msgid "**Structure blocks**: to give a basic structure to the website"
msgstr ""
#: ../../content/developer/howtos/website_themes/building_blocks.rst:11
msgid "**Feature blocks**: to describe the features of a product or service"
msgstr ""
#: ../../content/developer/howtos/website_themes/building_blocks.rst:12
msgid "**Dynamic Content blocks**: blocks that are animated or interact with the backend"
msgstr ""
#: ../../content/developer/howtos/website_themes/building_blocks.rst:13
msgid "**Inner Content blocks**: blocks used inside other building blocks"
msgstr ""
#: ../../content/developer/howtos/website_themes/building_blocks.rst:15
msgid "In this chapter, you will learn how to create custom building blocks and options."
msgstr ""
#: ../../content/developer/howtos/website_themes/building_blocks.rst:18
#: ../../content/developer/howtos/website_themes/theming.rst:37
msgid "File structure"
msgstr ""
#: ../../content/developer/howtos/website_themes/building_blocks.rst:20
msgid "The layout's file structure is the following."
msgstr ""
#: ../../content/developer/howtos/website_themes/building_blocks.rst:29
msgid "The styles' file structure is the following."
msgstr ""
#: ../../content/developer/howtos/website_themes/building_blocks.rst:44
#: ../../content/developer/howtos/website_themes/building_blocks.rst:373
msgid "`XML templates of the different snippets <https://github.com/odoo/odoo/blob/17.0/addons/website/views/snippets/snippets.xml>`_"
msgstr ""
#: ../../content/developer/howtos/website_themes/building_blocks.rst:47
#: ../../content/developer/howtos/website_themes/theming.rst:434
#: ../../content/developer/howtos/website_themes/theming.rst:491
msgid "Demo page"
msgstr ""
#: ../../content/developer/howtos/website_themes/building_blocks.rst:49
msgid "http://localhost:8069/website/demo/snippets"
msgstr ""
#: ../../content/developer/howtos/website_themes/building_blocks.rst:52
#: ../../content/developer/howtos/website_themes/layout.rst:3
msgid "Layout"
msgstr ""
#: ../../content/developer/howtos/website_themes/building_blocks.rst:54
msgid "Snippets are editable by the user using the Website Builder. Some Bootstrap classes are important as **they trigger some Website Builder options**."
msgstr ""
#: ../../content/developer/howtos/website_themes/building_blocks.rst:58
msgid "Wrapper"
msgstr ""
#: ../../content/developer/howtos/website_themes/building_blocks.rst:60
msgid "The standard main container of any snippet is a `section`. Any section element can be edited like a block of content that you can move or duplicate."
msgstr ""
#: ../../content/developer/howtos/website_themes/building_blocks.rst:69
msgid "For inner content snippets, any other HTML tag can be used."
msgstr ""
#: ../../content/developer/howtos/website_themes/building_blocks.rst:77
#: ../../content/developer/howtos/website_themes/layout.rst:547
#: ../../content/developer/howtos/website_themes/pages.rst:130
#: ../../content/developer/howtos/website_themes/pages.rst:194
#: ../../content/developer/howtos/website_themes/shapes.rst:125
msgid "Missing description in table ..."
msgstr ""
#: ../../content/developer/howtos/website_themes/building_blocks.rst:84
#: ../../content/developer/howtos/website_themes/building_blocks.rst:298
#: ../../content/developer/howtos/website_themes/building_blocks.rst:442
#: ../../content/developer/howtos/website_themes/building_blocks.rst:467
#: ../../content/developer/howtos/website_themes/building_blocks.rst:498
#: ../../content/developer/howtos/website_themes/layout.rst:69
#: ../../content/developer/howtos/website_themes/layout.rst:306
#: ../../content/developer/howtos/website_themes/pages.rst:251
#: ../../content/developer/howtos/website_themes/pages.rst:274
#: ../../content/developer/howtos/website_themes/shapes.rst:224
#: ../../content/developer/tutorials/getting_started/04_basicmodel.rst:260
msgid "Attribute"
msgstr ""
#: ../../content/developer/howtos/website_themes/building_blocks.rst:85
#: ../../content/developer/howtos/website_themes/building_blocks.rst:299
#: ../../content/developer/howtos/website_themes/building_blocks.rst:399
#: ../../content/developer/howtos/website_themes/building_blocks.rst:443
#: ../../content/developer/howtos/website_themes/building_blocks.rst:468
#: ../../content/developer/howtos/website_themes/building_blocks.rst:499
#: ../../content/developer/howtos/website_themes/layout.rst:70
#: ../../content/developer/howtos/website_themes/layout.rst:114
#: ../../content/developer/howtos/website_themes/layout.rst:127
#: ../../content/developer/howtos/website_themes/layout.rst:152
#: ../../content/developer/howtos/website_themes/layout.rst:307
#: ../../content/developer/howtos/website_themes/layout.rst:555
#: ../../content/developer/howtos/website_themes/navigation.rst:57
#: ../../content/developer/howtos/website_themes/navigation.rst:137
#: ../../content/developer/howtos/website_themes/navigation.rst:173
#: ../../content/developer/howtos/website_themes/pages.rst:138
#: ../../content/developer/howtos/website_themes/pages.rst:202
#: ../../content/developer/howtos/website_themes/pages.rst:252
#: ../../content/developer/howtos/website_themes/pages.rst:275
#: ../../content/developer/howtos/website_themes/setup.rst:211
#: ../../content/developer/howtos/website_themes/shapes.rst:133
#: ../../content/developer/howtos/website_themes/shapes.rst:165
#: ../../content/developer/howtos/website_themes/shapes.rst:225
#: ../../content/developer/howtos/website_themes/theming.rst:70
#: ../../content/developer/howtos/website_themes/theming.rst:120
#: ../../content/developer/howtos/website_themes/theming.rst:331
#: ../../content/developer/reference/frontend/assets.rst:299
#: ../../content/developer/reference/frontend/framework_overview.rst:265
#: ../../content/developer/reference/frontend/hooks.rst:47
#: ../../content/developer/reference/frontend/hooks.rst:64
#: ../../content/developer/reference/frontend/hooks.rst:104
#: ../../content/developer/reference/frontend/hooks.rst:141
#: ../../content/developer/reference/frontend/hooks.rst:187
#: ../../content/developer/reference/frontend/hooks.rst:227
#: ../../content/developer/reference/frontend/hooks.rst:301
#: ../../content/developer/reference/frontend/hooks.rst:353
#: ../../content/developer/reference/frontend/odoo_editor.rst:148
#: ../../content/developer/reference/frontend/odoo_editor.rst:174
#: ../../content/developer/reference/frontend/odoo_editor.rst:218
#: ../../content/developer/reference/frontend/owl_components.rst:172
#: ../../content/developer/reference/frontend/owl_components.rst:235
#: ../../content/developer/reference/frontend/owl_components.rst:303
#: ../../content/developer/reference/frontend/owl_components.rst:323
#: ../../content/developer/reference/frontend/owl_components.rst:342
#: ../../content/developer/reference/frontend/owl_components.rst:358
#: ../../content/developer/reference/frontend/owl_components.rst:421
#: ../../content/developer/reference/frontend/owl_components.rst:469
#: ../../content/developer/reference/frontend/owl_components.rst:516
#: ../../content/developer/reference/frontend/owl_components.rst:700
#: ../../content/developer/reference/frontend/owl_components.rst:721
#: ../../content/developer/reference/frontend/owl_components.rst:820
#: ../../content/developer/reference/frontend/owl_components.rst:840
#: ../../content/developer/reference/frontend/owl_components.rst:871
#: ../../content/developer/reference/frontend/owl_components.rst:889
#: ../../content/developer/reference/frontend/owl_components.rst:1049
#: ../../content/developer/reference/frontend/owl_components.rst:1064
#: ../../content/developer/reference/frontend/patching_code.rst:17
#: ../../content/developer/reference/frontend/services.rst:247
#: ../../content/developer/reference/frontend/services.rst:439
#: ../../content/developer/reference/frontend/services.rst:467
#: ../../content/developer/reference/frontend/services.rst:737
#: ../../content/developer/reference/frontend/services.rst:852
#: ../../../odoo/addons/account/models/account_tax.py:docstring of odoo.addons.account.models.account_tax.AccountTax.description:1
msgid "Description"
msgstr ""
#: ../../content/developer/howtos/website_themes/building_blocks.rst:86
msgid "class"
msgstr ""
#: ../../content/developer/howtos/website_themes/building_blocks.rst:87
msgid "Unique class name for this snippet"
msgstr ""
#: ../../content/developer/howtos/website_themes/building_blocks.rst:88
msgid "data-name"
msgstr ""
#: ../../content/developer/howtos/website_themes/building_blocks.rst:89
msgid "Displayed in the right panel as the name of the snippet. If not found, it will fall back to *Block*."
msgstr ""
#: ../../content/developer/howtos/website_themes/building_blocks.rst:91
msgid "data-snippet"
msgstr ""
#: ../../content/developer/howtos/website_themes/building_blocks.rst:92
msgid "Used by the system to identify the snippet"
msgstr ""
#: ../../content/developer/howtos/website_themes/building_blocks.rst:94
msgid "The system automatically adds the `data-name` and `data-snippet` attributes during the drag and drop based on the template's name."
msgstr ""
#: ../../content/developer/howtos/website_themes/building_blocks.rst:98
msgid "Those attributes should be specifically added when a snippet is declared on a theme page."
msgstr ""
#: ../../content/developer/howtos/website_themes/building_blocks.rst:101
msgid "Avoid adding a `section` tag inside another `section` tag: this will trigger twice the Website Builder's options. You can use inner content snippets instead."
msgstr ""
#: ../../content/developer/howtos/website_themes/building_blocks.rst:105
#: ../../../odoo/addons/account/models/account_report.py:docstring of odoo.addons.account.models.account_report.AccountReport.column_ids:1
msgid "Columns"
msgstr ""
#: ../../content/developer/howtos/website_themes/building_blocks.rst:107
msgid "Any large Bootstrap columns directly descending from a `.row` element (respecting Bootstrap structure) will be triggered by the Website Builder to make them resizable."
msgstr ""
#: ../../content/developer/howtos/website_themes/building_blocks.rst:114
msgid "Add padding on columns and sections."
msgstr ""
#: ../../content/developer/howtos/website_themes/building_blocks.rst:120
msgid "Add a background based on the color palette for columns and sections."
msgstr ""
#: ../../content/developer/howtos/website_themes/building_blocks.rst:126
msgid "Make an element not editable."
msgstr ""
#: ../../content/developer/howtos/website_themes/building_blocks.rst:132
msgid "Enable the columns selector."
msgstr ""
#: ../../content/developer/howtos/website_themes/building_blocks.rst:138
msgid "Disable the columns option."
msgstr ""
#: ../../content/developer/howtos/website_themes/building_blocks.rst:144
msgid "Disable the size option of all child columns."
msgstr ""
#: ../../content/developer/howtos/website_themes/building_blocks.rst:150
msgid "Disable the size option for one column."
msgstr ""
#: ../../content/developer/howtos/website_themes/building_blocks.rst:156
msgid "Disable the background color option for all columns."
msgstr ""
#: ../../content/developer/howtos/website_themes/building_blocks.rst:162
msgid "Disable the background color option of one column."
msgstr ""
#: ../../content/developer/howtos/website_themes/building_blocks.rst:168
msgid "Add parallax effect."
msgstr ""
#: ../../content/developer/howtos/website_themes/building_blocks.rst:179
msgid "Add a black color filter with an opacity of 50%."
msgstr ""
#: ../../content/developer/howtos/website_themes/building_blocks.rst:190
msgid "Add a white color filter with an opacity of 85%."
msgstr ""
#: ../../content/developer/howtos/website_themes/building_blocks.rst:201
msgid "Add a custom color filter."
msgstr ""
#: ../../content/developer/howtos/website_themes/building_blocks.rst:212
msgid "Add a custom gradient filter."
msgstr ""
#: ../../content/developer/howtos/website_themes/building_blocks.rst:224
#: ../../content/developer/howtos/website_themes/theming.rst:552
msgid "Styles"
msgstr ""
#: ../../content/developer/howtos/website_themes/building_blocks.rst:227
msgid "Compatibility system"
msgstr ""
#: ../../content/developer/howtos/website_themes/building_blocks.rst:229
msgid "When a snippet has a `data-vcss` or `data-vjs` attribute, it means it is an updated version, not the original one."
msgstr ""
#: ../../content/developer/howtos/website_themes/building_blocks.rst:238
msgid "The `data-vcss` and `data-js` attributes indicate to the system which file version to load for that snippet (e.g., :file:`001.js`, :file:`002.scss`)."
msgstr ""
#: ../../content/developer/howtos/website_themes/building_blocks.rst:242
#: ../../content/developer/howtos/website_themes/gradients.rst:33
#: ../../content/developer/howtos/website_themes/layout.rst:279
#: ../../content/developer/howtos/website_themes/layout.rst:466
#: ../../content/developer/howtos/website_themes/shapes.rst:88
msgid "Custom"
msgstr ""
#: ../../content/developer/howtos/website_themes/building_blocks.rst:244
msgid "Create the snippet's content."
msgstr ""
#: ../../content/developer/howtos/website_themes/building_blocks.rst:246
#: ../../content/developer/howtos/website_themes/layout.rst:485
#: ../../content/developer/howtos/website_themes/navigation.rst:36
#: ../../content/developer/howtos/website_themes/navigation.rst:105
#: ../../content/developer/howtos/website_themes/navigation.rst:147
#: ../../content/developer/howtos/website_themes/pages.rst:104
#: ../../content/developer/howtos/website_themes/pages.rst:182
#: ../../content/developer/howtos/website_themes/theming.rst:174
#: ../../content/developer/howtos/website_themes/theming.rst:200
#: ../../content/developer/howtos/website_themes/theming.rst:228
#: ../../content/developer/howtos/website_themes/theming.rst:347
#: ../../content/developer/howtos/website_themes/theming.rst:452
#: ../../content/developer/howtos/website_themes/theming.rst:558
#: ../../content/developer/howtos/website_themes/theming.rst:604
msgid "**Declaration**"
msgstr ""
#: ../../content/developer/howtos/website_themes/building_blocks.rst:248
msgid "``/website_airproof/views/snippets/s_airproof_snippet.xml``"
msgstr ""
#: ../../content/developer/howtos/website_themes/building_blocks.rst:263
msgid "`data-name` and `data-snippet` attributes have to be specified when a snippet is declared on a theme page."
msgstr ""
#: ../../content/developer/howtos/website_themes/building_blocks.rst:267
msgid "Use Bootstrap native classes as much as possible."
msgstr ""
#: ../../content/developer/howtos/website_themes/building_blocks.rst:268
msgid "Prefix all your custom classes."
msgstr ""
#: ../../content/developer/howtos/website_themes/building_blocks.rst:269
msgid "Use underscore lowercase notation to name classes, e.g., `.x_nav`, `.x_nav_item`."
msgstr ""
#: ../../content/developer/howtos/website_themes/building_blocks.rst:270
msgid "Avoid using ID tag."
msgstr ""
#: ../../content/developer/howtos/website_themes/building_blocks.rst:272
msgid "Add your custom snippet to the list of default snippets, so the user can drag and drop it on the page, directly from the edit panel."
msgstr ""
#: ../../content/developer/howtos/website_themes/building_blocks.rst:275
#: ../../content/developer/howtos/website_themes/building_blocks.rst:355
#: ../../content/developer/howtos/website_themes/building_blocks.rst:427
#: ../../content/developer/howtos/website_themes/building_blocks.rst:452
#: ../../content/developer/howtos/website_themes/building_blocks.rst:483
#: ../../content/developer/howtos/website_themes/shapes.rst:184
msgid "``/website_airproof/views/snippets/options.xml``"
msgstr ""
#: ../../content/developer/howtos/website_themes/building_blocks.rst:300
msgid "t-snippet"
msgstr ""
#: ../../content/developer/howtos/website_themes/building_blocks.rst:301
msgid "The template to use"
msgstr ""
#: ../../content/developer/howtos/website_themes/building_blocks.rst:302
msgid "t-thumbnail"
msgstr ""
#: ../../content/developer/howtos/website_themes/building_blocks.rst:303
msgid "The path to the snippet thumbnail"
msgstr ""
#: ../../content/developer/howtos/website_themes/building_blocks.rst:306
#: ../../content/developer/reference/frontend/odoo_editor.rst:207
msgid "Options"
msgstr ""
#: ../../content/developer/howtos/website_themes/building_blocks.rst:308
msgid "Options allow users to edit a snippet's appearance using the Website Builder. You can create snippet options easily and automatically add them to the Website Builder."
msgstr ""
#: ../../content/developer/howtos/website_themes/building_blocks.rst:312
msgid "Groups properties"
msgstr ""
#: ../../content/developer/howtos/website_themes/building_blocks.rst:314
msgid "Options are wrapped in groups. Groups can have properties that define how the included options interact with the user interface."
msgstr ""
#: ../../content/developer/howtos/website_themes/building_blocks.rst:317
msgid "`data-selector` binds all the options included in the group to a particular element. It can be used in combination with `data-target` and `data-exclude`."
msgstr ""
#: ../../content/developer/howtos/website_themes/building_blocks.rst:324
msgid "`data-js` binds custom JavaScript methods."
msgstr ""
#: ../../content/developer/howtos/website_themes/building_blocks.rst:330
msgid "`data-drop-in` defines the list of elements where the snippet can be dropped into."
msgstr ""
#: ../../content/developer/howtos/website_themes/building_blocks.rst:332
msgid "no css selector ..."
msgstr ""
#: ../../content/developer/howtos/website_themes/building_blocks.rst:338
msgid "`data-drop-near` defines the list of elements where the snippet can be dropped beside."
msgstr ""
#: ../../content/developer/howtos/website_themes/building_blocks.rst:345
msgid "SCSS options"
msgstr ""
#: ../../content/developer/howtos/website_themes/building_blocks.rst:347
msgid "Options can apply standard or custom CSS classes to the snippet. Depending on the method that you choose, the user interface will behave differently."
msgstr ""
#: ../../content/developer/howtos/website_themes/building_blocks.rst:350
msgid "`data-select-class=\"...\"`"
msgstr ""
#: ../../content/developer/howtos/website_themes/building_blocks.rst:352
msgid "More `data-select-class` in the same group defines a list of classes the user can apply. Only one option can be enabled at a time."
msgstr ""
#: ../../content/developer/howtos/website_themes/building_blocks.rst:377
msgid "JavaScript options"
msgstr ""
#: ../../content/developer/howtos/website_themes/building_blocks.rst:379
msgid "The `data-js` attribute can be assigned to an options group in order to define a custom method."
msgstr ""
#: ../../content/developer/howtos/website_themes/building_blocks.rst:391
msgid "The Website Builder provides several events you can use to trigger your custom functions."
msgstr ""
#: ../../content/developer/howtos/website_themes/building_blocks.rst:398
msgid "Event"
msgstr ""
#: ../../content/developer/howtos/website_themes/building_blocks.rst:400
msgid "start"
msgstr ""
#: ../../content/developer/howtos/website_themes/building_blocks.rst:401
msgid "Occurs when the publisher selects the snippet for the first time in an editing session or when the snippet is drag-and-dropped on the page."
msgstr ""
#: ../../content/developer/howtos/website_themes/building_blocks.rst:403
msgid "onFocus"
msgstr ""
#: ../../content/developer/howtos/website_themes/building_blocks.rst:404
msgid "Occurs each time the snippet is selected by the user or when the snippet is drag-and-dropped on the page."
msgstr ""
#: ../../content/developer/howtos/website_themes/building_blocks.rst:406
msgid "onBlur"
msgstr ""
#: ../../content/developer/howtos/website_themes/building_blocks.rst:407
msgid "Occurs when a snippet loses focus."
msgstr ""
#: ../../content/developer/howtos/website_themes/building_blocks.rst:408
msgid "onClone"
msgstr ""
#: ../../content/developer/howtos/website_themes/building_blocks.rst:409
msgid "Occurs just after a snippet is duplicated."
msgstr ""
#: ../../content/developer/howtos/website_themes/building_blocks.rst:410
msgid "onRemove"
msgstr ""
#: ../../content/developer/howtos/website_themes/building_blocks.rst:411
msgid "Occurs just before the snippet is removed."
msgstr ""
#: ../../content/developer/howtos/website_themes/building_blocks.rst:412
msgid "onBuilt"
msgstr ""
#: ../../content/developer/howtos/website_themes/building_blocks.rst:413
msgid "Occurs just after the snippet is drag-and-dropped on a drop zone. When this event is triggered, the content is already inserted in the page."
msgstr ""
#: ../../content/developer/howtos/website_themes/building_blocks.rst:415
msgid "cleanForSave"
msgstr ""
#: ../../content/developer/howtos/website_themes/building_blocks.rst:416
msgid "Occurs before the publisher saves the page."
msgstr ""
#: ../../content/developer/howtos/website_themes/building_blocks.rst:419
msgid "Dynamic Content templates"
msgstr ""
#: ../../content/developer/howtos/website_themes/building_blocks.rst:421
msgid "By default, Dynamic Content blocks have a selection of templates available in the Website Builder. You can also add your own template to the list."
msgstr ""
#: ../../content/developer/howtos/website_themes/building_blocks.rst:425
msgid "Blog posts"
msgstr ""
#: ../../content/developer/howtos/website_themes/building_blocks.rst:445
msgid "The ID of the template. Has to start with `dynamic_filter_template_blog_post_`"
msgstr ""
#: ../../content/developer/howtos/website_themes/building_blocks.rst:447
#: ../../content/developer/howtos/website_themes/building_blocks.rst:472
#: ../../content/developer/howtos/website_themes/building_blocks.rst:503
msgid "Human-readable name of the template"
msgstr ""
#: ../../content/developer/howtos/website_themes/building_blocks.rst:450
msgid "Products"
msgstr ""
#: ../../content/developer/howtos/website_themes/building_blocks.rst:470
msgid "The ID of the template. Has to start with `dynamic_filter_template_product_product_`"
msgstr ""
#: ../../content/developer/howtos/website_themes/building_blocks.rst:473
msgid "data-number-of-elements"
msgstr ""
#: ../../content/developer/howtos/website_themes/building_blocks.rst:474
msgid "Number of products per slide on desktop"
msgstr ""
#: ../../content/developer/howtos/website_themes/building_blocks.rst:475
msgid "data-number-of-elements-sm"
msgstr ""
#: ../../content/developer/howtos/website_themes/building_blocks.rst:476
msgid "Number of products per slide on mobile"
msgstr ""
#: ../../content/developer/howtos/website_themes/building_blocks.rst:477
msgid "data-number-of-elements-fetch"
msgstr ""
#: ../../content/developer/howtos/website_themes/building_blocks.rst:478
msgid "The total amount of fetched products"
msgstr ""
#: ../../content/developer/howtos/website_themes/building_blocks.rst:481
#: ../../content/developer/tutorials/web.rst:1003
msgid "Events"
msgstr ""
#: ../../content/developer/howtos/website_themes/building_blocks.rst:501
msgid "The ID of the template. Has to start with `dynamic_filter_template_event_event_`"
msgstr ""
#: ../../content/developer/howtos/website_themes/forms.rst:3
msgid "Forms"
msgstr ""
#: ../../content/developer/howtos/website_themes/forms.rst:5
msgid "Forms in Odoo are very powerful. They are directly integrated with other applications and can be used for many different purposes."
msgstr ""
#: ../../content/developer/howtos/website_themes/forms.rst:8
#: ../../content/developer/howtos/website_themes/gradients.rst:5
msgid "In this chapter, you will discover how to:"
msgstr ""
#: ../../content/developer/howtos/website_themes/forms.rst:10
msgid "Add a form in your custom theme."
msgstr ""
#: ../../content/developer/howtos/website_themes/forms.rst:11
msgid "Change the action of the form."
msgstr ""
#: ../../content/developer/howtos/website_themes/forms.rst:12
msgid "Stylize the form thanks to Bootstrap variables."
msgstr ""
#: ../../content/developer/howtos/website_themes/forms.rst:15
msgid "Default form"
msgstr ""
#: ../../content/developer/howtos/website_themes/forms.rst:17
msgid "To add a form to your page, you can simply copy and paste the code generated by the Website Builder in your view."
msgstr ""
#: ../../content/developer/howtos/website_themes/forms.rst:20
msgid "It should look something like the following."
msgstr ""
#: ../../content/developer/howtos/website_themes/forms.rst:35
msgid "There is a `data-model_name` in the form tag. It enables you to define different actions for your form."
msgstr ""
#: ../../content/developer/howtos/website_themes/forms.rst:38
msgid "Send an email (this action is used by default)."
msgstr ""
#: ../../content/developer/howtos/website_themes/forms.rst:44
msgid "Apply for a job."
msgstr ""
#: ../../content/developer/howtos/website_themes/forms.rst:50
msgid "Create a customer."
msgstr ""
#: ../../content/developer/howtos/website_themes/forms.rst:56
msgid "Create a ticket."
msgstr ""
#: ../../content/developer/howtos/website_themes/forms.rst:62
msgid "Create an opportunity."
msgstr ""
#: ../../content/developer/howtos/website_themes/forms.rst:68
msgid "Create a task."
msgstr ""
#: ../../content/developer/howtos/website_themes/forms.rst:75
#: ../../content/developer/reference/extract_api.rst:183
#: ../../content/developer/reference/extract_api.rst:284
msgid "Success"
msgstr ""
#: ../../content/developer/howtos/website_themes/forms.rst:77
msgid "You can also define what happens once the form is submitted thanks to the `data-success-mode`."
msgstr ""
#: ../../content/developer/howtos/website_themes/forms.rst:79
msgid "Redirect the user to a page defined in the `data-success-page`."
msgstr ""
#: ../../content/developer/howtos/website_themes/forms.rst:85
msgid "Show a message (on the same page)."
msgstr ""
#: ../../content/developer/howtos/website_themes/forms.rst:91
msgid "You can add your success message directly under the form tag. Always add the `d-none` class to make sure that your success message is hidden if the form hasn't been submitted."
msgstr ""
#: ../../content/developer/howtos/website_themes/forms.rst:107
#: ../../content/developer/howtos/website_themes/theming.rst:440
msgid "Bootstrap variables"
msgstr ""
#: ../../content/developer/howtos/website_themes/forms.rst:109
msgid "As you already know, the Website Builder creates content based on Bootstrap. This is also true for forms. Below you can find a selection of Bootstrap variables, or check out the `full list of variables <https://github.com/twbs/bootstrap/blob/main/scss/_variables.scss>`_."
msgstr ""
#: ../../content/developer/howtos/website_themes/forms.rst:113
#: ../../content/developer/howtos/website_themes/theming.rst:465
msgid "``/website_airproof/static/src/scss/bootstrap_overridden.scss``"
msgstr ""
#: ../../content/developer/howtos/website_themes/going_live.rst:3
msgid "Going live"
msgstr ""
#: ../../content/developer/howtos/website_themes/going_live.rst:5
msgid "Once you have finished all the web design and development work, it's time to deploy it on a development or production database."
msgstr ""
#: ../../content/developer/howtos/website_themes/going_live.rst:9
msgid "Module import"
msgstr ""
#: ../../content/developer/howtos/website_themes/going_live.rst:12
#: ../../content/developer/howtos/website_themes/setup.rst:116
msgid "Odoo SaaS"
msgstr ""
#: ../../content/developer/howtos/website_themes/going_live.rst:14
msgid "Follow these steps the first time you import a module:"
msgstr ""
#: ../../content/developer/howtos/website_themes/going_live.rst:16
msgid "Create a ZIP file of your module."
msgstr ""
#: ../../content/developer/howtos/website_themes/going_live.rst:17
msgid "Connect to the project database."
msgstr ""
#: ../../content/developer/howtos/website_themes/going_live.rst:18
msgid "Enable the :ref:`developer mode <developer-mode>`."
msgstr ""
#: ../../content/developer/howtos/website_themes/going_live.rst:19
msgid "Go to :guilabel:`Apps`, search for `base_import_module`, and install it if necessary."
msgstr ""
#: ../../content/developer/howtos/website_themes/going_live.rst:20
msgid "Click on :guilabel:`Import Module` in the menu."
msgstr ""
#: ../../content/developer/howtos/website_themes/going_live.rst:21
msgid "Upload your ZIP file, tick :guilabel:`Force init`, and click the :guilabel:`Import App` button."
msgstr ""
#: ../../content/developer/howtos/website_themes/going_live.rst:23
msgid "If you need to re-import a module after making some changes, follow the same steps, but before importing the module, open the developer menu and select :guilabel:`Become Superuser`. To leave the Superuser mode, log out and log back in."
msgstr ""
#: ../../content/developer/howtos/website_themes/going_live.rst:28
msgid "The ZIP file size must be less than 50 MB."
msgstr ""
#: ../../content/developer/howtos/website_themes/going_live.rst:31
msgid "`Odoo eLearning: Register a Free Domain Name <https://www.odoo.com/slides/slide/register-a-free-domain-name-1663>`_"
msgstr ""
#: ../../content/developer/howtos/website_themes/going_live.rst:36
msgid "Go to :guilabel:`Apps` and click on :guilabel:`Update Apps List` in the menu. Search for your module in the list and install it."
msgstr ""
#: ../../content/developer/howtos/website_themes/going_live.rst:40
msgid ":doc:`Introduction to Odoo.sh <../../../administration/odoo_sh/overview/introduction>`"
msgstr ""
#: ../../content/developer/howtos/website_themes/gradients.rst:3
msgid "Gradients"
msgstr ""
#: ../../content/developer/howtos/website_themes/gradients.rst:7
msgid "Add a gradient to a section or a title."
msgstr ""
#: ../../content/developer/howtos/website_themes/gradients.rst:8
msgid "Add your own gradient to the Website Builder palette."
msgstr ""
#: ../../content/developer/howtos/website_themes/gradients.rst:11
#: ../../content/developer/howtos/website_themes/layout.rst:255
#: ../../content/developer/howtos/website_themes/layout.rst:444
#: ../../content/developer/howtos/website_themes/shapes.rst:16
#: ../../content/developer/howtos/website_themes/shapes.rst:204
msgid "Standard"
msgstr ""
#: ../../content/developer/howtos/website_themes/gradients.rst:13
msgid "In standard, you can select several gradients directly from the Website Builder. However, for custom themes, you must add the gradients directly in the section tag with a style attribute."
msgstr ""
#: ../../content/developer/howtos/website_themes/gradients.rst:24
msgid "To apply a gradient to text, use a font tag with the `text-gradient` class."
msgstr ""
#: ../../content/developer/howtos/website_themes/gradients.rst:35
msgid "You can also add your own custom gradients to the Website Builder. This way, the user can easily use them without manually recreating them."
msgstr ""
#: ../../content/developer/howtos/website_themes/gradients.rst:38
#: ../../content/developer/howtos/website_themes/layout.rst:271
#: ../../content/developer/howtos/website_themes/layout.rst:290
#: ../../content/developer/howtos/website_themes/layout.rst:458
#: ../../content/developer/howtos/website_themes/layout.rst:473
#: ../../content/developer/howtos/website_themes/navigation.rst:201
#: ../../content/developer/howtos/website_themes/theming.rst:519
msgid "``/website_airproof/data/presets.xml``"
msgstr ""
#: ../../content/developer/howtos/website_themes/layout.rst:5
#: ../../content/developer/howtos/website_themes/navigation.rst:7
#: ../../content/developer/howtos/website_themes/translations.rst:7
msgid "In this chapter, you will learn how to:"
msgstr ""
#: ../../content/developer/howtos/website_themes/layout.rst:7
msgid "Create a custom header."
msgstr ""
#: ../../content/developer/howtos/website_themes/layout.rst:8
msgid "Create a custom footer."
msgstr ""
#: ../../content/developer/howtos/website_themes/layout.rst:9
msgid "Modify a standard template."
msgstr ""
#: ../../content/developer/howtos/website_themes/layout.rst:10
msgid "Add a copyright section."
msgstr ""
#: ../../content/developer/howtos/website_themes/layout.rst:11
msgid "Improve your website's responsiveness."
msgstr ""
#: ../../content/developer/howtos/website_themes/layout.rst:14
#: ../../content/developer/howtos/website_themes/navigation.rst:14
#: ../../content/developer/tutorials/getting_started/09_compute_onchange.rst:173
msgid "Default"
msgstr ""
#: ../../content/developer/howtos/website_themes/layout.rst:16
msgid "An Odoo page combines cross-page and unique elements. Cross-page elements are the same on every page, while unique elements are only related to a specific page. By default, a page has two cross-page elements, the header and the footer, and a unique main element that contains the specific content of that page."
msgstr ""
#: ../../content/developer/howtos/website_themes/layout.rst:33
msgid "Any Odoo XML file starts with encoding specifications. After that, you must write your code inside an `<odoo>` tag."
msgstr ""
#: ../../content/developer/howtos/website_themes/layout.rst:44
msgid "Using precise file names is important to find information through all modules quickly. File names should only contain lowercase alphanumerics and underscores."
msgstr ""
#: ../../content/developer/howtos/website_themes/layout.rst:47
msgid "Always add an empty line at the end of your file. This can be done automatically by configuring your IDE."
msgstr ""
#: ../../content/developer/howtos/website_themes/layout.rst:51
msgid "XPath"
msgstr ""
#: ../../content/developer/howtos/website_themes/layout.rst:53
msgid "XPath (XML Path Language) is an expression language that enables you to navigate through elements and attributes in an XML document easily. XPath is used to extend standard Odoo templates."
msgstr ""
#: ../../content/developer/howtos/website_themes/layout.rst:56
msgid "A view is coded the following way."
msgstr ""
#: ../../content/developer/howtos/website_themes/layout.rst:72
msgid "ID of the modified view"
msgstr ""
#: ../../content/developer/howtos/website_themes/layout.rst:73
msgid "inherited_id"
msgstr ""
#: ../../content/developer/howtos/website_themes/layout.rst:74
msgid "ID of the standard view"
msgstr ""
#: ../../content/developer/howtos/website_themes/layout.rst:76
msgid "Human-readable name of the modified view"
msgstr ""
#: ../../content/developer/howtos/website_themes/layout.rst:78
msgid "For each XPath, you modify two attributes: **expression** and **position**."
msgstr ""
#: ../../content/developer/howtos/website_themes/layout.rst:81
#: ../../content/developer/howtos/website_themes/layout.rst:329
#: ../../content/developer/howtos/website_themes/layout.rst:498
#: ../../content/developer/howtos/website_themes/layout.rst:523
#: ../../content/developer/howtos/website_themes/navigation.rst:188
msgid "``/website_airproof/views/website_templates.xml``"
msgstr ""
#: ../../content/developer/howtos/website_themes/layout.rst:90
msgid "This XPath adds a welcome message right before the page content."
msgstr ""
#: ../../content/developer/howtos/website_themes/layout.rst:93
msgid "Be careful when replacing default elements' attributes. As your theme extends the default one, your changes will take priority over any future Odoo update."
msgstr ""
#: ../../content/developer/howtos/website_themes/layout.rst:97
msgid "You should update your module every time you create a new template or record."
msgstr ""
#: ../../content/developer/howtos/website_themes/layout.rst:98
msgid "*XML IDs* of inheriting views should use the same *ID* as the original record. It helps to find all inheritance at a glance. As final *XML IDs* are prefixed by the module that creates them, there is no overlap."
msgstr ""
#: ../../content/developer/howtos/website_themes/layout.rst:103
#: ../../../odoo/addons/account/models/account_report.py:docstring of odoo.addons.account.models.account_report.AccountReportLine.expression_ids:1
msgid "Expressions"
msgstr ""
#: ../../content/developer/howtos/website_themes/layout.rst:105
msgid "XPath uses path expressions to select nodes in an XML document. Selectors are used inside the expression to target the right element. The most useful ones are listed below."
msgstr ""
#: ../../content/developer/howtos/website_themes/layout.rst:113
msgid "Descendent selectors"
msgstr ""
#: ../../content/developer/howtos/website_themes/layout.rst:115
msgid "/"
msgstr ""
#: ../../content/developer/howtos/website_themes/layout.rst:116
msgid "Selects from the root node."
msgstr ""
#: ../../content/developer/howtos/website_themes/layout.rst:117
msgid "//"
msgstr ""
#: ../../content/developer/howtos/website_themes/layout.rst:118
msgid "Selects nodes in the document from the current node that matches the selection no matter where they are."
msgstr ""
#: ../../content/developer/howtos/website_themes/layout.rst:126
msgid "Attribute selectors"
msgstr ""
#: ../../content/developer/howtos/website_themes/layout.rst:128
msgid "\\*"
msgstr ""
#: ../../content/developer/howtos/website_themes/layout.rst:129
msgid "Selects any XML tag. `*` can be replaced by a specific tag if the selection needs to be more precise."
msgstr ""
#: ../../content/developer/howtos/website_themes/layout.rst:131
msgid "\\*[@id=\"id\"]"
msgstr ""
#: ../../content/developer/howtos/website_themes/layout.rst:132
msgid "Selects a specific ID."
msgstr ""
#: ../../content/developer/howtos/website_themes/layout.rst:133
msgid "\\*[hasclass(\"class\")]"
msgstr ""
#: ../../content/developer/howtos/website_themes/layout.rst:134
msgid "Selects a specific class."
msgstr ""
#: ../../content/developer/howtos/website_themes/layout.rst:135
msgid "\\*[@name=\"name\"]"
msgstr ""
#: ../../content/developer/howtos/website_themes/layout.rst:136
msgid "Selects a tag with a specific name."
msgstr ""
#: ../../content/developer/howtos/website_themes/layout.rst:137
msgid "\\*[@t-call=\"t-call\"]"
msgstr ""
#: ../../content/developer/howtos/website_themes/layout.rst:138
msgid "Selects a specific t-call."
msgstr ""
#: ../../content/developer/howtos/website_themes/layout.rst:141
#: ../../content/developer/howtos/website_themes/layout.rst:151
msgid "Position"
msgstr ""
#: ../../content/developer/howtos/website_themes/layout.rst:143
msgid "The position defines where the code is placed inside the template. The possible values are listed below:"
msgstr ""
#: ../../content/developer/howtos/website_themes/layout.rst:153
msgid "replace"
msgstr ""
#: ../../content/developer/howtos/website_themes/layout.rst:154
msgid "Replaces the targeted node with the XPath content."
msgstr ""
#: ../../content/developer/howtos/website_themes/layout.rst:155
msgid "inside"
msgstr ""
#: ../../content/developer/howtos/website_themes/layout.rst:156
msgid "Adds the XPath content inside the targeted node."
msgstr ""
#: ../../content/developer/howtos/website_themes/layout.rst:157
msgid "before"
msgstr ""
#: ../../content/developer/howtos/website_themes/layout.rst:158
msgid "Adds the XPath content before the targeted node."
msgstr ""
#: ../../content/developer/howtos/website_themes/layout.rst:159
msgid "after"
msgstr ""
#: ../../content/developer/howtos/website_themes/layout.rst:160
msgid "Adds the XPath content after the targeted node."
msgstr ""
#: ../../content/developer/howtos/website_themes/layout.rst:161
#: ../../content/developer/reference/frontend/qweb.rst:196
msgid "attributes"
msgstr ""
#: ../../content/developer/howtos/website_themes/layout.rst:162
msgid "Adds the XPath content inside an attribute."
msgstr ""
#: ../../content/developer/howtos/website_themes/layout.rst:165
msgid "This XPath adds a `<div>` before the `<nav>` that is a direct child of the `<header>`."
msgstr ""
#: ../../content/developer/howtos/website_themes/layout.rst:173
msgid "This XPath adds `x_airproof_header` in the class attribute of the header. You also need to define a `separator` attribute to add a space before the class you are adding."
msgstr ""
#: ../../content/developer/howtos/website_themes/layout.rst:182
msgid "This XPath removes `x_airproof_header` in the class attribute of the header. In this case, you don't need to use the `separator` attribute."
msgstr ""
#: ../../content/developer/howtos/website_themes/layout.rst:191
msgid "This XPath removes the first element with a `.breadcrumb` class."
msgstr ""
#: ../../content/developer/howtos/website_themes/layout.rst:197
msgid "This XPath adds an extra `<li>` element after the last child of the `<ul>` element."
msgstr ""
#: ../../content/developer/howtos/website_themes/layout.rst:206
msgid "You can find more information about XPath in this `cheat sheet <https://devhints.io/xpath>`_."
msgstr ""
#: ../../content/developer/howtos/website_themes/layout.rst:209
#: ../../content/developer/reference/user_interface/view_architectures.rst:2691
msgid "QWeb"
msgstr ""
#: ../../content/developer/howtos/website_themes/layout.rst:211
msgid "QWeb is the primary templating engine used by Odoo. It is an XML templating engine mainly used to generate HTML fragments and pages."
msgstr ""
#: ../../content/developer/howtos/website_themes/layout.rst:215
msgid ":doc:`QWeb templates documentation <../../reference/frontend/qweb>`."
msgstr ""
#: ../../content/developer/howtos/website_themes/layout.rst:218
msgid "Background"
msgstr ""
#: ../../content/developer/howtos/website_themes/layout.rst:220
msgid "You can define a color or an image as the background of your website."
msgstr ""
#: ../../content/developer/howtos/website_themes/layout.rst:222
msgid "**Colors**"
msgstr ""
#: ../../content/developer/howtos/website_themes/layout.rst:224
#: ../../content/developer/howtos/website_themes/layout.rst:238
#: ../../content/developer/howtos/website_themes/layout.rst:262
#: ../../content/developer/howtos/website_themes/layout.rst:318
#: ../../content/developer/howtos/website_themes/layout.rst:449
#: ../../content/developer/howtos/website_themes/layout.rst:487
#: ../../content/developer/howtos/website_themes/shapes.rst:145
#: ../../content/developer/howtos/website_themes/theming.rst:202
#: ../../content/developer/howtos/website_themes/theming.rst:230
#: ../../content/developer/howtos/website_themes/theming.rst:248
#: ../../content/developer/howtos/website_themes/theming.rst:263
#: ../../content/developer/howtos/website_themes/theming.rst:302
#: ../../content/developer/howtos/website_themes/theming.rst:349
#: ../../content/developer/howtos/website_themes/theming.rst:372
#: ../../content/developer/howtos/website_themes/theming.rst:398
msgid "``/website_airproof/static/src/scss/primary_variables.scss``"
msgstr ""
#: ../../content/developer/howtos/website_themes/layout.rst:236
msgid "**Image/pattern**"
msgstr ""
#: ../../content/developer/howtos/website_themes/layout.rst:249
msgid "Header"
msgstr ""
#: ../../content/developer/howtos/website_themes/layout.rst:251
msgid "By default, the header contains a responsive navigation menu and the company's logo. You can easily add new elements or create your own template."
msgstr ""
#: ../../content/developer/howtos/website_themes/layout.rst:257
msgid "Enable one of the header default templates."
msgstr ""
#: ../../content/developer/howtos/website_themes/layout.rst:260
#: ../../content/developer/howtos/website_themes/layout.rst:284
msgid "Don't forget that you may need to disable the active header template first."
msgstr ""
#: ../../content/developer/howtos/website_themes/layout.rst:281
#: ../../content/developer/howtos/website_themes/navigation.rst:184
msgid "Create your own template and add it to the list."
msgstr ""
#: ../../content/developer/howtos/website_themes/layout.rst:286
#: ../../content/developer/howtos/website_themes/layout.rst:471
#: ../../content/developer/howtos/website_themes/navigation.rst:197
msgid "**Option**"
msgstr ""
#: ../../content/developer/howtos/website_themes/layout.rst:288
msgid "Use the following code to add an option for your new custom header on the Website Builder."
msgstr ""
#: ../../content/developer/howtos/website_themes/layout.rst:308
msgid "data-customize-website-views"
msgstr ""
#: ../../content/developer/howtos/website_themes/layout.rst:309
msgid "The template to enable"
msgstr ""
#: ../../content/developer/howtos/website_themes/layout.rst:310
msgid "data-customize-website-variable"
msgstr ""
#: ../../content/developer/howtos/website_themes/layout.rst:311
msgid "The name given to the variable"
msgstr ""
#: ../../content/developer/howtos/website_themes/layout.rst:312
msgid "data-img"
msgstr ""
#: ../../content/developer/howtos/website_themes/layout.rst:313
msgid "The thumbnail of the custom template shown in the templates selection on the Website Builder"
msgstr ""
#: ../../content/developer/howtos/website_themes/layout.rst:315
msgid "Now you have to explicitly define that you want to use your custom template in the Odoo SASS variables."
msgstr ""
#: ../../content/developer/howtos/website_themes/layout.rst:327
#: ../../content/developer/howtos/website_themes/layout.rst:496
#: ../../content/developer/howtos/website_themes/navigation.rst:186
msgid "**Layout**"
msgstr ""
#: ../../content/developer/howtos/website_themes/layout.rst:348
#: ../../content/developer/reference/user_interface/view_architectures.rst:935
#: ../../content/developer/reference/user_interface/view_architectures.rst:1307
#: ../../content/developer/reference/user_interface/view_architectures.rst:1742
#: ../../content/developer/reference/user_interface/view_architectures.rst:2406
msgid "Components"
msgstr ""
#: ../../content/developer/howtos/website_themes/layout.rst:350
msgid "In your custom header, you can call several sub-templates using the `t-call` directive from QWeb:"
msgstr ""
#: ../../content/developer/howtos/website_themes/layout.rst:353
msgid "Logo"
msgstr ""
#: ../../content/developer/howtos/website_themes/layout.rst:361
msgid "Don't forget to record the logo of your website in the database."
msgstr ""
#: ../../content/developer/howtos/website_themes/layout.rst:363
#: ../../content/developer/howtos/website_themes/pages.rst:184
msgid "``/website_airproof/data/images.xml``"
msgstr ""
#: ../../content/developer/howtos/website_themes/layout.rst:371
msgid "Menu"
msgstr ""
#: ../../content/developer/howtos/website_themes/layout.rst:383
#: ../../content/developer/howtos/website_themes/setup.rst:237
msgid "Sign in"
msgstr ""
#: ../../content/developer/howtos/website_themes/layout.rst:393
msgid "User dropdown"
msgstr ""
#: ../../content/developer/howtos/website_themes/layout.rst:407
msgid "Language selector"
msgstr ""
#: ../../content/developer/howtos/website_themes/layout.rst:416
msgid "Call to action"
msgstr ""
#: ../../content/developer/howtos/website_themes/layout.rst:425
msgid "Navbar toggler"
msgstr ""
#: ../../content/developer/howtos/website_themes/layout.rst:434
msgid "You can add a :ref:`header overlay <header_overlay>` to position your header over the content of your page. It has to be done on each page individually."
msgstr ""
#: ../../content/developer/howtos/website_themes/layout.rst:438
msgid "Footer"
msgstr ""
#: ../../content/developer/howtos/website_themes/layout.rst:440
msgid "By default, the footer contains a section with some static content. You can easily add new elements or create your own template."
msgstr ""
#: ../../content/developer/howtos/website_themes/layout.rst:446
msgid "Enable one of the default footer templates. Don't forget that you may need to disable the active footer template first."
msgstr ""
#: ../../content/developer/howtos/website_themes/layout.rst:468
msgid "Create your own template and add it to the list. Don't forget that you may need to disable the active footer template first."
msgstr ""
#: ../../content/developer/howtos/website_themes/layout.rst:517
msgid "Copyright"
msgstr ""
#: ../../content/developer/howtos/website_themes/layout.rst:519
msgid "There is only one template available at the moment for the copyright bar."
msgstr ""
#: ../../content/developer/howtos/website_themes/layout.rst:521
msgid "To replace the content or modify its structure, you can add your own code to the following XPath."
msgstr ""
#: ../../content/developer/howtos/website_themes/layout.rst:535
msgid "Drop zone"
msgstr ""
#: ../../content/developer/howtos/website_themes/layout.rst:537
msgid "Instead of defining the complete layout of a page, you can create building blocks (snippets) and let the user choose where to drag and drop them, creating the page layout on their own. We call this *modular design*."
msgstr ""
#: ../../content/developer/howtos/website_themes/layout.rst:541
msgid "You can define an empty area that the user can fill with snippets."
msgstr ""
#: ../../content/developer/howtos/website_themes/layout.rst:554
msgid "Class"
msgstr ""
#: ../../content/developer/howtos/website_themes/layout.rst:556
msgid "oe_structure"
msgstr ""
#: ../../content/developer/howtos/website_themes/layout.rst:557
msgid "Define a drag-and-drop area for the user."
msgstr ""
#: ../../content/developer/howtos/website_themes/layout.rst:558
msgid "oe_structure_solo"
msgstr ""
#: ../../content/developer/howtos/website_themes/layout.rst:559
msgid "Only one snippet can be dropped in this area."
msgstr ""
#: ../../content/developer/howtos/website_themes/layout.rst:561
msgid "You can also populate an existing drop zone with your content."
msgstr ""
#: ../../content/developer/howtos/website_themes/layout.rst:574
msgid "Responsive"
msgstr ""
#: ../../content/developer/howtos/website_themes/layout.rst:576
msgid "You can find some hints below to help you make your website responsive."
msgstr ""
#: ../../content/developer/howtos/website_themes/layout.rst:579
msgid "Bootstrap"
msgstr ""
#: ../../content/developer/howtos/website_themes/layout.rst:582
msgid "`Bootstrap documentation on responsive breakpoints <https://getbootstrap.com/docs/4.6/layout/overview/#responsive-breakpoints>`_"
msgstr ""
#: ../../content/developer/howtos/website_themes/layout.rst:584
msgid "`Bootstrap documentation on display property <https://getbootstrap.com/docs/4.6/utilities/display/>`_"
msgstr ""
#: ../../content/developer/howtos/website_themes/layout.rst:587
msgid "**Font size**"
msgstr ""
#: ../../content/developer/howtos/website_themes/layout.rst:589
msgid "As of v4.3.0, Bootstrap ships with the option to enable responsive font sizes, allowing text to scale more naturally across device and viewport sizes. Enable them by changing the `$enable-responsive-font-sizes` Sass variable to true."
msgstr ""
#: ../../content/developer/howtos/website_themes/layout.rst:594
msgid "`Responsive Font Size GitHub <https://github.com/twbs/rfs/tree/v8.1.0>`_"
msgstr ""
#: ../../content/developer/howtos/website_themes/layout.rst:597
msgid "Website Builder"
msgstr ""
#: ../../content/developer/howtos/website_themes/layout.rst:599
msgid "Hide a specific `<section>` on mobile."
msgstr ""
#: ../../content/developer/howtos/website_themes/layout.rst:607
msgid "Hide a `<col>` on mobile."
msgstr ""
#: ../../content/developer/howtos/website_themes/navigation.rst:3
msgid "Navigation"
msgstr ""
#: ../../content/developer/howtos/website_themes/navigation.rst:5
msgid "You can easily modify the navigation with the Website Builder to fit your needs."
msgstr ""
#: ../../content/developer/howtos/website_themes/navigation.rst:9
msgid "Delete and create menu items."
msgstr ""
#: ../../content/developer/howtos/website_themes/navigation.rst:10
msgid "Create a dropdown menu."
msgstr ""
#: ../../content/developer/howtos/website_themes/navigation.rst:11
msgid "Create a mega menu."
msgstr ""
#: ../../content/developer/howtos/website_themes/navigation.rst:16
msgid "Odoo automatically generates some basic menu items depending on the apps you installed. For example, the Website app adds two items to the main menu. These items are linked to pages, which are also automatically created."
msgstr ""
#: ../../content/developer/howtos/website_themes/navigation.rst:20
msgid "Delete default menu items."
msgstr ""
#: ../../content/developer/howtos/website_themes/navigation.rst:22
#: ../../content/developer/howtos/website_themes/navigation.rst:38
#: ../../content/developer/howtos/website_themes/navigation.rst:107
#: ../../content/developer/howtos/website_themes/navigation.rst:149
msgid "``/website_airproof/data/menu.xml``"
msgstr ""
#: ../../content/developer/howtos/website_themes/navigation.rst:34
msgid "Menu item"
msgstr ""
#: ../../content/developer/howtos/website_themes/navigation.rst:56
#: ../../content/developer/howtos/website_themes/navigation.rst:136
#: ../../content/developer/howtos/website_themes/navigation.rst:172
#: ../../content/developer/howtos/website_themes/pages.rst:137
#: ../../content/developer/howtos/website_themes/pages.rst:201
#: ../../content/developer/howtos/website_themes/shapes.rst:132
#: ../../content/developer/howtos/website_themes/theming.rst:119
#: ../../content/developer/tutorials/define_module_data.rst:175
#: ../../content/developer/tutorials/getting_started/04_basicmodel.rst:187
#: ../../content/developer/tutorials/getting_started/04_basicmodel.rst:260
#: ../../content/developer/tutorials/getting_started/08_relations.rst:71
#: ../../content/developer/tutorials/getting_started/08_relations.rst:178
#: ../../content/developer/tutorials/getting_started/08_relations.rst:241
#: ../../content/developer/tutorials/getting_started/09_compute_onchange.rst:173
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:216
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:263
#: ../../content/developer/tutorials/getting_started/13_inheritance.rst:155
msgid "Field"
msgstr ""
#: ../../content/developer/howtos/website_themes/navigation.rst:59
msgid "Link text"
msgstr ""
#: ../../content/developer/howtos/website_themes/navigation.rst:60
#: ../../content/developer/howtos/website_themes/pages.rst:145
#: ../../content/developer/howtos/website_themes/shapes.rst:138
msgid "url"
msgstr ""
#: ../../content/developer/howtos/website_themes/navigation.rst:61
msgid "Value of the href attribute"
msgstr ""
#: ../../content/developer/howtos/website_themes/navigation.rst:62
#: ../../content/developer/howtos/website_themes/navigation.rst:138
msgid "parent_id"
msgstr ""
#: ../../content/developer/howtos/website_themes/navigation.rst:63
msgid "The menu in which the item will be added."
msgstr ""
#: ../../content/developer/howtos/website_themes/navigation.rst:64
msgid "website_id"
msgstr ""
#: ../../content/developer/howtos/website_themes/navigation.rst:65
msgid "The website on which the item will be added."
msgstr ""
#: ../../content/developer/howtos/website_themes/navigation.rst:66
msgid "sequence"
msgstr ""
#: ../../content/developer/howtos/website_themes/navigation.rst:67
msgid "Defines the link's position in the top menu."
msgstr ""
#: ../../content/developer/howtos/website_themes/navigation.rst:70
msgid "New window"
msgstr ""
#: ../../content/developer/howtos/website_themes/navigation.rst:72
msgid "Open the link's URL in a new tab."
msgstr ""
#: ../../content/developer/howtos/website_themes/navigation.rst:81
msgid "External Links"
msgstr ""
#: ../../content/developer/howtos/website_themes/navigation.rst:83
msgid "Add a link to an external website."
msgstr ""
#: ../../content/developer/howtos/website_themes/navigation.rst:92
msgid "Anchor"
msgstr ""
#: ../../content/developer/howtos/website_themes/navigation.rst:94
msgid "Link to a specific section of a page."
msgstr ""
#: ../../content/developer/howtos/website_themes/navigation.rst:103
msgid "Dropdown menu"
msgstr ""
#: ../../content/developer/howtos/website_themes/navigation.rst:119
msgid "Add an item to a dropdown menu."
msgstr ""
#: ../../content/developer/howtos/website_themes/navigation.rst:139
msgid "The dropdown in which the item will be added."
msgstr ""
#: ../../content/developer/howtos/website_themes/navigation.rst:142
msgid "Mega menu"
msgstr ""
#: ../../content/developer/howtos/website_themes/navigation.rst:144
msgid "A mega menu is a dropdown menu with additional possibilities and not just a list of links. In a mega menu, you can use any kind of content (text, images, icons, ...)."
msgstr ""
#: ../../content/developer/howtos/website_themes/navigation.rst:174
msgid "is_mega_menu"
msgstr ""
#: ../../content/developer/howtos/website_themes/navigation.rst:175
msgid "Enable the mega menu feature."
msgstr ""
#: ../../content/developer/howtos/website_themes/navigation.rst:176
msgid "mega_menu_classes"
msgstr ""
#: ../../content/developer/howtos/website_themes/navigation.rst:177
msgid "Custom classes to be added to the main element"
msgstr ""
#: ../../content/developer/howtos/website_themes/navigation.rst:178
msgid "mega_menu_content"
msgstr ""
#: ../../content/developer/howtos/website_themes/navigation.rst:179
msgid "The default content of the mega menu"
msgstr ""
#: ../../content/developer/howtos/website_themes/navigation.rst:182
msgid "Custom template"
msgstr ""
#: ../../content/developer/howtos/website_themes/navigation.rst:199
msgid "Use the following code to add an option for your new custom mega menu on the Website Builder."
msgstr ""
#: ../../content/developer/howtos/website_themes/pages.rst:3
msgid "Pages"
msgstr ""
#: ../../content/developer/howtos/website_themes/pages.rst:5
msgid "In this chapter, you will learn how to declare static pages."
msgstr ""
#: ../../content/developer/howtos/website_themes/pages.rst:8
msgid "Default pages"
msgstr ""
#: ../../content/developer/howtos/website_themes/pages.rst:10
msgid "In Odoo, websites come with a few default static pages (Home, Contact us, 404, ...). They are built the following way."
msgstr ""
#: ../../content/developer/howtos/website_themes/pages.rst:30
msgid "Define the meta title."
msgstr ""
#: ../../content/developer/howtos/website_themes/pages.rst:36
msgid "Define the meta description."
msgstr ""
#: ../../content/developer/howtos/website_themes/pages.rst:42
msgid "Add a CSS class to the page."
msgstr ""
#: ../../content/developer/howtos/website_themes/pages.rst:48
msgid "Hide the header."
msgstr ""
#: ../../content/developer/howtos/website_themes/pages.rst:54
msgid "Hide the footer."
msgstr ""
#: ../../content/developer/howtos/website_themes/pages.rst:60
msgid "If needed, deactivate default pages."
msgstr ""
#: ../../content/developer/howtos/website_themes/pages.rst:62
msgid "``/website_airproof/data/pages/home.xml``"
msgstr ""
#: ../../content/developer/howtos/website_themes/pages.rst:69
msgid "``/website_airproof/data/pages/contactus.xml``"
msgstr ""
#: ../../content/developer/howtos/website_themes/pages.rst:76
msgid "Alternatively, replace the default content of these pages using XPath."
msgstr ""
#: ../../content/developer/howtos/website_themes/pages.rst:78
msgid "``/website_airproof/data/pages/404.xml``"
msgstr ""
#: ../../content/developer/howtos/website_themes/pages.rst:94
msgid "`Odoo eLearning: Search Engine Optimization (SEO) <https://www.odoo.com/slides/slide/search-engine-optimization-seo-648>`_"
msgstr ""
#: ../../content/developer/howtos/website_themes/pages.rst:96
2025-02-27 17:49:19 +07:00
msgid ":doc:`Documentation on SEO <../../../applications/websites/website/pages/seo>`"
msgstr ""
#: ../../content/developer/howtos/website_themes/pages.rst:99
msgid "Theme pages"
msgstr ""
#: ../../content/developer/howtos/website_themes/pages.rst:101
msgid "You can add as many pages as you want to your website. Instead of defining a `<template>`, create a page object."
msgstr ""
#: ../../content/developer/howtos/website_themes/pages.rst:106
msgid "``/website_airproof/data/pages/about_us.xml``"
msgstr ""
#: ../../content/developer/howtos/website_themes/pages.rst:140
msgid "Page name."
msgstr ""
#: ../../content/developer/howtos/website_themes/pages.rst:141
msgid "is_published"
msgstr ""
#: ../../content/developer/howtos/website_themes/pages.rst:142
msgid "Define if the page is published (visible to visitors)."
msgstr ""
#: ../../content/developer/howtos/website_themes/pages.rst:143
msgid "key"
msgstr ""
#: ../../content/developer/howtos/website_themes/pages.rst:144
msgid "View key (must be unique)"
msgstr ""
#: ../../content/developer/howtos/website_themes/pages.rst:146
msgid "URL where the page is reachable."
msgstr ""
#: ../../content/developer/howtos/website_themes/pages.rst:147
#: ../../content/developer/reference/backend/orm.rst:0
#: ../../content/developer/reference/user_interface/view_architectures.rst:0
#: ../../content/developer/reference/user_interface/view_architectures/button_attribute_context.rst:0
#: ../../content/developer/reference/user_interface/view_architectures/button_attribute_help.rst:0
#: ../../content/developer/reference/user_interface/view_architectures/button_attribute_icon.rst:0
#: ../../content/developer/reference/user_interface/view_architectures/button_attribute_name.rst:0
#: ../../content/developer/reference/user_interface/view_architectures/button_attribute_string.rst:0
#: ../../content/developer/reference/user_interface/view_architectures/button_attribute_type.rst:0
#: ../../content/developer/reference/user_interface/view_architectures/field_attribute_name.rst:0
#: ../../content/developer/reference/user_interface/view_architectures/field_attribute_readonly.rst:0
#: ../../content/developer/reference/user_interface/view_architectures/field_attribute_required.rst:0
#: ../../content/developer/reference/user_interface/view_architectures/field_attribute_string.rst:0
#: ../../content/developer/reference/user_interface/view_architectures/field_attribute_widget.rst:0
#: ../../content/developer/reference/user_interface/view_architectures/generic_attribute_class.rst:0
#: ../../content/developer/reference/user_interface/view_architectures/generic_attribute_column_invisible.rst:0
#: ../../content/developer/reference/user_interface/view_architectures/generic_attribute_groups.rst:0
#: ../../content/developer/reference/user_interface/view_architectures/generic_attribute_invisible.rst:0
#: ../../content/developer/reference/user_interface/view_architectures/root_attribute_banner_route.rst:0
#: ../../content/developer/reference/user_interface/view_architectures/root_attribute_create.rst:0
#: ../../content/developer/reference/user_interface/view_architectures/root_attribute_default_group_by.rst:0
#: ../../content/developer/reference/user_interface/view_architectures/root_attribute_default_order.rst:0
#: ../../content/developer/reference/user_interface/view_architectures/root_attribute_delete.rst:0
#: ../../content/developer/reference/user_interface/view_architectures/root_attribute_edit.rst:0
#: ../../content/developer/reference/user_interface/view_architectures/root_attribute_sample.rst:0
#: ../../content/developer/reference/user_interface/view_architectures/root_attribute_string.rst:0
#: ../../content/developer/reference/user_interface/view_records.rst:0
#: ../../../odoo/addons/payment/models/payment_method.py:docstring of odoo.addons.payment.models.payment_method.PaymentMethod._get_from_code:0
#: ../../content/developer/reference/user_interface/view_architectures/button_attribute_context.rst:0
#: ../../content/developer/reference/user_interface/view_architectures/button_attribute_help.rst:0
#: ../../content/developer/reference/user_interface/view_architectures/button_attribute_icon.rst:0
#: ../../content/developer/reference/user_interface/view_architectures/button_attribute_name.rst:0
#: ../../content/developer/reference/user_interface/view_architectures/button_attribute_string.rst:0
#: ../../content/developer/reference/user_interface/view_architectures/button_attribute_type.rst:0
#: ../../content/developer/reference/user_interface/view_architectures/field_attribute_name.rst:0
#: ../../content/developer/reference/user_interface/view_architectures/field_attribute_readonly.rst:0
#: ../../content/developer/reference/user_interface/view_architectures/field_attribute_required.rst:0
#: ../../content/developer/reference/user_interface/view_architectures/field_attribute_string.rst:0
#: ../../content/developer/reference/user_interface/view_architectures/field_attribute_widget.rst:0
#: ../../content/developer/reference/user_interface/view_architectures/generic_attribute_class.rst:0
#: ../../content/developer/reference/user_interface/view_architectures/generic_attribute_column_invisible.rst:0
#: ../../content/developer/reference/user_interface/view_architectures/generic_attribute_groups.rst:0
#: ../../content/developer/reference/user_interface/view_architectures/generic_attribute_invisible.rst:0
#: ../../content/developer/reference/user_interface/view_architectures/root_attribute_banner_route.rst:0
#: ../../content/developer/reference/user_interface/view_architectures/root_attribute_create.rst:0
#: ../../content/developer/reference/user_interface/view_architectures/root_attribute_default_group_by.rst:0
#: ../../content/developer/reference/user_interface/view_architectures/root_attribute_default_order.rst:0
#: ../../content/developer/reference/user_interface/view_architectures/root_attribute_delete.rst:0
#: ../../content/developer/reference/user_interface/view_architectures/root_attribute_edit.rst:0
#: ../../content/developer/reference/user_interface/view_architectures/root_attribute_sample.rst:0
#: ../../content/developer/reference/user_interface/view_architectures/root_attribute_string.rst:0
#: ../../docstring of odoo.models.BaseModel._inherit:0
msgid "type"
msgstr ""
#: ../../content/developer/howtos/website_themes/pages.rst:148
msgid "View type"
msgstr ""
#: ../../content/developer/howtos/website_themes/pages.rst:149
msgid "arch"
msgstr ""
#: ../../content/developer/howtos/website_themes/pages.rst:150
msgid "View architecture"
msgstr ""
#: ../../content/developer/howtos/website_themes/pages.rst:152
msgid "With `<t t-call=\"website.layout\">` you use the Odoo default page layout with your code."
msgstr ""
#: ../../content/developer/howtos/website_themes/pages.rst:-1
#: ../../content/developer/howtos/website_themes/pages.rst:157
msgid "Header overlay"
msgstr ""
#: ../../content/developer/howtos/website_themes/pages.rst:159
msgid "Make the header background transparent and stand on top of the page content."
msgstr ""
#: ../../content/developer/howtos/website_themes/pages.rst:169
msgid "Media"
msgstr ""
#: ../../content/developer/howtos/website_themes/pages.rst:172
msgid "Images"
msgstr ""
#: ../../content/developer/howtos/website_themes/pages.rst:174
msgid "You can record images in the database and use them later in your design/code. They will also be available for the end user through the *media dialog*."
msgstr ""
#: ../../content/developer/howtos/website_themes/pages.rst:-1
msgid "Media window"
msgstr ""
#: ../../content/developer/howtos/website_themes/pages.rst:180
msgid "The Website Builder supports the following image file formats: JPG, GIF, PNG, and SVG."
msgstr ""
#: ../../content/developer/howtos/website_themes/pages.rst:204
msgid "Image name"
msgstr ""
#: ../../content/developer/howtos/website_themes/pages.rst:205
#: ../../content/developer/howtos/website_themes/shapes.rst:136
msgid "datas"
msgstr ""
#: ../../content/developer/howtos/website_themes/pages.rst:206
msgid "Path to the image file"
msgstr ""
#: ../../content/developer/howtos/website_themes/pages.rst:207
msgid "res_model"
msgstr ""
#: ../../content/developer/howtos/website_themes/pages.rst:208
msgid "Name of the wizard model"
msgstr ""
#: ../../content/developer/howtos/website_themes/pages.rst:210
msgid "Use it as a background image."
msgstr ""
#: ../../content/developer/howtos/website_themes/pages.rst:216
msgid "Use it as a regular image."
msgstr ""
#: ../../content/developer/howtos/website_themes/pages.rst:222
msgid "Use as a regular image with a color filter."
msgstr ""
#: ../../content/developer/howtos/website_themes/pages.rst:232
msgid "The image size greatly influences the user experience, search engine optimization, and overall website performance. So, be sure to size your images correctly."
msgstr ""
#: ../../content/developer/howtos/website_themes/pages.rst:236
msgid "Videos"
msgstr ""
#: ../../content/developer/howtos/website_themes/pages.rst:238
msgid "Add videos as background."
msgstr ""
#: ../../content/developer/howtos/website_themes/pages.rst:253
msgid "data-bg-video-src"
msgstr ""
#: ../../content/developer/howtos/website_themes/pages.rst:254
#: ../../content/developer/howtos/website_themes/pages.rst:277
#: ../../content/developer/howtos/website_themes/pages.rst:279
msgid "Video URL."
msgstr ""
#: ../../content/developer/howtos/website_themes/pages.rst:256
msgid "Add videos as content."
msgstr ""
#: ../../content/developer/howtos/website_themes/pages.rst:276
msgid "data-oe-expression"
msgstr ""
#: ../../content/developer/howtos/website_themes/pages.rst:278
msgid "src"
msgstr ""
#: ../../content/developer/howtos/website_themes/pages.rst:282
msgid "Icons"
msgstr ""
#: ../../content/developer/howtos/website_themes/pages.rst:284
msgid "By default, the Font Awesome icons library is included in the Website Builder. You can place icons anywhere using the CSS Prefix `fa` and the icon's name. Font Awesome is designed to be used with inline elements. You can use `<i>` tag for brevity, but using a `<span>` is more semantically correct."
msgstr ""
#: ../../content/developer/howtos/website_themes/pages.rst:294
msgid "`Font Awesome v4 icons <https://fontawesome.com/v4/icons/>`_"
msgstr ""
#: ../../content/developer/howtos/website_themes/pages.rst:296
msgid "Enable the Website Builder style options."
msgstr ""
#: ../../content/developer/howtos/website_themes/pages.rst:302
msgid "Increase the icon size (fa-2x, fa-3x, fa-4x, or fa-5x classes)."
msgstr ""
#: ../../content/developer/howtos/website_themes/pages.rst:-1
msgid "Icon options"
msgstr ""
#: ../../content/developer/howtos/website_themes/setup.rst:3
#: ../../content/developer/tutorials/discover_js_framework.rst:37
#: ../../content/developer/tutorials/master_odoo_web_framework.rst:46
msgid "Setup"
msgstr ""
#: ../../content/developer/howtos/website_themes/setup.rst:5
msgid "In this chapter, you will learn:"
msgstr ""
#: ../../content/developer/howtos/website_themes/setup.rst:7
msgid "To set up your local development environment."
msgstr ""
#: ../../content/developer/howtos/website_themes/setup.rst:8
msgid "The outline of the Odoo database structure."
msgstr ""
#: ../../content/developer/howtos/website_themes/setup.rst:9
msgid "To export and import an Odoo database in your local environment."
msgstr ""
#: ../../content/developer/howtos/website_themes/setup.rst:10
msgid "To have an Odoo instance up and running."
msgstr ""
#: ../../content/developer/howtos/website_themes/setup.rst:13
msgid "Install"
msgstr ""
#: ../../content/developer/howtos/website_themes/setup.rst:15
msgid "There are multiple ways to :doc:`install Odoo <../../../administration/install>`, depending on the intended use case. This documentation assumes you use the :doc:`source install <../../../administration/install/source>` (running Odoo from the source code), which is best suited for Odoo designers and developers."
msgstr ""
#: ../../content/developer/howtos/website_themes/setup.rst:21
msgid "Databases"
msgstr ""
#: ../../content/developer/howtos/website_themes/setup.rst:24
#: ../../content/developer/reference/backend/data.rst:14
#: ../../content/developer/reference/backend/testing.rst:546
msgid "Structure"
msgstr ""
#: ../../content/developer/howtos/website_themes/setup.rst:26
msgid "Every Odoo application works similarly; they are built with the same logic. A model contains fields and relational fields that link to other models. Each model has views representing all its fields, with backend and frontend views."
msgstr ""
#: ../../content/developer/howtos/website_themes/setup.rst:31
#: ../../content/developer/reference/backend/orm.rst:20
#: ../../content/developer/reference/upgrade_utils.rst:113
msgid "Models"
msgstr ""
#: ../../content/developer/howtos/website_themes/setup.rst:33
msgid "The basis of Odoo is models. Models use fields to record the data. Records are stored in a database: they are therefore linked to a model. In Odoo, you can find the different models in the backend by enabling the :ref:`developer mode <developer-mode>` and then going to :menuselection:`Settings --> Technical --> Database Structure: Models`."
msgstr ""
#: ../../content/developer/howtos/website_themes/setup.rst:-1
msgid "Models page"
msgstr ""
#: ../../content/developer/howtos/website_themes/setup.rst:42
#: ../../content/developer/reference/backend/orm.rst:114
#: ../../content/developer/reference/backend/orm.rst:871
#: ../../content/developer/reference/frontend/javascript_reference.rst:1219
#: ../../content/developer/reference/upgrade_utils.rst:69
#: ../../content/developer/reference/user_interface/view_records.rst:68
msgid "Fields"
msgstr ""
#: ../../content/developer/howtos/website_themes/setup.rst:44
msgid "In a model, we will centralize fields (field names we need to target in our code)."
msgstr ""
#: ../../content/developer/howtos/website_themes/setup.rst:47
msgid ":doc:`/applications/productivity/studio/fields`"
msgstr ""
#: ../../content/developer/howtos/website_themes/setup.rst:50
msgid "Classic fields"
msgstr ""
#: ../../content/developer/howtos/website_themes/setup.rst:52
#: ../../content/developer/tutorials/getting_started/04_basicmodel.rst:192
#: ../../content/developer/tutorials/getting_started/09_compute_onchange.rst:176
msgid "Date"
msgstr ""
#: ../../content/developer/howtos/website_themes/setup.rst:53
#: ../../content/developer/tutorials/getting_started/04_basicmodel.rst:189
#: ../../content/developer/tutorials/getting_started/04_basicmodel.rst:191
#: ../../content/developer/tutorials/getting_started/08_relations.rst:73
#: ../../content/developer/tutorials/getting_started/08_relations.rst:180
msgid "Char"
msgstr ""
#: ../../content/developer/howtos/website_themes/setup.rst:54
#: ../../content/developer/tutorials/getting_started/04_basicmodel.rst:201
#: ../../content/developer/tutorials/getting_started/08_relations.rst:244
msgid "Selection"
msgstr ""
#: ../../content/developer/howtos/website_themes/setup.rst:58
#: ../../content/developer/reference/frontend/javascript_reference.rst:1761
#: ../../content/developer/reference/user_interface/view_architectures.rst:218
#: ../../content/developer/reference/user_interface/view_architectures.rst:243
#: ../../content/developer/reference/user_interface/view_architectures.rst:308
#: ../../content/developer/tutorials/backend.rst:459
msgid "Relational fields"
msgstr ""
#: ../../content/developer/howtos/website_themes/setup.rst:60
msgid "Relational fields call a field from another model. They allow you to link models together and make them interact easily. In other words, when you use a relational field, you link a record with another one (located on another model), enabling you to retrieve the content of the fields located on this linked record."
msgstr ""
#: ../../content/developer/howtos/website_themes/setup.rst:65
msgid "**Many2one** fields are filled in by choosing one record from a list of records on another model (from *many* records, you select *one*). For example, the *customer* field on a quotation makes you choose one customer from a list of several customers on the *contact* model."
msgstr ""
#: ../../content/developer/howtos/website_themes/setup.rst:68
msgid "**One2many** fields are reverse searches of existing many2one relations. For example, you could list on a contact all their existing quotations (from *one* record, you display *many*)."
msgstr ""
#: ../../content/developer/howtos/website_themes/setup.rst:70
msgid "**Many2many** fields are filled in by choosing one or several records from a list of records on another model. For example, you can put several tags on one product, and several products can use the same tags (from *many* records, you can select *many*)."
msgstr ""
#: ../../content/developer/howtos/website_themes/setup.rst:77
msgid "Views define how records should be displayed to end-users. They are specified in XML, meaning they can be edited independently from the models they represent. They are flexible and allow deep customization of the screens they control."
msgstr ""
#: ../../content/developer/howtos/website_themes/setup.rst:82
msgid "Backend vs. Frontend"
msgstr ""
#: ../../content/developer/howtos/website_themes/setup.rst:84
msgid "**Backend views**: Kanban, List, Form, etc."
msgstr ""
#: ../../content/developer/howtos/website_themes/setup.rst:85
msgid "**Frontend view**: QWeb"
msgstr ""
#: ../../content/developer/howtos/website_themes/setup.rst:88
msgid "Static vs. Dynamic"
msgstr ""
#: ../../content/developer/howtos/website_themes/setup.rst:90
msgid "**Static pages** have stable content, such as the homepage. You can define their URL and set some properties like published, indexed, etc."
msgstr ""
#: ../../content/developer/howtos/website_themes/setup.rst:92
msgid "**Dynamic pages** are dynamically generated, such as the product page. Their URL is dynamic and is accessible to all by default (this can be changed by configuring access rights)."
msgstr ""
#: ../../content/developer/howtos/website_themes/setup.rst:96
msgid "Standard vs. Inherited"
msgstr ""
#: ../../content/developer/howtos/website_themes/setup.rst:98
msgid "**Standard views** are base views implemented by Odoo. They are directly derived from their model. You should never change them as they allow updating an Odoo database without overwriting a client's modifications."
msgstr ""
#: ../../content/developer/howtos/website_themes/setup.rst:101
msgid "**Inherited views** are duplicated views. Modifications always take place in an inherited view. If there is a duplicate view, there will be two views with the same name in the database, but the duplicated view will not have an ID like for standard view."
msgstr ""
#: ../../content/developer/howtos/website_themes/setup.rst:106
msgid "Import an existing database"
msgstr ""
#: ../../content/developer/howtos/website_themes/setup.rst:109
msgid "You can directly go to the :doc:`theming` chapter if you do not need to import an existing database."
msgstr ""
#: ../../content/developer/howtos/website_themes/setup.rst:113
msgid "Dump"
msgstr ""
#: ../../content/developer/howtos/website_themes/setup.rst:118
msgid "Go to `<database_url>/saas_worker/dump`."
msgstr ""
#: ../../content/developer/howtos/website_themes/setup.rst:123
msgid "Connect to Odoo.sh."
msgstr ""
#: ../../content/developer/howtos/website_themes/setup.rst:124
msgid "Select the branch you want to back up."
msgstr ""
#: ../../content/developer/howtos/website_themes/setup.rst:125
msgid "Choose the :guilabel:`BACKUPS` tab."
msgstr ""
#: ../../content/developer/howtos/website_themes/setup.rst:126
msgid "Click the :guilabel:`Create Backup` button."
msgstr ""
#: ../../content/developer/howtos/website_themes/setup.rst:127
msgid "When the process is over, a notification appears. Open it and click the :guilabel:`Go to Backup` button."
msgstr ""
#: ../../content/developer/howtos/website_themes/setup.rst:129
msgid "Click the :guilabel:`Download` icon. Select :guilabel:`Testing` under :guilabel:`Purpose` and :guilabel:`With filestore` under :guilabel:`Filestore`."
msgstr ""
#: ../../content/developer/howtos/website_themes/setup.rst:0
msgid "Download backup"
msgstr ""
#: ../../content/developer/howtos/website_themes/setup.rst:135
msgid "You will receive a notification when the dump is ready to be downloaded. Open it and click on :guilabel:`Download` to get your dump."
msgstr ""
#: ../../content/developer/howtos/website_themes/setup.rst:0
msgid "Database backup"
msgstr ""
#: ../../content/developer/howtos/website_themes/setup.rst:142
msgid "Move filestore"
msgstr ""
#: ../../content/developer/howtos/website_themes/setup.rst:144
msgid "Copy all the folders included in the filestore folder and paste them to the following location on your computer:"
msgstr ""
#: ../../content/developer/howtos/website_themes/setup.rst:147
msgid "macOS: `/Users/<User>/Library/Application Support/Odoo/filestore/<database_name>`"
msgstr ""
#: ../../content/developer/howtos/website_themes/setup.rst:148
msgid "Linux: `/home/<User>/.local/share/Odoo/filestore/<database_name>`"
msgstr ""
#: ../../content/developer/howtos/website_themes/setup.rst:151
msgid "`/Library` is a hidden folder."
msgstr ""
#: ../../content/developer/howtos/website_themes/setup.rst:154
msgid "Database setup"
msgstr ""
#: ../../content/developer/howtos/website_themes/setup.rst:156
msgid "Create an empty database."
msgstr ""
#: ../../content/developer/howtos/website_themes/setup.rst:162
msgid "Import the SQL file in the database that you just created."
msgstr ""
#: ../../content/developer/howtos/website_themes/setup.rst:168
msgid "Reset the admin user password."
msgstr ""
#: ../../content/developer/howtos/website_themes/setup.rst:177
#: ../../content/developer/tutorials/getting_started.rst:7
msgid "Getting started"
msgstr ""
#: ../../content/developer/howtos/website_themes/setup.rst:180
msgid "Running Odoo"
msgstr ""
#: ../../content/developer/howtos/website_themes/setup.rst:182
msgid "Once all dependencies are set up, Odoo can be launched by running `odoo-bin`, the command-line interface of the server. It is located at the root of the Odoo Community directory."
msgstr ""
#: ../../content/developer/howtos/website_themes/setup.rst:185
msgid ":ref:`Running Odoo <install/source/running_odoo>`"
msgstr ""
#: ../../content/developer/howtos/website_themes/setup.rst:186
msgid "`Docker <https://hub.docker.com/_/odoo/>`_"
msgstr ""
#: ../../content/developer/howtos/website_themes/setup.rst:188
msgid "To configure the server, you can specify command-line arguments or a configuration file. The first method is presented below."
msgstr ""
#: ../../content/developer/howtos/website_themes/setup.rst:191
msgid "The :ref:`CLI <reference/cmdline>` offers several functionalities related to Odoo. You can use it to :ref:`run the server <reference/cmdline/server>`, scaffold an Odoo theme, populate a database, or count the number of lines of code."
msgstr ""
#: ../../content/developer/howtos/website_themes/setup.rst:196
msgid "Shell script"
msgstr ""
#: ../../content/developer/howtos/website_themes/setup.rst:198
msgid "A typical way to :ref:`run the server <reference/cmdline/server>` would be to add all command line arguments to a `.sh` script."
msgstr ""
#: ../../content/developer/howtos/website_themes/setup.rst:210
#: ../../content/developer/howtos/website_themes/theming.rst:69
msgid "Folder"
msgstr ""
#: ../../content/developer/howtos/website_themes/setup.rst:212
msgid ":option:`--addons-path <odoo-bin --addons-path>`"
msgstr ""
#: ../../content/developer/howtos/website_themes/setup.rst:213
#: ../../content/developer/reference/cli.rst:829
msgid "Comma-separated list of directories in which modules are stored. These directories are scanned for modules."
msgstr ""
#: ../../content/developer/howtos/website_themes/setup.rst:215
msgid ":option:`-d <odoo-bin --database>`"
msgstr ""
#: ../../content/developer/howtos/website_themes/setup.rst:217
msgid ":option:`--database <odoo-bin --database>`"
msgstr ""
#: ../../content/developer/howtos/website_themes/setup.rst:218
msgid "database(s) used when installing or updating modules."
msgstr ""
#: ../../content/developer/howtos/website_themes/setup.rst:219
msgid ":option:`--db-filter <odoo-bin --db-filter>`"
msgstr ""
#: ../../content/developer/howtos/website_themes/setup.rst:220
msgid "Hides databases that do not match the filter."
msgstr ""
#: ../../content/developer/howtos/website_themes/setup.rst:221
msgid ":option:`-i <odoo-bin --init>`"
msgstr ""
#: ../../content/developer/howtos/website_themes/setup.rst:223
msgid ":option:`--init <odoo-bin --init>`"
msgstr ""
#: ../../content/developer/howtos/website_themes/setup.rst:224
msgid "Comma-separated list of modules to install before running the server. (requires `-d`)"
msgstr ""
#: ../../content/developer/howtos/website_themes/setup.rst:225
msgid ":option:`-u <odoo-bin --update>`"
msgstr ""
#: ../../content/developer/howtos/website_themes/setup.rst:227
msgid ":option:`--update <odoo-bin --update>`"
msgstr ""
#: ../../content/developer/howtos/website_themes/setup.rst:228
msgid "Comma-separated list of modules to update before running the server. (requires `-d`)"
msgstr ""
#: ../../content/developer/howtos/website_themes/setup.rst:229
msgid ":option:`--without-demo <odoo-bin --without-demo>`"
msgstr ""
#: ../../content/developer/howtos/website_themes/setup.rst:230
msgid "Disables demo data loading for modules installed comma-separated; use `all` for all modules. (requires `-d` and `-i`)"
msgstr ""
#: ../../content/developer/howtos/website_themes/setup.rst:232
msgid ":option:`--dev <odoo-bin --dev>`"
msgstr ""
#: ../../content/developer/howtos/website_themes/setup.rst:233
msgid "Comma-separated list of features. For development purposes only. :ref:`More info <reference/cmdline/dev>`"
msgstr ""
#: ../../content/developer/howtos/website_themes/setup.rst:239
msgid "After the server has started (the INFO log `odoo.modules.loading: Modules loaded.` is printed), open http://localhost:8069 in your web browser and log in with the base administrator account."
msgstr ""
#: ../../content/developer/howtos/website_themes/setup.rst:242
msgid "Type **admin** for the email and **admin** for the password."
msgstr ""
#: ../../content/developer/howtos/website_themes/setup.rst:-1
msgid "Welcome homepage"
msgstr ""
#: ../../content/developer/howtos/website_themes/setup.rst:248
msgid "Hit *CTRL+C* to stop the server. Do it twice if needed."
msgstr ""
#: ../../content/developer/howtos/website_themes/setup.rst:251
msgid "Developer mode"
msgstr ""
#: ../../content/developer/howtos/website_themes/setup.rst:253
msgid "The developer mode, also known as debug mode, is useful for development as it gives access to additional tools. In the next chapters, it is assumed that you have enabled the developer mode."
msgstr ""
#: ../../content/developer/howtos/website_themes/setup.rst:257
msgid ":doc:`/applications/general/developer_mode`"
msgstr ""
#: ../../content/developer/howtos/website_themes/shapes.rst:3
msgid "Shapes"
msgstr ""
#: ../../content/developer/howtos/website_themes/shapes.rst:5
msgid "Shapes are handy if you want to add personality to your website."
msgstr ""
#: ../../content/developer/howtos/website_themes/shapes.rst:7
msgid "In this chapter, you will learn how to add standard and custom background and image shapes."
msgstr ""
#: ../../content/developer/howtos/website_themes/shapes.rst:10
msgid "Background shapes"
msgstr ""
#: ../../content/developer/howtos/website_themes/shapes.rst:12
msgid "Background shapes are SVG files that you can add as a decorative background in your different sections. Each shape has one or several customizable colors, and some of them are animated."
msgstr ""
#: ../../content/developer/howtos/website_themes/shapes.rst:18
msgid "A large selection of default background shapes is available."
msgstr ""
#: ../../content/developer/howtos/website_themes/shapes.rst:31
msgid "`data-oe-shape-data` is the location of your shape."
msgstr ""
#: ../../content/developer/howtos/website_themes/shapes.rst:33
msgid "Flip the shape horizontally or vertically by using the X or Y axis."
msgstr ""
#: ../../content/developer/howtos/website_themes/shapes.rst:45
msgid "Colors mapping"
msgstr ""
#: ../../content/developer/howtos/website_themes/shapes.rst:47
msgid "You can also change the default color mapping of your shape."
msgstr ""
#: ../../content/developer/howtos/website_themes/shapes.rst:50
msgid "Switch colors mapping"
msgstr ""
#: ../../content/developer/howtos/website_themes/shapes.rst:52
msgid "First, put the c* color (here `4`)."
msgstr ""
#: ../../content/developer/howtos/website_themes/shapes.rst:54
msgid "Then, the replacement color (here `3`). These replacement colors also range from 1 to 5:"
msgstr ""
#: ../../content/developer/howtos/website_themes/shapes.rst:56
msgid "`1` = background color of the color preset 1 (o-cc1)."
msgstr ""
#: ../../content/developer/howtos/website_themes/shapes.rst:57
msgid "`2` = background color of the color preset 2 (o-cc2)."
msgstr ""
#: ../../content/developer/howtos/website_themes/shapes.rst:58
msgid "`3` = background color of the color preset 3 (o-cc3)."
msgstr ""
#: ../../content/developer/howtos/website_themes/shapes.rst:59
msgid "`4` = background color of the color preset 4 (o-cc4)."
msgstr ""
#: ../../content/developer/howtos/website_themes/shapes.rst:60
msgid "`5` = background color of the color preset 5 (o-cc5)."
msgstr ""
#: ../../content/developer/howtos/website_themes/shapes.rst:62
#: ../../content/developer/howtos/website_themes/shapes.rst:73
msgid "``/website_airproof/static/src/scss/boostrap_overridden.scss``"
msgstr ""
#: ../../content/developer/howtos/website_themes/shapes.rst:68
msgid "Add extra colors mapping"
msgstr ""
#: ../../content/developer/howtos/website_themes/shapes.rst:70
msgid "Adding extra color mapping allows you to add a color variant to the template of a shape while keeping the original."
msgstr ""
#: ../../content/developer/howtos/website_themes/shapes.rst:90
msgid "Sometimes, your design might require creating one or several custom shapes."
msgstr ""
#: ../../content/developer/howtos/website_themes/shapes.rst:92
msgid "Firstly, you need to create an SVG file for your shape."
msgstr ""
#: ../../content/developer/howtos/website_themes/shapes.rst:94
msgid "``/website_airproof/static/shapes/hexagons/01.svg``"
msgstr ""
#: ../../content/developer/howtos/website_themes/shapes.rst:101
msgid "Make sure to use colors from the default Odoo palette for your shape."
msgstr ""
#: ../../content/developer/howtos/website_themes/shapes.rst:113
msgid "Declare your shape file."
msgstr ""
#: ../../content/developer/howtos/website_themes/shapes.rst:115
msgid "``/website_airproof/data/shapes.xml``"
msgstr ""
#: ../../content/developer/howtos/website_themes/shapes.rst:135
msgid "Name of the shape"
msgstr ""
#: ../../content/developer/howtos/website_themes/shapes.rst:137
msgid "Path to the shape"
msgstr ""
#: ../../content/developer/howtos/website_themes/shapes.rst:140
msgid "public"
msgstr ""
#: ../../content/developer/howtos/website_themes/shapes.rst:141
msgid "Makes the shape available for later editing."
msgstr ""
#: ../../content/developer/howtos/website_themes/shapes.rst:143
msgid "Define the styles of your shape."
msgstr ""
#: ../../content/developer/howtos/website_themes/shapes.rst:164
#: ../../content/developer/reference/frontend/assets.rst:297
#: ../../content/developer/reference/frontend/framework_overview.rst:106
msgid "Key"
msgstr ""
#: ../../content/developer/howtos/website_themes/shapes.rst:166
msgid "File location"
msgstr ""
#: ../../content/developer/howtos/website_themes/shapes.rst:167
msgid "`hexagons/01` corresponds to the location of your file in the `shapes` folder."
msgstr ""
#: ../../content/developer/howtos/website_themes/shapes.rst:168
msgid "position"
msgstr ""
#: ../../content/developer/howtos/website_themes/shapes.rst:169
msgid "Defines the position of your shape."
msgstr ""
#: ../../content/developer/howtos/website_themes/shapes.rst:170
msgid "size"
msgstr ""
#: ../../content/developer/howtos/website_themes/shapes.rst:171
msgid "Defines the size of your shape."
msgstr ""
#: ../../content/developer/howtos/website_themes/shapes.rst:172
msgid "colors"
msgstr ""
#: ../../content/developer/howtos/website_themes/shapes.rst:173
msgid "Defines the color c* you want it to have (this will override the color you specified in your SVG)."
msgstr ""
#: ../../content/developer/howtos/website_themes/shapes.rst:175
msgid "repeat-x"
msgstr ""
#: ../../content/developer/howtos/website_themes/shapes.rst:176
msgid "Defines if the shape is repeated horizontally. This key is optional and only needs to be defined if set to `true`."
msgstr ""
#: ../../content/developer/howtos/website_themes/shapes.rst:178
msgid "repeat-y"
msgstr ""
#: ../../content/developer/howtos/website_themes/shapes.rst:179
msgid "Defines if the shape is repeated vertically. This key is optional and only needs to be defined if set to `true`."
msgstr ""
#: ../../content/developer/howtos/website_themes/shapes.rst:182
msgid "Lastly, add your shape to the list of shapes available on the Website Builder."
msgstr ""
#: ../../content/developer/howtos/website_themes/shapes.rst:195
msgid "Your custom shape can now be used the same way as standard shapes."
msgstr ""
#: ../../content/developer/howtos/website_themes/shapes.rst:198
msgid "Image shapes"
msgstr ""
#: ../../content/developer/howtos/website_themes/shapes.rst:200
msgid "Image shapes are SVG files you can add as a clipping mask on your images. Some shapes have customizable colors, and some are animated."
msgstr ""
#: ../../content/developer/howtos/website_themes/shapes.rst:206
msgid "A large selection of default image shapes is available."
msgstr ""
#: ../../content/developer/howtos/website_themes/shapes.rst:226
msgid "data-shape"
msgstr ""
#: ../../content/developer/howtos/website_themes/shapes.rst:227
msgid "Location of the shape"
msgstr ""
#: ../../content/developer/howtos/website_themes/shapes.rst:228
msgid "data-shape-colors"
msgstr ""
#: ../../content/developer/howtos/website_themes/shapes.rst:229
msgid "Colors applied to the shape"
msgstr ""
#: ../../content/developer/howtos/website_themes/shapes.rst:232
msgid "Sometimes, your image shape might not be applied after adding your changes. To fix the issue, open the Website Builder and save the page to force the shape to load."
msgstr ""
#: ../../content/developer/howtos/website_themes/theming.rst:3
msgid "Theming"
msgstr ""
#: ../../content/developer/howtos/website_themes/theming.rst:5
msgid "After your development environment is fully set up, you can start building the skeleton of your theme module. In this chapter, you will discover how to:"
msgstr ""
#: ../../content/developer/howtos/website_themes/theming.rst:8
msgid "Enable/disable the Website Builder's standard options and templates."
msgstr ""
#: ../../content/developer/howtos/website_themes/theming.rst:9
msgid "Define the colors and fonts to use for your design."
msgstr ""
#: ../../content/developer/howtos/website_themes/theming.rst:10
msgid "Get the most out of Bootstrap variables."
msgstr ""
#: ../../content/developer/howtos/website_themes/theming.rst:11
msgid "Add custom styles and JavaScript."
msgstr ""
#: ../../content/developer/howtos/website_themes/theming.rst:14
msgid "Theme module"
msgstr ""
#: ../../content/developer/howtos/website_themes/theming.rst:16
msgid "Odoo comes with a default theme that provides minimal structure and layout. When you create a new theme, you are extending the default theme."
msgstr ""
#: ../../content/developer/howtos/website_themes/theming.rst:19
msgid "Remember to add the directory containing your module to the `addons-path` command-line argument when running Odoo in your development environment."
msgstr ""
#: ../../content/developer/howtos/website_themes/theming.rst:23
msgid "Technical naming"
msgstr ""
#: ../../content/developer/howtos/website_themes/theming.rst:25
msgid "The first step is to create a new directory."
msgstr ""
#: ../../content/developer/howtos/website_themes/theming.rst:32
msgid "Prefix it with `website_` and use only lowercase ASCII alphanumeric characters and underscores."
msgstr ""
#: ../../content/developer/howtos/website_themes/theming.rst:34
msgid "In this documentation, we will use **Airproof** (a fictional project) as an example."
msgstr ""
#: ../../content/developer/howtos/website_themes/theming.rst:39
msgid "Themes are packaged like any Odoo module. Even if you are designing a basic website, you need to package its theme like a module."
msgstr ""
#: ../../content/developer/howtos/website_themes/theming.rst:71
#: ../../content/developer/howtos/website_themes/theming.rst:137
msgid "data"
msgstr ""
#: ../../content/developer/howtos/website_themes/theming.rst:72
msgid "Presets, menus, pages, images, shapes, … (`*.xml`)"
msgstr ""
#: ../../content/developer/howtos/website_themes/theming.rst:73
msgid "i18n"
msgstr ""
#: ../../content/developer/howtos/website_themes/theming.rst:74
msgid "Translations (`*.po`, `*.pot`)"
msgstr ""
#: ../../content/developer/howtos/website_themes/theming.rst:75
msgid "lib"
msgstr ""
#: ../../content/developer/howtos/website_themes/theming.rst:76
msgid "External libraries (`*.js`)"
msgstr ""
#: ../../content/developer/howtos/website_themes/theming.rst:77
msgid "static"
msgstr ""
#: ../../content/developer/howtos/website_themes/theming.rst:78
msgid "Custom assets (`*.jpg`, `*.gif`, `*.png`, `*.svg`, `*.pdf`, `*.scss`, `*.js`)"
msgstr ""
#: ../../content/developer/howtos/website_themes/theming.rst:79
msgid "views"
msgstr ""
#: ../../content/developer/howtos/website_themes/theming.rst:80
msgid "Custom views and templates (`*.xml`)"
msgstr ""
#: ../../content/developer/howtos/website_themes/theming.rst:83
msgid "Initialization"
msgstr ""
#: ../../content/developer/howtos/website_themes/theming.rst:85
msgid "An Odoo module is also a Python package with a :file:`__init__.py` file containing import instructions for various Python files in the module. This file can remain empty for now."
msgstr ""
#: ../../content/developer/howtos/website_themes/theming.rst:89
msgid "Declaration"
msgstr ""
#: ../../content/developer/howtos/website_themes/theming.rst:91
msgid "An Odoo module is declared by its manifest file. This file declares a Python package as an Odoo module and specifies the module's metadata. It must at least contain the `name` field, which is always required. It usually contains much more information."
msgstr ""
#: ../../content/developer/howtos/website_themes/theming.rst:95
#: ../../content/developer/howtos/website_themes/theming.rst:176
#: ../../content/developer/howtos/website_themes/theming.rst:283
#: ../../content/developer/howtos/website_themes/theming.rst:454
#: ../../content/developer/howtos/website_themes/theming.rst:560
#: ../../content/developer/howtos/website_themes/theming.rst:606
msgid "``/website_airproof/__manifest__.py``"
msgstr ""
#: ../../content/developer/howtos/website_themes/theming.rst:122
msgid "Human-readable name of the module (required)"
msgstr ""
#: ../../content/developer/howtos/website_themes/theming.rst:123
#: ../../content/developer/tutorials/define_module_data.rst:179
#: ../../content/developer/tutorials/getting_started/04_basicmodel.rst:190
msgid "description"
msgstr ""
#: ../../content/developer/howtos/website_themes/theming.rst:124
msgid "Extended description of the module, in `reStructuredText <https://en.wikipedia.org/wiki/ReStructuredText>`_"
msgstr ""
#: ../../content/developer/howtos/website_themes/theming.rst:126
msgid "category"
msgstr ""
#: ../../content/developer/howtos/website_themes/theming.rst:127
msgid "Classification category within Odoo"
msgstr ""
#: ../../content/developer/howtos/website_themes/theming.rst:128
msgid "version"
msgstr ""
#: ../../content/developer/howtos/website_themes/theming.rst:129
msgid "Odoo version this module is addressing"
msgstr ""
#: ../../content/developer/howtos/website_themes/theming.rst:130
msgid "author"
msgstr ""
#: ../../content/developer/howtos/website_themes/theming.rst:131
msgid "Name of the module author"
msgstr ""
#: ../../content/developer/howtos/website_themes/theming.rst:132
msgid "license"
msgstr ""
#: ../../content/developer/howtos/website_themes/theming.rst:133
msgid "Distribution license for the module"
msgstr ""
#: ../../content/developer/howtos/website_themes/theming.rst:134
msgid "depends"
msgstr ""
#: ../../content/developer/howtos/website_themes/theming.rst:135
msgid "Odoo modules must be loaded before this one, either because this module uses features they create or because it alters resources they define"
msgstr ""
#: ../../content/developer/howtos/website_themes/theming.rst:138
msgid "List of XML files"
msgstr ""
#: ../../content/developer/howtos/website_themes/theming.rst:139
msgid "assets"
msgstr ""
#: ../../content/developer/howtos/website_themes/theming.rst:140
msgid "List of SCSS and JS files"
msgstr ""
#: ../../content/developer/howtos/website_themes/theming.rst:143
msgid "To create a website theme, you only need to install the Website app. If you need other apps (Blogs, Events, eCommerce, ...), you can also add them."
msgstr ""
#: ../../content/developer/howtos/website_themes/theming.rst:147
msgid "Default options"
msgstr ""
#: ../../content/developer/howtos/website_themes/theming.rst:149
msgid "First, try to construct your theme by using Odoo's default options. This ensures two things:"
msgstr ""
#: ../../content/developer/howtos/website_themes/theming.rst:151
msgid "You do not re-invent something which already exists. For example, as Odoo provides an option to add a border on the footer, you shouldn't recode it yourself. Instead, enable the default option first, then extend it if needed."
msgstr ""
#: ../../content/developer/howtos/website_themes/theming.rst:154
msgid "The user can still use all of Odoo's features with your theme. For example, if you recode the border on the footer, you may break the default option or make it useless, giving the user a bad experience. Also, your recode might not work as well as the default option, as other Odoo features may rely on it."
msgstr ""
#: ../../content/developer/howtos/website_themes/theming.rst:160
msgid "Use four spaces per indentation level."
msgstr ""
#: ../../content/developer/howtos/website_themes/theming.rst:161
msgid "Do not use tabs."
msgstr ""
#: ../../content/developer/howtos/website_themes/theming.rst:162
msgid "Never mix spaces and tabs."
msgstr ""
#: ../../content/developer/howtos/website_themes/theming.rst:165
msgid ":doc:`Odoo coding guidelines <../../../contributing/development/coding_guidelines>`"
msgstr ""
#: ../../content/developer/howtos/website_themes/theming.rst:168
msgid "Odoo variables"
msgstr ""
#: ../../content/developer/howtos/website_themes/theming.rst:170
msgid "Odoo declares many CSS rules, most entirely customizable by overriding the related SCSS variables. To do so, create a :file:`primary_variables.scss` file and add it to the `_assets_primary_variables` bundle."
msgstr ""
#: ../../content/developer/howtos/website_themes/theming.rst:185
msgid "By reading the source code, variables related to options are easily noticeable."
msgstr ""
#: ../../content/developer/howtos/website_themes/theming.rst:195
msgid "These variables can be overridden through the `$o-website-value-palettes` map, for example."
msgstr ""
#: ../../content/developer/howtos/website_themes/theming.rst:198
msgid "Global"
msgstr ""
#: ../../content/developer/howtos/website_themes/theming.rst:216
#: ../../content/developer/howtos/website_themes/theming.rst:481
msgid "That file must only contain definitions and overrides of SCSS variables and mixins."
msgstr ""
#: ../../content/developer/howtos/website_themes/theming.rst:219
msgid "`Primary variables SCSS <https://github.com/odoo/odoo/blob/34c0c9c1ae00aba391932129d4cefd027a9c6bbd/addons/website/static/src/scss/primary_variables.scss#L1954>`_"
msgstr ""
#: ../../content/developer/howtos/website_themes/theming.rst:223
msgid "Fonts"
msgstr ""
#: ../../content/developer/howtos/website_themes/theming.rst:225
msgid "You can embed any font on your website. The Website Builder automatically makes them available in the font selector."
msgstr ""
#: ../../content/developer/howtos/website_themes/theming.rst:261
msgid "Google fonts"
msgstr ""
#: ../../content/developer/howtos/website_themes/theming.rst:279
#: ../../content/developer/reference/backend/reports.rst:280
msgid "Custom fonts"
msgstr ""
#: ../../content/developer/howtos/website_themes/theming.rst:281
msgid "First, create a specific SCSS file to declare your custom font(s)."
msgstr ""
#: ../../content/developer/howtos/website_themes/theming.rst:292
msgid "Then, use the `@font-face` rule to allow you custom font(s) to be loaded on your website."
msgstr ""
#: ../../content/developer/howtos/website_themes/theming.rst:294
msgid "``/website_airproof/static/src/scss/font.scss``"
msgstr ""
#: ../../content/developer/howtos/website_themes/theming.rst:317
msgid "It is recommended to use the .woff format for your fonts."
msgstr ""
#: ../../content/developer/howtos/website_themes/theming.rst:320
msgid "Colors"
msgstr ""
#: ../../content/developer/howtos/website_themes/theming.rst:322
msgid "The Website Builder relies on palettes composed of five named colors. Defining those in your theme ensures it stays consistent."
msgstr ""
#: ../../content/developer/howtos/website_themes/theming.rst:330
#: ../../content/developer/reference/frontend/owl_components.rst:384
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:265
msgid "Color"
msgstr ""
#: ../../content/developer/howtos/website_themes/theming.rst:332
msgid "o-color-1"
msgstr ""
#: ../../content/developer/howtos/website_themes/theming.rst:333
msgid "Primary"
msgstr ""
#: ../../content/developer/howtos/website_themes/theming.rst:334
msgid "o-color-2"
msgstr ""
#: ../../content/developer/howtos/website_themes/theming.rst:335
msgid "Secondary"
msgstr ""
#: ../../content/developer/howtos/website_themes/theming.rst:336
msgid "o-color-3"
msgstr ""
#: ../../content/developer/howtos/website_themes/theming.rst:337
msgid "Extra"
msgstr ""
#: ../../content/developer/howtos/website_themes/theming.rst:338
msgid "o-color-4"
msgstr ""
#: ../../content/developer/howtos/website_themes/theming.rst:339
msgid "Whitish"
msgstr ""
#: ../../content/developer/howtos/website_themes/theming.rst:340
msgid "o-color-5"
msgstr ""
#: ../../content/developer/howtos/website_themes/theming.rst:341
msgid "Blackish"
msgstr ""
#: ../../content/developer/howtos/website_themes/theming.rst:-1
msgid "Theme colors"
msgstr ""
#: ../../content/developer/howtos/website_themes/theming.rst:364
msgid "Add the created palette to the list of palettes offered by the Website Builder."
msgstr ""
#: ../../content/developer/howtos/website_themes/theming.rst:-1
msgid "Theme colors Airproof"
msgstr ""
#: ../../content/developer/howtos/website_themes/theming.rst:385
msgid "**Color combinations**"
msgstr ""
#: ../../content/developer/howtos/website_themes/theming.rst:387
msgid "Based on the previously defined five color palettes, the Website Builder automatically generates five color combinations, each defining a color for the background, text, headings, links, primary buttons, and secondary buttons. These colors can be customized later by the user."
msgstr ""
#: ../../content/developer/howtos/website_themes/theming.rst:395
msgid "The colors used in a color combination are accessible and can be overridden through the BS `$colors map` using a specific prefix (`o-cc` for `color combination`)."
msgstr ""
#: ../../content/developer/howtos/website_themes/theming.rst:424
msgid "For each `o-cc*`, replace the `*` with the digit (1 - 5) corresponding to the desired color combination."
msgstr ""
#: ../../content/developer/howtos/website_themes/theming.rst:427
msgid "The default text color is `o-color-5`. If the background is too dark, it will automatically change to the `o-color-4` color."
msgstr ""
#: ../../content/developer/howtos/website_themes/theming.rst:431
msgid "`Color combinations SCSS <https://github.com/odoo/odoo/blob/34c0c9c1ae00aba391932129d4cefd027a9c6bbd/addons/web_editor/static/src/scss/web_editor.common.scss#L711>`_"
msgstr ""
#: ../../content/developer/howtos/website_themes/theming.rst:436
msgid "The Website Builder automatically generates a page to view the color combinations of the theme color palette: http://localhost:8069/website/demo/color-combinations"
msgstr ""
#: ../../content/developer/howtos/website_themes/theming.rst:442
msgid "Odoo includes Bootstrap by default. You can use all variables and mixins of the framework."
msgstr ""
#: ../../content/developer/howtos/website_themes/theming.rst:444
msgid "If Odoo does not provide the variable you are looking for, there could be a Bootstrap variable that allows it. Indeed all Odoo layouts respect Bootstrap structures and use Bootstrap components or their extensions. If you customize a Bootstrap variable, you add a generic style for the whole user website."
msgstr ""
#: ../../content/developer/howtos/website_themes/theming.rst:449
msgid "Use a dedicated file added to the :file:`_assets_frontend_helpers` bundle to override Bootstrap values and *not* the :file:`primary_variables.scss` file."
msgstr ""
#: ../../content/developer/howtos/website_themes/theming.rst:484
msgid "Don't override Bootstrap variables that depend on Odoo variables. Otherwise, you might break the possibility for the user to customize them using the Website Builder."
msgstr ""
#: ../../content/developer/howtos/website_themes/theming.rst:488
msgid "`Bootstrap overridden SCSS <https://github.com/odoo/odoo/blob/17.0/addons/website/static/src/scss/bootstrap_overridden.scss>`_"
msgstr ""
#: ../../content/developer/howtos/website_themes/theming.rst:493
msgid "http://localhost:8069/website/demo/bootstrap"
msgstr ""
#: ../../content/developer/howtos/website_themes/theming.rst:498
msgid "For some options, in addition to the Website Builder variable, you also have to activate a specific view."
msgstr ""
#: ../../content/developer/howtos/website_themes/theming.rst:501
msgid "By reading the source code, templates related to options are easily found."
msgstr ""
#: ../../content/developer/howtos/website_themes/theming.rst:517
msgid "**Changing the menu items' horizontal alignment**"
msgstr ""
#: ../../content/developer/howtos/website_themes/theming.rst:526
msgid "The same logic can be used for others Odoo apps as well."
msgstr ""
#: ../../content/developer/howtos/website_themes/theming.rst:528
msgid "**eCommerce - Display products categories**"
msgstr ""
#: ../../content/developer/howtos/website_themes/theming.rst:536
msgid "**Portal - Disable the language selector**"
msgstr ""
#: ../../content/developer/howtos/website_themes/theming.rst:545
#: ../../content/developer/reference/frontend/assets.rst:6
msgid "Assets"
msgstr ""
#: ../../content/developer/howtos/website_themes/theming.rst:547
msgid "For this part, we will refer to the `assets_frontend` bundle located in the web module. This bundle specifies the list of assets loaded by the Website Builder, and the goal is to add your SCSS and JS files to the bundle."
msgstr ""
#: ../../content/developer/howtos/website_themes/theming.rst:554
msgid "The Website Builder together with Bootstrap are great for defining the basic styles of your website. But to design something unique, you should go a step further. For this, you can easily add any SCSS file to your theme."
msgstr ""
#: ../../content/developer/howtos/website_themes/theming.rst:569
msgid "Feel free to reuse the variables from your Bootstrap file and the ones used by Odoo in your :file:`theme.scss` file."
msgstr ""
#: ../../content/developer/howtos/website_themes/theming.rst:573
msgid "``/website_airproof/static/src/scss/theme.scss``"
msgstr ""
#: ../../content/developer/howtos/website_themes/theming.rst:583
msgid "Interactivity"
msgstr ""
#: ../../content/developer/howtos/website_themes/theming.rst:585
msgid "Odoo supports three different kinds of JavaScript files:"
msgstr ""
#: ../../content/developer/howtos/website_themes/theming.rst:587
msgid ":ref:`plain JavaScript files <frontend/modules/plain_js>` (no module system),"
msgstr ""
#: ../../content/developer/howtos/website_themes/theming.rst:588
msgid ":ref:`native JavaScript module <frontend/modules/native_js>`, and"
msgstr ""
#: ../../content/developer/howtos/website_themes/theming.rst:589
msgid ":ref:`Odoo modules <frontend/modules/odoo_module>` (using a custom module system)."
msgstr ""
#: ../../content/developer/howtos/website_themes/theming.rst:591
msgid "Most new Odoo JavaScript codes should use the native JavaScript module system. It's simpler and brings the benefit of a better developer experience with better integration with the IDE."
msgstr ""
#: ../../content/developer/howtos/website_themes/theming.rst:595
msgid "Odoo needs to know which files should be translated into :ref:`Odoo modules <frontend/js_modules>` and which files should not. It's an opt-in system: Odoo looks at the first line of a JavaScript file and checks if it contains the string `@odoo-module`. If so, it will automatically be converted to an Odoo module."
msgstr ""
#: ../../content/developer/howtos/website_themes/theming.rst:616
msgid "If you want to include files from an external library, you can add them to the :file:`/lib` folder of your module."
msgstr ""
#: ../../content/developer/howtos/website_themes/theming.rst:620
msgid "Use a linter (JSHint, ...)."
msgstr ""
#: ../../content/developer/howtos/website_themes/theming.rst:621
msgid "Never add minified JavaScript libraries."
msgstr ""
#: ../../content/developer/howtos/website_themes/theming.rst:622
msgid "Add `'use strict';` on top of every Odoo JavaScript module."
msgstr ""
#: ../../content/developer/howtos/website_themes/theming.rst:623
msgid "Variables and functions should be *camelcased* (`myVariable`) instead of *snakecased* (`my_variable`)."
msgstr ""
#: ../../content/developer/howtos/website_themes/theming.rst:625
msgid "Do not name a variable `event`; use `ev.` instead. This is to avoid bugs on non-Chrome browsers, as Chrome is magically assigning a global event variable (so if you use the event variable without declaring it, it will work fine on Chrome but crash on every other browser)."
msgstr ""
#: ../../content/developer/howtos/website_themes/theming.rst:628
msgid "Use strict comparisons (`===` instead of `==`)."
msgstr ""
#: ../../content/developer/howtos/website_themes/theming.rst:629
msgid "Use double quotes for all textual strings (such as `\"Hello\"`) and single quotes for all other strings, such as a CSS selector `.x_nav_item`."
msgstr ""
#: ../../content/developer/howtos/website_themes/theming.rst:631
msgid "Always use `this._super.apply(this, arguments)`."
msgstr ""
#: ../../content/developer/howtos/website_themes/theming.rst:634
msgid "`Odoo JavaScript coding guidelines <https://github.com/odoo/odoo/wiki/Javascript-coding-guidelines>`_"
msgstr ""
#: ../../content/developer/howtos/website_themes/theming.rst:635
msgid ":doc:`Overview of the Odoo JavaScript framework <../../reference/frontend/javascript_reference>`"
msgstr ""
#: ../../content/developer/howtos/website_themes/theming.rst:637
msgid "`Odoo Experience Talk: 10 Tips to take your website design to the next level! <https://www.youtube.com/watch?v=vAgE_fPVXUQ&ab_channel=Odoo>`_"
msgstr ""
#: ../../content/developer/howtos/website_themes/translations.rst:3
#: ../../content/developer/tutorials/pdf_reports.rst:284
#: ../../content/developer/tutorials/web.rst:1221
msgid "Translations"
msgstr ""
#: ../../content/developer/howtos/website_themes/translations.rst:5
msgid "With Odoo, you can translate your website into different languages."
msgstr ""
#: ../../content/developer/howtos/website_themes/translations.rst:9
msgid "Translate the content of a module."
msgstr ""
#: ../../content/developer/howtos/website_themes/translations.rst:10
msgid "Import and export translations."
msgstr ""
#: ../../content/developer/howtos/website_themes/translations.rst:11
msgid "Integrate translations to a module."
msgstr ""
#: ../../content/developer/howtos/website_themes/translations.rst:14
msgid "Frontend"
msgstr ""
#: ../../content/developer/howtos/website_themes/translations.rst:16
msgid "To translate your pages with the Website Builder, go to your website and click on the language selector to switch to it. If your website was never translated to the target language, click :guilabel:`Add a language...`, select it in the pop-up window, and click :guilabel:`Add`."
msgstr ""
#: ../../content/developer/howtos/website_themes/translations.rst:20
msgid "Click :guilabel:`Translate` to start translating. Depending on the language, some text is automatically translated and highlighted in green, while everything that should be translated manually is highlighted in yellow."
msgstr ""
#: ../../content/developer/howtos/website_themes/translations.rst:-1
msgid "Translate button"
msgstr ""
#: ../../content/developer/howtos/website_themes/translations.rst:29
msgid "Backend"
msgstr ""
#: ../../content/developer/howtos/website_themes/translations.rst:31
msgid "Translating pages directly from the backend allows you to translate several languages at the same time. To do so, go to :menuselection:`Settings --> Technical --> User Interface: Views`, search for the name of the page you want to translate, and click the :guilabel:`Edit Translations` button."
msgstr ""
#: ../../content/developer/howtos/website_themes/translations.rst:-1
msgid "Edit translations"
msgstr ""
#: ../../content/developer/howtos/website_themes/translations.rst:40
msgid "Export"
msgstr ""
#: ../../content/developer/howtos/website_themes/translations.rst:42
msgid "Once you are done translating, you need to export the translations to integrate them into your module. To export everything at once, open your database, activate :ref:`developer mode <developer-mode>`, and go to :menuselection:`Settings --> Translations --> Export Translation`. Select the :guilabel:`Language` you translated, *PO File* under :guilabel:`File Format`, and *website_airproof* as the :guilabel:`Apps To Export`."
msgstr ""
#: ../../content/developer/howtos/website_themes/translations.rst:48
msgid "Download the file and move it to the :file:`i18n` folder. If needed, you can manually edit the :file:`.po` file afterward."
msgstr ""
#: ../../content/developer/howtos/website_themes/translations.rst:52
msgid "PO file"
msgstr ""
#: ../../content/developer/howtos/website_themes/translations.rst:54
msgid "You can translate directly by editing a :file:`.po` file or creating the file yourself. Check out the :doc:`translating modules documentation <../translations>` to write your translations."
msgstr ""
#: ../../content/developer/howtos/website_themes/translations.rst:57
msgid "``/website_coconuts/i18n/fr_BE.po``"
msgstr ""
#: ../../content/developer/howtos/website_themes/translations.rst:66
msgid "Import"
msgstr ""
#: ../../content/developer/howtos/website_themes/translations.rst:68
msgid "To import your translation files into Odoo, go to :menuselection:`Settings --> Translations --> Import Translation` and upload them."
msgstr ""
#: ../../content/developer/reference.rst:5
#: ../../content/developer/reference/frontend/odoo_editor.rst:135
msgid "Reference"
msgstr ""
#: ../../content/developer/reference/backend.rst:5
msgid "Python framework"
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:5
msgid "Actions define the behavior of the system in response to user actions: login, action button, selection of an invoice, ..."
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:8
msgid "Actions can be stored in the database or returned directly as dictionaries in e.g. button methods. All actions share two mandatory attributes:"
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:12
#: ../../content/developer/reference/backend/data.rst:135
msgid "``type``"
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:12
msgid "the category of the current action, determines which fields may be used and how the action is interpreted"
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:16
#: ../../content/developer/reference/backend/actions.rst:419
#: ../../content/developer/reference/backend/data.rst:221
#: ../../content/developer/reference/external_api.rst:1104
#: ../../content/developer/reference/external_api.rst:1268
#: ../../content/developer/reference/extract_api.rst:511
#: ../../content/developer/reference/frontend/services.rst:871
#: ../../content/developer/reference/user_interface/view_architectures.rst:3266
#: ../../content/developer/reference/user_interface/view_architectures.rst:3683
#: ../../content/developer/tutorials/web.rst:1320
msgid "``name``"
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:15
msgid "short user-readable description of the action, may be displayed in the client's interface"
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:18
msgid "A client can get actions in 4 forms:"
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:20
msgid "``False``"
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:21
msgid "if any action dialog is currently open, close it"
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:23
msgid "A string"
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:23
msgid "if a :ref:`client action <reference/actions/client>` matches, interpret as a client action's tag, otherwise treat as a number"
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:26
msgid "A number"
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:26
msgid "read the corresponding action record from the database, may be a database identifier or an :term:`external id`"
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:29
msgid "A dictionary"
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:29
msgid "treat as a client action descriptor and execute"
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:34
msgid "Bindings"
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:36
msgid "Aside from their two mandatory attributes, all actions also share *optional* attributes used to present an action in an arbitrary model's contextual menu:"
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:42
msgid "``binding_model_id``"
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:40
msgid "specifies which model the action is bound to"
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:42
msgid "For Server Actions, use ``model_id``."
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:52
msgid "``binding_type``"
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:45
msgid "specifies the type of binding, which is mostly which contextual menu the action will appear under"
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:49
msgid "``action`` (default)"
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:49
msgid "Specifies that the action will appear in the :menuselection:`Action` contextual menu of the bound model."
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:52
msgid "``report``"
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:52
msgid "Specifies that the action will appear in the :menuselection:`Print` contextual menu of the bound model."
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:57
msgid "``binding_view_types``"
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:55
msgid "a comma-separated list of view types for which the action appears in the contextual menu, mostly \"list\" and / or \"form\". Defaults to ``list,form`` (both list and form )"
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:62
msgid "Window Actions (``ir.actions.act_window``)"
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:64
msgid "The most common action type, used to present visualisations of a model through :doc:`views <../user_interface/view_records>`: a window action defines a set of view types (and possibly specific views) for a model (and possibly specific record of the model)."
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:69
msgid "Its fields are:"
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:71
#: ../../content/developer/tutorials/web.rst:1690
msgid "``res_model``"
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:72
msgid "model to present views for"
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:80
#: ../../content/developer/tutorials/web.rst:1698
msgid "``views``"
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:74
msgid "a list of ``(view_id, view_type)`` pairs. The second element of each pair is the category of the view (tree, form, graph, ...) and the first is an optional database id (or ``False``). If no id is provided, the client should fetch the default view of the specified type for the requested model (this is automatically done by :meth:`~odoo.models.Model.fields_view_get`). The first type of the list is the default view type and will be open by default when the action is executed. Each view type should be present at most once in the list"
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:83
#: ../../content/developer/tutorials/web.rst:1692
msgid "``res_id`` (optional)"
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:83
msgid "if the default view is ``form``, specifies the record to load (otherwise a new record should be created)"
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:87
msgid "``search_view_id`` (optional)"
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:86
msgid "``(id, name)`` pair, ``id`` is the database identifier of a specific search view to load for the action. Defaults to fetching the default search view for the model"
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:92
#: ../../content/developer/reference/backend/actions.rst:396
msgid "``target`` (optional)"
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:90
msgid "whether the views should be open in the main content area (``current``), in full screen mode (``fullscreen``) or in a dialog/popup (``new``). Use ``main`` instead of ``current`` to clear the breadcrumbs. Defaults to ``current``."
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:94
#: ../../content/developer/reference/backend/actions.rst:225
msgid "``context`` (optional)"
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:95
msgid "additional context data to pass to the views"
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:96
msgid "``domain`` (optional)"
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:97
msgid "filtering domain to implicitly add to all view search queries"
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:100
msgid "``limit`` (optional)"
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:99
msgid "number of records to display in lists by default. Defaults to 80 in the web client"
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:102
msgid "For instance, to open customers (partner with the ``customer`` flag set) with list and form views::"
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:112
msgid "Or to open the form view of a specific product (obtained separately) in a new dialog::"
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:123
msgid "In-database window actions have a few different fields which should be ignored by clients, mostly to use in composing the ``views`` list:"
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:127
msgid "``view_mode`` (default= ``tree,form`` )"
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:127
msgid "comma-separated list of view types as a string (/!\\\\ No spaces /!\\\\). All of these types will be present in the generated ``views`` list (with at least a ``False`` view_id)"
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:145
#: ../../content/developer/reference/external_api.rst:1115
msgid "``view_ids``"
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:130
msgid "M2M\\ [#notquitem2m]_ to view objects, defines the initial content of ``views``"
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:133
msgid "Act_window views can also be defined cleanly through ``ir.actions.act_window.view``."
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:135
msgid "If you plan to allow multiple views for your model, prefer using ir.actions.act_window.view instead of the action ``view_ids``"
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:150
msgid "``view_id``"
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:148
msgid "specific view added to the ``views`` list in case its type is part of the ``view_mode`` list and not already filled by one of the views in ``view_ids``"
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:152
msgid "These are mostly used when defining actions from :ref:`reference/data`:"
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:163
msgid "will use the \"my_specific_view\" view even if that's not the default view for the model."
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:166
msgid "The server-side composition of the ``views`` sequence is the following:"
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:168
msgid "get each ``(id, type)`` from ``view_ids`` (ordered by ``sequence``)"
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:169
msgid "if ``view_id`` is defined and its type isn't already filled, append its ``(id, type)``"
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:171
msgid "for each unfilled type in ``view_mode``, append ``(False, type)``"
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:175
msgid "``usage``?"
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:176
msgid "``groups_id``?"
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:177
msgid "``filter``?"
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:179
msgid "technically not an M2M: adds a sequence field and may be composed of just a view type, without a view id."
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:185
msgid "URL Actions (``ir.actions.act_url``)"
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:187
msgid "Allow opening a URL (website/web page) via an Odoo action. Can be customized via two fields:"
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:190
msgid "``url``"
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:191
msgid "the address to open when activating the action"
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:200
msgid "``target`` (default= ``new``)"
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:193
msgid "the available values are :"
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:195
msgid "``new``: opens the URL in a new window/page"
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:196
msgid "``self``: opens the URL in the current window/page (replaces the actual content)"
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:197
msgid "``download``: redirects to a download URL"
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:200
msgid "example:"
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:210
msgid "This will replace the current content section by the Odoo home page."
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:215
msgid "Server Actions (``ir.actions.server``)"
msgstr ""
#: ../../../odoo/odoo/addons/base/models/ir_actions.py:docstring of odoo.addons.base.models.ir_actions.IrActionsServer:1
msgid "Server actions model. Server action work on a base model and offer various type of actions that can be executed automatically, for example using base action rules, of manually, by adding the action in the 'More' contextual menu."
msgstr ""
#: ../../../odoo/odoo/addons/base/models/ir_actions.py:docstring of odoo.addons.base.models.ir_actions.IrActionsServer:6
msgid "Since Odoo 8.0 a button 'Create Menu Action' button is available on the action form view. It creates an entry in the More menu of the base model. This allows to create server actions and run them in mass mode easily through the interface."
msgstr ""
#: ../../../odoo/odoo/addons/base/models/ir_actions.py:docstring of odoo.addons.base.models.ir_actions.IrActionsServer:11
msgid "The available actions are :"
msgstr ""
#: ../../../odoo/odoo/addons/base/models/ir_actions.py:docstring of odoo.addons.base.models.ir_actions.IrActionsServer:13
msgid "'Execute Python Code': a block of python code that will be executed"
msgstr ""
#: ../../../odoo/odoo/addons/base/models/ir_actions.py:docstring of odoo.addons.base.models.ir_actions.IrActionsServer:14
msgid "'Create a new Record': create a new record with new values"
msgstr ""
#: ../../../odoo/odoo/addons/base/models/ir_actions.py:docstring of odoo.addons.base.models.ir_actions.IrActionsServer:15
msgid "'Write on a Record': update the values of a record"
msgstr ""
#: ../../../odoo/odoo/addons/base/models/ir_actions.py:docstring of odoo.addons.base.models.ir_actions.IrActionsServer:16
msgid "'Execute several actions': define an action that triggers several other server actions"
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:219
msgid "Allow triggering complex server code from any valid action location. Only two fields are relevant to clients:"
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:222
#: ../../content/developer/reference/backend/data.rst:70
#: ../../content/developer/reference/backend/data.rst:155
#: ../../content/developer/reference/backend/data.rst:232
#: ../../content/developer/reference/backend/data.rst:242
#: ../../content/developer/reference/extract_api.rst:168
#: ../../content/developer/reference/extract_api.rst:264
msgid "``id``"
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:223
msgid "the in-database identifier of the server action to run"
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:225
msgid "context data to use when running the server action"
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:227
msgid "In-database records are significantly richer and can perform a number of specific or generic actions based on their ``state``. Some fields (and corresponding behaviors) are shared between states:"
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:232
#: ../../content/developer/reference/backend/actions.rst:436
#: ../../content/developer/reference/external_api.rst:1266
msgid "``model_id``"
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:232
msgid "Odoo model linked to the action."
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:234
#: ../../content/developer/reference/external_api.rst:1109
#: ../../content/developer/reference/external_api.rst:1275
msgid "``state``"
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:236
msgid "``code``: Executes python code given through the ``code`` argument."
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:238
msgid "``object_create``: Creates a new record of model ``crud_model_id`` following ``fields_lines`` specifications."
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:240
msgid "``object_write``: Updates the current record(s) following ``fields_lines`` specifications"
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:242
msgid "``multi``: Executes several actions given through the ``child_ids`` argument."
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:245
msgid "State fields"
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:247
msgid "Depending on its state, the behavior is defined through different fields. The concerned state is given after each field."
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:292
msgid "``code`` (code)"
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:251
msgid "Specify a piece of Python code to execute when the action is called"
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:266
msgid "The code segment can define a variable called ``action``, which will be returned to the client as the next action to execute:"
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:286
msgid "will ask the client to open a form for the record if it fulfills some condition"
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:294
msgid "``crud_model_id`` (create)(required)"
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:295
msgid "model in which to create a new record"
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:298
msgid "``link_field_id`` (create)"
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:297
msgid "many2one to ``ir.model.fields``, specifies the current record's m2o field on which the newly created record should be set (models should match)"
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:312
msgid "``fields_lines`` (create/write)"
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:301
msgid "fields to override when creating or copying the record. :class:`~odoo.fields.One2many` with the fields:"
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:305
msgid "``col1``"
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:305
msgid "``ir.model.fields`` to set in the concerned model (``crud_model_id`` for creates, ``model_id`` for updates)"
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:307
#: ../../content/developer/reference/backend/orm.rst:944
#: ../../content/developer/reference/user_interface/view_architectures.rst:3314
msgid "``value``"
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:308
msgid "value for the field, interpreted via ``type``"
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:312
msgid "``type`` (value|reference|equation)"
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:310
msgid "If ``value``, the ``value`` field is interpreted as a literal value (possibly converted), if ``equation`` the ``value`` field is interpreted as a Python expression and evaluated"
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:317
msgid "``child_ids`` (multi)"
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:315
msgid "Specify the multiple sub-actions (``ir.actions.server``) to enact in state multi. If sub-actions themselves return actions, the last one will be returned to the client as the multi's own next action"
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:322
msgid "Evaluation context"
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:324
msgid "A number of keys are available in the evaluation context of or surrounding server actions:"
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:327
msgid "``model`` model object linked to the action via ``model_id``"
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:328
msgid "``record``/``records`` record/recorset on which the action is triggered, can be void."
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:329
msgid "``env`` Odoo Environment"
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:330
msgid "``datetime``, ``dateutil``, ``time``, ``timezone`` corresponding Python modules"
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:331
msgid "``log: log(message, level='info')`` logging function to record debug information in ir.logging table"
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:332
msgid "``Warning`` constructor for the ``Warning`` exception"
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:337
msgid "Report Actions (``ir.actions.report``)"
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:339
msgid "Triggers the printing of a report."
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:341
msgid "If you define your report through a `<record>` instead of a `<report>` tag and want the action to show up in the Print menu of the model's views, you will also need to specify ``binding_model_id`` from :ref:`reference/bindings`. It's not necessary to set ``binding_type`` to ``report``, since ``ir.actions.report`` will implicitly default to that."
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:350
#: ../../content/developer/reference/backend/reports.rst:196
#: ../../content/developer/reference/user_interface/view_architectures.rst:2774
#: ../../content/developer/reference/user_interface/view_architectures.rst:2837
#: ../../content/developer/reference/user_interface/view_architectures.rst:3134
msgid "``name`` (mandatory)"
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:349
msgid "used as the file name if ``print_report_name`` is not specified. Otherwise, only useful as a mnemonic/description of the report when looking for one in a list of some sort"
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:352
msgid "``model`` (mandatory)"
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:353
msgid "the model your report will be about"
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:354
msgid "``report_type`` (default=qweb-pdf)"
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:355
msgid "either ``qweb-pdf`` for PDF reports or ``qweb-html`` for HTML"
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:356
msgid "``report_name`` (mandatory)"
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:357
msgid "the name (:term:`external id`) of the qweb template used to render the report"
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:358
msgid "``print_report_name``"
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:359
msgid "python expression defining the name of the report."
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:361
msgid "``groups_id``"
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:361
msgid ":class:`~odoo.fields.Many2many` field to the groups allowed to view/use the current report"
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:363
msgid "``multi``"
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:364
msgid "if set to ``True``, the action will not be displayed on a form view."
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:366
msgid "``paperformat_id``"
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:366
msgid ":class:`~odoo.fields.Many2one` field to the paper format you wish to use for this report (if not specified, the company format will be used)"
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:373
msgid "``attachment_use``"
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:369
msgid "if set to ``True``, the report is only generated once the first time it is requested, and re-printed from the stored report afterwards instead of being re-generated every time."
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:373
msgid "Can be used for reports which must only be generated once (e.g. for legal reasons)"
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:377
msgid "``attachment``"
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:376
msgid "python expression that defines the name of the report; the record is accessible as the variable ``object``"
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:382
msgid "Client Actions (``ir.actions.client``)"
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:384
msgid "Triggers an action implemented entirely in the client."
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:387
msgid "``tag``"
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:387
msgid "the client-side identifier of the action, an arbitrary string which the client should know how to react to"
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:390
msgid "``params`` (optional)"
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:390
msgid "a Python dictionary of additional data to send to the client, alongside the client action tag"
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:393
msgid "whether the client action should be open in the main content area (``current``), in full screen mode (``fullscreen``) or in a dialog/popup (``new``). Use ``main`` instead of ``current`` to clear the breadcrumbs. Defaults to ``current``."
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:405
msgid "tells the client to start the Point of Sale interface, the server has no idea how the POS interface works."
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:409
msgid ":ref:`Tutorial: Client Actions <howtos/web/client_actions>`"
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:414
msgid "Automated Actions (``ir.cron``)"
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:416
msgid "Actions triggered automatically on a predefined frequency."
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:419
msgid "Name of the automated action (Mainly used in log display)"
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:422
msgid "``interval_number``"
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:422
msgid "Number of *interval_type* uom between two executions of the action"
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:425
msgid "``interval_type``"
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:425
msgid "Unit of measure of frequency interval (``minutes``, ``hours``, ``days``, ``weeks``, ``months``)"
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:429
msgid "``numbercall``"
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:428
msgid "Number of times this action has to be run. If the action is expected to run indefinitely, set to ``-1``."
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:433
msgid "``doall``"
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:432
msgid "Boolean precising whether the missed actions have to be executed in case of server restarts."
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:436
msgid "Model on which this action will be called"
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:444
msgid "``code``"
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:439
msgid "Code content of the action. Can be a simple call to the model's method :"
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:446
msgid "``nextcall``"
msgstr ""
#: ../../content/developer/reference/backend/actions.rst:447
msgid "Next planned execution date of this action (date/time format)"
msgstr ""
#: ../../content/developer/reference/backend/data.rst:6
msgid "Data Files"
msgstr ""
#: ../../content/developer/reference/backend/data.rst:8
msgid "Odoo is greatly data-driven, and a big part of modules definition is thus the definition of the various records it manages: UI (menus and views), security (access rights and record rules), reports and plain data are all defined via records."
msgstr ""
#: ../../content/developer/reference/backend/data.rst:16
msgid "The main way to define data in Odoo is via XML data files: The broad structure of an XML data file is the following:"
msgstr ""
#: ../../content/developer/reference/backend/data.rst:19
msgid "Any number of operation elements within the root element ``odoo``"
msgstr ""
#: ../../content/developer/reference/backend/data.rst:30
msgid "Data files are executed sequentially, operations can only refer to the result of operations defined previously"
msgstr ""
#: ../../content/developer/reference/backend/data.rst:35
msgid "If the content of the data file is expected to be applied only once, you can specify the odoo flag ``noupdate`` set to 1. If part of the data in the file is expected to be applied once, you can place this part of the file in a <data noupdate=\"1\"> domain."
msgstr ""
#: ../../content/developer/reference/backend/data.rst:53
msgid "Core operations"
msgstr ""
#: ../../content/developer/reference/backend/data.rst:58
#: ../../content/developer/reference/user_interface/view_architectures.rst:3060
msgid "``record``"
msgstr ""
#: ../../content/developer/reference/backend/data.rst:60
msgid "``record`` appropriately defines or updates a database record, it has the following attributes:"
msgstr ""
#: ../../content/developer/reference/backend/data.rst:63
#: ../../content/developer/reference/backend/data.rst:153
msgid "``model`` (required)"
msgstr ""
#: ../../content/developer/reference/backend/data.rst:64
msgid "name of the model to create (or update)"
msgstr ""
#: ../../content/developer/reference/backend/data.rst:66
msgid "the :term:`external identifier` for this record. It is strongly recommended to provide one"
msgstr ""
#: ../../content/developer/reference/backend/data.rst:69
msgid "for record creation, allows subsequent definitions to either modify or refer to this record"
msgstr ""
#: ../../content/developer/reference/backend/data.rst:71
msgid "for record modification, the record to modify"
msgstr ""
#: ../../content/developer/reference/backend/data.rst:72
#: ../../content/developer/reference/frontend/services.rst:853
#: ../../content/developer/reference/user_interface/view_architectures.rst:2722
#: ../../content/developer/tutorials/backend.rst:936
#: ../../content/developer/tutorials/web.rst:1704
msgid "``context``"
msgstr ""
#: ../../content/developer/reference/backend/data.rst:73
msgid "context to use when creating the record"
msgstr ""
#: ../../content/developer/reference/backend/data.rst:77
msgid "``forcecreate``"
msgstr ""
#: ../../content/developer/reference/backend/data.rst:75
msgid "in update mode whether the record should be created if it doesn't exist"
msgstr ""
#: ../../content/developer/reference/backend/data.rst:77
msgid "Requires an :term:`external id`, defaults to ``True``."
msgstr ""
#: ../../content/developer/reference/backend/data.rst:80
#: ../../content/developer/reference/user_interface/view_architectures.rst:3040
msgid "``field``"
msgstr ""
#: ../../content/developer/reference/backend/data.rst:82
msgid "Each record can be composed of ``field`` tags, defining values to set when creating the record. A ``record`` with no ``field`` will use all default values (creation) or do nothing (update)."
msgstr ""
#: ../../content/developer/reference/backend/data.rst:86
msgid "A ``field`` has a mandatory ``name`` attribute, the name of the field to set, and various methods to define the value itself:"
msgstr ""
#: ../../content/developer/reference/backend/data.rst:91
msgid "Nothing"
msgstr ""
#: ../../content/developer/reference/backend/data.rst:90
msgid "if no value is provided for the field, an implicit ``False`` will be set on the field. Can be used to clear a field, or avoid using a default value for the field."
msgstr ""
#: ../../content/developer/reference/backend/data.rst:98
#: ../../content/developer/reference/backend/data.rst:159
#: ../../content/developer/tutorials/define_module_data.rst:268
msgid "``search``"
msgstr ""
#: ../../content/developer/reference/backend/data.rst:94
msgid "for :ref:`relational fields <reference/fields/relational>`, should be a :ref:`domain <reference/orm/domains>` on the field's model."
msgstr ""
#: ../../content/developer/reference/backend/data.rst:97
msgid "Will evaluate the domain, search the field's model using it and set the search's result as the field's value. Will only use the first result if the field is a :class:`~odoo.fields.Many2one`"
msgstr ""
#: ../../content/developer/reference/backend/data.rst:104
#: ../../content/developer/tutorials/define_module_data.rst:219
msgid "``ref``"
msgstr ""
#: ../../content/developer/reference/backend/data.rst:101
msgid "if a ``ref`` attribute is provided, its value must be a valid :term:`external id`, which will be looked up and set as the field's value."
msgstr ""
#: ../../content/developer/reference/backend/data.rst:104
msgid "Mostly for :class:`~odoo.fields.Many2one` and :class:`~odoo.fields.Reference` fields"
msgstr ""
#: ../../content/developer/reference/backend/data.rst:107
msgid "if a ``type`` attribute is provided, it is used to interpret and convert the field's content. The field's content can be provided through an external file using the ``file`` attribute, or through the node's body."
msgstr ""
#: ../../content/developer/reference/backend/data.rst:111
msgid "Available types are:"
msgstr ""
#: ../../content/developer/reference/backend/data.rst:115
msgid "``xml``, ``html``"
msgstr ""
#: ../../content/developer/reference/backend/data.rst:114
msgid "extracts the ``field``'s children as a single document, evaluates any :term:`external id` specified with the form ``%(external_id)s``. ``%%`` can be used to output actual *%* signs."
msgstr ""
#: ../../content/developer/reference/backend/data.rst:118
msgid "``file``"
msgstr ""
#: ../../content/developer/reference/backend/data.rst:118
msgid "ensures that the field content is a valid file path in the current model, saves the pair :samp:`{module},{path}` as the field value"
msgstr ""
#: ../../content/developer/reference/backend/data.rst:121
msgid "``char``"
msgstr ""
#: ../../content/developer/reference/backend/data.rst:121
msgid "sets the field content directly as the field's value without alterations"
msgstr ""
#: ../../content/developer/reference/backend/data.rst:124
msgid "``base64``"
msgstr ""
#: ../../content/developer/reference/backend/data.rst:124
msgid "base64_-encodes the field's content, useful combined with the ``file`` *attribute* to load e.g. image data into attachments"
msgstr ""
#: ../../content/developer/reference/backend/data.rst:127
msgid "``int``"
msgstr ""
#: ../../content/developer/reference/backend/data.rst:127
msgid "converts the field's content to an integer and sets it as the field's value"
msgstr ""
#: ../../content/developer/reference/backend/data.rst:130
msgid "``float``"
msgstr ""
#: ../../content/developer/reference/backend/data.rst:130
msgid "converts the field's content to a float and sets it as the field's value"
msgstr ""
#: ../../content/developer/reference/backend/data.rst:135
msgid "``list``, ``tuple``"
msgstr ""
#: ../../content/developer/reference/backend/data.rst:133
msgid "should contain any number of ``value`` elements with the same properties as ``field``, each element resolves to an item of a generated tuple or list, and the generated collection is set as the field's value"
msgstr ""
#: ../../content/developer/reference/backend/data.rst:145
#: ../../content/developer/tutorials/define_module_data.rst:249
msgid "``eval``"
msgstr ""
#: ../../content/developer/reference/backend/data.rst:138
msgid "for cases where the previous methods are unsuitable, the ``eval`` attributes simply evaluates whatever Python expression it is provided and sets the result as the field's value."
msgstr ""
#: ../../content/developer/reference/backend/data.rst:142
msgid "The evaluation context contains various modules (``time``, ``datetime``, ``timedelta``, ``relativedelta``), a function to resolve :term:`external identifiers` (``ref``) and the model object for the current field if applicable (``obj``)"
msgstr ""
#: ../../content/developer/reference/backend/data.rst:148
msgid "``delete``"
msgstr ""
#: ../../content/developer/reference/backend/data.rst:150
msgid "The ``delete`` tag can remove any number of records previously defined. It has the following attributes:"
msgstr ""
#: ../../content/developer/reference/backend/data.rst:154
msgid "the model in which a specified record should be deleted"
msgstr ""
#: ../../content/developer/reference/backend/data.rst:156
msgid "the :term:`external id` of a record to remove"
msgstr ""
#: ../../content/developer/reference/backend/data.rst:158
msgid "a :ref:`domain <reference/orm/domains>` to find records of the model to remove"
msgstr ""
#: ../../content/developer/reference/backend/data.rst:161
msgid "``id`` and ``search`` are exclusive"
msgstr ""
#: ../../content/developer/reference/backend/data.rst:164
#: ../../content/developer/tutorials/define_module_data.rst:287
msgid "``function``"
msgstr ""
#: ../../content/developer/reference/backend/data.rst:166
msgid "The ``function`` tag calls a method on a model, with provided parameters. It has two mandatory parameters ``model`` and ``name`` specifying respectively the model and the name of the method to call."
msgstr ""
#: ../../content/developer/reference/backend/data.rst:170
msgid "Parameters can be provided using ``eval`` (should evaluate to a sequence of parameters to call the method with) or ``value`` elements (see ``list`` values)."
msgstr ""
#: ../../content/developer/reference/backend/data.rst:200
msgid "Shortcuts"
msgstr ""
#: ../../content/developer/reference/backend/data.rst:202
msgid "Because some important structural models of Odoo are complex and involved, data files provide shorter alternatives to defining them using :ref:`record tags <reference/data/record>`:"
msgstr ""
#: ../../content/developer/reference/backend/data.rst:207
msgid "``menuitem``"
msgstr ""
#: ../../content/developer/reference/backend/data.rst:209
msgid "Defines an ``ir.ui.menu`` record with a number of defaults and fallbacks:"
msgstr ""
#: ../../content/developer/reference/backend/data.rst:218
msgid "``parent``"
msgstr ""
#: ../../content/developer/reference/backend/data.rst:212
msgid "If a ``parent`` attribute is set, it should be the :term:`external id` of an other menu item, used as the new item's parent"
msgstr ""
#: ../../content/developer/reference/backend/data.rst:214
msgid "If no ``parent`` is provided, tries to interpret the ``name`` attribute as a ``/``-separated sequence of menu names and find a place in the menu hierarchy. In that interpretation, intermediate menus are automatically created"
msgstr ""
#: ../../content/developer/reference/backend/data.rst:218
msgid "Otherwise the menu is defined as a \"top-level\" menu item (*not* a menu with no parent)"
msgstr ""
#: ../../content/developer/reference/backend/data.rst:221
msgid "If no ``name`` attribute is specified, tries to get the menu name from a linked action if any. Otherwise uses the record's ``id``"
msgstr ""
#: ../../content/developer/reference/backend/data.rst:226
#: ../../content/developer/reference/backend/data.rst:250
#: ../../content/developer/reference/external_api.rst:1280
msgid "``groups``"
msgstr ""
#: ../../content/developer/reference/backend/data.rst:224
msgid "A ``groups`` attribute is interpreted as a comma-separated sequence of :term:`external identifiers` for ``res.groups`` models. If an :term:`external identifier` is prefixed with a minus (``-``), the group is *removed* from the menu's groups"
msgstr ""
#: ../../content/developer/reference/backend/data.rst:229
msgid "``action``"
msgstr ""
#: ../../content/developer/reference/backend/data.rst:229
msgid "if specified, the ``action`` attribute should be the :term:`external id` of an action to execute when the menu is open"
msgstr ""
#: ../../content/developer/reference/backend/data.rst:232
msgid "the menu item's :term:`external id`"
msgstr ""
#: ../../content/developer/reference/backend/data.rst:237
msgid "``template``"
msgstr ""
#: ../../content/developer/reference/backend/data.rst:239
msgid "Creates a :ref:`QWeb view <reference/view_architectures/qweb>` requiring only the ``arch`` section of the view, and allowing a few *optional* attributes:"
msgstr ""
#: ../../content/developer/reference/backend/data.rst:243
msgid "the view's :term:`external identifier`"
msgstr ""
#: ../../content/developer/reference/backend/data.rst:245
msgid "``name``, ``inherit_id``, ``priority``"
msgstr ""
#: ../../content/developer/reference/backend/data.rst:245
msgid "same as the corresponding field on ``ir.ui.view`` (nb: ``inherit_id`` should be an :term:`external identifier`)"
msgstr ""
#: ../../content/developer/reference/backend/data.rst:248
msgid "``primary``"
msgstr ""
#: ../../content/developer/reference/backend/data.rst:248
msgid "if set to ``True`` and combined with a ``inherit_id``, defines the view as a primary"
msgstr ""
#: ../../content/developer/reference/backend/data.rst:251
msgid "comma-separated list of group :term:`external identifiers`"
msgstr ""
#: ../../content/developer/reference/backend/data.rst:253
#: ../../content/developer/reference/extract_api.rst:364
msgid "``page``"
msgstr ""
#: ../../content/developer/reference/backend/data.rst:253
msgid "if set to ``\"True\"``, the template is a website page (linkable to, deletable)"
msgstr ""
#: ../../content/developer/reference/backend/data.rst:258
msgid "``optional``"
msgstr ""
#: ../../content/developer/reference/backend/data.rst:256
msgid "``enabled`` or ``disabled``, whether the view can be disabled (in the website interface) and its default status. If unset, the view is always enabled."
msgstr ""
#: ../../content/developer/reference/backend/data.rst:263
msgid "CSV data files"
msgstr ""
#: ../../content/developer/reference/backend/data.rst:265
msgid "XML data files are flexible and self-descriptive, but very verbose when creating a number of simple records of the same model in bulk."
msgstr ""
#: ../../content/developer/reference/backend/data.rst:268
msgid "For this case, data files can also use csv_, this is often the case for :ref:`access rights <reference/security/acl>`:"
msgstr ""
#: ../../content/developer/reference/backend/data.rst:271
msgid "the file name is :file:`{model_name}.csv`"
msgstr ""
#: ../../content/developer/reference/backend/data.rst:272
msgid "the first row lists the fields to write, with the special field ``id`` for :term:`external identifiers` (used for creation or update)"
msgstr ""
#: ../../content/developer/reference/backend/data.rst:274
msgid "each row thereafter creates a new record"
msgstr ""
#: ../../content/developer/reference/backend/data.rst:276
msgid "Here's the first lines of the data file defining country states ``res.country.state.csv``"
msgstr ""
#: ../../content/developer/reference/backend/data.rst:282
msgid "rendered in a more readable format:"
msgstr ""
#: ../../content/developer/reference/backend/data/res.country.state.csv:1
msgid "country_id:id"
msgstr ""
#: ../../content/developer/reference/backend/data/res.country.state.csv:1
msgid "code"
msgstr ""
#: ../../content/developer/reference/backend/data/res.country.state.csv:1
msgid "state_au_1"
msgstr ""
#: ../../content/developer/reference/backend/data/res.country.state.csv:1
msgid "au"
msgstr ""
#: ../../content/developer/reference/backend/data/res.country.state.csv:1
msgid "Australian Capital Territory"
msgstr ""
#: ../../content/developer/reference/backend/data/res.country.state.csv:1
msgid "ACT"
msgstr ""
#: ../../content/developer/reference/backend/data/res.country.state.csv:1
msgid "state_au_2"
msgstr ""
#: ../../content/developer/reference/backend/data/res.country.state.csv:1
msgid "New South Wales"
msgstr ""
#: ../../content/developer/reference/backend/data/res.country.state.csv:1
msgid "NSW"
msgstr ""
#: ../../content/developer/reference/backend/data/res.country.state.csv:1
msgid "state_au_3"
msgstr ""
#: ../../content/developer/reference/backend/data/res.country.state.csv:1
msgid "Northern Territory"
msgstr ""
#: ../../content/developer/reference/backend/data/res.country.state.csv:1
msgid "NT"
msgstr ""
#: ../../content/developer/reference/backend/data/res.country.state.csv:1
msgid "state_au_4"
msgstr ""
#: ../../content/developer/reference/backend/data/res.country.state.csv:1
msgid "Queensland"
msgstr ""
#: ../../content/developer/reference/backend/data/res.country.state.csv:1
msgid "QLD"
msgstr ""
#: ../../content/developer/reference/backend/data/res.country.state.csv:1
msgid "state_au_5"
msgstr ""
#: ../../content/developer/reference/backend/data/res.country.state.csv:1
msgid "South Australia"
msgstr ""
#: ../../content/developer/reference/backend/data/res.country.state.csv:1
msgid "SA"
msgstr ""
#: ../../content/developer/reference/backend/data/res.country.state.csv:1
msgid "state_au_6"
msgstr ""
#: ../../content/developer/reference/backend/data/res.country.state.csv:1
msgid "Tasmania"
msgstr ""
#: ../../content/developer/reference/backend/data/res.country.state.csv:1
msgid "TAS"
msgstr ""
#: ../../content/developer/reference/backend/data/res.country.state.csv:1
msgid "state_au_7"
msgstr ""
#: ../../content/developer/reference/backend/data/res.country.state.csv:1
msgid "Victoria"
msgstr ""
#: ../../content/developer/reference/backend/data/res.country.state.csv:1
msgid "VIC"
msgstr ""
#: ../../content/developer/reference/backend/data/res.country.state.csv:1
msgid "state_au_8"
msgstr ""
#: ../../content/developer/reference/backend/data/res.country.state.csv:1
msgid "Western Australia"
msgstr ""
#: ../../content/developer/reference/backend/data/res.country.state.csv:1
msgid "WA"
msgstr ""
#: ../../content/developer/reference/backend/data/res.country.state.csv:1
msgid "state_us_1"
msgstr ""
#: ../../content/developer/reference/backend/data/res.country.state.csv:1
msgid "us"
msgstr ""
#: ../../content/developer/reference/backend/data/res.country.state.csv:1
msgid "Alabama"
msgstr ""
#: ../../content/developer/reference/backend/data/res.country.state.csv:1
msgid "AL"
msgstr ""
#: ../../content/developer/reference/backend/data/res.country.state.csv:1
msgid "state_us_2"
msgstr ""
#: ../../content/developer/reference/backend/data/res.country.state.csv:1
msgid "Alaska"
msgstr ""
#: ../../content/developer/reference/backend/data/res.country.state.csv:1
msgid "AK"
msgstr ""
#: ../../content/developer/reference/backend/data/res.country.state.csv:1
msgid "state_us_3"
msgstr ""
#: ../../content/developer/reference/backend/data/res.country.state.csv:1
msgid "Arizona"
msgstr ""
#: ../../content/developer/reference/backend/data/res.country.state.csv:1
msgid "AZ"
msgstr ""
#: ../../content/developer/reference/backend/data/res.country.state.csv:1
msgid "state_us_4"
msgstr ""
#: ../../content/developer/reference/backend/data/res.country.state.csv:1
msgid "Arkansas"
msgstr ""
#: ../../content/developer/reference/backend/data/res.country.state.csv:1
msgid "AR"
msgstr ""
#: ../../content/developer/reference/backend/data/res.country.state.csv:1
msgid "state_us_5"
msgstr ""
#: ../../content/developer/reference/backend/data/res.country.state.csv:1
msgid "California"
msgstr ""
#: ../../content/developer/reference/backend/data/res.country.state.csv:1
msgid "CA"
msgstr ""
#: ../../content/developer/reference/backend/data/res.country.state.csv:1
msgid "state_us_6"
msgstr ""
#: ../../content/developer/reference/backend/data/res.country.state.csv:1
msgid "Colorado"
msgstr ""
#: ../../content/developer/reference/backend/data/res.country.state.csv:1
msgid "CO"
msgstr ""
#: ../../content/developer/reference/backend/data.rst:289
msgid "For each row (record):"
msgstr ""
#: ../../content/developer/reference/backend/data.rst:291
msgid "the first column is the :term:`external id` of the record to create or update"
msgstr ""
#: ../../content/developer/reference/backend/data.rst:293
msgid "the second column is the :term:`external id` of the country object to link to (country objects must have been defined beforehand)"
msgstr ""
#: ../../content/developer/reference/backend/data.rst:295
msgid "the third column is the ``name`` field for ``res.country.state``"
msgstr ""
#: ../../content/developer/reference/backend/data.rst:296
msgid "the fourth column is the ``code`` field for ``res.country.state``"
msgstr ""
#: ../../content/developer/reference/backend/http.rst:6
msgid "Web Controllers"
msgstr ""
#: ../../content/developer/reference/backend/http.rst:9
msgid "Controllers"
msgstr ""
#: ../../content/developer/reference/backend/http.rst:11
msgid "Controllers need to provide extensibility, much like :class:`~odoo.models.Model`, but can't use the same mechanism as the pre-requisites (a database with loaded modules) may not be available yet (e.g. no database created, or no database selected)."
msgstr ""
#: ../../content/developer/reference/backend/http.rst:16
msgid "Controllers thus provide their own extension mechanism, separate from that of models:"
msgstr ""
#: ../../content/developer/reference/backend/http.rst:19
msgid "Controllers are created by :ref:`inheriting <python:tut-inheritance>` from :class:`~odoo.http.Controller`. Routes are defined through methods decorated with :func:`~odoo.http.route`::"
msgstr ""
#: ../../content/developer/reference/backend/http.rst:27
msgid "To *override* a controller, :ref:`inherit <python:tut-inheritance>` from its class and override relevant methods, re-exposing them if necessary::"
msgstr ""
#: ../../content/developer/reference/backend/http.rst:36
msgid "decorating with :func:`~odoo.http.route` is necessary to keep the method (and route) visible: if the method is redefined without decorating, it will be \"unpublished\""
msgstr ""
#: ../../content/developer/reference/backend/http.rst:39
msgid "the decorators of all methods are combined, if the overriding method's decorator has no argument all previous ones will be kept, any provided argument will override previously defined ones e.g.::"
msgstr ""
#: ../../content/developer/reference/backend/http.rst:48
msgid "will change ``/some_url`` from public authentication to user (requiring a log-in)"
msgstr ""
#: ../../content/developer/reference/backend/http.rst:52
#: ../../content/developer/reference/backend/orm.rst:54
#: ../../content/developer/reference/frontend/hooks.rst:87
#: ../../content/developer/reference/frontend/hooks.rst:122
#: ../../content/developer/reference/frontend/hooks.rst:170
#: ../../content/developer/reference/frontend/hooks.rst:213
#: ../../content/developer/reference/frontend/hooks.rst:341
#: ../../content/developer/reference/frontend/qweb.rst:914
#: ../../content/developer/reference/frontend/registries.rst:170
#: ../../content/developer/reference/frontend/services.rst:156
#: ../../content/developer/reference/frontend/services.rst:211
#: ../../content/developer/reference/frontend/services.rst:373
#: ../../content/developer/reference/frontend/services.rst:421
#: ../../content/developer/reference/frontend/services.rst:534
#: ../../content/developer/reference/frontend/services.rst:637
#: ../../content/developer/reference/frontend/services.rst:727
#: ../../content/developer/reference/frontend/services.rst:776
#: ../../content/developer/reference/frontend/services.rst:844
#: ../../content/developer/reference/user_interface/view_architectures.rst:3648
msgid "API"
msgstr ""
#: ../../content/developer/reference/backend/http.rst:57
msgid "Routing"
msgstr ""
#: ../../../odoo/odoo/http.py:docstring of odoo.http.route:1
msgid "Decorate a controller method in order to route incoming requests matching the given URL and options to the decorated method."
msgstr ""
#: ../../../odoo/odoo/http.py:docstring of odoo.http.route:5
msgid "It is mandatory to re-decorate any method that is overridden in controller extensions but the arguments can be omitted. See :class:`~odoo.http.Controller` for more details."
msgstr ""
#: ../../../odoo/odoo/http.py:docstring of odoo.http.route:9
msgid "The paths that the decorated method is serving. Incoming HTTP request paths matching this route will be routed to this decorated method. See `werkzeug routing documentation <http://werkzeug.pocoo.org/docs/routing/>`_ for the format of route expressions."
msgstr ""
#: ../../../odoo/odoo/http.py:docstring of odoo.http.route:14
msgid "The type of request, either ``'json'`` or ``'http'``. It describes where to find the request parameters and how to serialize the response."
msgstr ""
#: ../../../odoo/odoo/http.py:docstring of odoo.http.route:17
msgid "The authentication method, one of the following: * ``'user'``: The user must be authenticated and the current request will be executed using the rights of the user. * ``'public'``: The user may or may not be authenticated. If he isn't, the current request will be executed using the shared Public user. * ``'none'``: The method is always active, even if there is no database. Mainly used by the framework and authentication modules. The request code will not have any facilities to access the current user."
msgstr ""
#: ../../../odoo/odoo/http.py:docstring of odoo.http.route:17
msgid "The authentication method, one of the following:"
msgstr ""
#: ../../../odoo/odoo/http.py:docstring of odoo.http.route:19
msgid "``'user'``: The user must be authenticated and the current request will be executed using the rights of the user."
msgstr ""
#: ../../../odoo/odoo/http.py:docstring of odoo.http.route:21
msgid "``'public'``: The user may or may not be authenticated. If he isn't, the current request will be executed using the shared Public user."
msgstr ""
#: ../../../odoo/odoo/http.py:docstring of odoo.http.route:24
msgid "``'none'``: The method is always active, even if there is no database. Mainly used by the framework and authentication modules. The request code will not have any facilities to access the current user."
msgstr ""
#: ../../../odoo/odoo/http.py:docstring of odoo.http.route:28
msgid "A list of http methods (verbs) this route applies to. If not specified, all methods are allowed."
msgstr ""
#: ../../../odoo/odoo/http.py:docstring of odoo.http.route:30
msgid "The Access-Control-Allow-Origin cors directive value."
msgstr ""
#: ../../../odoo/odoo/http.py:docstring of odoo.http.route:31
msgid "Whether CSRF protection should be enabled for the route. Enabled by default for ``'http'``-type requests, disabled by default for ``'json'``-type requests."
msgstr ""
#: ../../../odoo/odoo/http.py:docstring of odoo.http.route:34
msgid "Implement a custom behavior if an error occurred when retrieving the record from the URL parameters (access error or missing error)."
msgstr ""
#: ../../content/developer/reference/backend/http.rst:64
#: ../../content/developer/reference/extract_api.rst:74
#: ../../content/developer/reference/extract_api.rst:220
msgid "Request"
msgstr ""
#: ../../content/developer/reference/backend/http.rst:66
msgid "The request object is automatically set on :data:`odoo.http.request` at the start of the request."
msgstr ""
#: ../../../odoo/odoo/http.py:docstring of odoo.http.Request:1
msgid "Wrapper around the incoming HTTP request with deserialized request parameters, session utilities and request dispatching logic."
msgstr ""
#: ../../../odoo/odoo/http.py:docstring of odoo.http.Request.update_env:1
msgid "Update the environment of the current request."
msgstr ""
#: ../../../odoo/odoo/http.py:docstring of odoo.http.Request.update_env:3
msgid "optional user/user id to change the current user"
msgstr ""
#: ../../../odoo/odoo/http.py:docstring of odoo.http.Request.update_env:5
msgid "optional context dictionary to change the current context"
msgstr ""
#: ../../../odoo/odoo/http.py:docstring of odoo.http.Request.update_env:6
msgid "optional boolean to change the superuser mode"
msgstr ""
#: ../../../odoo/odoo/http.py:docstring of odoo.http.Request.update_context:1
msgid "Override the environment context of the current request with the values of ``overrides``. To replace the entire context, please use :meth:`~update_env` instead."
msgstr ""
#: ../../../odoo/odoo/http.py:docstring of odoo.http.Request.csrf_token:1
msgid "Generates and returns a CSRF token for the current session"
msgstr ""
#: ../../../odoo/odoo/http.py:docstring of odoo.http.Request.csrf_token:3
msgid "the CSRF token should only be valid for the specified duration (in second), by default 48h, ``None`` for the token to be valid as long as the current user's session is."
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:0
#: ../../content/developer/reference/frontend/assets.rst:0
#: ../../content/developer/reference/frontend/framework_overview.rst:0
#: ../../content/developer/reference/frontend/hooks.rst:0
#: ../../content/developer/reference/frontend/javascript_reference.rst:0
#: ../../content/developer/reference/frontend/mobile.rst:0
#: ../../content/developer/reference/frontend/patching_code.rst:0
#: ../../content/developer/reference/frontend/qweb.rst:0
#: ../../content/developer/reference/frontend/registries.rst:0
#: ../../content/developer/reference/frontend/services.rst:0
#: ../../content/developer/reference/upgrade_utils.rst:0
#: ../../../odoo/addons/payment/models/payment_method.py:docstring of odoo.addons.payment.models.payment_method.PaymentMethod._get_compatible_payment_methods:0
#: ../../../odoo/addons/payment/models/payment_method.py:docstring of odoo.addons.payment.models.payment_method.PaymentMethod._get_from_code:0
#: ../../../odoo/addons/payment/models/payment_provider.py:docstring of odoo.addons.payment.models.payment_provider.PaymentProvider._compute_feature_support_fields:0
#: ../../../odoo/addons/payment/models/payment_provider.py:docstring of odoo.addons.payment.models.payment_provider.PaymentProvider._compute_view_configuration_fields:0
#: ../../../odoo/addons/payment/models/payment_provider.py:docstring of odoo.addons.payment.models.payment_provider.PaymentProvider._get_compatible_providers:0
#: ../../../odoo/addons/payment/models/payment_provider.py:docstring of odoo.addons.payment.models.payment_provider.PaymentProvider._get_redirect_form_view:0
#: ../../../odoo/addons/payment/models/payment_provider.py:docstring of odoo.addons.payment.models.payment_provider.PaymentProvider._get_removal_values:0
#: ../../../odoo/addons/payment/models/payment_provider.py:docstring of odoo.addons.payment.models.payment_provider.PaymentProvider._get_validation_amount:0
#: ../../../odoo/addons/payment/models/payment_provider.py:docstring of odoo.addons.payment.models.payment_provider.PaymentProvider._get_validation_currency:0
#: ../../../odoo/addons/payment/models/payment_provider.py:docstring of odoo.addons.payment.models.payment_provider.PaymentProvider._is_tokenization_required:0
#: ../../../odoo/addons/payment/models/payment_provider.py:docstring of odoo.addons.payment.models.payment_provider.PaymentProvider._should_build_inline_form:0
#: ../../../odoo/addons/payment/models/payment_token.py:docstring of odoo.addons.payment.models.payment_token.PaymentToken._build_display_name:0
#: ../../../odoo/addons/payment/models/payment_token.py:docstring of odoo.addons.payment.models.payment_token.PaymentToken._get_available_tokens:0
#: ../../../odoo/addons/payment/models/payment_token.py:docstring of odoo.addons.payment.models.payment_token.PaymentToken._get_specific_create_values:0
#: ../../../odoo/addons/payment/models/payment_token.py:docstring of odoo.addons.payment.models.payment_token.PaymentToken._handle_archiving:0
#: ../../../odoo/addons/payment/models/payment_token.py:docstring of odoo.addons.payment.models.payment_token.PaymentToken.get_linked_records_info:0
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._compute_reference:0
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._compute_reference_prefix:0
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._get_post_processing_values:0
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._get_specific_create_values:0
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._get_specific_processing_values:0
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._get_specific_rendering_values:0
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._get_tx_from_notification_data:0
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._handle_notification_data:0
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._process_notification_data:0
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._send_capture_request:0
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._send_payment_request:0
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._send_refund_request:0
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._send_void_request:0
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._set_authorized:0
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._set_canceled:0
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._set_done:0
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._set_error:0
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._set_pending:0
#: ../../../odoo/odoo/addons/base/models/ir_ui_view.py:docstring of odoo.addons.base.models.ir_ui_view.Model.get_view:0
#: ../../../odoo/odoo/addons/base/models/ir_ui_view.py:docstring of odoo.addons.base.models.ir_ui_view.Model.get_views:0
#: ../../../odoo/odoo/api.py:docstring of odoo.api.Environment.companies:0
#: ../../../odoo/odoo/api.py:docstring of odoo.api.Environment.company:0
#: ../../../odoo/odoo/api.py:docstring of odoo.api.Environment.ref:0
#: ../../../odoo/odoo/api.py:docstring of odoo.api.Environment.user:0
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Date.to_date:0
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Date.to_string:0
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Datetime.context_timestamp:0
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Datetime.to_datetime:0
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Datetime.to_string:0
#: ../../../odoo/odoo/fields.py:docstring of odoo.tools.date_utils.add:0
#: ../../../odoo/odoo/fields.py:docstring of odoo.tools.date_utils.end_of:0
#: ../../../odoo/odoo/fields.py:docstring of odoo.tools.date_utils.start_of:0
#: ../../../odoo/odoo/fields.py:docstring of odoo.tools.date_utils.subtract:0
#: ../../../odoo/odoo/http.py:docstring of odoo.http.HttpDispatcher.handle_error:0
#: ../../../odoo/odoo/http.py:docstring of odoo.http.JsonRPCDispatcher.handle_error:0
#: ../../../odoo/odoo/http.py:docstring of odoo.http.Request.csrf_token:0
#: ../../../odoo/odoo/http.py:docstring of odoo.http.Request.default_lang:0
#: ../../../odoo/odoo/http.py:docstring of odoo.http.Request.get_http_params:0
#: ../../../odoo/odoo/http.py:docstring of odoo.http.Request.make_response:0
#: ../../../odoo/odoo/http.py:docstring of odoo.http.Request.validate_csrf:0
#: ../../../odoo/odoo/http.py:docstring of odoo.http.Response.load:0
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel._populate_factories:0
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel._read_group:0
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.browse:0
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.copy:0
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.create:0
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.default_get:0
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.fields_get:0
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.filtered:0
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.get_metadata:0
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.mapped:0
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.name_create:0
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.name_search:0
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.read:0
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.read_group:0
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.search:0
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.search_fetch:0
#: ../../../odoo/odoo/tests/common.py:docstring of odoo.tests.common.BaseCase.browse_ref:0
#: ../../../odoo/odoo/tests/common.py:docstring of odoo.tests.common.BaseCase.ref:0
#: ../../../odoo/odoo/tools/populate.py:docstring of odoo.tools.populate.cartesian:0
#: ../../../odoo/odoo/tools/populate.py:docstring of odoo.tools.populate.compute:0
#: ../../../odoo/odoo/tools/populate.py:docstring of odoo.tools.populate.constant:0
#: ../../../odoo/odoo/tools/populate.py:docstring of odoo.tools.populate.iterate:0
#: ../../../odoo/odoo/tools/populate.py:docstring of odoo.tools.populate.randint:0
#: ../../../odoo/odoo/tools/populate.py:docstring of odoo.tools.populate.randomize:0
msgid "Returns"
msgstr ""
#: ../../../odoo/odoo/http.py:docstring of odoo.http.Request.csrf_token:7
msgid "ASCII token string"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:0
#: ../../content/developer/reference/upgrade_utils.rst:0
#: ../../../odoo/addons/payment/models/payment_method.py:docstring of odoo.addons.payment.models.payment_method.PaymentMethod._get_compatible_payment_methods:0
#: ../../../odoo/addons/payment/models/payment_provider.py:docstring of odoo.addons.payment.models.payment_provider.PaymentProvider._get_compatible_providers:0
#: ../../../odoo/addons/payment/models/payment_provider.py:docstring of odoo.addons.payment.models.payment_provider.PaymentProvider._get_redirect_form_view:0
#: ../../../odoo/addons/payment/models/payment_provider.py:docstring of odoo.addons.payment.models.payment_provider.PaymentProvider._get_removal_values:0
#: ../../../odoo/addons/payment/models/payment_provider.py:docstring of odoo.addons.payment.models.payment_provider.PaymentProvider._get_validation_amount:0
#: ../../../odoo/addons/payment/models/payment_provider.py:docstring of odoo.addons.payment.models.payment_provider.PaymentProvider._get_validation_currency:0
#: ../../../odoo/addons/payment/models/payment_provider.py:docstring of odoo.addons.payment.models.payment_provider.PaymentProvider._is_tokenization_required:0
#: ../../../odoo/addons/payment/models/payment_provider.py:docstring of odoo.addons.payment.models.payment_provider.PaymentProvider._should_build_inline_form:0
#: ../../../odoo/addons/payment/models/payment_token.py:docstring of odoo.addons.payment.models.payment_token.PaymentToken._build_display_name:0
#: ../../../odoo/addons/payment/models/payment_token.py:docstring of odoo.addons.payment.models.payment_token.PaymentToken._get_available_tokens:0
#: ../../../odoo/addons/payment/models/payment_token.py:docstring of odoo.addons.payment.models.payment_token.PaymentToken._get_specific_create_values:0
#: ../../../odoo/addons/payment/models/payment_token.py:docstring of odoo.addons.payment.models.payment_token.PaymentToken.get_linked_records_info:0
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._compute_reference:0
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._compute_reference_prefix:0
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._get_post_processing_values:0
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._get_specific_create_values:0
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._get_specific_processing_values:0
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._get_specific_rendering_values:0
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._get_tx_from_notification_data:0
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._handle_notification_data:0
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._send_capture_request:0
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._send_refund_request:0
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._send_void_request:0
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._set_authorized:0
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._set_canceled:0
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._set_done:0
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._set_error:0
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._set_pending:0
#: ../../../odoo/odoo/addons/base/models/ir_ui_view.py:docstring of odoo.addons.base.models.ir_ui_view.Model.get_view:0
#: ../../../odoo/odoo/api.py:docstring of odoo.api.Environment.companies:0
#: ../../../odoo/odoo/api.py:docstring of odoo.api.Environment.company:0
#: ../../../odoo/odoo/api.py:docstring of odoo.api.Environment.lang:0
#: ../../../odoo/odoo/api.py:docstring of odoo.api.Environment.user:0
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Date.context_today:0
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Date.to_date:0
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Date.to_string:0
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Datetime.context_timestamp:0
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Datetime.to_datetime:0
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Datetime.to_string:0
#: ../../../odoo/odoo/http.py:docstring of odoo.http.Request.csrf_token:0
#: ../../../odoo/odoo/http.py:docstring of odoo.http.Request.default_lang:0
#: ../../../odoo/odoo/http.py:docstring of odoo.http.Request.get_http_params:0
#: ../../../odoo/odoo/http.py:docstring of odoo.http.Request.make_json_response:0
#: ../../../odoo/odoo/http.py:docstring of odoo.http.Request.make_response:0
#: ../../../odoo/odoo/http.py:docstring of odoo.http.Request.validate_csrf:0
#: ../../../odoo/odoo/http.py:docstring of odoo.http.Response.load:0
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel._populate_factories:0
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel._read_group:0
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.default_get:0
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.fields_get:0
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.get_metadata:0
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.grouped:0
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.mapped:0
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.name_create:0
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.name_search:0
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.read:0
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.read_group:0
#: ../../../odoo/odoo/models.py:docstring of odoo.models.Model._populate_dependencies:0
#: ../../../odoo/odoo/tools/populate.py:docstring of odoo.tools.populate.cartesian:0
#: ../../../odoo/odoo/tools/populate.py:docstring of odoo.tools.populate.compute:0
#: ../../../odoo/odoo/tools/populate.py:docstring of odoo.tools.populate.constant:0
#: ../../../odoo/odoo/tools/populate.py:docstring of odoo.tools.populate.iterate:0
#: ../../../odoo/odoo/tools/populate.py:docstring of odoo.tools.populate.randint:0
#: ../../../odoo/odoo/tools/populate.py:docstring of odoo.tools.populate.randomize:0
msgid "Return type"
msgstr ""
#: ../../../odoo/odoo/http.py:docstring of odoo.http.Request.validate_csrf:1
msgid "Is the given csrf token valid ?"
msgstr ""
#: ../../../odoo/odoo/http.py:docstring of odoo.http.Request.validate_csrf:3
msgid "The token to validate."
msgstr ""
#: ../../../odoo/odoo/http.py:docstring of odoo.http.Request.validate_csrf:4
msgid "``True`` when valid, ``False`` when not."
msgstr ""
#: ../../../odoo/odoo/http.py:docstring of odoo.http.Request.default_lang:1
msgid "Returns default user language according to request specification"
msgstr ""
#: ../../../odoo/odoo/http.py:docstring of odoo.http.Request.default_lang:3
msgid "Preferred language if specified or 'en_US'"
msgstr ""
#: ../../../odoo/odoo/http.py:docstring of odoo.http.Request.get_http_params:1
msgid "Extract key=value pairs from the query string and the forms present in the body (both application/x-www-form-urlencoded and multipart/form-data)."
msgstr ""
#: ../../../odoo/odoo/http.py:docstring of odoo.http.Request.get_http_params:5
msgid "The merged key-value pairs."
msgstr ""
#: ../../../odoo/odoo/http.py:docstring of odoo.http.Request.make_response:1
msgid "Helper for non-HTML responses, or HTML responses with custom response headers or cookies."
msgstr ""
#: ../../../odoo/odoo/http.py:docstring of odoo.http.Request.make_response:4
msgid "While handlers can just return the HTML markup of a page they want to send as a string if non-HTML data is returned they need to create a complete response object, or the returned data will not be correctly interpreted by the clients."
msgstr ""
#: ../../../odoo/odoo/http.py:docstring of odoo.http.Request.make_response:9
msgid "response body"
msgstr ""
#: ../../../odoo/odoo/http.py:docstring of odoo.http.Request.make_json_response:5
#: ../../../odoo/odoo/http.py:docstring of odoo.http.Request.make_response:10
msgid "http status code"
msgstr ""
#: ../../../odoo/odoo/http.py:docstring of odoo.http.Request.make_json_response:6
#: ../../../odoo/odoo/http.py:docstring of odoo.http.Request.make_response:11
msgid "HTTP headers to set on the response"
msgstr ""
#: ../../../odoo/odoo/http.py:docstring of odoo.http.Request.make_json_response:7
#: ../../../odoo/odoo/http.py:docstring of odoo.http.Request.make_response:13
msgid "cookies to set on the client"
msgstr ""
#: ../../../odoo/odoo/http.py:docstring of odoo.http.Request.make_response:14
msgid "a response object."
msgstr ""
#: ../../../odoo/odoo/http.py:docstring of odoo.http.Request.make_json_response:8
#: ../../../odoo/odoo/http.py:docstring of odoo.http.Request.make_response:15
msgid ":class:`~odoo.http.Response`"
msgstr ""
#: ../../../odoo/odoo/http.py:docstring of odoo.http.Request.make_json_response:1
msgid "Helper for JSON responses, it json-serializes ``data`` and sets the Content-Type header accordingly if none is provided."
msgstr ""
#: ../../../odoo/odoo/http.py:docstring of odoo.http.Request.make_json_response:4
msgid "the data that will be json-serialized into the response body"
msgstr ""
#: ../../../odoo/odoo/http.py:docstring of odoo.http.Request.not_found:1
msgid "Shortcut for a `HTTP 404 <http://tools.ietf.org/html/rfc7231#section-6.5.4>`_ (Not Found) response"
msgstr ""
#: ../../../odoo/odoo/http.py:docstring of odoo.http.Request.render:1
msgid "Lazy render of a QWeb template."
msgstr ""
#: ../../../odoo/odoo/http.py:docstring of odoo.http.Request.render:3
msgid "The actual rendering of the given template will occur at then end of the dispatching. Meanwhile, the template and/or qcontext can be altered or even replaced by a static response."
msgstr ""
#: ../../../odoo/odoo/http.py:docstring of odoo.http.Request.render:7
#: ../../../odoo/odoo/http.py:docstring of odoo.http.Response:6
msgid "template to render"
msgstr ""
#: ../../../odoo/odoo/http.py:docstring of odoo.http.Request.render:8
#: ../../../odoo/odoo/http.py:docstring of odoo.http.Response:7
msgid "Rendering context to use"
msgstr ""
#: ../../../odoo/odoo/http.py:docstring of odoo.http.Request.render:9
msgid "whether the template rendering should be deferred until the last possible moment"
msgstr ""
#: ../../../odoo/odoo/http.py:docstring of odoo.http.Request.render:11
msgid "forwarded to werkzeug's Response object"
msgstr ""
#: ../../../odoo/odoo/http.py:docstring of odoo.http.HttpDispatcher.is_compatible_with:1
#: ../../../odoo/odoo/http.py:docstring of odoo.http.JsonRPCDispatcher.is_compatible_with:1
msgid "Determine if the current request is compatible with this dispatcher."
msgstr ""
#: ../../../odoo/odoo/http.py:docstring of odoo.http.JsonRPCDispatcher.dispatch:1
msgid "`JSON-RPC 2 <http://www.jsonrpc.org/specification>`_ over HTTP."
msgstr ""
#: ../../../odoo/odoo/http.py:docstring of odoo.http.JsonRPCDispatcher.dispatch:3
msgid "Our implementation differs from the specification on two points:"
msgstr ""
#: ../../../odoo/odoo/http.py:docstring of odoo.http.JsonRPCDispatcher.dispatch:5
msgid "The ``method`` member of the JSON-RPC request payload is ignored as the HTTP path is already used to route the request to the controller."
msgstr ""
#: ../../../odoo/odoo/http.py:docstring of odoo.http.JsonRPCDispatcher.dispatch:8
msgid "We only support parameter structures by-name, i.e. the ``params`` member of the JSON-RPC request payload MUST be a JSON Object and not a JSON Array."
msgstr ""
#: ../../../odoo/odoo/http.py:docstring of odoo.http.JsonRPCDispatcher.dispatch:12
msgid "In addition, it is possible to pass a context that replaces the session context via a special ``context`` argument that is removed prior to calling the endpoint."
msgstr ""
#: ../../../odoo/odoo/http.py:docstring of odoo.http.JsonRPCDispatcher.dispatch:16
msgid "Successful request::"
msgstr ""
#: ../../../odoo/odoo/http.py:docstring of odoo.http.JsonRPCDispatcher.dispatch:22
msgid "Request producing a error::"
msgstr ""
#: ../../../odoo/odoo/http.py:docstring of odoo.http.JsonRPCDispatcher.handle_error:1
msgid "Handle any exception that occurred while dispatching a request to a `type='json'` route. Also handle exceptions that occurred when no route matched the request path, that no fallback page could be delivered and that the request ``Content-Type`` was json."
msgstr ""
#: ../../../odoo/odoo/http.py:docstring of odoo.http.HttpDispatcher.handle_error:7
#: ../../../odoo/odoo/http.py:docstring of odoo.http.JsonRPCDispatcher.handle_error:6
msgid "the exception that occurred."
msgstr ""
#: ../../../odoo/odoo/http.py:docstring of odoo.http.HttpDispatcher.handle_error:8
#: ../../../odoo/odoo/http.py:docstring of odoo.http.JsonRPCDispatcher.handle_error:7
msgid "a WSGI application"
msgstr ""
#: ../../../odoo/odoo/http.py:docstring of odoo.http.HttpDispatcher.dispatch:1
msgid "Perform http-related actions such as deserializing the request body and query-string and checking cors/csrf while dispatching a request to a ``type='http'`` route."
msgstr ""
#: ../../../odoo/odoo/http.py:docstring of odoo.http.HttpDispatcher.dispatch:5
msgid "See :meth:`~odoo.http.Response.load` method for the compatible endpoint return types."
msgstr ""
#: ../../../odoo/odoo/http.py:docstring of odoo.http.HttpDispatcher.handle_error:1
msgid "Handle any exception that occurred while dispatching a request to a `type='http'` route. Also handle exceptions that occurred when no route matched the request path, when no fallback page could be delivered and that the request ``Content-Type`` was not json."
msgstr ""
#: ../../content/developer/reference/backend/http.rst:81
#: ../../content/developer/reference/extract_api.rst:162
#: ../../content/developer/reference/extract_api.rst:254
msgid "Response"
msgstr ""
#: ../../../odoo/odoo/http.py:docstring of odoo.http.Response:1
msgid "Outgoing HTTP response with body, status, headers and qweb support. In addition to the :class:`werkzeug.wrappers.Response` parameters, this class's constructor can take the following additional parameters for QWeb Lazy Rendering."
msgstr ""
#: ../../../odoo/odoo/http.py:docstring of odoo.http.Response:8
msgid "User id to use for the ir.ui.view render call, ``None`` to use the request's user (the default)"
msgstr ""
#: ../../../odoo/odoo/http.py:docstring of odoo.http.Response:11
msgid "these attributes are available as parameters on the Response object and can be altered at any time before rendering"
msgstr ""
#: ../../../odoo/odoo/http.py:docstring of odoo.http.Response:14
msgid "Also exposes all the attributes and methods of :class:`werkzeug.wrappers.Response`."
msgstr ""
#: ../../docstring of odoo.http.Response.default_mimetype:1
msgid "the default mimetype if none is provided."
msgstr ""
#: ../../../odoo/odoo/http.py:docstring of odoo.http.Response.load:1
msgid "Convert the return value of an endpoint into a Response."
msgstr ""
#: ../../../odoo/odoo/http.py:docstring of odoo.http.Response.load:3
msgid "The endpoint return value to load the Response from."
msgstr ""
#: ../../../odoo/odoo/http.py:docstring of odoo.http.Response.load:6
msgid "The endpoint function name wherefrom the result emanated, used for logging."
msgstr ""
#: ../../../odoo/odoo/http.py:docstring of odoo.http.Response.load:8
msgid "The created :class:`~odoo.http.Response`."
msgstr ""
#: ../../../odoo/odoo/http.py:docstring of odoo.http.Response.load:10
msgid "When ``result`` type is none of the above- mentioned type."
msgstr ""
#: ../../../odoo/odoo/http.py:docstring of odoo.http.Response.render:1
msgid "Renders the Response's template, returns the result."
msgstr ""
#: ../../../odoo/odoo/http.py:docstring of odoo.http.Response.flatten:1
msgid "Forces the rendering of the response's template, sets the result as response body and unsets :attr:`.template`"
msgstr ""
#: ../../../odoo/odoo/http.py:docstring of odoo.http.Response.set_cookie:1
msgid "The default expires in Werkzeug is None, which means a session cookie. We want to continue to support the session cookie, but not by default. Now the default is arbitrary 1 year. So if you want a cookie of session, you have to explicitly pass expires=None."
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:6
msgid "Mixins and Useful Classes"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:8
msgid "Odoo implements some useful classes and mixins that make it easy for you to add often-used behaviours on your objects. This guide will details most of them, with examples and use cases."
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:15
msgid "Messaging features"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:20
msgid "Messaging integration"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:23
msgid "Basic messaging system"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:25
msgid "Integrating messaging features to your model is extremely easy. Simply inheriting the ``mail.thread`` model and adding the messaging fields (and their appropriate widgets) to your form view will get you up and running in no time."
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:31
msgid "Let's create a simplistic model representing a business trip. Since organizing this kind of trip usually involves a lot of people and a lot of discussion, let's add support for message exchange on the model."
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:46
msgid "In the form view:"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:66
msgid "Once you've added chatter support on your model, users can easily add messages or internal notes on any record of your model; every one of those will send a notification (to all followers for messages, to employee (*base.group_user*) users for internal notes). If your mail gateway and catchall address are correctly configured, these notifications will be sent by e-mail and can be replied-to directly from your mail client; the automatic routing system will route the answer to the correct thread."
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:74
msgid "Server-side, some helper functions are there to help you easily send messages and to manage followers on your record:"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:78
msgid "Posting messages"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:81
msgid "Post a new message in an existing thread, returning the new mail.message ID."
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:84
msgid "body of the message. Will be escaped if `str`. Use a :class:`~markupsafe.Markup` object for HTML content."
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:86
msgid "see mail_message.message_type field"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:87
msgid "handle reply to a previous message by adding the parent partners to the message in case of private discussion"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:89
msgid "list of attachment tuples in the form ``(name,content)``, where content is NOT base64 encoded"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:91
msgid "indicates whether `body` should be treated as HTML, even if `str`."
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:92
msgid "extra keyword arguments will be used as default column values for the new mail.message record"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:94
msgid "ID of newly created mail.message"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:99
msgid "Helper method to send a mail / post a message using a view_id to render using the ir.qweb engine. This method is stand alone, because there is nothing in template and composer that allows to handle views in batch. This method will probably disappear when templates handle ir ui views."
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:105
msgid "external id or record of the view that should be sent"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:110
msgid "Helper method to send a mail with a template"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:112
msgid "the id of the template to render to create the body of the message"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:113
msgid "parameter to create a mail.compose.message wizard (which inherit from mail.message)"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:116
msgid "Receiving messages"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:117
msgid "These methods are called when a new e-mail is processed by the mail gateway. These e-mails can either be new thread (if they arrive via an :ref:`alias <reference/mixins/mail/alias>`) or simply replies from an existing thread. Overriding them allows you to set values on the thread's record depending on some values from the email itself (i.e. update a date or an e-mail address, add CC's addresses as followers, etc.)."
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:125
msgid "Called by ``message_process`` when a new message is received for a given thread model, if the message did not belong to an existing thread."
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:129
msgid "The default behavior is to create a new record of the corresponding model (based on some very basic info extracted from the message). Additional behavior may be implemented by overriding this method."
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:133
msgid "a map containing the email details and attachments. See ``message_process`` and ``mail.message.parse`` for details"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:135
msgid "optional dictionary of additional field values to pass to create() when creating the new thread record; be careful, these values may override any other values coming from the message"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:140
msgid "the id of the newly created thread object"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:144
msgid "Called by ``message_process`` when a new message is received for an existing thread. The default behavior is to update the record with ``update_vals`` taken from the incoming email."
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:148
msgid "Additional behavior may be implemented by overriding this method."
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:151
msgid "a map containing the email details and attachments; see ``message_process`` and ``mail.message.parse()`` for details."
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:153
msgid "a dict containing values to update records given their ids; if the dict is None or is void, no write operation is performed."
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:155
#: ../../content/developer/reference/backend/mixins.rst:183
#: ../../content/developer/reference/backend/mixins.rst:193
#: ../../content/developer/tutorials/define_module_data.rst:187
#: ../../content/developer/tutorials/define_module_data.rst:188
#: ../../../odoo/addons/account/models/account_account_tag.py:docstring of odoo.addons.account.models.account_account_tag.AccountAccountTag.active:1
#: ../../../odoo/addons/account/models/account_tax.py:docstring of odoo.addons.account.models.account_tax.AccountTax.active:1
#: ../../../odoo/addons/account/models/account_tax.py:docstring of odoo.addons.account.models.account_tax.AccountTax.is_base_affected:1
msgid "True"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:158
msgid "Followers management"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:161
msgid "Add partners to the records followers."
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:163
#: ../../content/developer/reference/backend/mixins.rst:179
msgid "IDs of the partners that will be subscribed to the record"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:165
#: ../../content/developer/reference/backend/mixins.rst:181
msgid "IDs of the channels that will be subscribed to the record"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:167
msgid "IDs of the subtypes that the channels/partners will be subscribed to (defaults to the default subtypes if ``None``)"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:169
msgid "if True, delete existing followers before creating new one using the subtypes given in the parameters"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:171
msgid "Success/Failure"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:177
msgid "Remove partners from the record's followers."
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:189
msgid "Wrapper on message_subscribe, using users."
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:191
msgid "IDs of the users that will be unsubscribed to the record; if None, unsubscribe the current user instead."
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:197
msgid "Logging changes"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:199
msgid "The ``mail`` module adds a powerful tracking system on fields, allowing you to log changes to specific fields in the record's chatter. To add tracking to a field, simple set the tracking attribute to True."
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:205
msgid "Let's track changes on the name and responsible of our business trips:"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:219
msgid "From now on, every change to a trip's name or responsible will log a note on the record. The ``name`` field will be displayed in the notification as well to give more context about the notification (even if the name did not change)."
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:225
msgid "Subtypes"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:227
msgid "Subtypes give you more granular control over messages. Subtypes act as a classification system for notifications, allowing subscribers to a document to customize the subtype of notifications they wish to receive."
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:231
msgid "Subtypes are created as data in your module; the model has the following fields:"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:234
msgid "``name`` (mandatory) - :class:`~odoo.fields.Char`"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:234
msgid "name of the subtype, will be displayed in the notification customization popup"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:237
msgid "``description`` - :class:`~odoo.fields.Char`"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:237
msgid "description that will be added in the message posted for this subtype. If void, the name will be added instead"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:240
msgid "``internal`` - :class:`~odoo.fields.Boolean`"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:240
msgid "messages with internal subtypes will be visible only by employees, aka members of the ``base.group_user`` group"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:245
msgid "``parent_id`` - :class:`~odoo.fields.Many2one`"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:243
msgid "link subtypes for automatic subscription; for example project subtypes are linked to task subtypes through this link. When someone is subscribed to a project, he will be subscribed to all tasks of this project with subtypes found using the parent subtype"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:248
msgid "``relation_field`` - :class:`~odoo.fields.Char`"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:248
msgid "as an example, when linking project and tasks subtypes, the relation field is the project_id field of tasks"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:250
msgid "``res_model`` - :class:`~odoo.fields.Char`"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:251
msgid "model the subtype applies to; if False, this subtype applies to all models"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:252
msgid "``default`` - :class:`~odoo.fields.Boolean`"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:253
msgid "whether the subtype is activated by default when subscribing"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:254
msgid "``sequence`` - :class:`~odoo.fields.Integer`"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:255
msgid "used to order subtypes in the notification customization popup"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:258
msgid "``hidden`` - :class:`~odoo.fields.Boolean`"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:257
msgid "whether the subtype is hidden in the notification customization popup"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:260
msgid "Interfacing subtypes with field tracking allows to subscribe to different kind of notifications depending on what might interest users. To do this, you can override the ``_track_subtype()`` function:"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:266
#: ../../content/developer/reference/backend/mixins.rst:347
msgid "Give the subtype triggered by the changes on the record according to values that have been updated."
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:269
msgid "the original values of the record; only modified fields are present in the dict"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:271
#: ../../content/developer/reference/backend/mixins.rst:389
msgid "a subtype's full external id or False if no subtype is triggered"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:276
msgid "Let's add a ``state`` field on our example class and trigger a notification with a specific subtype when this field change values."
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:279
msgid "First, let's define our subtype:"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:291
msgid "Then, we need to override the ``track_subtype()`` function. This function is called by the tracking system to know which subtype should be used depending on the change currently being applied. In our case, we want to use our shiny new subtype when the ``state`` field changes from *draft* to *confirmed*:"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:321
msgid "Customizing notifications"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:323
msgid "When sending notifications to followers, it can be quite useful to add buttons in the template to allow quick actions directly from the e-mail. Even a simple button to link directly to the record's form view can be useful; however in most cases you don't want to display these buttons to portal users."
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:328
msgid "The notification system allows customizing notification templates in the following ways:"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:331
msgid "Display *Access Buttons*: these buttons are visible at the top of the notification e-mail and allow the recipient to directly access the form view of the record"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:333
msgid "Display *Follow Buttons*: these buttons allow the recipient to directly quickly subscribe from the record"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:335
msgid "Display *Unfollow Buttons*: these buttons allow the recipient to directly quickly unsubscribe from the record"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:337
msgid "Display *Custom Action Buttons*: these buttons are calls to specific routes and allow you to make some useful actions directly available from the e-mail (i.e. converting a lead to an opportunity, validating an expense sheet for an Expense Manager, etc.)"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:342
msgid "These buttons settings can be applied to different groups that you can define yourself by overriding the function ``_notify_get_groups``."
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:350
msgid "``mail.message`` record currently being sent"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:351
msgid "list of tuple of the form (group_name, group_func,group_data) where: group_name is an identifier used only to be able to override and manipulate groups. Default groups are ``user`` (recipients linked to an employee user), ``portal`` (recipients linked to a portal user) and ``customer`` (recipients not linked to any user). An example of override use would be to add a group linked to a res.groups like Hr Officers to set specific action buttons to them. group_func is a function pointer taking a partner record as parameter. This method will be applied on recipients to know whether they belong to a given group or not. Only first matching group is kept. Evaluation order is the list order. group_data is a dict containing parameters for the notification email with the following possible keys - values: - has_button_access whether to display Access <Document> in email. True by default for new groups, False for portal / customer. - button_access dict with url and title of the button - has_button_follow whether to display Follow in email (if recipient is not currently following the thread). True by default for new groups, False for portal / customer. - button_follow dict with url and title of the button - has_button_unfollow whether to display Unfollow in email (if recipient is currently following the thread). True by default for new groups, False for portal / customer. - button_unfollow dict with url and title of the button - actions list of action buttons to display in the notification email. Each action is a dict containing url and title of the button."
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:351
msgid "list of tuple of the form (group_name, group_func,group_data) where:"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:358
msgid "group_name"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:354
msgid "is an identifier used only to be able to override and manipulate groups. Default groups are ``user`` (recipients linked to an employee user), ``portal`` (recipients linked to a portal user) and ``customer`` (recipients not linked to any user). An example of override use would be to add a group linked to a res.groups like Hr Officers to set specific action buttons to them."
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:363
msgid "group_func"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:361
msgid "is a function pointer taking a partner record as parameter. This method will be applied on recipients to know whether they belong to a given group or not. Only first matching group is kept. Evaluation order is the list order."
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:387
msgid "group_data"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:366
msgid "is a dict containing parameters for the notification email with the following possible keys - values:"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:370
msgid "has_button_access"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:370
msgid "whether to display Access <Document> in email. True by default for new groups, False for portal / customer."
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:372
msgid "button_access"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:373
#: ../../content/developer/reference/backend/mixins.rst:379
#: ../../content/developer/reference/backend/mixins.rst:384
msgid "dict with url and title of the button"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:376
msgid "has_button_follow"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:375
msgid "whether to display Follow in email (if recipient is not currently following the thread). True by default for new groups, False for portal / customer."
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:378
msgid "button_follow"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:381
msgid "has_button_unfollow"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:381
msgid "whether to display Unfollow in email (if recipient is currently following the thread). True by default for new groups, False for portal / customer."
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:383
msgid "button_unfollow"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:387
msgid "actions"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:386
msgid "list of action buttons to display in the notification email. Each action is a dict containing url and title of the button."
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:392
msgid "The urls in the actions list can be generated automatically by calling the ``_notify_get_action_link()`` function:"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:398
msgid "Generate a link for the given type on the current record (or on a specific record if the kwargs ``model`` and ``res_id`` are set)."
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:401
msgid "link type to be generated; can be any of these values: ``view`` link to form view of the record ``assign`` assign the logged user to the ``user_id`` field of the record (if it exists) ``follow`` self-explanatory ``unfollow`` self-explanatory ``method`` call a method on the record; the method's name should be provided as the kwarg ``method`` ``new`` open an empty form view for a new record; you can specify a specific action by providing its id (database id or fully resolved external id) in the kwarg ``action_id``"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:401
msgid "link type to be generated; can be any of these values:"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:403
msgid "``view``"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:404
msgid "link to form view of the record"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:406
msgid "``assign``"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:406
msgid "assign the logged user to the ``user_id`` field of the record (if it exists)"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:408
msgid "``follow``"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:409
#: ../../content/developer/reference/backend/mixins.rst:411
msgid "self-explanatory"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:410
msgid "``unfollow``"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:413
msgid "``method``"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:413
msgid "call a method on the record; the method's name should be provided as the kwarg ``method``"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:418
msgid "``new``"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:416
msgid "open an empty form view for a new record; you can specify a specific action by providing its id (database id or fully resolved external id) in the kwarg ``action_id``"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:420
msgid "link of the type selected for the record"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:425
msgid "Let's add a custom button to the Business Trip state change notification; this button will reset the state to Draft and will be only visible to a member of the (imaginary) group Travel Manager (``business.group_trip_manager``)"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:464
msgid "Note that that I could have defined my evaluation function outside of this method and define a global function to do it instead of a lambda, but for the sake of being more brief and less verbose in these documentation files that can sometimes be boring, I choose the former instead of the latter."
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:470
msgid "Overriding defaults"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:472
msgid "There are several ways you can customize the behaviour of ``mail.thread`` models, including (but not limited to):"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:477
msgid "``_mail_post_access`` - :class:`~odoo.models.Model` attribute"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:476
msgid "the required access rights to be able to post a message on the model; by default a ``write`` access is needed, can be set to ``read`` as well"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:497
msgid "Context keys:"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:480
msgid "These context keys can be used to somewhat control ``mail.thread`` features like auto-subscription or field tracking during calls to ``create()`` or ``write()`` (or any other method where it may be useful)."
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:484
msgid "``mail_create_nosubscribe``: at create or message_post, do not subscribe the current user to the record thread"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:486
msgid "``mail_create_nolog``: at create, do not log the automatic '<Document> created' message"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:488
msgid "``mail_notrack``: at create and write, do not perform the value tracking creating messages"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:490
msgid "``tracking_disable``: at create and write, perform no MailThread features (auto subscription, tracking, post, ...)"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:492
msgid "``mail_auto_delete``: auto delete mail notifications; True by default"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:493
msgid "``mail_notify_force_send``: if less than 50 email notifications to send, send them directly instead of using the queue; True by default"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:495
msgid "``mail_notify_user_signature``: add the current user signature in email notifications; True by default"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:502
msgid "Mail alias"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:504
msgid "Aliases are configurable email addresses that are linked to a specific record (which usually inherits the ``mail.alias.mixin`` model) that will create new records when contacted via e-mail. They are an easy way to make your system accessible from the outside, allowing users or customers to quickly create records in your database without needing to connect to Odoo directly."
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:511
msgid "Aliases vs. Incoming Mail Gateway"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:513
msgid "Some people use the Incoming Mail Gateway for this same purpose. You still need a correctly configured mail gateway to use aliases, however a single catchall domain will be sufficient since all routing will be done inside Odoo. Aliases have several advantages over Mail Gateways:"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:521
msgid "Easier to configure"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:519
msgid "A single incoming gateway can be used by many aliases; this avoids having to configure multiple emails on your domain name (all configuration is done inside Odoo)"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:522
msgid "No need for System access rights to configure aliases"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:523
msgid "More coherent"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:524
msgid "Configurable on the related record, not in a Settings submenu"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:529
msgid "Easier to override server-side"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:526
msgid "Mixin model is built to be extended from the start, allowing you to extract useful data from incoming e-mails more easily than with a mail gateway."
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:532
msgid "Alias support integration"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:534
msgid "Aliases are usually configured on a parent model which will then create specific record when contacted by e-mail. For example, Project have aliases to create tasks or issues, Sales Team have aliases to generate Leads."
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:538
msgid "The model that will be created by the alias **must** inherit the ``mail_thread`` model."
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:541
msgid "Alias support is added by inheriting ``mail.alias.mixin``; this mixin will generate a new ``mail.alias`` record for each record of the parent class that gets created (for example, every ``project.project`` record having its ``mail.alias`` record initialized on creation)."
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:546
msgid "Aliases can also be created manually and supported by a simple :class:`~odoo.fields.Many2one` field. This guide assumes you wish a more complete integration with automatic creation of the alias, record-specific default values, etc."
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:551
msgid "Unlike ``mail.thread`` inheritance, the ``mail.alias.mixin`` **requires** some specific overrides to work correctly. These overrides will specify the values of the created alias, like the kind of record it must create and possibly some default values these records may have depending on the parent object:"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:558
msgid "Return the model name for the alias. Incoming emails that are not replies to existing records will cause the creation of a new record of this alias model. The value may depend on ``vals``, the dict of values passed to ``create`` when a record of this model is created."
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:563
msgid "values of the newly created record that will holding the alias"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:565
msgid "model name"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:570
msgid "Return values to create an alias, or to write on the alias after its creation. While not completely mandatory, it is usually required to make sure that newly created records will be linked to the alias' parent (i.e. tasks getting created in the right project) by setting a dictionary of default values in the alias' ``alias_defaults`` field."
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:576
msgid "dictionary of values that will be written to the new alias"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:579
msgid "The ``_get_alias_values()`` override is particularly interesting as it allows you to modify the behaviour of your aliases easily. Among the fields that can be set on the alias, the following are of particular interest:"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:584
msgid "``alias_name`` - :class:`~odoo.fields.Char`"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:584
msgid "name of the email alias, e.g. 'jobs' if you want to catch emails for <jobs@example.odoo.com>"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:589
msgid "``alias_user_id`` - :class:`~odoo.fields.Many2one` (``res.users``)"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:587
msgid "owner of records created upon receiving emails on this alias; if this field is not set the system will attempt to find the right owner based on the sender (From) address, or will use the Administrator account if no system user is found for that address"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:592
msgid "``alias_defaults`` - :class:`~odoo.fields.Text`"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:592
msgid "Python dictionary that will be evaluated to provide default values when creating new records for this alias"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:596
msgid "``alias_force_thread_id`` - :class:`~odoo.fields.Integer`"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:595
msgid "optional ID of a thread (record) to which all incoming messages will be attached, even if they did not reply to it; if set, this will disable the creation of new records completely"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:603
msgid "``alias_contact`` - :class:`~odoo.fields.Selection`"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:599
msgid "Policy to post a message on the document using the mailgateway"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:601
msgid "*everyone*: everyone can post"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:602
msgid "*partners*: only authenticated partners"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:603
msgid "*followers*: only followers of the related document or members of following channels"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:605
msgid "Note that aliases make use of :ref:`delegation inheritance <reference/orm/inheritance>`, which means that while the alias is stored in another table, you have access to all these fields directly from your parent object. This allows you to make your alias easily configurable from the record's form view."
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:612
msgid "Let's add aliases on our business trip class to create expenses on the fly via e-mail."
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:660
msgid "We would like our alias to be easily configurable from the form view of our business trips, so let's add the following to our form view:"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:685
msgid "Now we can change the alias address directly from the form view and change who can send e-mails to the alias."
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:688
msgid "We can then override ``message_new()`` on our expense model to fetch the values from our email when the expense will be created:"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:725
msgid "Activities tracking"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:727
msgid "Activities are actions users have to take on a document like making a phone call or organizing a meeting. Activities come with the mail module as they are integrated in the Chatter but are *not bundled with mail.thread*. Activities are records of the ``mail.activity`` class, which have a type (``mail.activity.type``), name, description, scheduled time (among others). Pending activities are visible above the message history in the chatter widget."
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:734
msgid "You can integrate activities using the ``mail.activity.mixin`` class on your object and the specific widgets to display them (via the field ``activity_ids``) in the form view and kanban view of your records (``mail_activity`` and ``kanban_activity`` widgets, respectively)."
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:741
msgid "Organizing a business trip is a tedious process and tracking needed activities like ordering plane tickets or a cab for the airport could be useful. To do so, we will add the activities mixin on our model and display the next planned activities in the message history of our trip."
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:756
msgid "We modify the form view of our trips to display their next activities:"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:775
#: ../../content/developer/reference/backend/mixins.rst:851
#: ../../content/developer/reference/backend/mixins.rst:1070
msgid "You can find concrete examples of integration in the following models:"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:777
#: ../../content/developer/reference/backend/mixins.rst:853
msgid "``crm.lead`` in the CRM (*crm*) Application"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:778
msgid "``sale.order`` in the Sales (*sale*) Application"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:779
msgid "``project.task`` in the Project (*project*) Application"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:785
msgid "Website features"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:790
msgid "Visitor tracking"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:792
msgid "The ``utm.mixin`` class can be used to track online marketing/communication campaigns through arguments in links to specified resources. The mixin adds 3 fields to your model:"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:796
msgid "``campaign_id``: :class:`~odoo.fields.Many2one` field to a ``utm.campaign`` object (i.e. Christmas_Special, Fall_Collection, etc.)"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:798
msgid "``source_id``: :class:`~odoo.fields.Many2one` field to a ``utm.source`` object (i.e. Search Engine, mailing list, etc.)"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:800
msgid "``medium_id``: :class:`~odoo.fields.Many2one` field to a ``utm.medium`` object (i.e. Snail Mail, e-Mail, social network update, etc.)"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:803
msgid "These models have a single field ``name`` (i.e. they are simply there to distinguish campaigns but don't have any specific behaviour)."
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:806
msgid "Once a customer visits your website with these parameters set in the url (i.e. https://www.odoo.com/?campaign_id=mixin_talk&source_id=www.odoo.com&medium_id=website), three cookies are set in the visitor's website for these parameters. Once a object that inherits the utm.mixin is created from the website (i.e. lead form, job application, etc.), the utm.mixin code kicks in and fetches the values from the cookies to set them in the new record. Once this is done, you can then use the campaign/source/medium fields as any other field when defining reports and views (group by, etc.)."
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:815
msgid "To extend this behaviour, simply add a relational field to a simple model (the model should support the *quick create* (i.e. call to ``create()`` with a single ``name`` value) and extend the function ``tracking_fields()``:"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:844
msgid "This will tell the system to create a cookie named *odoo_utm_my_field* with the value found in the url parameter ``my_field``; once a new record of this model is created by a call from a website form, the generic override of the ``create()`` method of ``utm.mixin`` will fetch the default values for this field from the cookie (and the ``my_module.my_track`` record will be creatwed on the fly if it does not exist yet)."
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:854
msgid "``hr.applicant`` in the Recruitment Process (*hr_recruitment*) Application"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:855
#: ../../content/developer/reference/backend/mixins.rst:1073
msgid "``helpdesk.ticket`` in the Helpdesk (*helpdesk* - Odoo Enterprise only) Application"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:860
msgid "Website visibility"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:862
msgid "You can quite easily add a website visibility toggle on any of your record. While this mixin is quite easy to implement manually, it is the most often-used after the ``mail.thread`` inheritance; a testament to its usefulness. The typical use case for this mixin is any object that has a frontend-page; being able to control the visibility of the page allows you to take your time while editing the page and only publish it when you're satisfied."
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:869
msgid "To include the functionality, you only need to inherit ``website.published.mixin``:"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:878
msgid "This mixin adds 2 fields on your model:"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:880
msgid "``website_published``: :class:`~odoo.fields.Boolean` field which represents the status of the publication"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:882
msgid "``website_url``: :class:`~odoo.fields.Char` field which represents the URL through which the object is accessed"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:885
msgid "Note that this last field is a computed field and must be implemented for your class:"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:893
msgid "Once the mechanism is in place, you just have to adapt your frontend and backend views to make it accessible. In the backend, adding a button in the button box is usually the way to go:"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:904
msgid "In the frontend, some security checks are needed to avoid showing 'Editing' buttons to website visitors:"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:918
msgid "Note that you must pass your object as the variable ``object`` to the template; in this example, the ``blog.post`` record was passed as the ``blog_post`` variable to the ``qweb`` rendering engine, it is necessary to specify this to the publish management template. The ``publish_edit`` variable allow the frontend button to link to the backend (allowing you to switch from frontend to backend and vice-versa easily); if set, you must specify the full external id of the action you want to call in the backend in the ``action`` variable (note that a Form View must exist for the model)."
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:927
msgid "The action ``website_publish_button`` is defined in the mixin and adapts its behaviour to your object: if the class has a valid ``website_url`` compute function, the user is redirected to the frontend when he clicks on the button; the user can then publish the page directly from the frontend. This ensures that no online publication can happen by accident. If there is not compute function, the boolean ``website_published`` is simply triggered."
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:937
msgid "Website metadata"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:939
msgid "This simple mixin simply allows you to easily inject metadata in your frontend pages."
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:949
msgid "This mixin adds 3 fields on your model:"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:951
msgid "``website_meta_title``: :class:`~odoo.fields.Char` field that allow you to set an additional title to your page"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:953
msgid "``website_meta_description``: :class:`~odoo.fields.Char` field that contains a short description of the page (sometimes used in search engines results)"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:955
msgid "``website_meta_keywords``: :class:`~odoo.fields.Char` field that contains some keywords to help your page to be classified more precisely by search engines; the \"Promote\" tool will help you select lexically-related keywords easily"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:959
msgid "These fields are editable in the frontend using the \"Promote\" tool from the Editor toolbar. Setting these fields can help search engines to better index your pages. Note that search engines do not base their results only on these metadata; the best SEO practice should still be to get referenced by reliable sources."
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:967
msgid "Others"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:972
msgid "Customer Rating"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:974
msgid "The rating mixin allows sending email to ask for customer rating, automatic transitioning in a kanban processes and aggregating statistics on your ratings."
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:978
msgid "Adding rating on your model"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:980
msgid "To add rating support, simply inherit the ``rating.mixin`` model:"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:991
msgid "The behaviour of the mixin adapts to your model:"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:993
msgid "The ``rating.rating`` record will be linked to the ``partner_id`` field of your model (if the field is present)."
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:996
msgid "this behaviour can be overridden with the function ``rating_get_partner_id()`` if you use another field than ``partner_id``"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:999
msgid "The ``rating.rating`` record will be linked to the partner of the ``user_id`` field of your model (if the field is present) (i.e. the partner who is rated)"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:1002
msgid "this behaviour can be overridden with the function ``rating_get_rated_partner_id()`` if you use another field than ``user_id`` (note that the function must return a ``res.partner``, for ``user_id`` the system automatically fetches the partner of the user)"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:1007
msgid "The chatter history will display the rating event (if your model inherits from ``mail.thread``)"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:1011
msgid "Send rating requests by e-mail"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:1013
msgid "If you wish to send emails to request a rating, simply generate an e-mail with links to the rating object. A very basic email template could look like this:"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:1037
msgid "Your customer will then receive an e-mail with links to a simple webpage allowing them to provide a feedback on their interaction with your users (including a free-text feedback message)."
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:1041
msgid "You can then quite easily integrate your ratings with your form view by defining an action for the ratings:"
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:1067
msgid "Note that there are default views (kanban,pivot,graph) for ratings which allow you a quick bird's eye view of your customer ratings."
msgstr ""
#: ../../content/developer/reference/backend/mixins.rst:1072
msgid "``project.task`` in the Project (*rating_project*) Application"
msgstr ""
#: ../../content/developer/reference/backend/module.rst:4
msgid "Module Manifests"
msgstr ""
#: ../../content/developer/reference/backend/module.rst:11
#: ../../content/developer/tutorials/define_module_data.rst:68
msgid "Manifest"
msgstr ""
#: ../../content/developer/reference/backend/module.rst:13
msgid "The manifest file serves to declare a python package as an Odoo module and to specify module metadata."
msgstr ""
#: ../../content/developer/reference/backend/module.rst:16
msgid "It is a file called ``__manifest__.py`` and contains a single Python dictionary, where each key specifies module metadatum."
msgstr ""
#: ../../content/developer/reference/backend/module.rst:40
msgid "Available manifest fields are:"
msgstr ""
#: ../../content/developer/reference/backend/module.rst:42
msgid "``name`` (``str``, required)"
msgstr ""
#: ../../content/developer/reference/backend/module.rst:43
msgid "the human-readable name of the module"
msgstr ""
#: ../../content/developer/reference/backend/module.rst:44
msgid "``version`` (``str``)"
msgstr ""
#: ../../content/developer/reference/backend/module.rst:45
msgid "this module's version, should follow `semantic versioning`_ rules"
msgstr ""
#: ../../content/developer/reference/backend/module.rst:46
msgid "``description`` (``str``)"
msgstr ""
#: ../../content/developer/reference/backend/module.rst:47
msgid "extended description for the module, in reStructuredText"
msgstr ""
#: ../../content/developer/reference/backend/module.rst:48
msgid "``author`` (``str``)"
msgstr ""
#: ../../content/developer/reference/backend/module.rst:49
msgid "name of the module author"
msgstr ""
#: ../../content/developer/reference/backend/module.rst:50
msgid "``website`` (``str``)"
msgstr ""
#: ../../content/developer/reference/backend/module.rst:51
msgid "website URL for the module author"
msgstr ""
#: ../../content/developer/reference/backend/module.rst:65
msgid "``license`` (``str``, defaults: ``LGPL-3``)"
msgstr ""
#: ../../content/developer/reference/backend/module.rst:53
msgid "distribution license for the module. Possible values:"
msgstr ""
#: ../../content/developer/reference/backend/module.rst:56
msgid "`GPL-2`"
msgstr ""
#: ../../content/developer/reference/backend/module.rst:57
msgid "`GPL-2 or any later version`"
msgstr ""
#: ../../content/developer/reference/backend/module.rst:58
msgid "`GPL-3`"
msgstr ""
#: ../../content/developer/reference/backend/module.rst:59
msgid "`GPL-3 or any later version`"
msgstr ""
#: ../../content/developer/reference/backend/module.rst:60
msgid "`AGPL-3`"
msgstr ""
#: ../../content/developer/reference/backend/module.rst:61
msgid "`LGPL-3`"
msgstr ""
#: ../../content/developer/reference/backend/module.rst:62
msgid "`Other OSI approved licence`"
msgstr ""
#: ../../content/developer/reference/backend/module.rst:63
msgid "`OEEL-1` (Odoo Enterprise Edition License v1.0)"
msgstr ""
#: ../../content/developer/reference/backend/module.rst:64
msgid "`OPL-1` (Odoo Proprietary License v1.0)"
msgstr ""
#: ../../content/developer/reference/backend/module.rst:65
msgid "`Other proprietary`"
msgstr ""
#: ../../content/developer/reference/backend/module.rst:73
msgid "``category`` (``str``, default: ``Uncategorized``)"
msgstr ""
#: ../../content/developer/reference/backend/module.rst:68
msgid "classification category within Odoo, rough business domain for the module."
msgstr ""
#: ../../content/developer/reference/backend/module.rst:70
msgid "Although using `existing categories`_ is recommended, the field is freeform and unknown categories are created on-the-fly. Category hierarchies can be created using the separator ``/`` e.g. ``Foo / Bar`` will create a category ``Foo``, a category ``Bar`` as child category of ``Foo``, and will set ``Bar`` as the module's category."
msgstr ""
#: ../../content/developer/reference/backend/module.rst:81
msgid "``depends`` (``list(str)``)"
msgstr ""
#: ../../content/developer/reference/backend/module.rst:76
msgid "Odoo modules which must be loaded before this one, either because this module uses features they create or because it alters resources they define."
msgstr ""
#: ../../content/developer/reference/backend/module.rst:80
msgid "When a module is installed, all of its dependencies are installed before it. Likewise dependencies are loaded before a module is loaded."
msgstr ""
#: ../../content/developer/reference/backend/module.rst:84
msgid "Module `base` is always installed in any Odoo instance. But you still need to specify it as dependency to make sure your module is updated when `base` is updated."
msgstr ""
#: ../../content/developer/reference/backend/module.rst:88
msgid "``data`` (``list(str)``)"
msgstr ""
#: ../../content/developer/reference/backend/module.rst:88
msgid "List of data files which must always be installed or updated with the module. A list of paths from the module root directory"
msgstr ""
#: ../../content/developer/reference/backend/module.rst:91
msgid "``demo`` (``list(str)``)"
msgstr ""
#: ../../content/developer/reference/backend/module.rst:91
msgid "List of data files which are only installed or updated in *demonstration mode*"
msgstr ""
#: ../../content/developer/reference/backend/module.rst:109
msgid "``auto_install`` (``bool`` or ``list(str)``, default: ``False``)"
msgstr ""
#: ../../content/developer/reference/backend/module.rst:94
msgid "If ``True``, this module will automatically be installed if all of its dependencies are installed."
msgstr ""
#: ../../content/developer/reference/backend/module.rst:97
msgid "It is generally used for \"link modules\" implementing synergetic integration between two otherwise independent modules."
msgstr ""
#: ../../content/developer/reference/backend/module.rst:100
msgid "For instance ``sale_crm`` depends on both ``sale`` and ``crm`` and is set to ``auto_install``. When both ``sale`` and ``crm`` are installed, it automatically adds CRM campaigns tracking to sale orders without either ``sale`` or ``crm`` being aware of one another."
msgstr ""
#: ../../content/developer/reference/backend/module.rst:105
msgid "If it is a list, it must contain a subset of the dependencies. This module will automatically be installed as soon as all the dependencies in the subset are installed. The remaining dependencies will be automatically installed as well. If the list is empty, this module will always be automatically installed regardless of its dependencies and these will be installed as well."
msgstr ""
#: ../../content/developer/reference/backend/module.rst:122
msgid "``external_dependencies`` (``dict(key=list(str))``)"
msgstr ""
#: ../../content/developer/reference/backend/module.rst:112
msgid "A dictionary containing python and/or binary dependencies."
msgstr ""
#: ../../content/developer/reference/backend/module.rst:114
msgid "For python dependencies, the ``python`` key must be defined for this dictionary and a list of python modules to be imported should be assigned to it."
msgstr ""
#: ../../content/developer/reference/backend/module.rst:118
msgid "For binary dependencies, the ``bin`` key must be defined for this dictionary and a list of binary executable names should be assigned to it."
msgstr ""
#: ../../content/developer/reference/backend/module.rst:121
msgid "The module won't be installed if either the python module is not installed in the host machine or the binary executable is not found within the host machine's PATH environment variable."
msgstr ""
#: ../../content/developer/reference/backend/module.rst:126
msgid "``application`` (``bool``, default: ``False``)"
msgstr ""
#: ../../content/developer/reference/backend/module.rst:125
msgid "Whether the module should be considered as a fully-fledged application (``True``) or is just a technical module (``False``) that provides some extra functionality to an existing application module."
msgstr ""
#: ../../content/developer/reference/backend/module.rst:130
msgid "``assets`` (``dict``)"
msgstr ""
#: ../../content/developer/reference/backend/module.rst:129
msgid "A definition of how all static files are loaded in various assets bundles. See the :ref:`assets <reference/assets>` page for more details on how to describe bundles."
msgstr ""
#: ../../content/developer/reference/backend/module.rst:132
msgid "``installable`` (``bool`` default: ``True``)"
msgstr ""
#: ../../content/developer/reference/backend/module.rst:133
msgid "Whether a user should be able to install the module from the Web UI or not."
msgstr ""
#: ../../content/developer/reference/backend/module.rst:135
msgid "``maintainer`` (``str``)"
msgstr ""
#: ../../content/developer/reference/backend/module.rst:135
msgid "Person or entity in charge of the maintenance of this module, by default it is assumed that the author is the maintainer."
msgstr ""
#: ../../content/developer/reference/backend/module.rst:151
msgid "``{pre_init, post_init, uninstall}_hook`` (``str``)"
msgstr ""
#: ../../content/developer/reference/backend/module.rst:138
msgid "Hooks for module installation/uninstallation, their value should be a string representing the name of a function defined inside the module's ``__init__.py``."
msgstr ""
#: ../../content/developer/reference/backend/module.rst:142
msgid "``pre_init_hook`` takes a cursor as its only argument, this function is executed prior to the module's installation."
msgstr ""
#: ../../content/developer/reference/backend/module.rst:145
msgid "``post_init_hook`` takes a cursor and a registry as its arguments, this function is executed right after the module's installation."
msgstr ""
#: ../../content/developer/reference/backend/module.rst:148
msgid "``uninstall_hook`` takes a cursor and a registry as its arguments, this function is executed after the module's uninstallation."
msgstr ""
#: ../../content/developer/reference/backend/module.rst:151
msgid "These hooks should only be used when setup/cleanup required for this module is either extremely difficult or impossible through the api."
msgstr ""
#: ../../content/developer/reference/backend/module.rst:154
msgid "``active`` (``bool``)"
msgstr ""
#: ../../content/developer/reference/backend/module.rst:154
msgid "Deprecated. Replaced by ``auto_install``."
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:7
msgid "ORM API"
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models:15
msgid "Object Relational Mapping module:"
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models:2
msgid "Hierarchical structure"
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models:3
msgid "Constraints consistency and validation"
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models:4
msgid "Object metadata depends on its status"
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models:5
msgid "Optimised processing by complex query (multiple actions at once)"
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models:6
msgid "Default field values"
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models:7
msgid "Permissions optimisation"
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models:8
msgid "Persistent object: DB postgresql"
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models:9
msgid "Data conversion"
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models:10
msgid "Multi-level caching system"
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models:11
msgid "Two different inheritance mechanisms"
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models:15
msgid "Rich set of field types:"
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models:13
msgid "classical (varchar, integer, boolean, ...)"
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models:14
msgid "relational (one2many, many2one, many2many)"
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models:15
msgid "functional"
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:22
msgid "Model fields are defined as attributes on the model itself::"
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:30
msgid "this means you cannot define a field and a method with the same name, the last one will silently overwrite the former ones."
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:33
msgid "By default, the field's label (user-visible name) is a capitalized version of the field name, this can be overridden with the ``string`` parameter. ::"
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:38
msgid "For the list of field types and parameters, see :ref:`the fields reference <reference/fields>`."
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:41
msgid "Default values are defined as parameters on fields, either as a value::"
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:45
msgid "or as a function called to compute the default value, which should return that value::"
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel:1
msgid "Base class for Odoo models."
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel:3
msgid "Odoo models are created by inheriting one of the following:"
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel:5
msgid ":class:`Model` for regular database-persisted models"
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel:7
msgid ":class:`TransientModel` for temporary data, stored in the database but automatically vacuumed every so often"
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel:10
msgid ":class:`AbstractModel` for abstract super classes meant to be shared by multiple inheriting models"
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel:13
msgid "The system automatically instantiates every model once per database. Those instances represent the available models on each database, and depend on which modules are installed on that database. The actual class of each instance is built from the Python classes that create and inherit from the corresponding model."
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel:19
msgid "Every model instance is a \"recordset\", i.e., an ordered collection of records of the model. Recordsets are returned by methods like :meth:`~.browse`, :meth:`~.search`, or field accesses. Records have no explicit representation: a record is represented as a recordset of one record."
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel:25
msgid "To create a class that should not be instantiated, the :attr:`~odoo.models.BaseModel._register` attribute may be set to False."
msgstr ""
#: ../../docstring of odoo.models.BaseModel._auto:1
#: ../../docstring of odoo.models.Model._auto:1
msgid "Whether a database table should be created. If set to ``False``, override :meth:`~odoo.models.BaseModel.init` to create the database table."
msgstr ""
#: ../../docstring of odoo.models.BaseModel._auto:5
#: ../../docstring of odoo.models.Model._auto:5
msgid "Automatically defaults to `True` for :class:`Model` and :class:`TransientModel`, `False` for :class:`AbstractModel`."
msgstr ""
#: ../../docstring of odoo.models.BaseModel._auto:8
#: ../../docstring of odoo.models.Model._auto:8
msgid "To create a model without any table, inherit from :class:`~odoo.models.AbstractModel`."
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:60
msgid "Whether the ORM should automatically generate and update the :ref:`reference/fields/automatic/log_access`."
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:63
msgid "Defaults to whatever value was set for :attr:`~._auto`."
msgstr ""
#: ../../docstring of odoo.models.BaseModel._table:1
msgid "SQL table name used by model if :attr:`_auto`"
msgstr ""
#: ../../docstring of odoo.models.BaseModel._sql_constraints:1
msgid "SQL constraints [(name, sql_def, message)]"
msgstr ""
#: ../../docstring of odoo.models.BaseModel._register:1
msgid "registry visibility"
msgstr ""
#: ../../docstring of odoo.models.BaseModel._abstract:1
#: ../../docstring of odoo.models.Model._abstract:1
msgid "Whether the model is *abstract*."
msgstr ""
#: ../../docstring of odoo.models.BaseModel._abstract:3
#: ../../docstring of odoo.models.Model._abstract:3
msgid ":class:`AbstractModel`"
msgstr ""
#: ../../docstring of odoo.models.BaseModel._transient:1
msgid "Whether the model is *transient*."
msgstr ""
#: ../../docstring of odoo.models.BaseModel._transient:3
msgid ":class:`TransientModel`"
msgstr ""
#: ../../docstring of odoo.models.BaseModel._name:1
msgid "the model name (in dot-notation, module namespace)"
msgstr ""
#: ../../docstring of odoo.models.BaseModel._description:1
msgid "the model's informal name"
msgstr ""
#: ../../docstring of odoo.models.BaseModel._inherit:1
msgid "Python-inherited models:"
msgstr ""
#: ../../docstring of odoo.models.BaseModel._inherit:3
msgid "str or list(str)"
msgstr ""
#: ../../docstring of odoo.models.BaseModel._inherit:7
msgid "If :attr:`._name` is set, name(s) of parent models to inherit from"
msgstr ""
#: ../../docstring of odoo.models.BaseModel._inherit:8
msgid "If :attr:`._name` is unset, name of a single model to extend in-place"
msgstr ""
#: ../../docstring of odoo.models.BaseModel._inherits:1
msgid "dictionary {'parent_model': 'm2o_field'} mapping the _name of the parent business objects to the names of the corresponding foreign key fields to use::"
msgstr ""
#: ../../docstring of odoo.models.BaseModel._inherits:9
msgid "implements composition-based inheritance: the new model exposes all the fields of the inherited models but stores none of them: the values themselves remain stored on the linked record."
msgstr ""
#: ../../docstring of odoo.models.BaseModel._inherits:15
msgid "if multiple fields with the same name are defined in the :attr:`~odoo.models.Model._inherits`-ed models, the inherited field will correspond to the last one (in the inherits list order)."
msgstr ""
#: ../../docstring of odoo.models.BaseModel._rec_name:1
msgid "field to use for labeling records, default: ``name``"
msgstr ""
#: ../../docstring of odoo.models.BaseModel._order:1
msgid "default order field for searching results"
msgstr ""
#: ../../docstring of odoo.models.BaseModel._check_company_auto:1
msgid "On write and create, call ``_check_company`` to ensure companies consistency on the relational fields having ``check_company=True`` as attribute."
msgstr ""
#: ../../docstring of odoo.models.BaseModel._parent_name:1
msgid "the many2one field used as parent field"
msgstr ""
#: ../../docstring of odoo.models.BaseModel._parent_store:1
msgid "set to True to compute parent_path field."
msgstr ""
#: ../../docstring of odoo.models.BaseModel._parent_store:3
msgid "Alongside a :attr:`~.parent_path` field, sets up an indexed storage of the tree structure of records, to enable faster hierarchical queries on the records of the current model using the ``child_of`` and ``parent_of`` domain operators."
msgstr ""
#: ../../docstring of odoo.models.BaseModel._fold_name:1
msgid "field to determine folded groups in kanban views"
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:89
msgid "AbstractModel"
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:94
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:154
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:183
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:216
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:263
msgid "Model"
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.Model:1
msgid "Main super-class for regular database-persisted Odoo models."
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.Model:3
msgid "Odoo models are created by inheriting from this class::"
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.Model:8
msgid "The system will later instantiate the class once per database (on which the class' module is installed)."
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:102
msgid "TransientModel"
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.TransientModel:1
msgid "Model super-class for transient records, meant to be temporarily persistent, and regularly vacuum-cleaned."
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.TransientModel:4
msgid "A TransientModel has a simplified access rights management, all users can create new records, and may only access the records they created. The superuser has unrestricted access to all TransientModel records."
msgstr ""
#: ../../docstring of odoo.models.TransientModel._transient_max_count:1
msgid "maximum number of transient records, unlimited if ``0``"
msgstr ""
#: ../../docstring of odoo.models.TransientModel._transient_max_hours:1
msgid "maximum idle lifetime (in hours), unlimited if ``0``"
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.TransientModel._transient_vacuum:1
msgid "Clean the transient records."
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.TransientModel._transient_vacuum:3
msgid "This unlinks old records from the transient model tables whenever the :attr:`_transient_max_count` or :attr:`_transient_max_hours` conditions (if any) are reached."
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.TransientModel._transient_vacuum:7
msgid "Actual cleaning will happen only once every 5 minutes. This means this method can be called frequently (e.g. whenever a new record is created)."
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.TransientModel._transient_vacuum:10
msgid "Example with both max_hours and max_count active:"
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.TransientModel._transient_vacuum:12
msgid "Suppose max_hours = 0.2 (aka 12 minutes), max_count = 20, there are 55 rows in the table, 10 created/changed in the last 5 minutes, an additional 12 created/changed between 5 and 10 minutes ago, the rest created/changed more than 12 minutes ago."
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.TransientModel._transient_vacuum:17
msgid "age based vacuum will leave the 22 rows created/changed in the last 12 minutes"
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.TransientModel._transient_vacuum:19
msgid "count based vacuum will wipe out another 12 rows. Not just 2, otherwise each addition would immediately cause the maximum to be reached again."
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.TransientModel._transient_vacuum:22
msgid "the 10 rows that have been created/changed the last 5 minutes will NOT be deleted"
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Field:1
msgid "The field descriptor contains the field definition, and manages accesses and assignments of the corresponding field on records. The following attributes may be provided when instantiating a field:"
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Field:5
msgid "the label of the field seen by users; if not set, the ORM takes the field name in the class (capitalized)."
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Field:8
msgid "the tooltip of the field seen by users"
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Field:10
msgid "whether the field is readonly (default: ``False``) This only has an impact on the UI. Any field assignation in code will work (if the field is a stored field or an inversable one)."
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Field:10
msgid "whether the field is readonly (default: ``False``)"
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Field:12
msgid "This only has an impact on the UI. Any field assignation in code will work (if the field is a stored field or an inversable one)."
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Field:15
msgid "whether the value of the field is required (default: ``False``)"
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Field:17
msgid "whether the field is indexed in database, and the kind of index. Note: this has no effect on non-stored and virtual fields. The possible values are: * ``\"btree\"`` or ``True``: standard index, good for many2one * ``\"btree_not_null\"``: BTREE index without NULL values (useful when most values are NULL, or when NULL is never searched for) * ``\"trigram\"``: Generalized Inverted Index (GIN) with trigrams (good for full-text search) * ``None`` or ``False``: no index (default)"
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Field:17
msgid "whether the field is indexed in database, and the kind of index. Note: this has no effect on non-stored and virtual fields. The possible values are:"
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Field:21
msgid "``\"btree\"`` or ``True``: standard index, good for many2one"
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Field:22
msgid "``\"btree_not_null\"``: BTREE index without NULL values (useful when most"
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Field:23
msgid "values are NULL, or when NULL is never searched for)"
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Field:24
msgid "``\"trigram\"``: Generalized Inverted Index (GIN) with trigrams (good for full-text search)"
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Field:25
msgid "``None`` or ``False``: no index (default)"
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Field:27
msgid "the default value for the field; this is either a static value, or a function taking a recordset and returning a value; use ``default=None`` to discard default values for the field"
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Field:32
msgid "comma-separated list of group xml ids (string); this restricts the field access to the users of the given groups only"
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Field:35
msgid "whether the field value is dependent of the current company; The value isn't stored on the model table. It is registered as `ir.property`. When the value of the company_dependent field is needed, an `ir.property` is searched, linked to the current company (and current record if one property exists). If the value is changed on the record, it either modifies the existing property for the current record (if one exists), or creates a new one for the current company and res_id. If the value is changed on the company side, it will impact all records on which the value hasn't been changed."
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Field:35
msgid "whether the field value is dependent of the current company;"
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Field:37
msgid "The value isn't stored on the model table. It is registered as `ir.property`. When the value of the company_dependent field is needed, an `ir.property` is searched, linked to the current company (and current record if one property exists)."
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Field:42
msgid "If the value is changed on the record, it either modifies the existing property for the current record (if one exists), or creates a new one for the current company and res_id."
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Field:46
msgid "If the value is changed on the company side, it will impact all records on which the value hasn't been changed."
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Field:49
msgid "whether the field value should be copied when the record is duplicated (default: ``True`` for normal fields, ``False`` for ``one2many`` and computed fields, including property fields and related fields)"
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Field:54
msgid "whether the field is stored in database (default:``True``, ``False`` for computed fields)"
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Field:57
msgid "aggregate function used by :meth:`~odoo.models.Model.read_group` when grouping on this field. Supported aggregate functions are: * ``array_agg`` : values, including nulls, concatenated into an array * ``count`` : number of rows * ``count_distinct`` : number of distinct rows * ``bool_and`` : true if all values are true, otherwise false * ``bool_or`` : true if at least one value is true, otherwise false * ``max`` : maximum value of all values * ``min`` : minimum value of all values * ``avg`` : the average (arithmetic mean) of all values * ``sum`` : sum of all values"
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Field:57
msgid "aggregate function used by :meth:`~odoo.models.Model.read_group` when grouping on this field."
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Field:60
msgid "Supported aggregate functions are:"
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Field:62
msgid "``array_agg`` : values, including nulls, concatenated into an array"
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Field:63
msgid "``count`` : number of rows"
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Field:64
msgid "``count_distinct`` : number of distinct rows"
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Field:65
msgid "``bool_and`` : true if all values are true, otherwise false"
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Field:66
msgid "``bool_or`` : true if at least one value is true, otherwise false"
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Field:67
msgid "``max`` : maximum value of all values"
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Field:68
msgid "``min`` : minimum value of all values"
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Field:69
msgid "``avg`` : the average (arithmetic mean) of all values"
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Field:70
msgid "``sum`` : sum of all values"
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Field:72
msgid "function used to expand read_group results when grouping on the current field. .. code-block:: python @api.model def _read_group_selection_field(self, values, domain, order): return ['choice1', 'choice2', ...] # available selection choices. @api.model def _read_group_many2one_field(self, records, domain, order): return records + self.search([custom_domain])"
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Field:72
msgid "function used to expand read_group results when grouping on the current field."
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:237
#: ../../content/developer/tutorials/getting_started/09_compute_onchange.rst:18
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Field:86
msgid "Computed Fields"
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Field:87
msgid "name of a method that computes the field .. seealso:: :ref:`Advanced Fields/Compute fields <reference/fields/compute>`"
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Field:87
msgid "name of a method that computes the field"
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Field:89
msgid ":ref:`Advanced Fields/Compute fields <reference/fields/compute>`"
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Field:91
msgid "whether the field should be computed before record insertion in database. Should be used to specify manually some fields as precompute=True when the field can be computed before record insertion. (e.g. avoid statistics fields based on search/read_group), many2one linking to the previous record, ... (default: `False`) .. warning:: Precomputation only happens when no explicit value and no default value is provided to create(). This means that a default value disables the precomputation, even if the field is specified as precompute=True. Precomputing a field can be counterproductive if the records of the given model are not created in batch. Consider the situation were many records are created one by one. If the field is not precomputed, it will normally be computed in batch at the flush(), and the prefetching mechanism will help making the computation efficient. On the other hand, if the field is precomputed, the computation will be made one by one, and will therefore not be able to take advantage of the prefetching mechanism. Following the remark above, precomputed fields can be interesting on the lines of a one2many, which are usually created in batch by the ORM itself, provided that they are created by writing on the record that contains them."
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Field:91
msgid "whether the field should be computed before record insertion in database. Should be used to specify manually some fields as precompute=True when the field can be computed before record insertion. (e.g. avoid statistics fields based on search/read_group), many2one linking to the previous record, ... (default: `False`)"
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Field:99
msgid "Precomputation only happens when no explicit value and no default value is provided to create(). This means that a default value disables the precomputation, even if the field is specified as precompute=True."
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Field:104
msgid "Precomputing a field can be counterproductive if the records of the given model are not created in batch. Consider the situation were many records are created one by one. If the field is not precomputed, it will normally be computed in batch at the flush(), and the prefetching mechanism will help making the computation efficient. On the other hand, if the field is precomputed, the computation will be made one by one, and will therefore not be able to take advantage of the prefetching mechanism."
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Field:113
msgid "Following the remark above, precomputed fields can be interesting on the lines of a one2many, which are usually created in batch by the ORM itself, provided that they are created by writing on the record that contains them."
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Field:118
msgid "whether the field should be recomputed as superuser to bypass access rights (by default ``True`` for stored fields, ``False`` for non stored fields)"
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Field:122
msgid "whether the field has recursive dependencies (the field ``X`` has a dependency like ``parent_id.X``); declaring a field recursive must be explicit to guarantee that recomputation is correct"
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Field:126
msgid "name of a method that inverses the field (optional)"
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Field:128
msgid "name of a method that implement search on the field (optional)"
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Field:130
msgid "sequence of field names"
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Field:132
msgid "whether the field must be exported by default in an import-compatible export .. seealso:: :ref:`Advanced fields/Related fields <reference/fields/related>`"
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Field:132
msgid "whether the field must be exported by default in an import-compatible export"
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Field:134
msgid ":ref:`Advanced fields/Related fields <reference/fields/related>`"
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:123
msgid "Basic Fields"
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Boolean:1
msgid "Encapsulates a :class:`bool`."
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Char:1
msgid "Basic string field, can be length-limited, usually displayed as a single-line string in clients."
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Char:4
msgid "the maximum size of values stored for that field"
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Char:6
msgid "states whether the value is trimmed or not (by default, ``True``). Note that the trim operation is applied only by the web client."
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Char:9
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Text:4
msgid "enable the translation of the field's values; use ``translate=True`` to translate field values as a whole; ``translate`` may also be a callable such that ``translate(callback, value)`` translates ``value`` by using ``callback(term)`` to retrieve the translation of terms."
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Float:1
msgid "Encapsulates a :class:`float`."
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Float:3
msgid "The precision digits are given by the (optional) ``digits`` attribute."
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Float:5
msgid "a pair (total, decimal) or a string referencing a :class:`~odoo.addons.base.models.decimal_precision.DecimalPrecision` record name."
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Float:9
msgid "When a float is a quantity associated with an unit of measure, it is important to use the right tool to compare or round values with the correct precision."
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Float:12
msgid "The Float class provides some static methods for this purpose:"
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Float:14
msgid ":func:`~odoo.fields.Float.round()` to round a float with the given precision. :func:`~odoo.fields.Float.is_zero()` to check if a float equals zero at the given precision. :func:`~odoo.fields.Float.compare()` to compare two floats at the given precision."
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:309
#: ../../content/developer/reference/frontend/services.rst:393
#: ../../../odoo/odoo/exceptions.py:docstring of odoo.exceptions.AccessDenied:7
#: ../../../odoo/odoo/exceptions.py:docstring of odoo.exceptions.AccessError:3
#: ../../../odoo/odoo/exceptions.py:docstring of odoo.exceptions.CacheMiss:3
#: ../../../odoo/odoo/exceptions.py:docstring of odoo.exceptions.MissingError:3
#: ../../../odoo/odoo/exceptions.py:docstring of odoo.exceptions.ValidationError:3
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Float:18
msgid "Example"
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Float:20
msgid "To round a quantity with the precision of the unit of measure::"
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Float:24
msgid "To check if the quantity is zero with the precision of the unit of measure::"
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Float:28
msgid "To compare two quantities::"
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Float:32
msgid "The compare helper uses the __cmp__ semantics for historic purposes, therefore the proper, idiomatic way to use this helper is like so:"
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Float:35
msgid "if result == 0, the first and second floats are equal if result < 0, the first float is lower than the second if result > 0, the first float is greater than the second"
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Integer:1
msgid "Encapsulates an :class:`int`."
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:136
msgid "Advanced Fields"
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Binary:1
msgid "Encapsulates a binary content (e.g. a file)."
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Binary:3
msgid "whether the field should be stored as `ir_attachment` or in a column of the model's table (default: ``True``)."
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Html:1
msgid "Encapsulates an html code content."
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Html:3
msgid "whether value must be sanitized (default: ``True``)"
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Html:4
msgid "whether the sanitation can be bypassed by the users part of the `base.group_sanitize_override` group (default: ``False``)"
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Html:6
msgid "whether to sanitize tags (only a white list of attributes is accepted, default: ``True``)"
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Html:8
msgid "whether to sanitize attributes (only a white list of attributes is accepted, default: ``True``)"
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Html:10
msgid "whether to sanitize style attributes (default: ``False``)"
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Html:11
msgid "whether to strip style attributes (removed and therefore not sanitized, default: ``False``)"
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Html:13
msgid "whether to strip classes attributes (default: ``False``)"
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Image:1
msgid "Encapsulates an image, extending :class:`Binary`."
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Image:3
msgid "If image size is greater than the ``max_width``/``max_height`` limit of pixels, the image will be resized to the limit by keeping aspect ratio."
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Image:6
msgid "the maximum width of the image (default: ``0``, no limit)"
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Image:7
msgid "the maximum height of the image (default: ``0``, no limit)"
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Image:8
msgid "whether the image resolution should be verified to ensure it doesn't go over the maximum image resolution (default: ``True``). See :class:`odoo.tools.image.ImageProcess` for maximum image resolution (default: ``50e6``)."
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Image:14
msgid "If no ``max_width``/``max_height`` is specified (or is set to 0) and ``verify_resolution`` is False, the field content won't be verified at all and a :class:`Binary` field should be used."
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Monetary:1
msgid "Encapsulates a :class:`float` expressed in a given :class:`res_currency<odoo.addons.base.models.res_currency.Currency>`."
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Monetary:4
msgid "The decimal precision and currency symbol are taken from the ``currency_field`` attribute."
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Monetary:6
msgid "name of the :class:`Many2one` field holding the :class:`res_currency <odoo.addons.base.models.res_currency.Currency>` this monetary field is expressed in (default: `'currency_id'`)"
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Selection:1
msgid "Encapsulates an exclusive choice between different values."
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Selection:3
msgid "specifies the possible values for this field. It is given as either a list of pairs ``(value, label)``, or a model method, or a method name."
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Selection:8
msgid "provides an extension of the selection in the case of an overridden field. It is a list of pairs ``(value, label)`` or singletons ``(value,)``, where singleton values must appear in the overridden selection. The new values are inserted in an order that is consistent with the overridden selection and this list:: selection = [('a', 'A'), ('b', 'B')] selection_add = [('c', 'C'), ('b',)] > result = [('a', 'A'), ('c', 'C'), ('b', 'B')]"
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Selection:8
msgid "provides an extension of the selection in the case of an overridden field. It is a list of pairs ``(value, label)`` or singletons ``(value,)``, where singleton values must appear in the overridden selection. The new values are inserted in an order that is consistent with the overridden selection and this list::"
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Selection:19
msgid "provides a fallback mechanism for any overridden field with a selection_add. It is a dict that maps every option from the selection_add to a fallback action. This fallback action will be applied to all records whose selection_add option maps to it. The actions can be any of the following: - 'set null' -- the default, all records with this option will have their selection value set to False. - 'cascade' -- all records with this option will be deleted along with the option itself. - 'set default' -- all records with this option will be set to the default of the field definition - 'set VALUE' -- all records with this option will be set to the given value - <callable> -- a callable whose first and only argument will be the set of records containing the specified Selection option, for custom processing"
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Selection:19
msgid "provides a fallback mechanism for any overridden field with a selection_add. It is a dict that maps every option from the selection_add to a fallback action."
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Selection:23
msgid "This fallback action will be applied to all records whose selection_add option maps to it."
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Selection:37
msgid "The actions can be any of the following:"
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Selection:27
msgid "'set null' -- the default, all records with this option will have their selection value set to False."
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Selection:29
msgid "'cascade' -- all records with this option will be deleted along with the option itself."
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Selection:31
msgid "'set default' -- all records with this option will be set to the default of the field definition"
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Selection:33
msgid "'set VALUE' -- all records with this option will be set to the given value"
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Selection:35
msgid "<callable> -- a callable whose first and only argument will be the set of records containing the specified Selection option, for custom processing"
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Selection:39
msgid "The attribute ``selection`` is mandatory except in the case of ``related`` or extended fields."
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Text:1
msgid "Very similar to :class:`Char` but used for longer contents, does not have a size and usually displayed as a multiline text box."
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:153
msgid "Date(time) Fields"
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:155
msgid ":class:`Dates <odoo.fields.Date>` and :class:`Datetimes <odoo.fields.Datetime>` are very important fields in any kind of business application. Their misuse can create invisible yet painful bugs, this section aims to provide Odoo developers with the knowledge required to avoid misusing these fields."
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:161
msgid "When assigning a value to a Date/Datetime field, the following options are valid:"
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:163
msgid "A `date` or `datetime` object."
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:164
msgid "A string in the proper server format:"
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:166
msgid "``YYYY-MM-DD`` for :class:`~odoo.fields.Date` fields,"
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:167
msgid "``YYYY-MM-DD HH:MM:SS`` for :class:`~odoo.fields.Datetime` fields."
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:169
msgid "`False` or `None`."
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:171
msgid "The Date and Datetime fields class have helper methods to attempt conversion into a compatible type:"
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:174
msgid ":func:`~odoo.fields.Date.to_date` will convert to a :class:`datetime.date`"
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:175
msgid ":func:`~odoo.fields.Datetime.to_datetime` will convert to a :class:`datetime.datetime`."
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:179
msgid "To parse date/datetimes coming from external sources::"
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:183
msgid "Date / Datetime comparison best practices:"
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:185
msgid "Date fields can **only** be compared to date objects."
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:186
msgid "Datetime fields can **only** be compared to datetime objects."
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:188
msgid "Strings representing dates and datetimes can be compared between each other, however the result may not be the expected result, as a datetime string will always be greater than a date string, therefore this practice is **heavily** discouraged."
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:194
msgid "Common operations with dates and datetimes such as addition, subtraction or fetching the start/end of a period are exposed through both :class:`~odoo.fields.Date` and :class:`~odoo.fields.Datetime`. These helpers are also available by importing `odoo.tools.date_utils`."
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:199
msgid "Timezones"
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:201
msgid "Datetime fields are stored as `timestamp without timezone` columns in the database and are stored in the UTC timezone. This is by design, as it makes the Odoo database independent from the timezone of the hosting server system. Timezone conversion is managed entirely by the client side."
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Date:1
msgid "Encapsulates a python :class:`date <datetime.date>` object."
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.tools.date_utils.add:1
msgid "Return the sum of ``value`` and a :class:`relativedelta`."
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.tools.date_utils.add:3
#: ../../../odoo/odoo/fields.py:docstring of odoo.tools.date_utils.end_of:3
#: ../../../odoo/odoo/fields.py:docstring of odoo.tools.date_utils.start_of:3
#: ../../../odoo/odoo/fields.py:docstring of odoo.tools.date_utils.subtract:3
msgid "initial date or datetime."
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.tools.date_utils.add:4
#: ../../../odoo/odoo/fields.py:docstring of odoo.tools.date_utils.subtract:4
msgid "positional args to pass directly to :class:`relativedelta`."
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.tools.date_utils.add:5
#: ../../../odoo/odoo/fields.py:docstring of odoo.tools.date_utils.subtract:5
msgid "keyword args to pass directly to :class:`relativedelta`."
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.tools.date_utils.add:6
#: ../../../odoo/odoo/fields.py:docstring of odoo.tools.date_utils.subtract:6
msgid "the resulting date/datetime."
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Date.context_today:1
msgid "Return the current date as seen in the client's timezone in a format fit for date fields."
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Date.context_today:4
msgid "This method may be used to compute default values."
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Date.context_today:6
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Datetime.context_timestamp:8
msgid "recordset from which the timezone will be obtained."
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Date.context_today:7
msgid "optional datetime value to use instead of the current date and time (must be a datetime, regular dates can't be converted between timezones)."
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.tools.date_utils.end_of:1
msgid "Get end of a time period from a date or a datetime."
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.tools.date_utils.end_of:4
msgid "Type of period in string, can be year, quarter, month, week, day or hour."
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.tools.date_utils.end_of:5
msgid "A date/datetime object corresponding to the start of the specified period."
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.tools.date_utils.start_of:1
msgid "Get start of a time period from a date or a datetime."
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.tools.date_utils.start_of:4
msgid "type of period in string, can be year, quarter, month, week, day or hour."
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.tools.date_utils.start_of:5
msgid "a date/datetime object corresponding to the start of the specified period."
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.tools.date_utils.subtract:1
msgid "Return the difference between ``value`` and a :class:`relativedelta`."
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Date.to_date:1
msgid "Attempt to convert ``value`` to a :class:`date` object."
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Date.to_date:5
msgid "If a datetime object is given as value, it will be converted to a date object and all datetime-specific information will be lost (HMS, TZ, ...)."
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Date.to_date:9
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Date.to_string:3
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Datetime.to_datetime:3
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Datetime.to_string:3
msgid "value to convert."
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Date.to_date:11
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Datetime.to_datetime:5
msgid "an object representing ``value``."
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Date.to_string:1
msgid "Convert a :class:`date` or :class:`datetime` object to a string."
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Date.to_string:4
msgid "a string representing ``value`` in the server's date format, if ``value`` is of type :class:`datetime`, the hours, minute, seconds, tzinfo will be truncated."
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Date.today:1
msgid "Return the current day in the format expected by the ORM."
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Date.today:3
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Datetime.now:3
msgid "This function may be used to compute default values."
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Datetime:1
msgid "Encapsulates a python :class:`datetime <datetime.datetime>` object."
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Datetime.context_timestamp:1
msgid "Return the given timestamp converted to the client's timezone."
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Datetime.context_timestamp:3
msgid "This method is *not* meant for use as a default initializer, because datetime fields are automatically converted upon display on client side. For default values, :meth:`now` should be used instead."
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Datetime.context_timestamp:9
msgid "naive datetime value (expressed in UTC) to be converted to the client timezone."
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Datetime.context_timestamp:11
msgid "timestamp converted to timezone-aware datetime in context timezone."
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Datetime.now:1
msgid "Return the current day and time in the format expected by the ORM."
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Datetime.to_datetime:1
msgid "Convert an ORM ``value`` into a :class:`datetime` value."
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Datetime.to_string:1
msgid "Convert a :class:`datetime` or :class:`date` object to a string."
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Datetime.to_string:5
msgid "a string representing ``value`` in the server's datetime format, if ``value`` is of type :class:`date`, the time portion will be midnight (00:00:00)."
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Datetime.today:1
msgid "Return the current day, at midnight (00:00:00)."
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:214
msgid "Relational Fields"
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Many2one:1
msgid "The value of such a field is a recordset of size 0 (no record) or 1 (a single record)."
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Many2one:4
msgid "name of the target model ``Mandatory`` except for related or extended fields."
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Many2many:29
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Many2one:7
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.One2many:10
msgid "an optional domain to set on candidate values on the client side (domain or a python expression that will be evaluated to provide domain)"
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Many2many:33
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Many2one:11
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.One2many:14
msgid "an optional context to use on the client side when handling that field"
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Many2one:14
msgid "what to do when the referred record is deleted; possible values are: ``'set null'``, ``'restrict'``, ``'cascade'``"
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Many2one:17
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.One2many:17
msgid "whether JOINs are generated upon search through that field (default: ``False``)"
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Many2one:20
msgid "set it to ``True`` to make fields of the target model accessible from the current model (corresponds to ``_inherits``)"
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Many2many:36
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Many2one:23
msgid "Mark the field to be verified in :meth:`~odoo.models.Model._check_company`. Add a default company domain depending on the field attributes."
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.One2many:1
msgid "One2many field; the value of such a field is the recordset of all the records in ``comodel_name`` such that the field ``inverse_name`` is equal to the current record."
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.One2many:5
msgid "name of the target model"
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.One2many:7
msgid "name of the inverse ``Many2one`` field in ``comodel_name``"
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.One2many:20
msgid "The attributes ``comodel_name`` and ``inverse_name`` are mandatory except in the case of related fields or field extensions."
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Many2many:1
msgid "Many2many field; the value of such a field is the recordset."
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Many2many:3
msgid "name of the target model (string) mandatory except in the case of related or extended fields"
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Many2many:6
msgid "optional name of the table that stores the relation in the database"
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Many2many:9
msgid "optional name of the column referring to \"these\" records in the table ``relation``"
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Many2many:12
msgid "optional name of the column referring to \"those\" records in the table ``relation``"
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Many2many:15
msgid "The attributes ``relation``, ``column1`` and ``column2`` are optional. If not given, names are automatically generated from model names, provided ``model_name`` and ``comodel_name`` are different!"
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Many2many:19
msgid "Note that having several fields with implicit relation parameters on a given model with the same comodel is not accepted by the ORM, since those field would use the same table. The ORM prevents two many2many fields to use the same relation parameters, except if"
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Many2many:24
msgid "both fields use the same model, comodel, and relation parameters are explicit; or"
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Many2many:27
msgid "at least one field belongs to a model with ``_auto = False``."
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Command:1
msgid ":class:`~odoo.fields.One2many` and :class:`~odoo.fields.Many2many` fields expect a special command to manipulate the relation they implement."
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Command:4
msgid "Internally, each command is a 3-elements tuple where the first element is a mandatory integer that identifies the command, the second element is either the related record id to apply the command on (commands update, delete, unlink and link) either 0 (commands create, clear and set), the third element is either the ``values`` to write on the record (commands create and update) either the new ``ids`` list of related records (command set), either 0 (commands delete, unlink, link, and clear)."
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Command:12
msgid "Via Python, we encourage developers craft new commands via the various functions of this namespace. We also encourage developers to use the command identifier constant names when comparing the 1st element of existing commands."
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Command:17
msgid "Via RPC, it is impossible nor to use the functions nor the command constant names. It is required to instead write the literal 3-elements tuple where the first element is the integer identifier of the command."
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Command.create:1
msgid "Create new records in the comodel using ``values``, link the created records to ``self``."
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Command.create:4
msgid "In case of a :class:`~odoo.fields.Many2many` relation, one unique new record is created in the comodel such that all records in `self` are linked to the new record."
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Command.create:8
msgid "In case of a :class:`~odoo.fields.One2many` relation, one new record is created in the comodel for every record in ``self`` such that every record in ``self`` is linked to exactly one of the new records."
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Command.create:12
msgid "Return the command triple :samp:`(CREATE, 0, {values})`"
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Command.update:1
msgid "Write ``values`` on the related record."
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Command.update:3
msgid "Return the command triple :samp:`(UPDATE, {id}, {values})`"
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Command.delete:1
msgid "Remove the related record from the database and remove its relation with ``self``."
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Command.delete:4
msgid "In case of a :class:`~odoo.fields.Many2many` relation, removing the record from the database may be prevented if it is still linked to other records."
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Command.delete:8
msgid "Return the command triple :samp:`(DELETE, {id}, 0)`"
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Command.unlink:1
msgid "Remove the relation between ``self`` and the related record."
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Command.unlink:3
msgid "In case of a :class:`~odoo.fields.One2many` relation, the given record is deleted from the database if the inverse field is set as ``ondelete='cascade'``. Otherwise, the value of the inverse field is set to False and the record is kept."
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Command.unlink:8
msgid "Return the command triple :samp:`(UNLINK, {id}, 0)`"
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Command.link:1
msgid "Add a relation between ``self`` and the related record."
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Command.link:3
msgid "Return the command triple :samp:`(LINK, {id}, 0)`"
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Command.clear:1
msgid "Remove all records from the relation with ``self``. It behaves like executing the `unlink` command on every record."
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Command.clear:4
msgid "Return the command triple :samp:`(CLEAR, 0, 0)`"
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Command.set:1
msgid "Replace the current relations of ``self`` by the given ones. It behaves like executing the ``unlink`` command on every removed relation then executing the ``link`` command on every new relation."
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Command.set:5
msgid "Return the command triple :samp:`(SET, 0, {ids})`"
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:228
msgid "Pseudo-relational fields"
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Many2oneReference:1
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Reference:1
msgid "Pseudo-relational field (no FK in database)."
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Reference:3
msgid "The field value is stored as a :class:`string <str>` following the pattern ``\"res_model,res_id\"`` in database."
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Many2oneReference:3
msgid "The field value is stored as an :class:`integer <int>` id in database."
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Many2oneReference:5
msgid "Contrary to :class:`Reference` fields, the model has to be specified in a :class:`Char` field, whose name has to be specified in the `model_field` attribute for the current :class:`Many2oneReference` field."
msgstr ""
#: ../../../odoo/odoo/fields.py:docstring of odoo.fields.Many2oneReference:9
msgid "name of the :class:`Char` where the model name is stored."
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:239
msgid "Fields can be computed (instead of read straight from the database) using the ``compute`` parameter. **It must assign the computed value to the field**. If it uses the values of other *fields*, it should specify those fields using :func:`~odoo.api.depends`. ::"
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:252
msgid "dependencies can be dotted paths when using sub-fields::"
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:259
msgid "computed fields are not stored by default, they are computed and returned when requested. Setting ``store=True`` will store them in the database and automatically enable searching."
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:262
msgid "searching on a computed field can also be enabled by setting the ``search`` parameter. The value is a method name returning a :ref:`reference/orm/domains`. ::"
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:273
msgid "The search method is invoked when processing domains before doing an actual search on the model. It must return a domain equivalent to the condition: ``field operator value``."
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:279
msgid "Computed fields are readonly by default. To allow *setting* values on a computed field, use the ``inverse`` parameter. It is the name of a function reversing the computation and setting the relevant fields::"
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:295
msgid "multiple fields can be computed at the same time by the same method, just use the same method on all fields and set all of them::"
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:311
msgid "While it is possible to use the same compute method for multiple fields, it is not recommended to do the same for the inverse method."
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:315
msgid "During the computation of the inverse, **all** fields that use said inverse are protected, meaning that they can't be computed, even if their value is not in the cache."
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:319
msgid "If any of those fields is accessed and its value is not in cache, the ORM will simply return a default value of `False` for these fields. This means that the value of the inverse fields (other than the one triggering the inverse method) may not give their correct value and this will probably break the expected behavior of the inverse method."
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:328
msgid "Related fields"
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:330
msgid "A special case of computed fields are *related* (proxy) fields, which provide the value of a sub-field on the current record. They are defined by setting the ``related`` parameter and like regular computed fields they can be stored::"
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:337
msgid "The value of a related field is given by following a sequence of relational fields and reading a field on the reached model. The complete sequence of fields to traverse is specified by the ``related`` attribute."
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:341
msgid "Some field attributes are automatically copied from the source field if they are not redefined: ``string``, ``help``, ``required`` (only if all fields in the sequence are required), ``groups``, ``digits``, ``size``, ``translate``, ``sanitize``, ``selection``, ``comodel_name``, ``domain``, ``context``. All semantic-free attributes are copied from the source field."
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:348
msgid "By default, related fields are:"
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:350
msgid "not stored"
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:351
msgid "not copied"
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:352
#: ../../../odoo/addons/account/models/account_account.py:docstring of odoo.addons.account.models.account_account.AccountGroup.parent_id:0
msgid "readonly"
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:353
msgid "computed in superuser mode"
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:355
msgid "Add the attribute ``store=True`` to make it stored, just like computed fields. Related fields are automatically recomputed when their dependencies are modified."
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:361
msgid "You can specify precise field dependencies if you don't want the related field to be recomputed on any dependency change::"
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:372
msgid "You cannot chain :class:`~odoo.fields.Many2many` or :class:`~odoo.fields.One2many` fields in ``related`` fields dependencies."
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:374
msgid "``related`` can be used to refer to a :class:`~odoo.fields.One2many` or :class:`~odoo.fields.Many2many` field on another model on the condition that it's done through a ``Many2one`` relation on the current model. ``One2many`` and ``Many2many`` are not supported and the results will not be aggregated correctly::"
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:397
msgid "Automatic fields"
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:401
msgid "Identifier :class:`field <odoo.fields.Field>`"
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:403
msgid "If length of current recordset is 1, return id of unique record in it."
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:405
msgid "Raise an Error otherwise."
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:409
msgid "Name :class:`field <odoo.fields.Char>` displayed by default in the web client"
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:411
msgid "By default, it equals to :attr:`~odoo.models.BaseModel._rec_name` value field but the behavior can be customized by overriding :attr:`~odoo.models.BaseModel._compute_display_name`"
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:417
msgid "Access Log fields"
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:419
msgid "These fields are automatically set and updated if :attr:`~odoo.models.BaseModel._log_access` is enabled. It can be disabled to avoid creating or updating those fields on tables for which they are not useful."
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:424
msgid "By default, :attr:`~odoo.models.BaseModel._log_access` is set to the same value as :attr:`~odoo.models.BaseModel._auto`"
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:429
msgid "Stores when the record was created, :class:`~odoo.fields.Datetime`"
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:433
msgid "Stores *who* created the record, :class:`~odoo.fields.Many2one` to a ``res.users``."
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:438
msgid "Stores when the record was last updated, :class:`~odoo.fields.Datetime`"
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:442
msgid "Stores who last updated the record, :class:`~odoo.fields.Many2one` to a ``res.users``."
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:445
msgid ":attr:`~odoo.models.BaseModel._log_access` *must* be enabled on :class:`~odoo.models.TransientModel`."
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:451
msgid "Reserved Field names"
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:453
msgid "A few field names are reserved for pre-defined behaviors beyond that of automated fields. They should be defined on a model when the related behavior is desired:"
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:459
msgid "default value for :attr:`~odoo.models.BaseModel._rec_name`, used to display records in context where a representative \"naming\" is necessary."
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:463
#: ../../content/developer/reference/backend/orm.rst:500
#: ../../content/developer/reference/user_interface/view_records.rst:81
#: ../../content/developer/reference/user_interface/view_records.rst:88
msgid ":class:`~odoo.fields.Char`"
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:467
msgid "toggles the global visibility of the record, if ``active`` is set to ``False`` the record is invisible in most searches and listing."
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:470
msgid ":class:`~odoo.fields.Boolean`"
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:472
msgid "Special methods:"
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.toggle_active:1
msgid "Inverses the value of :attr:`active` on the records in ``self``."
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.action_archive:1
msgid "Sets :attr:`active` to ``False`` on a recordset, by calling :meth:`toggle_active` on its currently active records."
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.action_unarchive:1
msgid "Sets :attr:`active` to ``True`` on a recordset, by calling :meth:`toggle_active` on its currently inactive records."
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:480
msgid "lifecycle stages of the object, used by the ``states`` attribute on :class:`fields <odoo.fields.Field>`."
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:483
msgid ":class:`~odoo.fields.Selection`"
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:487
msgid "default_value of :attr:`~._parent_name`, used to organize records in a tree structure and enables the ``child_of`` and ``parent_of`` operators in domains."
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:491
#: ../../content/developer/reference/user_interface/view_records.rst:131
msgid ":class:`~odoo.fields.Many2one`"
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:495
msgid "When :attr:`~._parent_store` is set to True, used to store a value reflecting the tree structure of :attr:`~._parent_name`, and to optimize the operators ``child_of`` and ``parent_of`` in search domains. It must be declared with ``index=True`` for proper operation."
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:504
msgid "Main field name used for Odoo multi-company behavior."
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:506
msgid "Used by `:meth:~odoo.models._check_company` to check multi company consistency. Defines whether a record is shared between companies (no value) or only accessible by the users of a given company."
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:510
msgid ":class:`~odoo.fields.Many2one` :type: :class:`~odoo.addons.base.models.res_company`"
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:514
msgid "Recordsets"
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:516
msgid "Interactions with models and records are performed through recordsets, an ordered collection of records of the same model."
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:519
msgid "Contrary to what the name implies, it is currently possible for recordsets to contain duplicates. This may change in the future."
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:522
msgid "Methods defined on a model are executed on a recordset, and their ``self`` is a recordset::"
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:532
msgid "Iterating on a recordset will yield new sets of *a single record* (\"singletons\"), much like iterating on a Python string yields strings of a single characters::"
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:542
msgid "Field access"
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:544
msgid "Recordsets provide an \"Active Record\" interface: model fields can be read and written directly from the record as attributes."
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:549
msgid "When accessing non-relational fields on a recordset of potentially multiple records, use :meth:`~odoo.models.BaseModel.mapped`::"
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:554
msgid "Field values can also be accessed like dict items, which is more elegant and safer than ``getattr()`` for dynamic field names. Setting a field's value triggers an update to the database::"
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:569
msgid "Trying to read a field on multiple records will raise an error for non relational fields."
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:572
msgid "Accessing a relational field (:class:`~odoo.fields.Many2one`, :class:`~odoo.fields.One2many`, :class:`~odoo.fields.Many2many`) *always* returns a recordset, empty if the field is not set."
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:577
msgid "Record cache and prefetching"
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:579
msgid "Odoo maintains a cache for the fields of the records, so that not every field access issues a database request, which would be terrible for performance. The following example queries the database only for the first statement::"
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:586
msgid "To avoid reading one field on one record at a time, Odoo *prefetches* records and fields following some heuristics to get good performance. Once a field must be read on a given record, the ORM actually reads that field on a larger recordset, and stores the returned values in cache for later use. The prefetched recordset is usually the recordset from which the record comes by iteration. Moreover, all simple stored fields (boolean, integer, float, char, text, date, datetime, selection, many2one) are fetched altogether; they correspond to the columns of the model's table, and are fetched efficiently in the same query."
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:595
msgid "Consider the following example, where ``partners`` is a recordset of 1000 records. Without prefetching, the loop would make 2000 queries to the database. With prefetching, only one query is made::"
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:604
msgid "The prefetching also works on *secondary records*: when relational fields are read, their values (which are records) are subscribed for future prefetching. Accessing one of those secondary records prefetches all secondary records from the same model. This makes the following example generate only two queries, one for partners and one for countries::"
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:616
msgid "The methods :meth:`~odoo.models.Model.search_fetch` and :meth:`~odoo.models.Model.fetch` can be used to populate the cache of records, typically in cases where the prefetching mechanism does not work well."
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:625
msgid "Method decorators"
msgstr ""
#: ../../../odoo/odoo/api.py:docstring of odoo.api:1
msgid "The Odoo API module defines Odoo Environments and method decorators."
msgstr ""
#: ../../../odoo/odoo/api.py:docstring of odoo.api:3
msgid "Document this module"
msgstr ""
#: ../../../odoo/odoo/api.py:docstring of odoo.api.autovacuum:1
msgid "Decorate a method so that it is called by the daily vacuum cron job (model ``ir.autovacuum``). This is typically used for garbage-collection-like tasks that do not deserve a specific cron job."
msgstr ""
#: ../../../odoo/odoo/api.py:docstring of odoo.api.constrains:1
msgid "Decorate a constraint checker."
msgstr ""
#: ../../../odoo/odoo/api.py:docstring of odoo.api.constrains:3
msgid "Each argument must be a field name used in the check::"
msgstr ""
#: ../../../odoo/odoo/api.py:docstring of odoo.api.constrains:11
msgid "Invoked on the records on which one of the named fields has been modified."
msgstr ""
#: ../../../odoo/odoo/api.py:docstring of odoo.api.constrains:13
msgid "Should raise :exc:`~odoo.exceptions.ValidationError` if the validation failed."
msgstr ""
#: ../../../odoo/odoo/api.py:docstring of odoo.api.constrains:18
msgid "``@constrains`` only supports simple field names, dotted names (fields of relational fields e.g. ``partner_id.customer``) are not supported and will be ignored."
msgstr ""
#: ../../../odoo/odoo/api.py:docstring of odoo.api.constrains:22
msgid "``@constrains`` will be triggered only if the declared fields in the decorated method are included in the ``create`` or ``write`` call. It implies that fields not present in a view will not trigger a call during a record creation. A override of ``create`` is necessary to make sure a constraint will always be triggered (e.g. to test the absence of value)."
msgstr ""
#: ../../../odoo/odoo/api.py:docstring of odoo.api.constrains:29
msgid "One may also pass a single function as argument. In that case, the field names are given by calling the function with a model instance."
msgstr ""
#: ../../../odoo/odoo/api.py:docstring of odoo.api.depends:1
msgid "Return a decorator that specifies the field dependencies of a \"compute\" method (for new-style function fields). Each argument must be a string that consists in a dot-separated sequence of field names::"
msgstr ""
#: ../../../odoo/odoo/api.py:docstring of odoo.api.depends:15
msgid "One may also pass a single function as argument. In that case, the dependencies are given by calling the function with the field's model."
msgstr ""
#: ../../../odoo/odoo/api.py:docstring of odoo.api.depends_context:1
msgid "Return a decorator that specifies the context dependencies of a non-stored \"compute\" method. Each argument is a key in the context's dictionary::"
msgstr ""
#: ../../../odoo/odoo/api.py:docstring of odoo.api.depends_context:16
msgid "All dependencies must be hashable. The following keys have special support:"
msgstr ""
#: ../../../odoo/odoo/api.py:docstring of odoo.api.depends_context:19
msgid "`company` (value in context or current company id),"
msgstr ""
#: ../../../odoo/odoo/api.py:docstring of odoo.api.depends_context:20
msgid "`uid` (current user id and superuser flag),"
msgstr ""
#: ../../../odoo/odoo/api.py:docstring of odoo.api.depends_context:21
msgid "`active_test` (value in env.context or value in field.context)."
msgstr ""
#: ../../../odoo/odoo/api.py:docstring of odoo.api.model:1
msgid "Decorate a record-style method where ``self`` is a recordset, but its contents is not relevant, only the model is. Such a method::"
msgstr ""
#: ../../../odoo/odoo/api.py:docstring of odoo.api.model_create_multi:1
msgid "Decorate a method that takes a list of dictionaries and creates multiple records. The method may be called with either a single dict or a list of dicts::"
msgstr ""
#: ../../../odoo/odoo/api.py:docstring of odoo.api.onchange:1
msgid "Return a decorator to decorate an onchange method for given fields."
msgstr ""
#: ../../../odoo/odoo/api.py:docstring of odoo.api.onchange:3
msgid "In the form views where the field appears, the method will be called when one of the given fields is modified. The method is invoked on a pseudo-record that contains the values present in the form. Field assignments on that record are automatically sent back to the client."
msgstr ""
#: ../../../odoo/odoo/api.py:docstring of odoo.api.onchange:8
msgid "Each argument must be a field name::"
msgstr ""
#: ../../../odoo/odoo/api.py:docstring of odoo.api.onchange:20
msgid "If the type is set to notification, the warning will be displayed in a notification. Otherwise it will be displayed in a dialog as default."
msgstr ""
#: ../../../odoo/odoo/api.py:docstring of odoo.api.onchange:25
msgid "``@onchange`` only supports simple field names, dotted names (fields of relational fields e.g. ``partner_id.tz``) are not supported and will be ignored"
msgstr ""
#: ../../../odoo/odoo/api.py:docstring of odoo.api.onchange:31
msgid "Since ``@onchange`` returns a recordset of pseudo-records, calling any one of the CRUD methods (:meth:`create`, :meth:`read`, :meth:`write`, :meth:`unlink`) on the aforementioned recordset is undefined behaviour, as they potentially do not exist in the database yet."
msgstr ""
#: ../../../odoo/odoo/api.py:docstring of odoo.api.onchange:37
msgid "Instead, simply set the record's field like shown in the example above or call the :meth:`update` method."
msgstr ""
#: ../../../odoo/odoo/api.py:docstring of odoo.api.onchange:42
msgid "It is not possible for a ``one2many`` or ``many2many`` field to modify itself via onchange. This is a webclient limitation - see `#2693 <https://github.com/odoo/odoo/issues/2693>`_."
msgstr ""
#: ../../../odoo/odoo/api.py:docstring of odoo.api.ondelete:1
msgid "Mark a method to be executed during :meth:`~odoo.models.BaseModel.unlink`."
msgstr ""
#: ../../../odoo/odoo/api.py:docstring of odoo.api.ondelete:3
msgid "The goal of this decorator is to allow client-side errors when unlinking records if, from a business point of view, it does not make sense to delete such records. For instance, a user should not be able to delete a validated sales order."
msgstr ""
#: ../../../odoo/odoo/api.py:docstring of odoo.api.ondelete:8
msgid "While this could be implemented by simply overriding the method ``unlink`` on the model, it has the drawback of not being compatible with module uninstallation. When uninstalling the module, the override could raise user errors, but we shouldn't care because the module is being uninstalled, and thus **all** records related to the module should be removed anyway."
msgstr ""
#: ../../../odoo/odoo/api.py:docstring of odoo.api.ondelete:14
msgid "This means that by overriding ``unlink``, there is a big chance that some tables/records may remain as leftover data from the uninstalled module. This leaves the database in an inconsistent state. Moreover, there is a risk of conflicts if the module is ever reinstalled on that database."
msgstr ""
#: ../../../odoo/odoo/api.py:docstring of odoo.api.ondelete:19
msgid "Methods decorated with ``@ondelete`` should raise an error following some conditions, and by convention, the method should be named either ``_unlink_if_<condition>`` or ``_unlink_except_<not_condition>``."
msgstr ""
#: ../../../odoo/odoo/api.py:docstring of odoo.api.ondelete:36
msgid "Whether the decorated method should be called if the module that implements said method is being uninstalled. Should almost always be ``False``, so that module uninstallation does not trigger those errors."
msgstr ""
#: ../../../odoo/odoo/api.py:docstring of odoo.api.ondelete:42
msgid "The parameter ``at_uninstall`` should only be set to ``True`` if the check you are implementing also applies when uninstalling the module."
msgstr ""
#: ../../../odoo/odoo/api.py:docstring of odoo.api.ondelete:45
msgid "For instance, it doesn't matter if when uninstalling ``sale``, validated sales orders are being deleted because all data pertaining to ``sale`` should be deleted anyway, in that case ``at_uninstall`` should be set to ``False``."
msgstr ""
#: ../../../odoo/odoo/api.py:docstring of odoo.api.ondelete:50
msgid "However, it makes sense to prevent the removal of the default language if no other languages are installed, since deleting the default language will break a lot of basic behavior. In this case, ``at_uninstall`` should be set to ``True``."
msgstr ""
#: ../../../odoo/odoo/api.py:docstring of odoo.api.returns:1
msgid "Return a decorator for methods that return instances of ``model``."
msgstr ""
#: ../../../odoo/odoo/api.py:docstring of odoo.api.returns:3
msgid "a model name, or ``'self'`` for the current model"
msgstr ""
#: ../../../odoo/odoo/api.py:docstring of odoo.api.returns:5
msgid "a function ``downgrade(self, value, *args, **kwargs)`` to convert the record-style ``value`` to a traditional-style output"
msgstr ""
#: ../../../odoo/odoo/api.py:docstring of odoo.api.returns:8
msgid "a function ``upgrade(self, value, *args, **kwargs)`` to convert the traditional-style ``value`` to a record-style output"
msgstr ""
#: ../../../odoo/odoo/api.py:docstring of odoo.api.returns:11
msgid "The arguments ``self``, ``*args`` and ``**kwargs`` are the ones passed to the method in the record-style."
msgstr ""
#: ../../../odoo/odoo/api.py:docstring of odoo.api.returns:14
msgid "The decorator adapts the method output to the api style: ``id``, ``ids`` or ``False`` for the traditional style, and recordset for the record style::"
msgstr ""
#: ../../../odoo/odoo/api.py:docstring of odoo.api.returns:28
msgid "Note that the decorated method must satisfy that convention."
msgstr ""
#: ../../../odoo/odoo/api.py:docstring of odoo.api.returns:30
msgid "Those decorators are automatically *inherited*: a method that overrides a decorated existing method will be decorated with the same ``@returns(model)``."
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:639
msgid "With sphinx 2.0 : autodecorator"
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:641
msgid "Add in Views reference * It is possible to suppress the trigger from a specific field by adding ``on_change=\"0\"`` in a view::"
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:647
msgid "will not trigger any interface update when the field is edited by the user, even if there are function fields or explicit onchange depending on that field."
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:654
#: ../../content/developer/reference/frontend/framework_overview.rst:96
msgid "Environment"
msgstr ""
#: ../../../odoo/odoo/api.py:docstring of odoo.api.Environment:1
msgid "The environment stores various contextual data used by the ORM:"
msgstr ""
#: ../../../odoo/odoo/api.py:docstring of odoo.api.Environment:3
msgid ":attr:`cr`: the current database cursor (for database queries);"
msgstr ""
#: ../../../odoo/odoo/api.py:docstring of odoo.api.Environment:4
msgid ":attr:`uid`: the current user id (for access rights checks);"
msgstr ""
#: ../../../odoo/odoo/api.py:docstring of odoo.api.Environment:5
msgid ":attr:`context`: the current context dictionary (arbitrary metadata);"
msgstr ""
#: ../../../odoo/odoo/api.py:docstring of odoo.api.Environment:6
msgid ":attr:`su`: whether in superuser mode."
msgstr ""
#: ../../../odoo/odoo/api.py:docstring of odoo.api.Environment:8
msgid "It provides access to the registry by implementing a mapping from model names to models. It also holds a cache for records, and a data structure to manage recomputations."
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:671
msgid "When creating a recordset from an other recordset, the environment is inherited. The environment can be used to get an empty recordset in an other model, and query that model:"
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:682
msgid "Some lazy properties are available to access the environment (contextual) data:"
msgstr ""
#: ../../docstring of odoo.api.Environment.lang:1
msgid "Return the current language code."
msgstr ""
#: ../../docstring of odoo.api.Environment.user:1
msgid "Return the current user (as an instance)."
msgstr ""
#: ../../docstring of odoo.api.Environment.user:3
msgid "current user - sudoed"
msgstr ""
#: ../../docstring of odoo.api.Environment.user:4
msgid ":class:`res.users record<~odoo.addons.base.models.res_users.Users>`"
msgstr ""
#: ../../docstring of odoo.api.Environment.company:1
msgid "Return the current company (as an instance)."
msgstr ""
#: ../../docstring of odoo.api.Environment.company:3
msgid "If not specified in the context (`allowed_company_ids`), fallback on current user main company."
msgstr ""
#: ../../docstring of odoo.api.Environment.companies:6
#: ../../docstring of odoo.api.Environment.company:6
msgid "invalid or unauthorized `allowed_company_ids` context key content."
msgstr ""
#: ../../docstring of odoo.api.Environment.company:7
msgid "current company (default=`self.user.company_id`), with the current environment"
msgstr ""
#: ../../docstring of odoo.api.Environment.company:8
msgid ":class:`res.company record<~odoo.addons.base.models.res_company.Company>`"
msgstr ""
#: ../../docstring of odoo.api.Environment.company:12
msgid "No sanity checks applied in sudo mode! When in sudo mode, a user can access any company, even if not in his allowed companies."
msgstr ""
#: ../../docstring of odoo.api.Environment.companies:16
#: ../../docstring of odoo.api.Environment.company:16
msgid "This allows to trigger inter-company modifications, even if the current user doesn't have access to the targeted company."
msgstr ""
#: ../../docstring of odoo.api.Environment.companies:1
msgid "Return a recordset of the enabled companies by the user."
msgstr ""
#: ../../docstring of odoo.api.Environment.companies:3
msgid "If not specified in the context(`allowed_company_ids`), fallback on current user companies."
msgstr ""
#: ../../docstring of odoo.api.Environment.companies:7
msgid "current companies (default=`self.user.company_ids`), with the current environment"
msgstr ""
#: ../../docstring of odoo.api.Environment.companies:8
msgid ":class:`res.company recordset<~odoo.addons.base.models.res_company.Company>`"
msgstr ""
#: ../../docstring of odoo.api.Environment.companies:12
msgid "No sanity checks applied in sudo mode ! When in sudo mode, a user can access any company, even if not in his allowed companies."
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:690
msgid "Useful environment methods"
msgstr ""
#: ../../../odoo/odoo/api.py:docstring of odoo.api.Environment.ref:1
msgid "Return the record corresponding to the given ``xml_id``."
msgstr ""
#: ../../content/developer/reference/upgrade_utils.rst:230
#: ../../content/developer/reference/upgrade_utils.rst:254
#: ../../content/developer/reference/upgrade_utils.rst:274
#: ../../../odoo/odoo/api.py:docstring of odoo.api.Environment.ref:3
msgid "record xml_id, under the format ``<module.id>``"
msgstr ""
#: ../../../odoo/odoo/api.py:docstring of odoo.api.Environment.ref:4
msgid "whether the method should raise if record is not found"
msgstr ""
#: ../../../odoo/odoo/api.py:docstring of odoo.api.Environment.ref:5
msgid "Found record or None"
msgstr ""
#: ../../../odoo/odoo/api.py:docstring of odoo.api.Environment.ref:6
msgid "if record wasn't found and ``raise_if_not_found`` is True"
msgstr ""
#: ../../../odoo/odoo/api.py:docstring of odoo.api.Environment.is_superuser:1
msgid "Return whether the environment is in superuser mode."
msgstr ""
#: ../../../odoo/odoo/api.py:docstring of odoo.api.Environment.is_admin:1
msgid "Return whether the current user has group \"Access Rights\", or is in superuser mode."
msgstr ""
#: ../../../odoo/odoo/api.py:docstring of odoo.api.Environment.is_system:1
msgid "Return whether the current user has group \"Settings\", or is in superuser mode."
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:698
msgid "Altering the environment"
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.with_context:1
msgid "Returns a new version of this recordset attached to an extended context."
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.with_context:4
msgid "The extended context is either the provided ``context`` in which ``overrides`` are merged or the *current* context in which ``overrides`` are merged e.g.::"
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.with_user:1
msgid "Return a new version of this recordset attached to the given user, in non-superuser mode, unless `user` is the superuser (by convention, the superuser is always in superuser mode.)"
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.with_company:1
msgid "Return a new version of this recordset with a modified context, such that::"
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.with_company:6
msgid "main company of the new environment."
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.with_company:11
msgid "When using an unauthorized company for current user, accessing the company(ies) on the environment may trigger an AccessError if not done in a sudoed environment."
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.with_env:1
msgid "Return a new version of this recordset attached to the provided environment."
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.sudo:18
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.with_env:7
msgid "The returned recordset has the same prefetch object as ``self``."
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.sudo:1
msgid "Returns a new version of this recordset with superuser mode enabled or disabled, depending on `flag`. The superuser mode does not change the current user, and simply bypasses access rights checks."
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.sudo:7
msgid "Using ``sudo`` could cause data access to cross the boundaries of record rules, possibly mixing records that are meant to be isolated (e.g. records from different companies in multi-company environments)."
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.sudo:12
msgid "It may lead to un-intuitive results in methods which select one record among many - for example getting the default company, or selecting a Bill of Materials."
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:715
msgid "SQL Execution"
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:717
msgid "The :attr:`~odoo.api.Environment.cr` attribute on environments is the cursor for the current database transaction and allows executing SQL directly, either for queries which are difficult to express using the ORM (e.g. complex joins) or for performance reasons::"
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:725
msgid "Executing raw SQL bypasses the ORM and, by consequent, Odoo security rules. Please make sure your queries are sanitized when using user input and prefer using ORM utilities if you don't really need to use SQL queries."
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:729
msgid "The recommended way to build SQL queries is to use the wrapper object"
msgstr ""
#: ../../../odoo/odoo/tools/sql.py:docstring of odoo.tools.sql.SQL:1
msgid "An object that wraps SQL code with its parameters, like::"
msgstr ""
#: ../../../odoo/odoo/tools/sql.py:docstring of odoo.tools.sql.SQL:6
msgid "The code is given as a ``%``-format string, and supports either positional arguments (with `%s`) or named arguments (with `%(name)s`). Escaped characters (like ``\"%%\"``) are not supported, though. The arguments are meant to be merged into the code using the `%` formatting operator."
msgstr ""
#: ../../../odoo/odoo/tools/sql.py:docstring of odoo.tools.sql.SQL:11
msgid "The SQL wrapper is designed to be composable: the arguments can be either actual parameters, or SQL objects themselves::"
msgstr ""
#: ../../../odoo/odoo/tools/sql.py:docstring of odoo.tools.sql.SQL:20
msgid "The combined SQL code is given by ``sql.code``, while the corresponding combined parameters are given by the list ``sql.params``. This allows to combine any number of SQL terms without having to separately combine their parameters, which can be tedious, bug-prone, and is the main downside of `psycopg2.sql <https://www.psycopg.org/docs/sql.html>`."
msgstr ""
#: ../../../odoo/odoo/tools/sql.py:docstring of odoo.tools.sql.SQL:26
msgid "The second purpose of the wrapper is to discourage SQL injections. Indeed, if ``code`` is a string literal (not a dynamic string), then the SQL object made with ``code`` is guaranteed to be safe, provided the SQL objects within its parameters are themselves safe."
msgstr ""
#: ../../../odoo/odoo/tools/sql.py:docstring of odoo.tools.sql.SQL.join:1
msgid "Join SQL objects or parameters with ``self`` as a separator."
msgstr ""
#: ../../../odoo/odoo/tools/sql.py:docstring of odoo.tools.sql.SQL.identifier:1
msgid "Return an SQL object that represents an identifier."
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:736
msgid "One important thing to know about models is that they don't necessarily perform database updates right away. Indeed, for performance reasons, the framework delays the recomputation of fields after modifying records. And some database updates are delayed, too. Therefore, before querying the database, one has to make sure that it contains the relevant data for the query. This operation is called *flushing* and performs the expected database updates."
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:753
msgid "Before every SQL query, one has to flush the data needed for that query. There are three levels for flushing, each with its own API. One can flush either everything, all the records of a model, or some specific records. Because delaying updates improves performance in general, we recommend to be *specific* when flushing."
msgstr ""
#: ../../../odoo/odoo/api.py:docstring of odoo.api.Environment.flush_all:1
msgid "Flush all pending computations and updates to the database."
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.flush_model:1
msgid "Process the pending computations and database updates on ``self``'s model. When the parameter is given, the method guarantees that at least the given fields are flushed to the database. More fields can be flushed, though."
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.flush_model:6
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.flush_recordset:6
msgid "optional iterable of field names to flush"
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.flush_recordset:1
msgid "Process the pending computations and database updates on the records ``self``. When the parameter is given, the method guarantees that at least the given fields on records ``self`` are flushed to the database. More fields and records can be flushed, though."
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:765
msgid "Because models use the same cursor and the :class:`~odoo.api.Environment` holds various caches, these caches must be invalidated when *altering* the database in raw SQL, or further uses of models may become incoherent. It is necessary to clear caches when using ``CREATE``, ``UPDATE`` or ``DELETE`` in SQL, but not ``SELECT`` (which simply reads the database)."
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:783
msgid "Just like flushing, one can invalidate either the whole cache, the cache of all the records of a model, or the cache of specific records. One can even invalidate specific fields on some records or all records of a model. As the cache improves performance in general, we recommend to be *specific* when invalidating."
msgstr ""
#: ../../../odoo/odoo/api.py:docstring of odoo.api.Environment.invalidate_all:1
msgid "Invalidate the cache of all records."
msgstr ""
#: ../../../odoo/odoo/api.py:docstring of odoo.api.Environment.invalidate_all:3
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.invalidate_model:6
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.invalidate_recordset:6
msgid "whether pending updates should be flushed before invalidation. It is ``True`` by default, which ensures cache consistency. Do not use this parameter unless you know what you are doing."
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.invalidate_model:1
msgid "Invalidate the cache of all records of ``self``'s model, when the cached values no longer correspond to the database values. If the parameter is given, only the given fields are invalidated from cache."
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.invalidate_model:5
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.invalidate_recordset:5
msgid "optional iterable of field names to invalidate"
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.invalidate_recordset:1
msgid "Invalidate the cache of the records in ``self``, when the cached values no longer correspond to the database values. If the parameter is given, only the given fields on ``self`` are invalidated from cache."
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:795
msgid "The methods above keep the caches and the database consistent with each other. However, if computed field dependencies have been modified in the database, one has to inform the models for the computed fields to be recomputed. The only thing the framework needs to know is *what* fields have changed on *which* records."
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:817
msgid "One has to figure out which records have been modified. There are many ways to do this, possibly involving extra SQL queries. In the example above, we take advantage of the ``RETURNING`` clause of PostgreSQL to retrieve the information without an extra query. After making the cache consistent by invalidation, invoke the method ``modified`` on the modified records with the fields that have been updated."
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.modified:1
msgid "Notify that fields will be or have been modified on ``self``. This invalidates the cache where necessary, and prepares the recomputation of dependent stored fields."
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.modified:5
msgid "iterable of field names modified on records ``self``"
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.modified:6
msgid "whether called in the context of record creation"
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.modified:7
msgid "whether called before modifying records ``self``"
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:830
msgid "Common ORM methods"
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:835
msgid "Create/update"
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:837
msgid "api.model_create_multi information"
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.create:1
msgid "Creates new records for the model."
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.create:3
msgid "The new records are initialized using the values from the list of dicts ``vals_list``, and if necessary those from :meth:`~.default_get`."
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.create:6
msgid "values for the model's fields, as a list of dictionaries:: [{'field_name': field_value, ...}, ...] For backward compatibility, ``vals_list`` may be a dictionary. It is treated as a singleton list ``[vals]``, and a single record is returned. see :meth:`~.write` for details"
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.create:7
msgid "values for the model's fields, as a list of dictionaries::"
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.create:11
msgid "For backward compatibility, ``vals_list`` may be a dictionary. It is treated as a singleton list ``[vals]``, and a single record is returned."
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.create:15
msgid "see :meth:`~.write` for details"
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.create:17
msgid "the created records"
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.create:18
msgid "if the current user is not allowed to create records of the specified model"
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.create:19
msgid "if user tries to enter invalid value for a selection field"
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.create:20
msgid "if a field name specified in the create values does not exist."
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.create:21
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.write:6
msgid "if a loop would be created in a hierarchy of objects a result of the operation (such as setting an object as its own parent)"
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.copy:1
msgid "Duplicate record ``self`` updating it with default values"
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.copy:3
msgid "dictionary of field values to override in the original values of the copied record, e.g: ``{'field_name': overridden_value, ...}``"
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.copy:5
msgid "new record"
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.default_get:1
msgid "Return default values for the fields in ``fields_list``. Default values are determined by the context, user defaults, and the model itself."
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.default_get:5
msgid "names of field whose default is requested"
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.default_get:6
msgid "a dictionary mapping field names to their corresponding default values, if they have a default value."
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.default_get:12
msgid "Unrequested defaults won't be considered, there is no need to return a value for fields whose names are not in `fields_list`."
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.name_create:1
msgid "Create a new record by calling :meth:`~.create` with only one value provided: the display name of the new record."
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.name_create:4
msgid "The new record will be initialized with any default values applicable to this model, or provided through the context. The usual behavior of :meth:`~.create` applies."
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.name_create:8
msgid "display name of the record to create"
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.name_create:10
msgid "the (id, display_name) pair value of the created record"
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.write:1
msgid "Updates all records in ``self`` with the provided values."
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.write:3
msgid "fields to update and the value to set on them"
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.write:4
msgid "if user is not allowed to modify the specified records/fields"
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.write:5
msgid "if invalid values are specified for selection fields"
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.write:8
msgid "For numeric fields (:class:`~odoo.fields.Integer`, :class:`~odoo.fields.Float`) the value should be of the corresponding type"
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.write:11
msgid "For :class:`~odoo.fields.Boolean`, the value should be a :class:`python:bool`"
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.write:13
msgid "For :class:`~odoo.fields.Selection`, the value should match the selection values (generally :class:`python:str`, sometimes :class:`python:int`)"
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.write:16
msgid "For :class:`~odoo.fields.Many2one`, the value should be the database identifier of the record to set"
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.write:18
msgid "The expected value of a :class:`~odoo.fields.One2many` or :class:`~odoo.fields.Many2many` relational field is a list of :class:`~odoo.fields.Command` that manipulate the relation the implement. There are a total of 7 commands: :meth:`~odoo.fields.Command.create`, :meth:`~odoo.fields.Command.update`, :meth:`~odoo.fields.Command.delete`, :meth:`~odoo.fields.Command.unlink`, :meth:`~odoo.fields.Command.link`, :meth:`~odoo.fields.Command.clear`, and :meth:`~odoo.fields.Command.set`."
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.write:29
msgid "For :class:`~odoo.fields.Date` and `~odoo.fields.Datetime`, the value should be either a date(time), or a string."
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.write:34
msgid "If a string is provided for Date(time) fields, it must be UTC-only and formatted according to :const:`odoo.tools.misc.DEFAULT_SERVER_DATE_FORMAT` and :const:`odoo.tools.misc.DEFAULT_SERVER_DATETIME_FORMAT`"
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.write:39
msgid "Other non-relational fields use a string for value"
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:850
msgid "Search/Read"
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.browse:1
msgid "Returns a recordset for the ids provided as parameter in the current environment."
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.browse:9
msgid "id(s)"
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.browse:11
msgid "recordset"
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.search:1
msgid "Search for the records that satisfy the given ``domain`` :ref:`search domain <reference/orm/domains>`."
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel._read_group:4
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.read_group:3
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.search:4
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.search_count:4
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.search_fetch:7
msgid ":ref:`A search domain <reference/orm/domains>`. Use an empty list to match all records."
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.search:6
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.search_fetch:10
msgid "number of results to ignore (default: none)"
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.search:7
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.search_fetch:11
msgid "maximum number of records to return (default: all)"
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.search:8
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.search_fetch:12
msgid "sort string"
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.search:9
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.search_fetch:13
msgid "at most ``limit`` records matching the search criteria"
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel._read_group:28
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.fetch:7
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.read:10
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.read_group:35
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.search:10
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.search_fetch:14
msgid "if user is not allowed to access requested information"
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.search:12
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.search_count:8
msgid "This is a high-level method, which should not be overridden. Its actual implementation is done by method :meth:`_search`."
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.search_count:1
msgid "Returns the number of records in the current model matching :ref:`the provided domain <reference/orm/domains>`."
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.search_count:6
msgid "maximum number of record to count (upperbound) (default: all)"
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.search_fetch:1
msgid "Search for the records that satisfy the given ``domain`` :ref:`search domain <reference/orm/domains>`, and fetch the given fields to the cache. This method is like a combination of methods :meth:`search` and :meth:`fetch`, but it performs both tasks with a minimal number of SQL queries."
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.fetch:6
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.search_fetch:9
msgid "a collection of field names to fetch"
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.name_search:1
msgid "Search for records that have a display name matching the given ``name`` pattern when compared with the given ``operator``, while also matching the optional search domain (``args``)."
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.name_search:5
msgid "This is used for example to provide suggestions based on a partial value for a relational field. Should usually behave as the reverse of ``display_name``, but that is not guaranteed."
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.name_search:9
msgid "This method is equivalent to calling :meth:`~.search` with a search domain based on ``display_name`` and mapping id and display_name on the resulting search."
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.name_search:13
msgid "the name pattern to match"
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.name_search:14
msgid "optional search domain (see :meth:`~.search` for syntax), specifying further restrictions"
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.name_search:16
msgid "domain operator for matching ``name``, such as ``'like'`` or ``'='``."
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.name_search:18
msgid "optional max number of records to return"
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.name_search:20
msgid "list of pairs ``(id, display_name)`` for all matching records."
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.fetch:1
msgid "Make sure the given fields are in memory for the records in ``self``, by fetching what is necessary from the database. Non-stored fields are mostly ignored, except for their stored dependencies. This method should be called to optimize code."
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.fetch:9
msgid "This method is implemented thanks to methods :meth:`_search` and :meth:`_fetch_query`, and should not be overridden."
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.read:1
msgid "Read the requested fields for the records in ``self``, and return their values as a list of dicts."
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.read:4
msgid "field names to return (default is all fields)"
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.read:5
msgid "loading mode, currently the only option is to set to ``None`` to avoid loading the `display_name` of m2o fields"
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.read:7
msgid "a list of dictionaries mapping field names to their values, with one dictionary per record"
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.read:11
msgid "if a requested field does not exist"
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.read:13
msgid "This is a high-level method that is not supposed to be overridden. In order to modify how fields are read from database, see methods :meth:`_fetch_query` and :meth:`_read_format`."
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel._read_group:1
msgid "Get fields aggregations specified by ``aggregates`` grouped by the given ``groupby`` fields where record are filtered by the ``domain``."
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel._read_group:6
msgid "list of groupby descriptions by which the records will be grouped. A groupby description is either a field (then it will be grouped by that field) or a string `'field:granularity'`. Right now, the only supported granularities are `'day'`, `'week'`, `'month'`, `'quarter'` or `'year'`, and they only make sense for date/datetime fields."
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel._read_group:11
msgid "list of aggregates specification. Each element is `'field:agg'` (aggregate field with aggregation function `'agg'`). The possible aggregation functions are the ones provided by `PostgreSQL <https://www.postgresql.org/docs/current/static/functions-aggregate.html>`_, `'count_distinct'` with the expected meaning and `'recordset'` to act like `'array_agg'` converted into a recordset."
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel._read_group:17
msgid "A domain where the valid \"fields\" are the aggregates."
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel._read_group:18
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.read_group:17
msgid "optional number of groups to skip"
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel._read_group:19
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.read_group:18
msgid "optional max number of groups to return"
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel._read_group:20
msgid "optional ``order by`` specification, for overriding the natural sort ordering of the groups, see also :meth:`~.search`."
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel._read_group:23
msgid "list of tuple containing in the order the groups values and aggregates values (flatten): `[(groupby_1_value, ... , aggregate_1_value_aggregate, ...), ...]`. If group is related field, the value of it will be a recordset (with a correct prefetch set)."
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.read_group:1
msgid "Get the list of records in list view grouped by the given ``groupby`` fields."
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.read_group:5
msgid "list of fields present in the list view specified on the object. Each element is either 'field' (field name, using the default aggregation), or 'field:agg' (aggregate field with aggregation function 'agg'), or 'name:agg(field)' (aggregate field with 'agg' and return it as 'name'). The possible aggregation functions are the ones provided by `PostgreSQL <https://www.postgresql.org/docs/current/static/functions-aggregate.html>`_ and 'count_distinct', with the expected meaning."
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.read_group:12
msgid "list of groupby descriptions by which the records will be grouped. A groupby description is either a field (then it will be grouped by that field) or a string 'field:granularity'. Right now, the only supported granularities are 'day', 'week', 'month', 'quarter' or 'year', and they only make sense for date/datetime fields."
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.read_group:19
msgid "optional ``order by`` specification, for overriding the natural sort ordering of the groups, see also :py:meth:`~osv.osv.osv.search` (supported only for many2one fields currently)"
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.read_group:23
msgid "if true, the results are only grouped by the first groupby and the remaining groupbys are put in the __context key. If false, all the groupbys are done in one call."
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.read_group:26
msgid "list of dictionaries(one dictionary for each record) containing: * the values of fields grouped by the fields in ``groupby`` argument * __domain: list of tuples specifying the search criteria * __context: dictionary with argument like ``groupby`` * __range: (date/datetime only) dictionary with field_name:granularity as keys mapping to a dictionary with keys: \"from\" (inclusive) and \"to\" (exclusive) mapping to a string representation of the temporal bounds of the group"
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.read_group:26
msgid "list of dictionaries(one dictionary for each record) containing:"
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.read_group:28
msgid "the values of fields grouped by the fields in ``groupby`` argument"
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.read_group:29
msgid "__domain: list of tuples specifying the search criteria"
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.read_group:30
msgid "__context: dictionary with argument like ``groupby``"
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.read_group:32
msgid "__range: (date/datetime only) dictionary with field_name:granularity as keys"
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.read_group:32
msgid "mapping to a dictionary with keys: \"from\" (inclusive) and \"to\" (exclusive) mapping to a string representation of the temporal bounds of the group"
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.fields_get:1
msgid "Return the definition of each field."
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.fields_get:3
msgid "The returned value is a dictionary (indexed by field name) of dictionaries. The _inherits'd fields are included. The string, help, and selection (if present) attributes are translated."
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.fields_get:7
msgid "fields to document, all if empty or not provided"
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.fields_get:8
msgid "attributes to return for each field, all if empty or not provided"
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.fields_get:9
msgid "dictionary mapping field names to a dictionary mapping attributes to values."
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:878
msgid "Search domains"
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:880
msgid "A domain is a list of criteria, each criterion being a triple (either a ``list`` or a ``tuple``) of ``(field_name, operator, value)`` where:"
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:886
msgid "``field_name`` (``str``)"
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:884
msgid "a field name of the current model, or a relationship traversal through a :class:`~odoo.fields.Many2one` using dot-notation e.g. ``'street'`` or ``'partner_id.country'``"
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:940
msgid "``operator`` (``str``)"
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:889
msgid "an operator used to compare the ``field_name`` with the ``value``. Valid operators are:"
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:892
msgid "``=``"
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:893
msgid "equals to"
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:894
msgid "``!=``"
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:895
msgid "not equals to"
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:896
msgid "``>``"
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:897
msgid "greater than"
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:898
msgid "``>=``"
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:899
msgid "greater than or equal to"
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:900
msgid "``<``"
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:901
msgid "less than"
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:902
msgid "``<=``"
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:903
msgid "less than or equal to"
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:905
msgid "``=?``"
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:905
msgid "unset or equals to (returns true if ``value`` is either ``None`` or ``False``, otherwise behaves like ``=``)"
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:909
msgid "``=like``"
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:908
msgid "matches ``field_name`` against the ``value`` pattern. An underscore ``_`` in the pattern stands for (matches) any single character; a percent sign ``%`` matches any string of zero or more characters."
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:912
msgid "``like``"
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:912
msgid "matches ``field_name`` against the ``%value%`` pattern. Similar to ``=like`` but wraps ``value`` with '%' before matching"
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:914
msgid "``not like``"
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:915
msgid "doesn't match against the ``%value%`` pattern"
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:916
msgid "``ilike``"
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:917
msgid "case insensitive ``like``"
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:918
msgid "``not ilike``"
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:919
msgid "case insensitive ``not like``"
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:920
msgid "``=ilike``"
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:921
msgid "case insensitive ``=like``"
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:923
msgid "``in``"
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:923
msgid "is equal to any of the items from ``value``, ``value`` should be a list of items"
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:925
msgid "``not in``"
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:926
msgid "is unequal to all of the items from ``value``"
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:932
msgid "``child_of``"
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:928
msgid "is a child (descendant) of a ``value`` record (value can be either one item or a list of items)."
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:931
#: ../../content/developer/reference/backend/orm.rst:938
msgid "Takes the semantics of the model into account (i.e following the relationship field named by :attr:`~odoo.models.Model._parent_name`)."
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:940
msgid "``parent_of``"
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:935
msgid "is a parent (ascendant) of a ``value`` record (value can be either one item or a list of items)."
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:943
msgid "variable type, must be comparable (through ``operator``) to the named field."
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:946
msgid "Domain criteria can be combined using logical operators in *prefix* form:"
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:949
msgid "``'&'``"
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:949
msgid "logical *AND*, default operation to combine criteria following one another. Arity 2 (uses the next 2 criteria or combinations)."
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:951
msgid "``'|'``"
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:952
msgid "logical *OR*, arity 2."
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:958
msgid "``'!'``"
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:954
msgid "logical *NOT*, arity 1."
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:956
msgid "Mostly to negate combinations of criteria Individual criterion generally have a negative form (e.g. ``=`` -> ``!=``, ``<`` -> ``>=``) which is simpler than negating the positive."
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:962
msgid "To search for partners named *ABC*, from belgium or germany, whose language is not english::"
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:970
msgid "This domain is interpreted as:"
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:979
#: ../../content/developer/tutorials/getting_started/13_inheritance.rst:0
msgid "Unlink"
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.unlink:1
msgid "Deletes the records in ``self``."
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.unlink:3
msgid "if the user is not allowed to delete all the given records"
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.unlink:4
msgid "if the record is default property for other records"
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:986
msgid "Record(set) information"
msgstr ""
#: ../../docstring of odoo.models.Model.ids:1
msgid "Return the list of actual record ids corresponding to ``self``."
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:992
msgid "Returns the environment of the given recordset."
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:994
#: ../../content/developer/reference/upgrade_utils.rst:192
msgid ":class:`~odoo.api.Environment`"
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:996
msgid "Environment documentation"
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.exists:1
msgid "Returns the subset of records in ``self`` that exist. It can be used as a test on records::"
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.exists:7
msgid "By convention, new records are returned as existing."
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.ensure_one:1
msgid "Verify that the current recordset holds a single record."
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.ensure_one:3
msgid "``len(self) != 1``"
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.get_metadata:1
msgid "Return some metadata about the given records."
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.get_metadata:3
msgid "list of ownership dictionaries for each requested record"
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.get_metadata:4
msgid "list of dictionaries with the following keys: * id: object id * create_uid: user who created the record * create_date: date when the record was created * write_uid: last user who changed the record * write_date: date of the last change to the record * xmlid: XML ID to use to refer to this record (if there is one), in format ``module.name`` * xmlids: list of dict with xmlid in format ``module.name``, and noupdate as boolean * noupdate: A boolean telling if the record will be updated or not"
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.get_metadata:4
msgid "list of dictionaries with the following keys:"
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.get_metadata:6
msgid "id: object id"
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.get_metadata:7
msgid "create_uid: user who created the record"
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.get_metadata:8
msgid "create_date: date when the record was created"
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.get_metadata:9
msgid "write_uid: last user who changed the record"
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.get_metadata:10
msgid "write_date: date of the last change to the record"
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.get_metadata:11
msgid "xmlid: XML ID to use to refer to this record (if there is one), in format ``module.name``"
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.get_metadata:12
msgid "xmlids: list of dict with xmlid in format ``module.name``, and noupdate as boolean"
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.get_metadata:13
msgid "noupdate: A boolean telling if the record will be updated or not"
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:1007
#: ../../content/developer/reference/frontend/assets.rst:103
msgid "Operations"
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:1009
msgid "Recordsets are immutable, but sets of the same model can be combined using various set operations, returning new recordsets."
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:1014
msgid "``record in set`` returns whether ``record`` (which must be a 1-element recordset) is present in ``set``. ``record not in set`` is the inverse operation"
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:1017
msgid "``set1 <= set2`` and ``set1 < set2`` return whether ``set1`` is a subset of ``set2`` (resp. strict)"
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:1019
msgid "``set1 >= set2`` and ``set1 > set2`` return whether ``set1`` is a superset of ``set2`` (resp. strict)"
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:1021
msgid "``set1 | set2`` returns the union of the two recordsets, a new recordset containing all records present in either source"
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:1023
msgid "``set1 & set2`` returns the intersection of two recordsets, a new recordset containing only records present in both sources"
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:1025
msgid "``set1 - set2`` returns a new recordset containing only records of ``set1`` which are *not* in ``set2``"
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:1028
msgid "Recordsets are iterable so the usual Python tools are available for transformation (:func:`python:map`, :func:`python:sorted`, :func:`~python:itertools.ifilter`, ...) however these return either a :class:`python:list` or an :term:`python:iterator`, removing the ability to call methods on their result, or to use set operations."
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:1034
msgid "Recordsets therefore provide the following operations returning recordsets themselves (when possible):"
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:1038
#: ../../content/developer/tutorials/getting_started/07_basicviews.rst:0
msgid "Filter"
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.filtered:1
msgid "Return the records in ``self`` satisfying ``func``."
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.filtered:3
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.mapped:5
msgid "a function or a dot-separated sequence of field names"
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.filtered:5
msgid "recordset of records satisfying func, may be empty."
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.filtered_domain:1
msgid "Return the records in ``self`` satisfying the domain and keeping the same order."
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.filtered_domain:3
msgid ":ref:`A search domain <reference/orm/domains>`."
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:1045
#: ../../content/developer/reference/user_interface/view_architectures.rst:3635
msgid "Map"
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.mapped:1
msgid "Apply ``func`` on all records in ``self``, and return the result as a list or a recordset (if ``func`` return recordsets). In the latter case, the order of the returned recordset is arbitrary."
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.mapped:7
msgid "self if func is falsy, result of func applied to all ``self`` records."
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.mapped:15
msgid "The provided function can be a string to get field values:"
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:1051
msgid "Since V13, multi-relational field access is supported and works like a mapped call:"
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:1060
msgid "Sort"
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.sorted:1
msgid "Return the recordset ``self`` ordered by ``key``."
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.sorted:3
msgid "either a function of one argument that returns a comparison key for each record, or a field name, or ``None``, in which case records are ordered according the default model's order"
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.sorted:7
msgid "if ``True``, return the result in reverse order"
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:1065
msgid "Grouping"
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.grouped:1
msgid "Eagerly groups the records of ``self`` by the ``key``, returning a dict from the ``key``'s result to recordsets. All the resulting recordsets are guaranteed to be part of the same prefetch-set."
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.grouped:5
msgid "Provides a convenience method to partition existing recordsets without the overhead of a :meth:`~.read_group`, but performs no aggregation."
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.grouped:8
msgid "unlike :func:`itertools.groupby`, does not care about input ordering, however the tradeoff is that it can not be lazy"
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel.grouped:11
msgid "either a callable from a :class:`Model` to a (hashable) value, or a field name. In the latter case, it is equivalent to ``itemgetter(key)`` (aka the named field's value)"
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:1072
msgid "Inheritance and extension"
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:1074
msgid "Odoo provides three different mechanisms to extend models in a modular way:"
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:1076
msgid "creating a new model from an existing one, adding new information to the copy but leaving the original module as-is"
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:1078
msgid "extending models defined in other modules in-place, replacing the previous version"
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:1080
msgid "delegating some of the model's fields to records it contains"
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:1086
msgid "Classical inheritance"
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:1088
msgid "When using the :attr:`~odoo.models.Model._inherit` and :attr:`~odoo.models.Model._name` attributes together, Odoo creates a new model using the existing one (provided via :attr:`~odoo.models.Model._inherit`) as a base. The new model gets all the fields, methods and meta-information (defaults & al) from its base."
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:1116
msgid "and using them::"
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:1124
msgid "will yield:"
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:1126
msgid "\"This is model 0 record A\" \"This is model 1 record B\""
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:1129
msgid "the second model has inherited from the first model's ``check`` method and its ``name`` field, but overridden the ``call`` method, as when using standard :ref:`Python inheritance <python:tut-inheritance>`."
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:1134
msgid "Extension"
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:1136
msgid "When using :attr:`~odoo.models.Model._inherit` but leaving out :attr:`~odoo.models.Model._name`, the new model replaces the existing one, essentially extending it in-place. This is useful to add new fields or methods to existing models (created in other modules), or to customize or reconfigure them (e.g. to change their default sort order)::"
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:1158
msgid "will yield::"
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:1165
msgid "It will also yield the various :ref:`automatic fields <reference/fields/automatic>` unless they've been disabled"
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:1169
msgid "Delegation"
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:1171
msgid "The third inheritance mechanism provides more flexibility (it can be altered at runtime) but less power: using the :attr:`~odoo.models.Model._inherits` a model *delegates* the lookup of any field not found on the current model to \"children\" models. The delegation is performed via :class:`~odoo.fields.Reference` fields automatically set up on the parent model."
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:1178
msgid "The main difference is in the meaning. When using Delegation, the model **has one** instead of **is one**, turning the relationship in a composition instead of inheritance::"
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:1220
#: ../../content/developer/reference/frontend/qweb.rst:25
#: ../../content/developer/reference/frontend/qweb.rst:35
#: ../../content/developer/reference/frontend/qweb.rst:329
msgid "will result in::"
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:1225
msgid "and it's possible to write directly on the delegated field::"
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:1229
msgid "when using delegation inheritance, methods are *not* inherited, only fields"
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:1234
msgid "`_inherits` is more or less implemented, avoid it if you can;"
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:1235
msgid "chained `_inherits` is essentially not implemented, we cannot guarantee anything on the final behavior."
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:1239
msgid "Fields Incremental Definition"
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:1241
msgid "A field is defined as class attribute on a model class. If the model is extended, one can also extend the field definition by redefining a field with the same name and same type on the subclass. In that case, the attributes of the field are taken from the parent class and overridden by the ones given in subclasses."
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:1247
msgid "For instance, the second class below only adds a tooltip on the field ``state``::"
msgstr ""
#: ../../content/developer/reference/backend/orm.rst:1261
msgid "Error management"
msgstr ""
#: ../../../odoo/odoo/exceptions.py:docstring of odoo.exceptions:1
msgid "The Odoo Exceptions module defines a few core exception types."
msgstr ""
#: ../../../odoo/odoo/exceptions.py:docstring of odoo.exceptions:3
msgid "Those types are understood by the RPC layer. Any other exception type bubbling until the RPC layer will be treated as a 'Server error'."
msgstr ""
#: ../../../odoo/odoo/exceptions.py:docstring of odoo.exceptions:8
msgid "If you consider introducing new exceptions, check out the :mod:`odoo.addons.test_exceptions` module."
msgstr ""
#: ../../../odoo/odoo/exceptions.py:docstring of odoo.exceptions.AccessDenied:1
msgid "Login/password error."
msgstr ""
#: ../../../odoo/odoo/exceptions.py:docstring of odoo.exceptions.AccessDenied:5
msgid "No traceback."
msgstr ""
#: ../../../odoo/odoo/exceptions.py:docstring of odoo.exceptions.AccessDenied:9
msgid "When you try to log with a wrong password."
msgstr ""
#: ../../../odoo/odoo/exceptions.py:docstring of odoo.exceptions.AccessError:1
msgid "Access rights error."
msgstr ""
#: ../../../odoo/odoo/exceptions.py:docstring of odoo.exceptions.AccessError:5
msgid "When you try to read a record that you are not allowed to."
msgstr ""
#: ../../../odoo/odoo/exceptions.py:docstring of odoo.exceptions.CacheMiss:1
msgid "Missing value(s) in cache."
msgstr ""
#: ../../../odoo/odoo/exceptions.py:docstring of odoo.exceptions.CacheMiss:5
msgid "When you try to read a value in a flushed cache."
msgstr ""
#: ../../../odoo/odoo/exceptions.py:docstring of odoo.exceptions.MissingError:1
msgid "Missing record(s)."
msgstr ""
#: ../../../odoo/odoo/exceptions.py:docstring of odoo.exceptions.MissingError:5
msgid "When you try to write on a deleted record."
msgstr ""
#: ../../../odoo/odoo/exceptions.py:docstring of odoo.exceptions.RedirectWarning:1
msgid "Warning with a possibility to redirect the user instead of simply displaying the warning message."
msgstr ""
#: ../../../odoo/odoo/exceptions.py:docstring of odoo.exceptions.RedirectWarning:4
msgid "exception message and frontend modal content"
msgstr ""
#: ../../../odoo/odoo/exceptions.py:docstring of odoo.exceptions.RedirectWarning:5
msgid "id of the action where to perform the redirection"
msgstr ""
#: ../../../odoo/odoo/exceptions.py:docstring of odoo.exceptions.RedirectWarning:6
msgid "text to put on the button that will trigger the redirection."
msgstr ""
#: ../../../odoo/odoo/exceptions.py:docstring of odoo.exceptions.RedirectWarning:8
msgid "parameter passed to action_id. Can be used to limit a view to active_ids for example."
msgstr ""
#: ../../../odoo/odoo/exceptions.py:docstring of odoo.exceptions.UserError:1
msgid "Generic error managed by the client."
msgstr ""
#: ../../../odoo/odoo/exceptions.py:docstring of odoo.exceptions.UserError:3
msgid "Typically when the user tries to do something that has no sense given the current state of a record. Semantically comparable to the generic 400 HTTP status codes."
msgstr ""
#: ../../../odoo/odoo/exceptions.py:docstring of odoo.exceptions.ValidationError:1
msgid "Violation of python constraints."
msgstr ""
#: ../../../odoo/odoo/exceptions.py:docstring of odoo.exceptions.ValidationError:5
msgid "When you try to create a new user with a login which already exist in the db."
msgstr ""
#: ../../content/developer/reference/backend/orm/changelog.rst:5
msgid "Changelog"
msgstr ""
#: ../../content/developer/reference/backend/orm/changelog.rst:8
msgid "Odoo version 17.0"
msgstr ""
#: ../../content/developer/reference/backend/orm/changelog.rst:10
msgid "Introduce an :class:`~odoo.tools.SQL` wrapper object to make SQL composition easier and safer with respect to SQL injections. Methods of the ORM now use it internally. Introduced by `#134677 <https://github.com/odoo/odoo/pull/134677>`_."
msgstr ""
#: ../../content/developer/reference/backend/orm/changelog.rst:15
msgid "Odoo Online version 16.4"
msgstr ""
#: ../../content/developer/reference/backend/orm/changelog.rst:17
msgid "Method :meth:`~odoo.models.Model.name_get` has been deprecated with `#122085 <https://github.com/odoo/odoo/pull/122085>`_. Read field `display_name` instead."
msgstr ""
#: ../../content/developer/reference/backend/orm/changelog.rst:22
msgid "Odoo Online version 16.3"
msgstr ""
#: ../../content/developer/reference/backend/orm/changelog.rst:24
msgid "Method :meth:`~odoo.models.Model._read_group` has a new signature with `#110737 <https://github.com/odoo/odoo/pull/110737>`_"
msgstr ""
#: ../../content/developer/reference/backend/orm/changelog.rst:28
msgid "Odoo Online version 16.2"
msgstr ""
#: ../../content/developer/reference/backend/orm/changelog.rst:30
msgid "Refactor the implementation of searching and reading methods to be able to combine both in a minimal number of SQL queries. We introduce two new methods :meth:`~odoo.models.Model.search_fetch` and :meth:`~odoo.models.Model.fetch` that take advantage of the combination. More details can be found on the pull request `#112126 <https://github.com/odoo/odoo/pull/112126>`_."
msgstr ""
#: ../../content/developer/reference/backend/orm/changelog.rst:37
msgid "Odoo version 16.0"
msgstr ""
#: ../../content/developer/reference/backend/orm/changelog.rst:39
msgid "Translations for translated fields are stored as JSONB values with `#97692 <https://github.com/odoo/odoo/pull/97692>`_ and `#101115 <https://github.com/odoo/odoo/pull/101115>`_. Code translations are no longer stored into the database. They become static and are extracted from the PO files when needed."
msgstr ""
#: ../../content/developer/reference/backend/orm/changelog.rst:44
msgid ":meth:`~odoo.models.Model.search_count` takes the :attr:`limit` argument into account with `#95589 <https://github.com/odoo/odoo/pull/95589>`_. It limits the number of records to count, improving performance when a partial result is acceptable."
msgstr ""
#: ../../content/developer/reference/backend/orm/changelog.rst:48
msgid "Odoo Online version 15.4"
msgstr ""
#: ../../content/developer/reference/backend/orm/changelog.rst:50
msgid "New API for flushing to the database and invalidating the cache with `#87527 <https://github.com/odoo/odoo/pull/87527>`_. New methods have been added to `odoo.models.Model` and `odoo.api.Environment`, and are less confusing about what is actually done in each case. See the section :ref:`SQL Execution <reference/orm/sql>`."
msgstr ""
#: ../../content/developer/reference/backend/orm/changelog.rst:57
msgid "Odoo Online version 15.3"
msgstr ""
#: ../../content/developer/reference/backend/orm/changelog.rst:59
msgid "The argument `args` is renamed to `domain` for :meth:`~odoo.models.Model.search`, :meth:`~odoo.models.Model.search_count` and :meth:`~odoo.models.Model._search`. `#83687 <https://github.com/odoo/odoo/pull/83687>`_"
msgstr ""
#: ../../content/developer/reference/backend/orm/changelog.rst:61
msgid ":meth:`~odoo.models.Model.filtered_domain` conserves the order of the current recordset. `#83687 <https://github.com/odoo/odoo/pull/83687>`_"
msgstr ""
#: ../../content/developer/reference/backend/orm/changelog.rst:62
msgid ":meth:`~odoo.models.Model.browse` does not accept :class:`str` as `ids`. `#83687 <https://github.com/odoo/odoo/pull/83687>`_"
msgstr ""
#: ../../content/developer/reference/backend/orm/changelog.rst:63
msgid "The methods :meth:`~odoo.models.Model.fields_get_keys` and :meth:`~odoo.models.Model.get_xml_id` on :class:`~odoo.models.Model` are deprecated. `#83687 <https://github.com/odoo/odoo/pull/83687>`_"
msgstr ""
#: ../../content/developer/reference/backend/orm/changelog.rst:64
msgid "The method :meth:`~odoo.models.Model._mapped_cache` is removed. `#83687 <https://github.com/odoo/odoo/pull/83687>`_"
msgstr ""
#: ../../content/developer/reference/backend/orm/changelog.rst:65
msgid "Remove the :attr:`limit` attribute of :class:`~odoo.fields.One2many` and :class:`~odoo.fields.Many2many`. `#83687 <https://github.com/odoo/odoo/pull/83687>`_"
msgstr ""
#: ../../content/developer/reference/backend/orm/changelog.rst:68
msgid "Odoo Online version 15.2"
msgstr ""
#: ../../content/developer/reference/backend/orm/changelog.rst:70
msgid "Specific index types on fields: With `#83274 <https://github.com/odoo/odoo/pull/83274>`_ and `#83015 <https://github.com/odoo/odoo/pull/83015>`_, developers can now define what type of indexes can be used on fields by PostgreSQL. See the :ref:`index property <reference/fields>` of `odoo.fields.Field`."
msgstr ""
#: ../../content/developer/reference/backend/orm/changelog.rst:74
msgid "The :attr:`_sequence` attribute of :class:`~odoo.models.Model` is removed. Odoo lets PostgreSQL use the default sequence of the primary key. `#82727 <https://github.com/odoo/odoo/pull/82727>`_"
msgstr ""
#: ../../content/developer/reference/backend/orm/changelog.rst:75
msgid "The method :meth:`~odoo.models.Model._write` does not raise an error for non-existing records. `#82727 <https://github.com/odoo/odoo/pull/82727>`_"
msgstr ""
#: ../../content/developer/reference/backend/orm/changelog.rst:76
msgid "The :attr:`column_format` and :attr:`deprecated` attributes of :class:`~odoo.fields.Field` are removed. `#82727 <https://github.com/odoo/odoo/pull/82727>`_"
msgstr ""
#: ../../content/developer/reference/backend/performance.rst:5
msgid "Performance"
msgstr ""
#: ../../content/developer/reference/backend/performance.rst:10
msgid "Profiling"
msgstr ""
#: ../../content/developer/reference/backend/performance.rst:14
msgid "Profiling is about analysing the execution of a program and measure aggregated data. These data can be the elapsed time for each function, the executed SQL queries..."
msgstr ""
#: ../../content/developer/reference/backend/performance.rst:17
msgid "While profiling does not improve the performance of a program by itself, it can prove very helpful in finding performance issues and identifying which part of the program is responsible for them."
msgstr ""
#: ../../content/developer/reference/backend/performance.rst:20
msgid "Odoo provides an integrated profiling tool that allows recording all executed queries and stack traces during execution. It can be used to profile either a set of requests of a user session, or a specific portion of code. Profiling results can be either inspected with the integrated `speedscope <https://github.com/jlfwong/speedscope>`_ :dfn:`open source app allowing to visualize a flamegraph` view or analyzed with custom tools by first saving them in a JSON file or in the database."
msgstr ""
#: ../../content/developer/reference/backend/performance.rst:29
msgid "Enable the profiler"
msgstr ""
#: ../../content/developer/reference/backend/performance.rst:31
msgid "The profiler can either be enabled from the user interface, which is the easiest way to do so but allows profiling only web requests, or from Python code, which allows profiling any piece of code including tests."
msgstr ""
#: ../../content/developer/reference/backend/performance.rst:37
msgid "Enable from the user interface"
msgstr ""
#: ../../content/developer/reference/backend/performance.rst:39
msgid ":ref:`Enable the developer mode <developer-mode>`."
msgstr ""
#: ../../content/developer/reference/backend/performance.rst:40
msgid "Before starting a profiling session, the profiler must be enabled globally on the database. This can be done in two ways:"
msgstr ""
#: ../../content/developer/reference/backend/performance.rst:43
msgid "Open the :ref:`developer mode tools <developer-mode/mode-tools>`, then toggle the :guilabel:`Enable profiling` button. A wizard suggests a set of expiry times for the profiling. Click on :guilabel:`ENABLE PROFILING` to enable the profiler globally."
msgstr ""
#: ../../content/developer/reference/backend/performance.rst:49
msgid "Go to :guilabel:`Settings --> General Settings --> Performance` and set the desired time to the field :guilabel:`Enable profiling until`."
msgstr ""
#: ../../content/developer/reference/backend/performance.rst:52
msgid "After the profiler is enabled on the database, users can enable it on their session. To do so, toggle the :guilabel:`Enable profiling` button in the :ref:`developer mode tools <developer-mode/mode-tools>` again. By default, the recommended options :guilabel:`Record sql` and :guilabel:`Record traces` are enabled. To learn more about the different options, head over to :ref:`performance/profiling/collectors`."
msgstr ""
#: ../../content/developer/reference/backend/performance.rst:60
msgid "When the profiler is enabled, all the requests made to the server are profiled and saved into an `ir.profile` record. Such records are grouped into the current profiling session which spans from when the profiler was enabled until it is disabled."
msgstr ""
#: ../../content/developer/reference/backend/performance.rst:65
msgid "Odoo Online databases cannot be profiled."
msgstr ""
#: ../../content/developer/reference/backend/performance.rst:67
msgid "Enable from Python code"
msgstr ""
#: ../../content/developer/reference/backend/performance.rst:69
msgid "Starting the profiler manually can be convenient to profile a specific method or a part of the code. This code can be a test, a compute method, the entire loading, etc."
msgstr ""
#: ../../content/developer/reference/backend/performance.rst:72
msgid "To start the profiler from Python code, call it as a context manager. You may specify *what* you want to record through the parameters. A shortcut is available for profiling test classes: :code:`self.profile()`. See :ref:`performance/profiling/collectors` for more information on the `collectors` parameter."
msgstr ""
#: ../../content/developer/reference/backend/performance.rst:100
msgid "The profiler is called outside of the `assertQueryCount` in order to catch queries made when exiting the context manager (e.g., flush)."
msgstr ""
#: ../../../odoo/odoo/tools/profiler.py:docstring of odoo.tools.profiler.Profiler:1
msgid "Context manager to use to start the recording of some execution. Will save sql and async stack trace by default."
msgstr ""
#: ../../../odoo/odoo/tools/profiler.py:docstring of odoo.tools.profiler.Profiler.__init__:1
msgid "database name to use to save results. Will try to define database automatically by default. Use value ``None`` to not save results in a database."
msgstr ""
#: ../../../odoo/odoo/tools/profiler.py:docstring of odoo.tools.profiler.Profiler.__init__:4
msgid "list of string and Collector object Ex: ['sql', PeriodicCollector(interval=0.2)]. Use `None` for default collectors"
msgstr ""
#: ../../../odoo/odoo/tools/profiler.py:docstring of odoo.tools.profiler.Profiler.__init__:5
msgid "session description to use to reproup multiple profile. use make_session(name) for default format."
msgstr ""
#: ../../../odoo/odoo/tools/profiler.py:docstring of odoo.tools.profiler.Profiler.__init__:6
msgid "description of the current profiler Suggestion: (route name/test method/loading module, ...)"
msgstr ""
#: ../../../odoo/odoo/tools/profiler.py:docstring of odoo.tools.profiler.Profiler.__init__:7
msgid "flag to disable gc durring profiling (usefull to avoid gc while profiling, especially during sql execution)"
msgstr ""
#: ../../../odoo/odoo/tools/profiler.py:docstring of odoo.tools.profiler.Profiler.__init__:8
msgid "parameters usable by collectors (like frame interval)"
msgstr ""
#: ../../content/developer/reference/backend/performance.rst:106
msgid "When the profiler is enabled, all executions of a test method are profiled and saved into an `ir.profile` record. Such records are grouped into a single profiling session. This is especially useful when using the :code:`@warmup` and :code:`@users` decorators."
msgstr ""
#: ../../content/developer/reference/backend/performance.rst:111
msgid "It can be complicated to analyze profiling results of a method that is called several times because all the calls are grouped together in the stack trace. Add an **execution context** as a context manager to break down the results into multiple frames."
msgstr ""
#: ../../content/developer/reference/backend/performance.rst:126
msgid "Analyse the results"
msgstr ""
#: ../../content/developer/reference/backend/performance.rst:128
msgid "To browse the profiling results, make sure that the :ref:`profiler is enabled globally on the database <performance/profiling/enable>`, then open the :ref:`developer mode tools <developer-mode/mode-tools>` and click on the button in the top-right corner of the profiling section. A list view of the `ir.profile` records grouped by profiling session opens."
msgstr ""
#: ../../content/developer/reference/backend/performance.rst:136
msgid "Each record has a clickable link that opens the speedscope results in a new tab."
msgstr ""
#: ../../content/developer/reference/backend/performance.rst:141
msgid "Speedscope falls out of the scope of this documentation but there are a lot of tools to try: search, highlight of similar frames, zoom on frame, timeline, left heavy, sandwich view..."
msgstr ""
#: ../../content/developer/reference/backend/performance.rst:144
msgid "Depending on the profiling options that were activated, Odoo generates different view modes that you can access from the top menu."
msgstr ""
#: ../../content/developer/reference/backend/performance.rst:150
msgid "The :guilabel:`Combined` view shows all the SQL queries and traces merged togethers."
msgstr ""
#: ../../content/developer/reference/backend/performance.rst:151
msgid "The :guilabel:`Combined no context` view shows the same result but ignores the saved execution context <performance/profiling/enable>`."
msgstr ""
#: ../../content/developer/reference/backend/performance.rst:153
msgid "The :guilabel:`sql (no gap)` view shows all the SQL queries as if they were executed one after another, without any Python logic. This is useful for optimizing SQL only."
msgstr ""
#: ../../content/developer/reference/backend/performance.rst:155
msgid "The :guilabel:`sql (density)` view shows only all the SQL queries, leaving gap between them. This can be useful to spot if eiter SQL or Python code is the problem, and to identify zones in where many small queries could be batched."
msgstr ""
#: ../../content/developer/reference/backend/performance.rst:158
msgid "The :guilabel:`frames` view shows the results of only the :ref:`periodic collector <performance/profiling/collectors/periodic>`."
msgstr ""
#: ../../content/developer/reference/backend/performance.rst:162
msgid "Even though the profiler has been designed to be as light as possible, it can still impact performance, especially when using the :ref:`Sync collector <performance/profiling/collectors/sync>`. Keep that in mind when analyzing speedscope results."
msgstr ""
#: ../../content/developer/reference/backend/performance.rst:169
msgid "Collectors"
msgstr ""
#: ../../content/developer/reference/backend/performance.rst:171
msgid "Whereas the profiler is about the *when* of profiling, the collectors take care of the *what*."
msgstr ""
#: ../../content/developer/reference/backend/performance.rst:173
msgid "Each collector specializes in collecting profiling data in its own format and manner. They can be individually enabled from the user interface through their dedicated toggle button in the :ref:`developer mode tools <developer-mode/mode-tools>`, or from Python code through their key or class."
msgstr ""
#: ../../content/developer/reference/backend/performance.rst:178
msgid "There are currently four collectors available in Odoo:"
msgstr ""
#: ../../content/developer/reference/backend/performance.rst:183
#: ../../content/developer/reference/frontend/framework_overview.rst:263
#: ../../content/developer/reference/frontend/hooks.rst:21
#: ../../content/developer/reference/frontend/odoo_editor.rst:146
#: ../../content/developer/reference/frontend/odoo_editor.rst:172
#: ../../content/developer/reference/frontend/odoo_editor.rst:216
#: ../../content/developer/reference/frontend/owl_components.rst:233
#: ../../content/developer/reference/frontend/owl_components.rst:321
#: ../../content/developer/reference/frontend/owl_components.rst:356
#: ../../content/developer/reference/frontend/owl_components.rst:719
#: ../../content/developer/reference/frontend/owl_components.rst:838
#: ../../content/developer/reference/frontend/owl_components.rst:887
#: ../../content/developer/reference/frontend/owl_components.rst:1062
#: ../../content/developer/reference/frontend/services.rst:245
#: ../../content/developer/reference/frontend/services.rst:437
#: ../../content/developer/reference/frontend/services.rst:465
#: ../../content/developer/reference/frontend/services.rst:735
#: ../../content/developer/reference/frontend/services.rst:850
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:187
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:188
#: ../../../odoo/addons/account/models/account_account.py:docstring of odoo.addons.account.models.account_account.AccountGroup.name:1
#: ../../../odoo/addons/account/models/account_report.py:docstring of odoo.addons.account.models.account_report.AccountReport.name:1
#: ../../../odoo/addons/account/models/account_report.py:docstring of odoo.addons.account.models.account_report.AccountReportLine.name:1
msgid "Name"
msgstr ""
#: ../../content/developer/reference/backend/performance.rst:184
msgid "Toggle button"
msgstr ""
#: ../../content/developer/reference/backend/performance.rst:185
msgid "Python key"
msgstr ""
#: ../../content/developer/reference/backend/performance.rst:186
msgid "Python class"
msgstr ""
#: ../../content/developer/reference/backend/performance.rst:187
msgid ":ref:`SQL collector <performance/profiling/collectors/sql>`"
msgstr ""
#: ../../content/developer/reference/backend/performance.rst:188
msgid ":guilabel:`Record sql`"
msgstr ""
#: ../../content/developer/reference/backend/performance.rst:189
msgid "`sql`"
msgstr ""
#: ../../content/developer/reference/backend/performance.rst:190
msgid "`SqlCollector`"
msgstr ""
#: ../../content/developer/reference/backend/performance.rst:191
msgid ":ref:`Periodic collector <performance/profiling/collectors/periodic>`"
msgstr ""
#: ../../content/developer/reference/backend/performance.rst:192
msgid ":guilabel:`Record traces`"
msgstr ""
#: ../../content/developer/reference/backend/performance.rst:193
msgid "`traces_async`"
msgstr ""
#: ../../content/developer/reference/backend/performance.rst:194
msgid "`PeriodicCollector`"
msgstr ""
#: ../../content/developer/reference/backend/performance.rst:195
msgid ":ref:`QWeb collector <performance/profiling/collectors/qweb>`"
msgstr ""
#: ../../content/developer/reference/backend/performance.rst:196
msgid ":guilabel:`Record qweb`"
msgstr ""
#: ../../content/developer/reference/backend/performance.rst:197
#: ../../content/developer/reference/frontend/framework_overview.rst:108
msgid "`qweb`"
msgstr ""
#: ../../content/developer/reference/backend/performance.rst:198
msgid "`QwebCollector`"
msgstr ""
#: ../../content/developer/reference/backend/performance.rst:199
msgid ":ref:`Sync collector <performance/profiling/collectors/sync>`"
msgstr ""
#: ../../content/developer/reference/backend/performance.rst:200
msgid "No"
msgstr ""
#: ../../content/developer/reference/backend/performance.rst:201
msgid "`traces_sync`"
msgstr ""
#: ../../content/developer/reference/backend/performance.rst:202
msgid "`SyncCollector`"
msgstr ""
#: ../../content/developer/reference/backend/performance.rst:204
msgid "By default, the profiler enables the SQL and the Periodic collectors. Both when it is enabled from the user interface or Python code."
msgstr ""
#: ../../content/developer/reference/backend/performance.rst:210
msgid "SQL collector"
msgstr ""
#: ../../content/developer/reference/backend/performance.rst:212
msgid "The SQL collector saves all the SQL queries made to the database in the current thread (for all cursors), as well as the stack trace. The overhead of the collector is added to the analysed thread for each query, which means that using it on a lot of small queries may impact execution time and other profilers."
msgstr ""
#: ../../content/developer/reference/backend/performance.rst:217
msgid "It is especially useful to debug query counts, or to add information to the :ref:`Periodic collector <performance/profiling/collectors/periodic>` in the combined speedscope view."
msgstr ""
#: ../../../odoo/odoo/tools/profiler.py:docstring of odoo.tools.profiler.SQLCollector:1
msgid "Saves all executed queries in the current thread with the call stack."
msgstr ""
#: ../../content/developer/reference/backend/performance.rst:225
msgid "Periodic collector"
msgstr ""
#: ../../content/developer/reference/backend/performance.rst:227
msgid "This collector runs in a separate thread and saves the stack trace of the analysed thread at every interval. The interval (by default 10 ms) can be defined through the :guilabel:`Interval` option in the user interface, or the `interval` parameter in Python code."
msgstr ""
#: ../../content/developer/reference/backend/performance.rst:232
msgid "If the interval is set at a very low value, profiling long requests will generate memory issues. If the interval is set at a very high value, information on short function executions will be lost."
msgstr ""
#: ../../content/developer/reference/backend/performance.rst:236
msgid "It is one of the best way to analyse performance as it should have a very low impact on the execution time thanks to its separate thread."
msgstr ""
#: ../../../odoo/odoo/tools/profiler.py:docstring of odoo.tools.profiler.PeriodicCollector:1
msgid "Record execution frames asynchronously at most every `interval` seconds."
msgstr ""
#: ../../../odoo/odoo/tools/profiler.py:docstring of odoo.tools.profiler.PeriodicCollector:3
msgid "time to wait in seconds between two samples."
msgstr ""
#: ../../content/developer/reference/backend/performance.rst:244
msgid "QWeb collector"
msgstr ""
#: ../../content/developer/reference/backend/performance.rst:246
msgid "This collector saves the Python execution time and queries of all directives. As for the :ref:`SQL collector <performance/profiling/collectors/sql>`, the overhead can be important when executing a lot of small directives. The results are different from other collectors in terms of collected data, and can be analysed from the `ir.profile` form view using a custom widget."
msgstr ""
#: ../../content/developer/reference/backend/performance.rst:251
msgid "It is mainly useful for optimizing views."
msgstr ""
#: ../../../odoo/odoo/tools/profiler.py:docstring of odoo.tools.profiler.QwebCollector:1
msgid "Record qweb execution with directive trace."
msgstr ""
#: ../../content/developer/reference/backend/performance.rst:258
msgid "Sync collector"
msgstr ""
#: ../../content/developer/reference/backend/performance.rst:260
msgid "This collector saves the stack for every function's call and return and runs on the same thread, which greatly impacts performance."
msgstr ""
#: ../../content/developer/reference/backend/performance.rst:263
msgid "It can be useful to debug and understand complex flows, and follow their execution in the code. It is however not recommended for performance analysis because the overhead is high."
msgstr ""
#: ../../../odoo/odoo/tools/profiler.py:docstring of odoo.tools.profiler.SyncCollector:1
msgid "Record complete execution synchronously. Note that --limit-memory-hard may need to be increased when launching Odoo."
msgstr ""
#: ../../content/developer/reference/backend/performance.rst:271
msgid "Performance pitfalls"
msgstr ""
#: ../../content/developer/reference/backend/performance.rst:273
msgid "Be careful with randomness. Multiple executions may lead to different results. E.g., a garbage collector being triggered during execution."
msgstr ""
#: ../../content/developer/reference/backend/performance.rst:275
msgid "Be careful with blocking calls. In some cases, external `c_call` may take some time before releasing the GIL, thus leading to unexpected long frames with the :ref:`Periodic collector <performance/profiling/collectors/periodic>`. This should be detected by the profiler and give a warning. It is possible to trigger the profiler manually before such calls if needed."
msgstr ""
#: ../../content/developer/reference/backend/performance.rst:279
msgid "Pay attention to the cache. Profiling before that the `view`/`assets`/... are in cache can lead to different results."
msgstr ""
#: ../../content/developer/reference/backend/performance.rst:281
msgid "Be aware of the profiler's overhead. The :ref:`SQL collector <performance/profiling/collectors/sql>`'s overhead can be important when a lot of small queries are executed. Profiling is practical to spot a problem but you may want to disable the profiler in order to measure the real impact of a code change."
msgstr ""
#: ../../content/developer/reference/backend/performance.rst:285
msgid "Profiling results can be memory intensive. In some cases (e.g., profiling an install or a long request), it is possible that you reach memory limit, especially when rendering the speedscope results, which can lead to an HTTP 500 error. In this case, you may need to start the server with a higher memory limit: `--limit-memory-hard $((8*1024**3))`."
msgstr ""
#: ../../content/developer/reference/backend/performance.rst:293
msgid "Database population"
msgstr ""
#: ../../content/developer/reference/backend/performance.rst:295
msgid "Odoo CLI offers a :ref:`database population <reference/cmdline/populate>` feature through the CLI command :command:`odoo-bin populate`."
msgstr ""
#: ../../content/developer/reference/backend/performance.rst:298
msgid "Instead of the tedious manual, or programmatic, specification of test data, one can use this feature to fill a database on demand with the desired number of test data. This can be used to detect diverse bugs or performance issues in tested flows."
msgstr ""
#: ../../content/developer/reference/backend/performance.rst:304
msgid "To populate a given model, the following methods and attributes can be defined."
msgstr ""
#: ../../docstring of odoo.models.Model._populate_sizes:1
msgid "Return a dict mapping symbolic sizes (``'small'``, ``'medium'``, ``'large'``) to integers, giving the minimal number of records that :meth:`_populate` should create."
msgstr ""
#: ../../docstring of odoo.models.Model._populate_sizes:4
msgid "The default population sizes are:"
msgstr ""
#: ../../docstring of odoo.models.Model._populate_sizes:6
msgid "``small`` : 10"
msgstr ""
#: ../../docstring of odoo.models.Model._populate_sizes:7
msgid "``medium`` : 100"
msgstr ""
#: ../../docstring of odoo.models.Model._populate_sizes:8
msgid "``large`` : 1000"
msgstr ""
#: ../../docstring of odoo.models.Model._populate_dependencies:1
msgid "Return the list of models which have to be populated before the current one."
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel._populate:1
msgid "Create records to populate this model."
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel._populate:3
msgid "symbolic size for the number of records: ``'small'``, ``'medium'`` or ``'large'``"
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel._populate_factories:1
msgid "Generates a factory for the different fields of the model."
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel._populate_factories:3
msgid "``factory`` is a generator of values (dict of field values)."
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel._populate_factories:5
msgid "Factory skeleton::"
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel._populate_factories:12
msgid "See :mod:`odoo.tools.populate` for population tools and applications."
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel._populate_factories:14
msgid "list of pairs(field_name, factory) where `factory` is a generator function."
msgstr ""
#: ../../../odoo/odoo/models.py:docstring of odoo.models.BaseModel._populate_factories:19
msgid "It is the responsibility of the generator to handle the field_name correctly. The generator could generate values for multiple fields together. In this case, the field_name should be more a \"field_group\" (should be begin by a \"_\"), covering the different fields updated by the generator (e.g. \"_address\" for a generator updating multiple address fields)."
msgstr ""
#: ../../content/developer/reference/backend/performance.rst:314
msgid "You have to define at least :meth:`~odoo.models.Model._populate` or :meth:`~odoo.models.Model._populate_factories` on the model to enable database population."
msgstr ""
#: ../../content/developer/reference/backend/performance.rst:360
msgid "Population tools"
msgstr ""
#: ../../content/developer/reference/backend/performance.rst:362
msgid "Multiple population tools are available to easily create the needed data generators."
msgstr ""
#: ../../../odoo/odoo/tools/populate.py:docstring of odoo.tools.populate.cartesian:1
msgid "Return a factory for an iterator of values dicts that combines all ``vals`` for the field with the other field values in input."
msgstr ""
#: ../../../odoo/odoo/tools/populate.py:docstring of odoo.tools.populate.cartesian:4
#: ../../../odoo/odoo/tools/populate.py:docstring of odoo.tools.populate.iterate:5
#: ../../../odoo/odoo/tools/populate.py:docstring of odoo.tools.populate.randomize:4
msgid "list in which a value will be chosen, depending on `weights`"
msgstr ""
#: ../../../odoo/odoo/tools/populate.py:docstring of odoo.tools.populate.cartesian:5
#: ../../../odoo/odoo/tools/populate.py:docstring of odoo.tools.populate.iterate:6
#: ../../../odoo/odoo/tools/populate.py:docstring of odoo.tools.populate.randomize:5
msgid "list of probabilistic weights"
msgstr ""
#: ../../../odoo/odoo/tools/populate.py:docstring of odoo.tools.populate.cartesian:6
#: ../../../odoo/odoo/tools/populate.py:docstring of odoo.tools.populate.compute:6
#: ../../../odoo/odoo/tools/populate.py:docstring of odoo.tools.populate.iterate:7
#: ../../../odoo/odoo/tools/populate.py:docstring of odoo.tools.populate.randomize:6
msgid "optional initialization of the random number generator"
msgstr ""
#: ../../../odoo/odoo/tools/populate.py:docstring of odoo.tools.populate.cartesian:7
#: ../../../odoo/odoo/tools/populate.py:docstring of odoo.tools.populate.iterate:8
#: ../../../odoo/odoo/tools/populate.py:docstring of odoo.tools.populate.randomize:7
msgid "(val, counter, values) --> formatted_value"
msgstr ""
#: ../../../odoo/odoo/tools/populate.py:docstring of odoo.tools.populate.cartesian:8
#: ../../../odoo/odoo/tools/populate.py:docstring of odoo.tools.populate.iterate:9
msgid "if defined, factory used when vals has been consumed."
msgstr ""
#: ../../../odoo/odoo/tools/populate.py:docstring of odoo.tools.populate.cartesian:9
#: ../../../odoo/odoo/tools/populate.py:docstring of odoo.tools.populate.compute:7
#: ../../../odoo/odoo/tools/populate.py:docstring of odoo.tools.populate.constant:4
#: ../../../odoo/odoo/tools/populate.py:docstring of odoo.tools.populate.iterate:10
#: ../../../odoo/odoo/tools/populate.py:docstring of odoo.tools.populate.randint:7
#: ../../../odoo/odoo/tools/populate.py:docstring of odoo.tools.populate.randomize:9
msgid "function of the form (iterator, field_name, model_name) -> values"
msgstr ""
#: ../../../odoo/odoo/tools/populate.py:docstring of odoo.tools.populate.compute:1
msgid "Return a factory for an iterator of values dicts that computes the field value as ``function(values, counter, random)``, where ``values`` is the other field values, ``counter`` is an integer, and ``random`` is a pseudo-random number generator."
msgstr ""
#: ../../../odoo/odoo/tools/populate.py:docstring of odoo.tools.populate.compute:5
msgid "(values, counter, random) --> field_values"
msgstr ""
#: ../../../odoo/odoo/tools/populate.py:docstring of odoo.tools.populate.constant:1
msgid "Return a factory for an iterator of values dicts that sets the field to the given value in each input dict."
msgstr ""
#: ../../../odoo/odoo/tools/populate.py:docstring of odoo.tools.populate.iterate:1
msgid "Return a factory for an iterator of values dicts that picks a value among ``vals`` for each input. Once all ``vals`` have been used once, resume as ``then`` or as a ``randomize`` generator."
msgstr ""
#: ../../../odoo/odoo/tools/populate.py:docstring of odoo.tools.populate.randint:1
msgid "Return a factory for an iterator of values dicts that sets the field to a random integer between a and b included in each input dict."
msgstr ""
#: ../../../odoo/odoo/tools/populate.py:docstring of odoo.tools.populate.randint:4
msgid "minimal random value"
msgstr ""
#: ../../../odoo/odoo/tools/populate.py:docstring of odoo.tools.populate.randint:5
msgid "maximal random value"
msgstr ""
#: ../../../odoo/odoo/tools/populate.py:docstring of odoo.tools.populate.randomize:1
msgid "Return a factory for an iterator of values dicts with pseudo-randomly chosen values (among ``vals``) for a field."
msgstr ""
#: ../../content/developer/reference/backend/performance.rst:370
msgid "Good practices"
msgstr ""
#: ../../content/developer/reference/backend/performance.rst:375
msgid "Batch operations"
msgstr ""
#: ../../content/developer/reference/backend/performance.rst:377
msgid "When working with recordsets, it is almost always better to batch operations."
msgstr ""
#: ../../content/developer/reference/backend/performance.rst:380
msgid "Don't call a method that runs SQL queries while looping over a recordset because it will do so for each record of the set."
msgstr ""
#: ../../content/developer/reference/backend/performance.rst:391
msgid "Instead, replace the `search_count` with a `_read_group` to execute one SQL query for the entire batch of records."
msgstr ""
#: ../../content/developer/reference/backend/performance.rst:405
msgid "This example is not optimal nor correct in all cases. It is only a substitute for a `search_count`. Another solution could be to prefetch and count the inverse `One2many` field."
msgstr ""
#: ../../content/developer/reference/backend/performance.rst:409
msgid "Don't create records one after another."
msgstr ""
#: ../../content/developer/reference/backend/performance.rst:417
msgid "Instead, accumulate the create values and call the `create` method on the batch. Doing so has mostly no impact and helps the framework optimize fields computation."
msgstr ""
#: ../../content/developer/reference/backend/performance.rst:429
msgid "Fail to prefetch the fields of a recordset while browsing a single record inside a loop."
msgstr ""
#: ../../content/developer/reference/backend/performance.rst:438
msgid "Instead, browse the entire recordset first."
msgstr ""
#: ../../content/developer/reference/backend/performance.rst:447
msgid "We can verify that the records are prefetched in batch by reading the field `prefetch_ids` which includes each of the record ids.browsing all records together is unpractical,"
msgstr ""
#: ../../content/developer/reference/backend/performance.rst:450
msgid "If needed, the `with_prefetch` method can be used to disable batch prefetching:"
msgstr ""
#: ../../content/developer/reference/backend/performance.rst:460
msgid "Reduce the algorithmic complexity"
msgstr ""
#: ../../content/developer/reference/backend/performance.rst:462
msgid "Algorithmic complexity is a measure of how long an algorithm would take to complete in regard to the size `n` of the input. When the complexity is high, the execution time can grow quickly as the input becomes larger. In some cases, the algorithmic complexity can be reduced by preparing the input's data correctly."
msgstr ""
#: ../../content/developer/reference/backend/performance.rst:468
msgid "For a given problem, let's consider a naive algorithm crafted with two nested loops for which the complexity in in O(n²)."
msgstr ""
#: ../../content/developer/reference/backend/performance.rst:480
msgid "Assuming that all results have a different id, we can prepare the data to reduce the complexity."
msgstr ""
#: ../../content/developer/reference/backend/performance.rst:490
msgid "Choosing the bad data structure to hold the input can lead to quadratic complexity."
msgstr ""
#: ../../content/developer/reference/backend/performance.rst:500
msgid "If `invalid_ids` is a list-like data structure, the complexity of the algorithm may be quadratic."
msgstr ""
#: ../../content/developer/reference/backend/performance.rst:502
msgid "Instead, prefer using set operations like casting `invalid_ids` to a set."
msgstr ""
#: ../../content/developer/reference/backend/performance.rst:512
msgid "Depending on the input, recordset operations can also be used."
msgstr ""
#: ../../content/developer/reference/backend/performance.rst:524
msgid "Use indexes"
msgstr ""
#: ../../content/developer/reference/backend/performance.rst:526
msgid "Database indexes can help fasten search operations, be it from a search in the or through the user interface."
msgstr ""
#: ../../content/developer/reference/backend/performance.rst:534
msgid "Be careful not to index every field as indexes consume space and impact on performance when executing one of `INSERT`, `UPDATE`, and `DELETE`."
msgstr ""
#: ../../content/developer/reference/backend/reports.rst:10
msgid "QWeb Reports"
msgstr ""
#: ../../content/developer/reference/backend/reports.rst:12
msgid "Reports are written in HTML/QWeb, like website views in Odoo. You can use the usual :ref:`QWeb control flow tools <reference/qweb>`. The PDF rendering itself is performed by wkhtmltopdf_."
msgstr ""
#: ../../content/developer/reference/backend/reports.rst:16
msgid "Reports are declared using a :ref:`report action <reference/actions/report>`, and a :ref:`reference/reports/templates` for the action to use."
msgstr ""
#: ../../content/developer/reference/backend/reports.rst:19
msgid "If useful or necessary, it is possible to specify a :ref:`reference/reports/paper_formats` for the report report."
msgstr ""
#: ../../content/developer/reference/backend/reports.rst:25
msgid "Report template"
msgstr ""
#: ../../content/developer/reference/backend/reports.rst:27
msgid "Report templates will always provide the following variables:"
msgstr ""
#: ../../content/developer/reference/backend/reports.rst:29
#: ../../content/developer/reference/backend/security.rst:122
msgid "``time``"
msgstr ""
#: ../../content/developer/reference/backend/reports.rst:30
msgid "a reference to :mod:`python:time` from the Python standard library"
msgstr ""
#: ../../content/developer/reference/backend/reports.rst:31
#: ../../content/developer/reference/backend/security.rst:124
#: ../../content/developer/tutorials/backend.rst:1312
msgid "``user``"
msgstr ""
#: ../../content/developer/reference/backend/reports.rst:32
msgid "``res.user`` record for the user printing the report"
msgstr ""
#: ../../content/developer/reference/backend/reports.rst:33
msgid "``res_company``"
msgstr ""
#: ../../content/developer/reference/backend/reports.rst:34
msgid "record for the current ``user``'s company"
msgstr ""
#: ../../content/developer/reference/backend/reports.rst:35
#: ../../content/developer/reference/extract_api.rst:452
msgid "``website``"
msgstr ""
#: ../../content/developer/reference/backend/reports.rst:36
msgid "the current website object, if any (this item can be present but ``None``)"
msgstr ""
#: ../../content/developer/reference/backend/reports.rst:37
msgid "``web_base_url``"
msgstr ""
#: ../../content/developer/reference/backend/reports.rst:38
msgid "the base url for the webserver"
msgstr ""
#: ../../content/developer/reference/backend/reports.rst:41
msgid "``context_timestamp``"
msgstr ""
#: ../../content/developer/reference/backend/reports.rst:40
msgid "a function taking :class:`python:datetime.datetime` in UTC\\ [#unzoned]_ and converting it to the timezone of the user printing the report"
msgstr ""
#: ../../content/developer/reference/backend/reports.rst:44
msgid "Minimal viable template"
msgstr ""
#: ../../content/developer/reference/backend/reports.rst:46
msgid "A minimal template would look like::"
msgstr ""
#: ../../content/developer/reference/backend/reports.rst:61
msgid "Calling ``external_layout`` will add the default header and footer on your report. The PDF body will be the content inside the ``<div class=\"page\">``. The template's ``id`` must be the name specified in the report declaration; for example ``account.report_invoice`` for the above report. Since this is a QWeb template, you can access all the fields of the ``docs`` objects received by the template."
msgstr ""
#: ../../content/developer/reference/backend/reports.rst:68
msgid "By default, the rendering context will also expose the following items:"
msgstr ""
#: ../../content/developer/reference/backend/reports.rst:70
#: ../../content/developer/tutorials/backend.rst:1309
msgid "``docs``"
msgstr ""
#: ../../content/developer/reference/backend/reports.rst:71
msgid "records for the current report"
msgstr ""
#: ../../content/developer/reference/backend/reports.rst:72
msgid "``doc_ids``"
msgstr ""
#: ../../content/developer/reference/backend/reports.rst:73
msgid "list of ids for the ``docs`` records"
msgstr ""
#: ../../content/developer/reference/backend/reports.rst:75
msgid "``doc_model``"
msgstr ""
#: ../../content/developer/reference/backend/reports.rst:75
msgid "model for the ``docs`` records"
msgstr ""
#: ../../content/developer/reference/backend/reports.rst:77
msgid "If you wish to access other records/models in the template, you will need :ref:`a custom report <reference/reports/custom_reports>`, however in that case you will have to provide the items above if you need them."
msgstr ""
#: ../../content/developer/reference/backend/reports.rst:82
msgid "Translatable Templates"
msgstr ""
#: ../../content/developer/reference/backend/reports.rst:84
msgid "If you wish to translate reports (to the language of a partner, for example), you need to define two templates:"
msgstr ""
#: ../../content/developer/reference/backend/reports.rst:87
msgid "The main report template"
msgstr ""
#: ../../content/developer/reference/backend/reports.rst:88
msgid "The translatable document"
msgstr ""
#: ../../content/developer/reference/backend/reports.rst:90
msgid "You can then call the translatable document from your main template with the attribute ``t-lang`` set to a language code (for example ``fr`` or ``en_US``) or to a record field. You will also need to re-browse the related records with the proper context if you use fields that are translatable (like country names, sales conditions, etc.)"
msgstr ""
#: ../../content/developer/reference/backend/reports.rst:97
msgid "If your report template does not use translatable record fields, re-browsing the record in another language is *not* necessary and will impact performances."
msgstr ""
#: ../../content/developer/reference/backend/reports.rst:100
msgid "For example, let's look at the Sale Order report from the Sale module::"
msgstr ""
#: ../../content/developer/reference/backend/reports.rst:130
msgid "The main template calls the translatable template with ``doc.partner_id.lang`` as a ``t-lang`` parameter, so it will be rendered in the language of the partner. This way, each Sale Order will be printed in the language of the corresponding customer. If you wish to translate only the body of the document, but keep the header and footer in a default language, you could call the report's external layout this way::"
msgstr ""
#: ../../content/developer/reference/backend/reports.rst:140
msgid "Please take note that this works only when calling external templates, you will not be able to translate part of a document by setting a ``t-lang`` attribute on an xml node other than ``t-call``. If you wish to translate part of a template, you can create an external template with this partial template and call it from the main one with the ``t-lang`` attribute."
msgstr ""
#: ../../content/developer/reference/backend/reports.rst:148
#: ../../content/developer/tutorials/pdf_reports.rst:299
msgid "Barcodes"
msgstr ""
#: ../../content/developer/reference/backend/reports.rst:150
msgid "Barcodes are images returned by a controller and can easily be embedded in reports thanks to the QWeb syntax (e.g. see :ref:`reference/qweb/attributes`):"
msgstr ""
#: ../../content/developer/reference/backend/reports.rst:157
msgid "More parameters can be passed as a query string"
msgstr ""
#: ../../content/developer/reference/backend/reports.rst:166
msgid "Useful Remarks"
msgstr ""
#: ../../content/developer/reference/backend/reports.rst:168
msgid "Twitter Bootstrap and FontAwesome classes can be used in your report template"
msgstr ""
#: ../../content/developer/reference/backend/reports.rst:170
msgid "Local CSS can be put directly in the template"
msgstr ""
#: ../../content/developer/reference/backend/reports.rst:171
msgid "Global CSS can be inserted in the main report layout by inheriting its template and inserting your CSS::"
msgstr ""
#: ../../content/developer/reference/backend/reports.rst:184
msgid "If it appears that your PDF report is missing the styles, please check :ref:`these instructions <reference/backend/reporting/printed-reports/pdf-without-styles>`."
msgstr ""
#: ../../content/developer/reference/backend/reports.rst:190
msgid "Paper Format"
msgstr ""
#: ../../content/developer/reference/backend/reports.rst:192
msgid "Paper formats are records of ``report.paperformat`` and can contain the following attributes:"
msgstr ""
#: ../../content/developer/reference/backend/reports.rst:196
msgid "only useful as a mnemonic/description of the report when looking for one in a list of some sort"
msgstr ""
#: ../../content/developer/reference/backend/reports.rst:198
#: ../../content/developer/reference/extract_api.rst:491
msgid "``description``"
msgstr ""
#: ../../content/developer/reference/backend/reports.rst:199
msgid "a small description of your format"
msgstr ""
#: ../../content/developer/reference/backend/reports.rst:202
#: ../../content/developer/reference/user_interface/view_architectures.rst:3386
msgid "``format``"
msgstr ""
#: ../../content/developer/reference/backend/reports.rst:201
msgid "either a predefined format (A0 to A9, B0 to B10, Legal, Letter, Tabloid,...) or ``custom``; A4 by default. You cannot use a non-custom format if you define the page dimensions."
msgstr ""
#: ../../content/developer/reference/backend/reports.rst:204
msgid "``dpi``"
msgstr ""
#: ../../content/developer/reference/backend/reports.rst:205
msgid "output DPI; 90 by default"
msgstr ""
#: ../../content/developer/reference/backend/reports.rst:206
msgid "``margin_top``, ``margin_bottom``, ``margin_left``, ``margin_right``"
msgstr ""
#: ../../content/developer/reference/backend/reports.rst:207
msgid "margin sizes in mm"
msgstr ""
#: ../../content/developer/reference/backend/reports.rst:208
msgid "``page_height``, ``page_width``"
msgstr ""
#: ../../content/developer/reference/backend/reports.rst:209
msgid "page dimensions in mm"
msgstr ""
#: ../../content/developer/reference/backend/reports.rst:210
msgid "``orientation``"
msgstr ""
#: ../../content/developer/reference/backend/reports.rst:211
msgid "Landscape or Portrait"
msgstr ""
#: ../../content/developer/reference/backend/reports.rst:212
msgid "``header_line``"
msgstr ""
#: ../../content/developer/reference/backend/reports.rst:213
msgid "boolean to display a header line"
msgstr ""
#: ../../content/developer/reference/backend/reports.rst:215
msgid "``header_spacing``"
msgstr ""
#: ../../content/developer/reference/backend/reports.rst:215
msgid "header spacing in mm"
msgstr ""
#: ../../content/developer/reference/backend/reports.rst:217
#: ../../content/developer/reference/backend/reports.rst:285
#: ../../content/developer/reference/backend/reports.rst:295
#: ../../content/developer/reference/frontend/qweb.rst:523
#: ../../content/developer/reference/frontend/qweb.rst:545
#: ../../content/developer/reference/frontend/qweb.rst:582
#: ../../content/developer/reference/frontend/qweb.rst:613
#: ../../content/developer/reference/frontend/qweb.rst:653
msgid "Example::"
msgstr ""
#: ../../content/developer/reference/backend/reports.rst:238
msgid "Custom Reports"
msgstr ""
#: ../../content/developer/reference/backend/reports.rst:240
msgid "By default, the reporting system builds rendering values based on the target model specified through the ``model`` field."
msgstr ""
#: ../../content/developer/reference/backend/reports.rst:243
msgid "However, it will first look for a model named :samp:`report.{module.report_name}` and call that model's ``_get_report_values(doc_ids, data)`` in order to prepare the rendering data for the template."
msgstr ""
#: ../../content/developer/reference/backend/reports.rst:248
msgid "This can be used to include arbitrary items to use or display while rendering the template, such as data from additional models:"
msgstr ""
#: ../../content/developer/reference/backend/reports.rst:270
msgid "When using a custom report, the \"default\" document-related items (``doc_ids``, ``doc_model`` and ``docs``) will *not* be included. If you want them, you will need to include them yourself."
msgstr ""
#: ../../content/developer/reference/backend/reports.rst:274
msgid "In the example above, the rendering context will contain the \"global\" values as well as the ``lines`` we put in there but nothing else."
msgstr ""
#: ../../content/developer/reference/backend/reports.rst:282
msgid "If you want to use custom fonts you will need to add your custom font and the related less/CSS to the ``web.reports_assets_common`` assets bundle. Adding your custom font(s) to ``web.assets_common`` or ``web.assets_backend`` will not make your font available in QWeb reports."
msgstr ""
#: ../../content/developer/reference/backend/reports.rst:293
msgid "You will need to define your ``@font-face`` within this less file, even if you've used in another assets bundle (other than ``web.reports_assets_common``)."
msgstr ""
#: ../../content/developer/reference/backend/reports.rst:308
msgid "After you've added the less into your assets bundle you can use the classes - in this example ``h1-title-big`` - in your custom QWeb report."
msgstr ""
#: ../../content/developer/reference/backend/reports.rst:311
#: ../../content/developer/tutorials/pdf_reports.rst:291
msgid "Reports are web pages"
msgstr ""
#: ../../content/developer/reference/backend/reports.rst:313
msgid "Reports are dynamically generated by the report module and can be accessed directly via URL:"
msgstr ""
#: ../../content/developer/reference/backend/reports.rst:316
msgid "For example, you can access a Sale Order report in html mode by going to \\http://<server-address>/report/html/sale.report_saleorder/38"
msgstr ""
#: ../../content/developer/reference/backend/reports.rst:319
msgid "Or you can access the pdf version at \\http://<server-address>/report/pdf/sale.report_saleorder/38"
msgstr ""
#: ../../content/developer/reference/backend/reports.rst:322
msgid "it does not matter what timezone the :class:`python:datetime` object is actually in (including no timezone), its timezone will unconditionally be *set* to UTC before being adjusted to the user's"
msgstr ""
#: ../../content/developer/reference/backend/security.rst:6
msgid "Security in Odoo"
msgstr ""
#: ../../content/developer/reference/backend/security.rst:8
msgid "Aside from manually managing access using custom code, Odoo provides two main data-driven mechanisms to manage or restrict access to data."
msgstr ""
#: ../../content/developer/reference/backend/security.rst:11
msgid "Both mechanisms are linked to specific users through *groups*: a user belongs to any number of groups, and security mechanisms are associated to groups, thus applying security mechanisms to users."
msgstr ""
#: ../../content/developer/reference/backend/security.rst:19
msgid "serves as user-readable identification for the group (spells out the role / purpose of the group)"
msgstr ""
#: ../../content/developer/reference/backend/security.rst:24
msgid "The *module category*, serves to associate groups with an Odoo App (~a set of related business models) and convert them into an exclusive selection in the user form."
msgstr ""
#: ../../content/developer/reference/backend/security.rst:28
msgid "clarify & document special cases & relationship between groups & categories better"
msgstr ""
#: ../../content/developer/reference/backend/security.rst:33
msgid "Other groups to set on the user alongside this one. This is a convenience pseudo-inheritance relationship: it's possible to explicitly remove implied groups from a user without removing the implier."
msgstr ""
#: ../../content/developer/reference/backend/security.rst:40
msgid "Additional notes on the group e.g."
msgstr ""
#: ../../content/developer/reference/backend/security.rst:45
#: ../../content/developer/tutorials/getting_started/05_securityintro.rst:69
#: ../../content/developer/tutorials/restrict_data_access.rst:132
msgid "Access Rights"
msgstr ""
#: ../../content/developer/reference/backend/security.rst:47
msgid "*Grants* access to an entire model for a given set of operations. If no access rights matches an operation on a model for a user (through their group), the user doesn't have access."
msgstr ""
#: ../../content/developer/reference/backend/security.rst:51
msgid "Access rights are additive, a user's accesses are the union of the accesses they get through all their groups e.g. given a user who is part of group A granting read and create access and a group B granting update access, the user will have all three of create, read, and update."
msgstr ""
#: ../../content/developer/reference/backend/security.rst:60
msgid "The purpose or role of the group."
msgstr ""
#: ../../content/developer/reference/backend/security.rst:64
msgid "The model whose access the ACL controls."
msgstr ""
#: ../../content/developer/reference/backend/security.rst:68
msgid "The :class:`res.groups` to which the accesses are granted, an empty :attr:`group_id` means the ACL is granted to *every user* (non-employees e.g. portal or public users)."
msgstr ""
#: ../../content/developer/reference/backend/security.rst:72
msgid "The :samp:`perm_{method}` attributes grant the corresponding CRUD access when set, they are all unset by default."
msgstr ""
#: ../../content/developer/reference/backend/security.rst:83
#: ../../content/developer/tutorials/restrict_data_access.rst:197
msgid "Record Rules"
msgstr ""
#: ../../content/developer/reference/backend/security.rst:85
msgid "Record rules are *conditions* which must be satisfied in order for an operation to be allowed. Record rules are evaluated record-by-record, following access rights."
msgstr ""
#: ../../content/developer/reference/backend/security.rst:89
msgid "Record rules are default-allow: if access rights grant access and no rule applies to the operation and model for the user, the access is granted."
msgstr ""
#: ../../content/developer/reference/backend/security.rst:96
msgid "The description of the rule."
msgstr ""
#: ../../content/developer/reference/backend/security.rst:100
msgid "The model to which the rule applies."
msgstr ""
#: ../../content/developer/reference/backend/security.rst:104
msgid "The :class:`res.groups` to which access is granted (or not). Multiple groups can be specified. If no group is specified, the rule is *global* which is treated differently than \"group\" rules (see below)."
msgstr ""
#: ../../content/developer/reference/backend/security.rst:110
msgid "Computed on the basis of :attr:`groups`, provides easy access to the global status (or not) of the rule."
msgstr ""
#: ../../content/developer/reference/backend/security.rst:115
msgid "A predicate specified as a :ref:`domain <reference/orm/domains>`, the rule allows the selected operations if the domain matches the record, and forbids it otherwise."
msgstr ""
#: ../../content/developer/reference/backend/security.rst:119
msgid "The domain is a *python expression* which can use the following variables:"
msgstr ""
#: ../../content/developer/reference/backend/security.rst:123
msgid "Python's :mod:`python:time` module."
msgstr ""
#: ../../content/developer/reference/backend/security.rst:125
msgid "The current user, as a singleton recordset."
msgstr ""
#: ../../content/developer/reference/backend/security.rst:127
msgid "``company_id``"
msgstr ""
#: ../../content/developer/reference/backend/security.rst:127
msgid "The current user's currently selected company as a single company id (not a recordset)."
msgstr ""
#: ../../content/developer/reference/backend/security.rst:131
msgid "``company_ids``"
msgstr ""
#: ../../content/developer/reference/backend/security.rst:130
msgid "All the companies to which the current user has access as a list of company ids (not a recordset), see :ref:`howto/company/security` for more details."
msgstr ""
#: ../../content/developer/reference/backend/security.rst:134
msgid "The :samp:`perm_{method}` have completely different semantics than for :class:`ir.model.access`: for rules, they specify which operation the rules applies *for*. If an operation is not selected, then the rule is not checked for it, as if the rule did not exist."
msgstr ""
#: ../../content/developer/reference/backend/security.rst:139
msgid "All operations are selected by default."
msgstr ""
#: ../../content/developer/reference/backend/security.rst:149
msgid "Global rules versus group rules"
msgstr ""
#: ../../content/developer/reference/backend/security.rst:151
msgid "There is a large difference between global and group rules in how they compose and combine:"
msgstr ""
#: ../../content/developer/reference/backend/security.rst:154
msgid "Global rules *intersect*, if two global rules apply then *both* must be satisfied for the access to be granted, this means adding global rules always restricts access further."
msgstr ""
#: ../../content/developer/reference/backend/security.rst:157
msgid "Group rules *unify*, if two group rules apply then *either* can be satisfied for the access to be granted. This means adding group rules can expand access, but not beyond the bounds defined by global rules."
msgstr ""
#: ../../content/developer/reference/backend/security.rst:160
msgid "The global and group rulesets *intersect*, which means the first group rule being added to a given global ruleset will restrict access."
msgstr ""
#: ../../content/developer/reference/backend/security.rst:165
msgid "Creating multiple global rules is risky as it's possible to create non-overlapping rulesets, which will remove all access."
msgstr ""
#: ../../content/developer/reference/backend/security.rst:171
msgid "Field Access"
msgstr ""
#: ../../content/developer/reference/backend/security.rst:173
msgid "An ORM :class:`~odoo.fields.Field` can have a ``groups`` attribute providing a list of groups (as a comma-separated string of :term:`external identifiers`)."
msgstr ""
#: ../../content/developer/reference/backend/security.rst:177
msgid "If the current user is not in one of the listed groups, he will not have access to the field:"
msgstr ""
#: ../../content/developer/reference/backend/security.rst:180
msgid "restricted fields are automatically removed from requested views"
msgstr ""
#: ../../content/developer/reference/backend/security.rst:181
msgid "restricted fields are removed from :meth:`~odoo.models.Model.fields_get` responses"
msgstr ""
#: ../../content/developer/reference/backend/security.rst:183
msgid "attempts to (explicitly) read from or write to restricted fields results in an access error"
msgstr ""
#: ../../content/developer/reference/backend/security.rst:188
msgid "field access groups apply to the Superuser in fields_get but not in read/write..."
msgstr ""
#: ../../content/developer/reference/backend/security.rst:197
msgid "Security Pitfalls"
msgstr ""
#: ../../content/developer/reference/backend/security.rst:199
msgid "As a developer, it is important to understand the security mechanisms and avoid common mistakes leading to insecure code."
msgstr ""
#: ../../content/developer/reference/backend/security.rst:203
msgid "Unsafe Public Methods"
msgstr ""
#: ../../content/developer/reference/backend/security.rst:205
msgid "Any public method can be executed via a :ref:`RPC call <api/external_api/calling_methods>` with the chosen parameters. The methods starting with a ``_`` are not callable from an action button or external API."
msgstr ""
#: ../../content/developer/reference/backend/security.rst:209
msgid "On public methods, the record on which a method is executed and the parameters can not be trusted, ACL being only verified during CRUD operations."
msgstr ""
#: ../../content/developer/reference/backend/security.rst:223
msgid "Making a method private is obviously not enough and care must be taken to use it properly."
msgstr ""
#: ../../content/developer/reference/backend/security.rst:227
msgid "Bypassing the ORM"
msgstr ""
#: ../../content/developer/reference/backend/security.rst:229
msgid "You should never use the database cursor directly when the ORM can do the same thing! By doing so you are bypassing all the ORM features, possibly the automated behaviours like translations, invalidation of fields, ``active``, access rights and so on."
msgstr ""
#: ../../content/developer/reference/backend/security.rst:234
msgid "And chances are that you are also making the code harder to read and probably less secure."
msgstr ""
#: ../../content/developer/reference/backend/security.rst:253
msgid "SQL injections"
msgstr ""
#: ../../content/developer/reference/backend/security.rst:255
msgid "Care must be taken not to introduce SQL injections vulnerabilities when using manual SQL queries. The vulnerability is present when user input is either incorrectly filtered or badly quoted, allowing an attacker to introduce undesirable clauses to a SQL query (such as circumventing filters or executing ``UPDATE`` or ``DELETE`` commands)."
msgstr ""
#: ../../content/developer/reference/backend/security.rst:261
msgid "The best way to be safe is to never, NEVER use Python string concatenation (+) or string parameters interpolation (%) to pass variables to a SQL query string."
msgstr ""
#: ../../content/developer/reference/backend/security.rst:264
msgid "The second reason, which is almost as important, is that it is the job of the database abstraction layer (psycopg2) to decide how to format query parameters, not your job! For example psycopg2 knows that when you pass a list of values it needs to format them as a comma-separated list, enclosed in parentheses !"
msgstr ""
#: ../../content/developer/reference/backend/security.rst:284
msgid "This is very important, so please be careful also when refactoring, and most importantly do not copy these patterns!"
msgstr ""
#: ../../content/developer/reference/backend/security.rst:287
msgid "Here is a memorable example to help you remember what the issue is about (but do not copy the code there). Before continuing, please be sure to read the online documentation of pyscopg2 to learn of to use it properly:"
msgstr ""
#: ../../content/developer/reference/backend/security.rst:291
msgid "`The problem with query parameters <http://initd.org/psycopg/docs/usage.html#the-problem-with-the-query-parameters>`_"
msgstr ""
#: ../../content/developer/reference/backend/security.rst:292
msgid "`How to pass parameters with psycopg2 <http://initd.org/psycopg/docs/usage.html#passing-parameters-to-sql-queries>`_"
msgstr ""
#: ../../content/developer/reference/backend/security.rst:293
msgid "`Advanced parameter types <http://initd.org/psycopg/docs/usage.html#adaptation-of-python-values-to-sql-types>`_"
msgstr ""
#: ../../content/developer/reference/backend/security.rst:294
msgid "`Psycopg documentation <https://www.psycopg.org/docs/sql.html>`_"
msgstr ""
#: ../../content/developer/reference/backend/security.rst:297
msgid "Unescaped field content"
msgstr ""
#: ../../content/developer/reference/backend/security.rst:299
msgid "When rendering content using JavaScript and XML, one may be tempted to use a ``t-raw`` to display rich-text content. This should be avoided as a frequent `XSS <https://en.wikipedia.org/wiki/Cross-site_scripting>`_ vector."
msgstr ""
#: ../../content/developer/reference/backend/security.rst:303
msgid "It is very hard to control the integrity of the data from the computation until the final integration in the browser DOM. A ``t-raw`` that is correctly escaped at the time of introduction may no longer be safe at the next bugfix or refactoring."
msgstr ""
#: ../../content/developer/reference/backend/security.rst:320
msgid "The above code may feel safe as the message content is controlled but is a bad practice that may lead to unexpected security vulnerabilities once this code evolves in the future."
msgstr ""
#: ../../content/developer/reference/backend/security.rst:332
msgid "While formatting the template differently would prevent such vulnerabilities."
msgstr ""
#: ../../content/developer/reference/backend/security.rst:357
msgid "Creating safe content using :class:`~markupsafe.Markup`"
msgstr ""
#: ../../content/developer/reference/backend/security.rst:359
msgid "See the `official documentation <https://markupsafe.palletsprojects.com/>`_ for explanations, but the big advantage of :class:`~markupsafe.Markup` is that it's a very rich type overrinding :class:`str` operations to *automatically escape parameters*."
msgstr ""
#: ../../content/developer/reference/backend/security.rst:364
msgid "This means that it's easy to create *safe* html snippets by using :class:`~markupsafe.Markup` on a string literal and \"formatting in\" user-provided (and thus potentially unsafe) content:"
msgstr ""
#: ../../content/developer/reference/backend/security.rst:375
msgid "though it is a very good thing, note that the effects can be odd at times:"
msgstr ""
#: ../../content/developer/reference/backend/security.rst:388
msgid "Most of the content-safe APIs actually return a :class:`~markupsafe.Markup` with all that implies."
msgstr ""
#: ../../content/developer/reference/backend/security.rst:391
msgid "The :class:`~markupsafe.escape` method (and its alias :class:`~odoo.tools.misc.html_escape`) turns a `str` into a :class:`~markupsafe.Markup` and escapes its content. It will not escape the content of a :class:`~markupsafe.Markup` object."
msgstr ""
#: ../../content/developer/reference/backend/security.rst:410
msgid "When generating HTML code, it is important to separate the structure (tags) from the content (text)."
msgstr ""
#: ../../content/developer/reference/backend/security.rst:437
msgid "When working with translations, it is especially important to separate the HTML from the text. The translation methods accepts a :class:`~markupsafe.Markup` parameters and will escape the translation if it gets receives at least one."
msgstr ""
#: ../../content/developer/reference/backend/security.rst:454
msgid "Escaping vs Sanitizing"
msgstr ""
#: ../../content/developer/reference/backend/security.rst:458
msgid "Escaping is always 100% mandatory when you mix data and code, no matter how safe the data"
msgstr ""
#: ../../content/developer/reference/backend/security.rst:461
msgid "**Escaping** converts *TEXT* to *CODE*. It is absolutely mandatory to do it every time you mix *DATA/TEXT* with *CODE* (e.g. generating HTML or python code to be evaluated inside a `safe_eval`), because *CODE* always requires *TEXT* to be encoded. It is critical for security, but it's also a question of correctness. Even when there is no security risk (because the text is 100% guarantee to be safe or trusted), it is still required (e.g. to avoid breaking the layout in generated HTML)."
msgstr ""
#: ../../content/developer/reference/backend/security.rst:469
msgid "Escaping will never break any feature, as long as the developer identifies which variable contains *TEXT* and which contains *CODE*."
msgstr ""
#: ../../content/developer/reference/backend/security.rst:485
msgid "**Sanitizing** converts *CODE* to *SAFER CODE* (but not necessary *safe* code). It does not work on *TEXT*. Sanitizing is only necessary when *CODE* is untrusted, because it comes in full or in part from some user-provided data. If the user-provided data is in the form of *TEXT* (e.g. the content from a form filled by a user), and if that data was correctly escaped before putting it in *CODE*, then sanitizing is useless (but can still be done). If however, the user-provided data was **not escaped**, then sanitizing will **not** work as expected."
msgstr ""
#: ../../content/developer/reference/backend/security.rst:504
msgid "Sanitizing can break features, depending on whether the *CODE* is expected to contain patterns that are not safe. That's why `fields.Html` and `tools.html_sanitize()` have options to fine-tune the level of sanitization for styles, etc. Those options have to be carefully considered depending on where the data comes from, and the desired features. The sanitization safety is balanced against sanitization breakages: the safer the sanitisation the more likely it is to break things."
msgstr ""
#: ../../content/developer/reference/backend/security.rst:521
msgid "Evaluating content"
msgstr ""
#: ../../content/developer/reference/backend/security.rst:523
msgid "Some may want to ``eval`` to parse user provided content. Using ``eval`` should be avoided at all cost. A safer, sandboxed, method :class:`~odoo.tools.safe_eval` can be used instead but still gives tremendous capabilities to the user running it and must be reserved for trusted privileged users only as it breaks the barrier between code and data."
msgstr ""
#: ../../content/developer/reference/backend/security.rst:545
msgid "Parsing content does not need ``eval``"
msgstr ""
#: ../../content/developer/reference/backend/security.rst:548
msgid "Language"
msgstr ""
#: ../../content/developer/reference/backend/security.rst:548
msgid "Data type"
msgstr ""
#: ../../content/developer/reference/backend/security.rst:548
msgid "Suitable parser"
msgstr ""
#: ../../content/developer/reference/backend/security.rst:550
#: ../../content/developer/reference/backend/security.rst:552
#: ../../content/developer/reference/backend/testing.rst:715
#: ../../content/developer/reference/frontend/qweb.rst:352
#: ../../content/developer/reference/frontend/qweb.rst:414
#: ../../content/developer/tutorials/getting_started/11_constraints.rst:69
msgid "Python"
msgstr ""
#: ../../content/developer/reference/backend/security.rst:550
#: ../../content/developer/reference/backend/security.rst:551
msgid "int, float, etc."
msgstr ""
#: ../../content/developer/reference/backend/security.rst:550
msgid "int(), float()"
msgstr ""
#: ../../content/developer/reference/backend/security.rst:551
#: ../../content/developer/reference/backend/security.rst:553
#: ../../content/developer/reference/backend/testing.rst:582
#: ../../content/developer/reference/frontend/qweb.rst:751
msgid "Javascript"
msgstr ""
#: ../../content/developer/reference/backend/security.rst:551
msgid "parseInt(), parseFloat()"
msgstr ""
#: ../../content/developer/reference/backend/security.rst:552
msgid "dict"
msgstr ""
#: ../../content/developer/reference/backend/security.rst:552
msgid "json.loads(), ast.literal_eval()"
msgstr ""
#: ../../content/developer/reference/backend/security.rst:553
msgid "object, list, etc."
msgstr ""
#: ../../content/developer/reference/backend/security.rst:553
msgid "JSON.parse()"
msgstr ""
#: ../../content/developer/reference/backend/security.rst:557
msgid "Accessing object attributes"
msgstr ""
#: ../../content/developer/reference/backend/security.rst:559
msgid "If the values of a record needs to be retrieved or modified dynamically, one may want to use the ``getattr`` and ``setattr`` methods."
msgstr ""
#: ../../content/developer/reference/backend/security.rst:569
msgid "This code is however not safe as it allows to access any property of the record, including private attributes or methods."
msgstr ""
#: ../../content/developer/reference/backend/security.rst:572
msgid "The ``__getitem__`` of a recordset has been defined and accessing a dynamic field value can be easily achieved safely:"
msgstr ""
#: ../../content/developer/reference/backend/security.rst:582
msgid "The above method is obviously still too optimistic and additional verifications on the record id and field value must be done."
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:5
msgid "Testing Odoo"
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:7
msgid "There are many ways to test an application. In Odoo, we have three kinds of tests"
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:10
msgid "Python unit tests (see `Testing Python code`_): useful for testing model business logic"
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:11
msgid "JS unit tests (see `Testing JS code`_): useful to test the javascript code in isolation"
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:12
msgid "Tours (see `Integration Testing`_): tours simulate a real situation. They ensures that the python and the javascript parts properly talk to each other."
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:18
msgid "Testing Python code"
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:20
msgid "Odoo provides support for testing modules using `Python's unittest library <https://docs.python.org/3/library/unittest.html>`_."
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:23
msgid "To write tests, simply define a ``tests`` sub-package in your module, it will be automatically inspected for test modules. Test modules should have a name starting with ``test_`` and should be imported from ``tests/__init__.py``, e.g."
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:37
msgid "and ``__init__.py`` contains::"
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:43
msgid "test modules which are not imported from ``tests/__init__.py`` will not be run"
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:46
msgid "The test runner will simply run any test case, as described in the official `unittest documentation`_, but Odoo provides a number of utilities and helpers related to testing Odoo content (modules, mainly):"
msgstr ""
#: ../../../odoo/odoo/tests/common.py:docstring of odoo.tests.common.TransactionCase:1
msgid "Test class in which all test methods are run in a single transaction, but each test method is run in a sub-transaction managed by a savepoint. The transaction's cursor is always closed without committing."
msgstr ""
#: ../../../odoo/odoo/tests/common.py:docstring of odoo.tests.common.TransactionCase:5
msgid "The data setup common to all methods should be done in the class method `setUpClass`, so that it is done once for all test methods. This is useful for test cases containing fast tests but with significant database setup common to all cases (complex in-db test data)."
msgstr ""
#: ../../../odoo/odoo/tests/common.py:docstring of odoo.tests.common.TransactionCase:10
msgid "After being run, each test method cleans up the record cache and the registry cache. However, there is no cleanup of the registry models and fields. If a test modifies the registry (custom models and/or fields), it should prepare the necessary cleanup (`self.registry.reset_changes()`)."
msgstr ""
#: ../../../odoo/odoo/tests/common.py:docstring of odoo.tests.common.BaseCase.browse_ref:1
msgid "Returns a record object for the provided :term:`external identifier`"
msgstr ""
#: ../../../odoo/odoo/tests/common.py:docstring of odoo.tests.common.BaseCase.browse_ref:4
#: ../../../odoo/odoo/tests/common.py:docstring of odoo.tests.common.BaseCase.ref:4
msgid "fully-qualified :term:`external identifier`, in the form :samp:`{module}.{identifier}`"
msgstr ""
#: ../../../odoo/odoo/tests/common.py:docstring of odoo.tests.common.BaseCase.browse_ref:0
#: ../../../odoo/odoo/tests/common.py:docstring of odoo.tests.common.BaseCase.ref:0
msgid "raise"
msgstr ""
#: ../../../odoo/odoo/tests/common.py:docstring of odoo.tests.common.BaseCase.browse_ref:6
#: ../../../odoo/odoo/tests/common.py:docstring of odoo.tests.common.BaseCase.ref:6
msgid "ValueError if not found"
msgstr ""
#: ../../../odoo/odoo/tests/common.py:docstring of odoo.tests.common.BaseCase.browse_ref:7
msgid ":class:`~odoo.models.BaseModel`"
msgstr ""
#: ../../../odoo/odoo/tests/common.py:docstring of odoo.tests.common.BaseCase.ref:1
msgid "Returns database ID for the provided :term:`external identifier`, shortcut for ``_xmlid_lookup``"
msgstr ""
#: ../../../odoo/odoo/tests/common.py:docstring of odoo.tests.common.BaseCase.ref:7
msgid "registered id"
msgstr ""
#: ../../../odoo/odoo/tests/common.py:docstring of odoo.tests.common.SingleTransactionCase:1
msgid "TestCase in which all test methods are run in the same transaction, the transaction is started with the first test method and rolled back at the end of the last."
msgstr ""
#: ../../../odoo/odoo/tests/common.py:docstring of odoo.tests.common.HttpCase:1
msgid "Transactional HTTP TestCase with url_open and Chrome headless helpers."
msgstr ""
#: ../../../odoo/odoo/tests/common.py:docstring of odoo.tests.common.HttpCase.browser_js:1
msgid "Test js code running in the browser - optionnally log as 'login' - load page given by url_path - wait for ready object to be available - eval(code) inside the page"
msgstr ""
#: ../../../odoo/odoo/tests/common.py:docstring of odoo.tests.common.HttpCase.browser_js:7
msgid "To signal success test do: console.log('test successful') To signal test failure raise an exception or call console.error with a message. Test will stop when a failure occurs if error_checker is not defined or returns True for this message"
msgstr ""
#: ../../../odoo/odoo/tests/common.py:docstring of odoo.tests.common.tagged:1
msgid "A decorator to tag BaseCase objects."
msgstr ""
#: ../../../odoo/odoo/tests/common.py:docstring of odoo.tests.common.tagged:3
msgid "Tags are stored in a set that can be accessed from a 'test_tags' attribute."
msgstr ""
#: ../../../odoo/odoo/tests/common.py:docstring of odoo.tests.common.tagged:5
msgid "A tag prefixed by '-' will remove the tag e.g. to remove the 'standard' tag."
msgstr ""
#: ../../../odoo/odoo/tests/common.py:docstring of odoo.tests.common.tagged:7
msgid "By default, all Test classes from odoo.tests.common have a test_tags attribute that defaults to 'standard' and 'at_install'."
msgstr ""
#: ../../../odoo/odoo/tests/common.py:docstring of odoo.tests.common.tagged:10
msgid "When using class inheritance, the tags ARE inherited."
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:61
msgid "By default, tests are run once right after the corresponding module has been installed. Test cases can also be configured to run after all modules have been installed, and not run right after the module installation::"
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:74
msgid "The most common situation is to use :class:`~odoo.tests.TransactionCase` and test a property of a model in each method::"
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:90
msgid "Test methods must start with ``test_``"
msgstr ""
#: ../../../odoo/odoo/tests/form.py:docstring of odoo.tests.form.Form:1
msgid "Server-side form view implementation (partial)"
msgstr ""
#: ../../../odoo/odoo/tests/form.py:docstring of odoo.tests.form.Form:3
msgid "Implements much of the \"form view\" manipulation flow, such that server-side tests can more properly reflect the behaviour which would be observed when manipulating the interface:"
msgstr ""
#: ../../../odoo/odoo/tests/form.py:docstring of odoo.tests.form.Form:7
msgid "call the relevant onchanges on \"creation\";"
msgstr ""
#: ../../../odoo/odoo/tests/form.py:docstring of odoo.tests.form.Form:8
msgid "call the relevant onchanges on setting fields;"
msgstr ""
#: ../../../odoo/odoo/tests/form.py:docstring of odoo.tests.form.Form:9
msgid "properly handle defaults & onchanges around x2many fields."
msgstr ""
#: ../../../odoo/odoo/tests/form.py:docstring of odoo.tests.form.Form:11
msgid "Saving the form returns the current record (which means the created record if in creation mode). It can also be accessed as ``form.record``, but only when the form has no pending changes."
msgstr ""
#: ../../../odoo/odoo/tests/form.py:docstring of odoo.tests.form.Form:15
msgid "Regular fields can just be assigned directly to the form. In the case of :class:`~odoo.fields.Many2one` fields, one can assign a recordset::"
msgstr ""
#: ../../../odoo/odoo/tests/form.py:docstring of odoo.tests.form.Form:23
msgid "One can also use the form as a context manager to create or edit a record. The changes are automatically saved at the end of the scope::"
msgstr ""
#: ../../../odoo/odoo/tests/form.py:docstring of odoo.tests.form.Form:38
msgid "For :class:`~odoo.fields.Many2many` fields, the field itself is a :class:`~odoo.tests.common.M2MProxy` and can be altered by adding or removing records::"
msgstr ""
#: ../../../odoo/odoo/tests/form.py:docstring of odoo.tests.form.Form:46
msgid "Finally :class:`~odoo.fields.One2many` are reified as :class:`~O2MProxy`."
msgstr ""
#: ../../../odoo/odoo/tests/form.py:docstring of odoo.tests.form.Form:48
msgid "Because the :class:`~odoo.fields.One2many` only exists through its parent, it is manipulated more directly by creating \"sub-forms\" with the :meth:`~O2MProxy.new` and :meth:`~O2MProxy.edit` methods. These would normally be used as context managers since they get saved in the parent record::"
msgstr ""
#: ../../../odoo/odoo/tests/form.py:docstring of odoo.tests.form.Form:69
msgid "empty or singleton recordset. An empty recordset will put the view in \"creation\" mode from default values, while a singleton will put it in \"edit\" mode and only load the view's data."
msgstr ""
#: ../../../odoo/odoo/tests/form.py:docstring of odoo.tests.form.Form:74
msgid "the id, xmlid or actual view object to use for onchanges and view constraints. If none is provided, simply loads the default view for the model."
msgstr ""
#: ../../../odoo/odoo/tests/form.py:docstring of odoo.tests.Form.record:1
msgid "Return the record being edited by the form. This attribute is readonly and can only be accessed when the form has no pending changes."
msgstr ""
#: ../../../odoo/odoo/tests/form.py:docstring of odoo.tests.form.Form.save:1
msgid "Save the form (if necessary) and return the current record:"
msgstr ""
#: ../../../odoo/odoo/tests/form.py:docstring of odoo.tests.form.Form.save:3
msgid "does not save ``readonly`` fields;"
msgstr ""
#: ../../../odoo/odoo/tests/form.py:docstring of odoo.tests.form.Form.save:4
msgid "does not save unmodified fields (during edition) — any assignment or onchange return marks the field as modified, even if set to its current value."
msgstr ""
#: ../../../odoo/odoo/tests/form.py:docstring of odoo.tests.form.Form.save:8
msgid "When nothing must be saved, it simply returns the current record."
msgstr ""
#: ../../../odoo/odoo/tests/form.py:docstring of odoo.tests.form.Form.save:10
msgid "if the form has any unfilled required field"
msgstr ""
#: ../../../odoo/odoo/tests/form.py:docstring of odoo.tests.form.M2MProxy:1
msgid "Proxy object for editing the value of a many2many field."
msgstr ""
#: ../../../odoo/odoo/tests/form.py:docstring of odoo.tests.form.M2MProxy:3
msgid "Behaves as a :class:`~collection.Sequence` of recordsets, can be indexed or sliced to get actual underlying recordsets."
msgstr ""
#: ../../../odoo/odoo/tests/form.py:docstring of odoo.tests.form.M2MProxy.add:1
msgid "Adds ``record`` to the field, the record must already exist."
msgstr ""
#: ../../../odoo/odoo/tests/form.py:docstring of odoo.tests.form.M2MProxy.add:3
msgid "The addition will only be finalized when the parent record is saved."
msgstr ""
#: ../../../odoo/odoo/tests/form.py:docstring of odoo.tests.form.M2MProxy.clear:1
msgid "Removes all existing records in the m2m"
msgstr ""
#: ../../../odoo/odoo/tests/form.py:docstring of odoo.tests.form.M2MProxy.remove:1
msgid "Removes a record at a certain index or with a provided id from the field."
msgstr ""
#: ../../../odoo/odoo/tests/form.py:docstring of odoo.tests.form.O2MProxy:1
msgid "Proxy object for editing the value of a one2many field."
msgstr ""
#: ../../../odoo/odoo/tests/form.py:docstring of odoo.tests.form.O2MProxy.edit:1
msgid "Returns a :class:`Form` to edit the pre-existing :class:`~odoo.fields.One2many` record."
msgstr ""
#: ../../../odoo/odoo/tests/form.py:docstring of odoo.tests.form.O2MProxy.edit:4
#: ../../../odoo/odoo/tests/form.py:docstring of odoo.tests.form.O2MProxy.new:4
msgid "The form is created from the list view if editable, or the field's form view otherwise."
msgstr ""
#: ../../../odoo/odoo/tests/form.py:docstring of odoo.tests.form.O2MProxy.edit:7
#: ../../../odoo/odoo/tests/form.py:docstring of odoo.tests.form.O2MProxy.new:7
#: ../../../odoo/odoo/tests/form.py:docstring of odoo.tests.form.O2MProxy.remove:3
msgid "if the field is not editable"
msgstr ""
#: ../../../odoo/odoo/tests/form.py:docstring of odoo.tests.form.O2MProxy.new:1
msgid "Returns a :class:`Form` for a new :class:`~odoo.fields.One2many` record, properly initialised."
msgstr ""
#: ../../../odoo/odoo/tests/form.py:docstring of odoo.tests.form.O2MProxy.remove:1
msgid "Removes the record at ``index`` from the parent form."
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:102
msgid "Running tests"
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:104
msgid "Tests are automatically run when installing or updating modules if :option:`--test-enable <odoo-bin --test-enable>` was enabled when starting the Odoo server."
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:113
msgid "Test selection"
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:115
msgid "In Odoo, Python tests can be tagged to facilitate the test selection when running tests."
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:118
msgid "Subclasses of :class:`odoo.tests.BaseCase` (usually through :class:`~odoo.tests.TransactionCase` or :class:`~odoo.tests.HttpCase`) are automatically tagged with ``standard`` and ``at_install`` by default."
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:124
msgid "Invocation"
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:126
msgid ":option:`--test-tags <odoo-bin --test-tags>` can be used to select/filter tests to run on the command-line. It implies :option:`--test-enable <odoo-bin --test-enable>`, so it's not necessary to specify :option:`--test-enable <odoo-bin --test-enable>` when using :option:`--test-tags <odoo-bin --test-tags>`."
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:131
msgid "This option defaults to ``+standard`` meaning tests tagged ``standard`` (explicitly or implicitly) will be run by default when starting Odoo with :option:`--test-enable <odoo-bin --test-enable>`."
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:135
msgid "When writing tests, the :func:`~odoo.tests.tagged` decorator can be used on **test classes** to add or remove tags."
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:138
msgid "The decorator's arguments are tag names, as strings."
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:140
msgid ":func:`~odoo.tests.tagged` is a class decorator, it has no effect on functions or methods"
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:143
msgid "Tags can be prefixed with the minus (``-``) sign, to *remove* them instead of add or select them e.g. if you don't want your test to be executed by default you can remove the ``standard`` tag:"
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:155
msgid "This test will not be selected by default, to run it the relevant tag will have to be selected explicitly:"
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:162
msgid "Note that only the tests tagged ``nice`` are going to be executed. To run *both* ``nice`` and ``standard`` tests, provide multiple values to :option:`--test-tags <odoo-bin --test-tags>`: on the command-line, values are *additive* (you're selecting all tests with *any* of the specified tags)"
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:171
msgid "The config switch parameter also accepts the ``+`` and ``-`` prefixes. The ``+`` prefix is implied and therefore, totally optional. The ``-`` (minus) prefix is made to deselect tests tagged with the prefixed tags, even if they are selected by other specified tags e.g. if there are ``standard`` tests which are also tagged as ``slow`` you can run all standard tests *except* the slow ones:"
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:182
msgid "When you write a test that does not inherit from the :class:`~odoo.tests.BaseCase`, this test will not have the default tags, you have to add them explicitly to have the test included in the default test suite. This is a common issue when using a simple ``unittest.TestCase`` as they're not going to get run:"
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:197
msgid "Besides tags you can also specify specific modules, classes or functions to test. The full syntax of the format accepted by :option:`--test-tags <odoo-bin --test-tags>` is:"
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:205
msgid "So if you want to test the `stock_account` module, you can use:"
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:211
msgid "If you want to test a specific function with a unique name, it can be specified directly:"
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:218
msgid "This is equivalent to"
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:224
msgid "if the name of the test is unambiguous. Multiple modules, classes and functions can be specified at once separated by a `,` like with regular tags."
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:230
msgid "Special tags"
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:232
msgid "``standard``: All Odoo tests that inherit from :class:`~odoo.tests.BaseCase` are implicitly tagged standard. :option:`--test-tags <odoo-bin --test-tags>` also defaults to ``standard``."
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:236
msgid "That means untagged test will be executed by default when tests are enabled."
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:237
msgid "``at_install``: Means that the test will be executed right after the module installation and before other modules are installed. This is a default implicit tag."
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:240
msgid "``post_install``: Means that the test will be executed after all the modules are installed. This is what you want for HttpCase tests most of the time."
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:243
msgid "Note that this is *not exclusive* with ``at_install``, however since you will generally not want both ``post_install`` is usually paired with ``-at_install`` when tagging a test class."
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:248
#: ../../content/developer/reference/frontend/services.rst:479
msgid "Examples"
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:252
msgid "Tests will be executed only in installed modules. If you're starting from a clean database, you'll need to install the modules with the :option:`-i <odoo-bin -i>` switch at least once. After that it's no longer needed, unless you need to upgrade the module, in which case :option:`-u <odoo-bin -u>` can be used. For simplicity, those switches are not specified in the examples below."
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:259
msgid "Run only the tests from the sale module:"
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:265
msgid "Run the tests from the sale module but not the ones tagged as slow:"
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:271
msgid "Run only the tests from stock or tagged as slow:"
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:277
msgid "``-standard`` is implicit (not required), and present for clarity"
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:280
msgid "Testing JS code"
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:282
msgid "Testing a complex system is an important safeguard to prevent regressions and to guarantee that some basic functionality still works. Since Odoo has a non trivial codebase in Javascript, it is necessary to test it. In this section, we will discuss the practice of testing JS code in isolation: these tests stay in the browser, and are not supposed to reach the server."
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:291
msgid "Qunit test suite"
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:293
msgid "The Odoo framework uses the QUnit_ library testing framework as a test runner. QUnit defines the concepts of *tests* and *modules* (a set of related tests), and gives us a web based interface to execute the tests."
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:297
msgid "For example, here is what a pyUtils test could look like:"
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:312
msgid "The main way to run the test suite is to have a running Odoo server, then navigate a web browser to ``/web/tests``. The test suite will then be executed by the web browser Javascript engine."
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:319
msgid "The web UI has many useful features: it can run only some submodules, or filter tests that match a string. It can show every assertions, failed or passed, rerun specific tests, ..."
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:325
msgid "While the test suite is running, make sure that:"
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:327
msgid "your browser window is focused,"
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:328
msgid "it is not zoomed in/out. It needs to have exactly 100% zoom level."
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:330
msgid "If this is not the case, some tests will fail, without a proper explanation."
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:333
msgid "Testing Infrastructure"
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:335
msgid "Here is a high level overview of the most important parts of the testing infrastructure:"
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:338
msgid "there is an asset bundle named `web.qunit_suite`_. This bundle contains the main code (assets common + assets backend), some libraries, the QUnit test runner and the test bundles listed below."
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:342
msgid "a bundle named `web.tests_assets`_ includes most of the assets and utils required by the test suite: custom QUnit asserts, test helpers, lazy loaded assets, etc."
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:345
msgid "another asset bundle, `web.qunit_suite_tests`_, contains all the test scripts. This is typically where the test files are added to the suite."
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:348
msgid "there is a `controller`_ in web, mapped to the route */web/tests*. This controller simply renders the *web.qunit_suite* template."
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:351
msgid "to execute the tests, one can simply point its browser to the route */web/tests*. In that case, the browser will download all assets, and QUnit will take over."
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:354
msgid "there is some code in `qunit_config.js`_ which logs in the console some information when a test passes or fails."
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:357
msgid "we want the runbot to also run these tests, so there is a test (in `test_js.py`_) which simply spawns a browser and points it to the *web/tests* url. Note that the browser_js method spawns a Chrome headless instance."
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:363
msgid "Modularity and testing"
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:365
msgid "With the way Odoo is designed, any addon can modify the behaviour of other parts of the system. For example, the *voip* addon can modify the *FieldPhone* widget to use extra features. This is not really good from the perspective of the testing system, since this means that a test in the addon web will fail whenever the voip addon is installed (note that the runbot runs the tests with all addons installed)."
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:372
msgid "At the same time, our testing system is good, because it can detect whenever another module breaks some core functionality. There is no complete solution to this issue. For now, we solve this on a case by case basis."
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:376
msgid "Usually, it is not a good idea to modify some other behaviour. For our voip example, it is certainly cleaner to add a new *FieldVOIPPhone* widget and modify the few views that needs it. This way, the *FieldPhone* widget is not impacted, and both can be tested."
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:382
msgid "Adding a new test case"
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:384
msgid "Let us assume that we are maintaining an addon *my_addon*, and that we want to add a test for some javascript code (for example, some utility function myFunction, located in *my_addon.utils*). The process to add a new test case is the following:"
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:389
msgid "create a new file *my_addon/static/tests/utils_tests.js*. This file contains the basic code to add a QUnit module *my_addon > utils*."
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:407
msgid "In *my_addon/assets.xml*, add the file to the main test assets:"
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:420
msgid "Restart the server and update *my_addon*, or do it from the interface (to make sure the new test file is loaded)"
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:423
msgid "Add a test case after the definition of the *utils* sub test suite:"
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:434
msgid "Visit */web/tests/* to make sure the test is executed"
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:437
msgid "Helper functions and specialized assertions"
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:439
msgid "Without help, it is quite difficult to test some parts of Odoo. In particular, views are tricky, because they communicate with the server and may perform many rpcs, which needs to be mocked. This is why we developed some specialized helper functions, located in `test_utils.js`_."
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:444
msgid "Mock test functions: these functions help setting up a test environment. The most important use case is mocking the answers given by the Odoo server. These functions use a `mock server`_. This is a javascript class that simulates answers to the most common model methods: read, search_read, nameget, ..."
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:449
msgid "DOM helpers: useful to simulate events/actions on some specific target. For example, testUtils.dom.click performs a click on a target. Note that it is safer than doing it manually, because it also checks that the target exists, and is visible."
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:454
msgid "create helpers: they are probably the most important functions exported by `test_utils.js`_. These helpers are useful to create a widget, with a mock environment, and a lot of small detail to simulate as much as possible the real conditions. The most important is certainly `createView`_."
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:459
msgid "`qunit assertions`_: QUnit can be extended with specialized assertions. For Odoo, we frequently test some DOM properties. This is why we made some assertions to help with that. For example, the *containsOnce* assertion takes a widget/jQuery/HtmlElement and a selector, then checks if the target contains exactly one match for the css selector."
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:465
msgid "For example, with these helpers, here is what a simple form test could look like:"
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:489
msgid "Notice the use of the testUtils.createView helper and of the containsOnce assertion. Also, the form controller was properly destroyed at the end of the test."
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:494
msgid "Best Practices"
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:496
msgid "In no particular order:"
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:498
msgid "all test files should be added in *some_addon/static/tests/*"
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:499
msgid "for bug fixes, make sure that the test fails without the bug fix, and passes with it. This ensures that it actually works."
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:501
msgid "try to have the minimal amount of code necessary for the test to work."
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:502
msgid "usually, two small tests are better than one large test. A smaller test is easier to understand and to fix."
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:504
msgid "always cleanup after a test. For example, if your test instantiates a widget, it should destroy it at the end."
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:506
msgid "no need to have full and complete code coverage. But adding a few tests helps a lot: it makes sure that your code is not completely broken, and whenever a bug is fixed, it is really much easier to add a test to an existing test suite."
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:509
msgid "if you want to check some negative assertion (for example, that a HtmlElement does not have a specific css class), then try to add the positive assertion in the same test (for example, by doing an action that changes the state). This will help avoid the test to become dead in the future (for example, if the css class is changed)."
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:516
msgid "Tips"
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:518
msgid "running only one test: you can (temporarily!) change the *QUnit.test(...)* definition into *QUnit.only(...)*. This is useful to make sure that QUnit only runs this specific test."
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:521
msgid "debug flag: most create utility functions have a debug mode (activated by the debug: true parameter). In that case, the target widget will be put in the DOM instead of the hidden qunit specific fixture, and more information will be logged. For example, all mocked network communications will be available in the console."
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:526
msgid "when working on a failing test, it is common to add the debug flag, then comment the end of the test (in particular, the destroy call). With this, it is possible to see the state of the widget directly, and even better, to manipulate the widget by clicking/interacting with it."
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:534
#: ../../content/developer/reference/extract_api.rst:523
msgid "Integration Testing"
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:536
msgid "Testing Python code and JS code separately is very useful, but it does not prove that the web client and the server work together. In order to do that, we can write another kind of test: tours. A tour is a mini scenario of some interesting business flow. It explains a sequence of steps that should be followed. The test runner will then create a PhantomJs browser, point it to the proper url and simulate the click and inputs, according to the scenario."
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:543
msgid "Writing a test tour"
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:548
msgid "To write a test tour for `your_module`, start with creating the required files:"
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:563
msgid "You can then:"
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:565
msgid "update :file:`__manifest__.py` to add :file:`your_tour.js` in the assets."
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:575
msgid "update :file:`__init__.py` in the folder :file:`tests` to import :file:`test_calling_the_tour`."
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:578
msgid ":ref:`Assets Bundle <reference/assets_bundle>`"
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:579
msgid ":ref:`testing/python`"
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:584
msgid "Setup your tour by registering it."
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:597
msgid "Add any step you want."
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:599
msgid "Every step contains at least a trigger. You can either use the `predefined steps <https://github.com/odoo/odoo/blob/17.0/addons/web_tour/static/src/tour_service/tour_utils.js#L426>`_ or write your own personalized step."
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:603
msgid "Here are some example of steps:"
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:638
msgid "Here are some possible arguments for your personalized steps:"
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:640
msgid "**trigger**: Selector/element to ``run`` an action on. The tour will wait until the element exists and is visible before ``run``-ing the action *on it*."
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:643
msgid "**extra_trigger**: Optional secondary condition for the step to ``run``. Will be waited for like the **trigger** element but the action will not run on the extra trigger."
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:647
msgid "Useful to have a precondition, or two different and unrelated conditions."
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:649
msgid "**run**: Action to perform on the *trigger* element."
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:651
msgid "By default, tries to set the **trigger**'s content to ``Text`` if it's an ``input``, otherwise ``click`` it."
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:654
msgid "The action can also be:"
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:656
msgid "A function, synchronous, executed with the trigger's ``Tip`` as context (``this``) and the action helpers as parameter."
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:658
msgid "The name of one of the action helpers, which will be run on the trigger element:"
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:664
msgid "``click``"
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:664
msgid "Clicks the element, performing all the relevant intermediate events."
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:668
msgid ":samp:`text {content}`"
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:667
msgid "Clicks (focuses) the element then sets ``content`` as the element's value (if an input), option (if a select), or content."
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:670
msgid "``dblclick``, ``tripleclick``"
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:671
msgid "Same as ``click`` with multiple repetitions."
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:675
msgid "``clicknoleave``"
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:673
msgid "By default, ``click`` (and variants) will trigger \"exit\" events on the trigger element (mouseout, mouseleave). This helper suppresses those (note: further clicks on other elements will not trigger those events implicitly)."
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:678
msgid "``text_blur``"
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:678
msgid "Similar to ``text`` but follows the edition with ``focusout`` and ``blur`` events."
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:681
msgid ":samp:`drag_and_drop {target}`"
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:681
msgid "Simulates the dragging of the **trigger** element over to the ``target``."
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:683
msgid "**edition**: Optional,"
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:685
msgid "If you don't specify an edition, the step will be active in both community and enterprise."
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:686
msgid "Sometimes, a step will be different in enterprise or in community. You can then write two steps, one for the enterprise edition and one for the community one."
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:688
msgid "Generally, you want to specify an edition for steps that use the main menu as the main menus are different in community and enterprise."
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:690
msgid "**position**: Optional, ``\"top\"``, ``\"right\"``, ``\"bottom\"``, or ``\"left\"``. Where to position the tooltip relative to the **target** when running interactive tours."
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:693
msgid "**content**: Optional but recommended, the content of the tooltip in interactive tours, also logged to the console so very useful to trace and debug automated tours."
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:696
msgid "**auto**: Whether the tour manager should wait for the user to perform the action if the tour is interactive, defaults to ``false``."
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:699
msgid "**in_modal**: If set the **trigger** element will be searched only in the top modal window, defaults to ``false``."
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:701
msgid "**timeout**: How long to wait until the step can ``run``, in milliseconds, 10000 (10 seconds)."
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:706
msgid "The last step(s) of a tour should always return the client to a \"stable\" state (e.g. no ongoing editions) and ensure all side-effects (network requests) have finished running to avoid race conditions or errors during teardown."
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:712
msgid "`jQuery documentation about find <https://api.jquery.com/find/>`_"
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:717
msgid "To start a tour from a python test, make the class inherit from :class:`~odoo.tests.HTTPCase`, and call `start_tour`:"
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:728
msgid "Debugging tips"
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:731
msgid "Observing tours in a browser"
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:733
msgid "There are two ways with different tradeoffs:"
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:736
msgid "``watch=True``"
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:738
msgid "When running a tour locally via the test suite, the ``watch=True`` parameter can be added to the ``browser_js`` or ``start_tour`` call::"
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:744
msgid "This will automatically open a Chrome window with the tour being run inside it."
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:749
#: ../../content/developer/reference/backend/testing.rst:774
#: ../../content/developer/reference/backend/testing.rst:830
#: ../../content/developer/reference/backend/testing.rst:848
msgid "**Advantages**"
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:748
msgid "always works if the tour has Python setup / surrounding code, or multiple steps"
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:749
msgid "runs entirely automatically (just select the test which launches the tour)"
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:750
msgid "transactional (*should* always be runnable multiple times)"
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:753
#: ../../content/developer/reference/backend/testing.rst:778
#: ../../content/developer/reference/backend/testing.rst:833
#: ../../content/developer/reference/backend/testing.rst:851
msgid "**Drawbacks**"
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:752
msgid "only works locally"
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:753
msgid "only works if the test / tour can run correctly locally"
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:756
msgid "Run via browser"
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:758
msgid "Tours can also be launched via the browser UI, either by calling"
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:764
msgid "in the javascript console, or by enabling :ref:`tests mode <frontend/framework/tests_debug_mode>` by setting ``?debug=tests`` in the URL, then selecting **Start Tour** in the debug menu and picking a tour:"
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:773
msgid "easier to run"
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:774
msgid "can be used on production or test sites, not just local instances"
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:775
msgid "allows running in \"Onboarding\" mode (manual steps)"
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:777
msgid "harder to use with test tours involving Python setup"
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:778
msgid "may not work multiple times depending on tour side-effects"
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:782
msgid "It's possible to use this method to observe or interact with tours which require Python setup:"
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:785
msgid "add a *python* breakpoint before the relevant tour is started (``start_tour`` or ``browser_js`` call)"
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:787
msgid "when the breakpoint is hit, open the instance in your browser"
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:788
msgid "run the tour"
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:790
msgid "At this point the Python setup will be visible to the browser, and the tour will be able to run."
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:793
msgid "You may want to comment the ``start_tour`` or ``browser_js`` call if you also want the test to continue afterwards, depending on the tour's side-effects."
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:798
msgid "Screenshots and screencasts during browser_js tests"
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:800
msgid "When running tests that use ``HttpCase.browser_js`` from the command line, the Chrome browser is used in headless mode. By default, if a test fails, a PNG screenshot is taken at the moment of the failure and written in"
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:808
msgid "Two new command line arguments were added since Odoo 13.0 to control this behavior: :option:`--screenshots <odoo-bin --screenshots>` and :option:`--screencasts <odoo-bin --screencasts>`"
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:812
msgid "Introspecting / debugging steps"
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:814
msgid "When trying to fix / debug a tour, the screenshots (on failure) are not necessarily sufficient. In that case it can be useful to see what's happening at some or each step."
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:818
msgid "While this is pretty easy when in an \"onboarding\" (as they're mostly driven explicitly by the user) it's more complicated when running \"test\" tours, or when running tours through the test suite. In that case there are two main tricks:"
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:823
msgid "Have a step with a ``run() { debugger; }`` action."
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:825
msgid "This can be added to an existing step, or can be a new dedicated step. Once the step's **trigger** is matched, the execution will stop all javascript execution."
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:830
msgid "very simple"
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:831
msgid "the tour restarts as soon as you resume execution"
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:833
msgid "page interaction is limited as all javascript is blocked"
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:834
msgid "debugging the inside of the tour manager is not very useful"
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:835
msgid "Add a step with a trigger which never succeeds and a very long ``timeout``."
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:838
msgid "The browser will wait for the **trigger** until the ``timeout`` before it fails the tour, this allows inspecting and interacting with the page until the developer is ready to resume, by manually enabling the **trigger** (a nonsense class is useful there, as it can be triggered by adding the class to any visible element of the page)."
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:846
msgid "allows interacting with the page"
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:847
msgid "easy to apply to a step which times out (just add a long ``timeout`` then look around)"
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:849
msgid "no useless (for this situation) debugger UI"
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:851
msgid "more manual, especially when resuming"
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:854
msgid "Performance Testing"
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:857
msgid "Query counts"
msgstr ""
#: ../../content/developer/reference/backend/testing.rst:859
msgid "One of the ways to test performance is to measure database queries. Manually, this can be tested with the `--log-sql` CLI parameter. If you want to establish the maximum number of queries for an operation, you can use the :meth:`~odoo.tests.BaseCase.assertQueryCount` method, integrated in Odoo test classes."
msgstr ""
#: ../../content/developer/reference/cli.rst:5
msgid "Command-line interface (CLI)"
msgstr ""
#: ../../content/developer/reference/cli.rst:7
msgid "The CLI :dfn:`command-line interface` offers several functionalities related to Odoo. You can use it to :ref:`run the server <reference/cmdline/server>`, :ref:`launch Odoo as a Python console environment <reference/cmdline/shell>`, :ref:`scaffold an Odoo module <reference/cmdline/scaffold>`, :ref:`populate a database <reference/cmdline/populate>`, or :ref:`count the number of lines of code <reference/cmdline/cloc>`."
msgstr ""
#: ../../content/developer/reference/cli.rst:14
msgid "The command to use to call the CLI depends on how you installed Odoo. In the examples below, we assume that you are :doc:`running Odoo from source <../../administration/install/source>` with the :file:`odoo-bin` file. If you installed Odoo :doc:`from a distribution package <../../administration/install/packages>` or with `Docker <https://hub.docker.com/_/odoo/>`_, you must adapt the command."
msgstr ""
#: ../../content/developer/reference/cli.rst:22
msgid "Run Odoo from source"
msgstr ""
#: ../../content/developer/reference/cli.rst:24
msgid "Navigate to the root of the directory where you downloaded the source files of Odoo Community."
msgstr ""
#: ../../content/developer/reference/cli.rst:26
msgid "Run all CLI commands with :command:`./odoo-bin`"
msgstr ""
#: ../../content/developer/reference/cli.rst:28
msgid "Odoo was installed from a distribution package"
msgstr ""
#: ../../content/developer/reference/cli.rst:30
msgid "When Odoo was installed, an executable named `odoo` was added to your user's PATH. Replace all occurrences of :command:`odoo-bin` with :command:`odoo` in the examples below."
msgstr ""
#: ../../content/developer/reference/cli.rst:33
msgid "Odoo was installed with Docker"
msgstr ""
#: ../../content/developer/reference/cli.rst:35
msgid "Please refer to the `documentation of the official Docker image of Odoo <https://hub.docker.com/_/odoo/>`_."
msgstr ""
#: ../../content/developer/reference/cli.rst:41
msgid "Help & version"
msgstr ""
#: ../../content/developer/reference/cli.rst:47
msgid "shows help text with all available options"
msgstr ""
#: ../../content/developer/reference/cli.rst:51
msgid "shows Odoo version e.g. \"Odoo Server 17.0\""
msgstr ""
#: ../../content/developer/reference/cli.rst:53
msgid "You can enable auto-completion in your shell by running"
msgstr ""
#: ../../content/developer/reference/cli.rst:64
msgid "Running the server"
msgstr ""
#: ../../content/developer/reference/cli.rst:70
msgid "database(s) used when installing or updating modules. Providing a comma-separated list restrict access to databases provided in list."
msgstr ""
#: ../../content/developer/reference/cli.rst:74
msgid "For advanced database options, take a look :ref:`below <reference/cmdline/server/database>`."
msgstr ""
#: ../../content/developer/reference/cli.rst:78
msgid "comma-separated list of modules to install before running the server (requires :option:`-d`)."
msgstr ""
#: ../../content/developer/reference/cli.rst:83
msgid "comma-separated list of modules to update before running the server. Use ``all`` for all modules. (requires :option:`-d`)."
msgstr ""
#: ../../content/developer/reference/cli.rst:88
msgid "comma-separated list of directories in which modules are stored. These directories are scanned for modules."
msgstr ""
#: ../../content/developer/reference/cli.rst:95
msgid "specify an additional upgrade path."
msgstr ""
#: ../../content/developer/reference/cli.rst:99
msgid "list of server-wide modules to load. Those modules are supposed to provide features not necessarily tied to a particular database. This is in contrast to modules that are always bound to a specific database when they are installed (i.e. the majority of Odoo addons). Default is ``base,web``."
msgstr ""
#: ../../content/developer/reference/cli.rst:106
msgid "path to an alternate :ref:`configuration file <reference/cmdline/config>`. If not defined, Odoo checks ``ODOO_RC`` environmental variable and default location :file:`{$HOME}/.odoorc`. See configuration file section :ref:`below <reference/cmdline/config>`."
msgstr ""
#: ../../content/developer/reference/cli.rst:113
msgid "directory path where to store Odoo data (eg. filestore, sessions). If not specified, Odoo will fallback to a predefined path. On Unix systems its one defined in ``$XDG_DATA_HOME`` environmental variable or :file:`~/.local/share/Odoo` or :file:`/var/lib/Odoo`."
msgstr ""
#: ../../content/developer/reference/cli.rst:121
msgid "saves the server configuration to the current configuration file (:file:`{$HOME}/.odoorc` by default, and can be overridden using :option:`-c`)."
msgstr ""
#: ../../content/developer/reference/cli.rst:127
msgid "disables demo data loading for modules installed comma-separated, use ``all`` for all modules. Requires :option:`-d` and :option:`-i`."
msgstr ""
#: ../../content/developer/reference/cli.rst:133
msgid "path to a file where the server pid will be stored"
msgstr ""
#: ../../content/developer/reference/cli.rst:137
msgid "stops the server after its initialization."
msgstr ""
#: ../../content/developer/reference/cli.rst:141
msgid "Absolute path to the GeoIP City database file."
msgstr ""
#: ../../content/developer/reference/cli.rst:145
msgid "Absolute path to the GeoIP Country database file."
msgstr ""
#: ../../content/developer/reference/cli.rst:151
msgid "Testing Configuration"
msgstr ""
#: ../../content/developer/reference/cli.rst:155
msgid "runs tests after module installation"
msgstr ""
#: ../../content/developer/reference/cli.rst:159
msgid "runs a python test file"
msgstr ""
#: ../../content/developer/reference/cli.rst:163
msgid "Comma-separated list of specs to filter which tests to execute. Enable unit tests if set."
msgstr ""
#: ../../content/developer/reference/cli.rst:165
msgid "Example: `--test-tags :TestClass.test_func,/test_module,external`"
msgstr ""
#: ../../content/developer/reference/cli.rst:167
msgid "The `-` specifies if we want to include or exclude tests matching this spec."
msgstr ""
#: ../../content/developer/reference/cli.rst:168
msgid "The tag will match tags added on a class with a :func:`~odoo.tests.common.tagged` decorator (all :ref:`test classes <reference/testing>` have `standard` and `at_install` tags until explicitly removed, see the decorator documentation)."
msgstr ""
#: ../../content/developer/reference/cli.rst:171
msgid "`*` will match all tags."
msgstr ""
#: ../../content/developer/reference/cli.rst:172
msgid "If tag is omitted on include mode, its value is `standard`."
msgstr ""
#: ../../content/developer/reference/cli.rst:173
msgid "If tag is omitted on exclude mode, its value is `*`."
msgstr ""
#: ../../content/developer/reference/cli.rst:174
msgid "The module, class, and method will respectively match the module name, test class name and test method name."
msgstr ""
#: ../../content/developer/reference/cli.rst:176
msgid "Filtering and executing the tests happens twice: right after each module installation/update and at the end of the modules loading. At each stage tests are filtered by `--test-tags` specs and additionally by dynamic specs `at_install` and `post_install` correspondingly."
msgstr ""
#: ../../content/developer/reference/cli.rst:184
msgid "Specify directory where to write screenshots when an HttpCase.browser_js test fails. It defaults to :file:`/tmp/odoo_tests/{db_name}/screenshots`"
msgstr ""
#: ../../content/developer/reference/cli.rst:189
msgid "Enable screencasts and specify directory where to write screencasts files. The ``ffmpeg`` utility needs to be installed to encode frames into a video file. Otherwise frames will be kept instead of the video file."
msgstr ""
#: ../../content/developer/reference/cli.rst:196
msgid "Database"
msgstr ""
#: ../../content/developer/reference/cli.rst:200
msgid "database username, used to connect to PostgreSQL."
msgstr ""
#: ../../content/developer/reference/cli.rst:204
msgid "database password, if using `password authentication`_."
msgstr ""
#: ../../content/developer/reference/cli.rst:208
msgid "host for the database server"
msgstr ""
#: ../../content/developer/reference/cli.rst:210
msgid "``localhost`` on Windows"
msgstr ""
#: ../../content/developer/reference/cli.rst:211
msgid "UNIX socket otherwise"
msgstr ""
#: ../../content/developer/reference/cli.rst:215
msgid "port the database listens on, defaults to 5432"
msgstr ""
#: ../../content/developer/reference/cli.rst:219
msgid "hides databases that do not match ``<filter>``. The filter is a `regular expression`_, with the additions that:"
msgstr ""
#: ../../content/developer/reference/cli.rst:222
msgid "``%h`` is replaced by the whole hostname the request is made on."
msgstr ""
#: ../../content/developer/reference/cli.rst:223
msgid "``%d`` is replaced by the subdomain the request is made on, with the exception of ``www`` (so domain ``odoo.com`` and ``www.odoo.com`` both match the database ``odoo``)."
msgstr ""
#: ../../content/developer/reference/cli.rst:227
msgid "These operations are case sensitive. Add option ``(?i)`` to match all databases (so domain ``odoo.com`` using ``(?i)%d`` matches the database ``Odoo``)."
msgstr ""
#: ../../content/developer/reference/cli.rst:231
msgid "Since version 11, it's also possible to restrict access to a given database listen by using the --database parameter and specifying a comma-separated list of databases"
msgstr ""
#: ../../content/developer/reference/cli.rst:235
msgid "When combining the two parameters, db-filter supersedes the comma-separated database list for restricting database list, while the comma-separated list is used for performing requested operations like upgrade of modules."
msgstr ""
#: ../../content/developer/reference/cli.rst:243
msgid "Restrict access to databases whose name starts with 11"
msgstr ""
#: ../../content/developer/reference/cli.rst:249
msgid "Restrict access to only two databases, 11firstdatabase and 11seconddatabase"
msgstr ""
#: ../../content/developer/reference/cli.rst:255
msgid "Restrict access to only two databases, 11firstdatabase and 11seconddatabase, and update base module on one database: 11firstdatabase. If database 11seconddatabase doesn't exist, the database is created and base modules is installed"
msgstr ""
#: ../../content/developer/reference/cli.rst:264
msgid "Restrict access to databases whose name starts with 11, and update base module on one database: 11firstdatabase. If database 11seconddatabase doesn't exist, the database is created and base modules is installed"
msgstr ""
#: ../../content/developer/reference/cli.rst:271
msgid "when creating new databases from the database-management screens, use the specified `template database`_. Defaults to ``template0``."
msgstr ""
#: ../../content/developer/reference/cli.rst:276
msgid "Path to the PostgreSQL binaries that are used by the database manager to dump and restore databases. You have to specify this option only if these binaries are located in a non-standard directory."
msgstr ""
#: ../../content/developer/reference/cli.rst:282
msgid "Suppresses the ability to list databases available on the system"
msgstr ""
#: ../../content/developer/reference/cli.rst:286
msgid "Control the SSL security of the connection between Odoo and PostgreSQL. Value should be one of 'disable', 'allow', 'prefer', 'require', 'verify-ca' or 'verify-full' Default value is 'prefer'"
msgstr ""
#: ../../content/developer/reference/cli.rst:293
msgid "Try to enable the unaccent extension when creating new databases"
msgstr ""
#: ../../content/developer/reference/cli.rst:298
msgid "Emails"
msgstr ""
#: ../../content/developer/reference/cli.rst:302
msgid "Email address used as <FROM> when Odoo needs to send mails"
msgstr ""
#: ../../content/developer/reference/cli.rst:306
msgid "Define which email address the SMTP configuration will apply to. The field can be a domain name or an entire email address, or it can remain empty. If the sender's email address does not match this set filter, then the email will be encapsulated using a combination of the two system parameters: ``mail.default.from`` and ``mail.catchall.domain``. For example, \"Admin\" <admin\\@example.com> => \"Admin\" <notifications\\@mycompany.com>."
msgstr ""
#: ../../content/developer/reference/cli.rst:314
msgid "Address of the SMTP server to connect to in order to send mails"
msgstr ""
#: ../../content/developer/reference/cli.rst:320
msgid "If set, odoo should use SSL/STARTSSL SMTP connections"
msgstr ""
#: ../../content/developer/reference/cli.rst:324
msgid "Username to connect to the SMTP server"
msgstr ""
#: ../../content/developer/reference/cli.rst:328
msgid "Password to connect to the SMTP server"
msgstr ""
#: ../../content/developer/reference/cli.rst:332
msgid "An SSL certificate is to be used for authentication. If set, then `smtp-ssl-private-key` is required."
msgstr ""
#: ../../content/developer/reference/cli.rst:337
msgid "An SSL private key is used for authentication. If set, then `smtp-ssl-certificate` is required."
msgstr ""
#: ../../content/developer/reference/cli.rst:342
msgid "Internationalisation"
msgstr ""
#: ../../content/developer/reference/cli.rst:344
msgid "Use these options to translate Odoo to another language. See i18n section of the user manual. Option '-d' is mandatory. Option '-l' is mandatory in case of importation"
msgstr ""
#: ../../content/developer/reference/cli.rst:350
msgid "specifies the languages (separated by commas) for the translations you want to be loaded"
msgstr ""
#: ../../content/developer/reference/cli.rst:355
msgid "specify the language of the translation file. Use it with --i18n-export or --i18n-import"
msgstr ""
#: ../../content/developer/reference/cli.rst:360
msgid "export all sentences to be translated to a CSV file, a PO file or a TGZ archive and exit."
msgstr ""
#: ../../content/developer/reference/cli.rst:365
msgid "import a CSV or a PO file with translations and exit. The '-l' option is required."
msgstr ""
#: ../../content/developer/reference/cli.rst:370
msgid "overwrites existing translation terms on updating a module or importing a CSV or a PO file."
msgstr ""
#: ../../content/developer/reference/cli.rst:375
msgid "specify modules to export. Use in combination with --i18n-export"
msgstr ""
#: ../../content/developer/reference/cli.rst:380
msgid "Advanced Options"
msgstr ""
#: ../../content/developer/reference/cli.rst:385
msgid "Developer features"
msgstr ""
#: ../../content/developer/reference/cli.rst:389
msgid "comma-separated list of features. For development purposes only. Do not use it in production. Possible features are:"
msgstr ""
#: ../../content/developer/reference/cli.rst:392
msgid "``all``: all the features below are activated"
msgstr ""
#: ../../content/developer/reference/cli.rst:394
msgid "``xml``: read QWeb template from xml file directly instead of database. Once a template has been modified in database, it will be not be read from the xml file until the next update/init. Particularly, templates are not translated on using this option."
msgstr ""
#: ../../content/developer/reference/cli.rst:399
msgid "``reload``: restart server when python file are updated (may not be detected depending on the text editor used)"
msgstr ""
#: ../../content/developer/reference/cli.rst:402
msgid "``qweb``: break in the evaluation of QWeb template when a node contains ``t-debug='debugger'``"
msgstr ""
#: ../../content/developer/reference/cli.rst:404
msgid "``(i)p(u)db``: start the chosen python debugger in the code when an unexpected error is raised before logging and returning the error."
msgstr ""
#: ../../content/developer/reference/cli.rst:407
msgid "``werkzeug``: display the full traceback on the frontend page in case of exception"
msgstr ""
#: ../../content/developer/reference/cli.rst:413
msgid "HTTP"
msgstr ""
#: ../../content/developer/reference/cli.rst:417
msgid "do not start the HTTP or long-polling workers (may still start :ref:`cron <reference/actions/cron>` workers)"
msgstr ""
#: ../../content/developer/reference/cli.rst:420
msgid "has no effect if :option:`--test-enable` is set, as tests require an accessible HTTP server"
msgstr ""
#: ../../content/developer/reference/cli.rst:425
msgid "TCP/IP address on which the HTTP server listens, defaults to ``0.0.0.0`` (all addresses)"
msgstr ""
#: ../../content/developer/reference/cli.rst:431
msgid "Port on which the HTTP server listens, defaults to 8069."
msgstr ""
#: ../../content/developer/reference/cli.rst:435
msgid "TCP port for websocket connections in multiprocessing or gevent mode, defaults to 8072. Not used in default (threaded) mode."
msgstr ""
#: ../../content/developer/reference/cli.rst:440
msgid "enables the use of ``X-Forwarded-*`` headers through `Werkzeug's proxy support`_."
msgstr ""
#: ../../content/developer/reference/cli.rst:443
msgid "It ignores all ``X-Forwarded-*`` headers in case ``X-Forwarded-Host`` is missing from the request."
msgstr ""
#: ../../content/developer/reference/cli.rst:446
msgid "It always gets the real IP from the last entry of the ``X-Forwarded-For`` chain. Configure your web server accordingly using directives such as nginx's `set_real_ip_from <https://nginx.org/en/docs/http/ngx_http_realip_module.html>`_ in case there are other trusted proxies along the chain that must be ignored."
msgstr ""
#: ../../content/developer/reference/cli.rst:451
msgid "``X-Forwarded-Proto`` and ``X-Forwarded-Host`` are used to update the request root URL, which in turn is used to update the ``web.base.url`` system parameter upon a successful admin authentication. This system parameter is used to generate all links for the current database; see :ref:`domain-name/web-base-url`."
msgstr ""
#: ../../content/developer/reference/cli.rst:458
msgid "proxy mode *must not* be enabled outside of a reverse proxy scenario"
msgstr ""
#: ../../content/developer/reference/cli.rst:463
msgid "delegates serving attachments files to the static web server and sets both ``X-Sendfile`` (apache) and ``X-Accel-*`` (nginx) http headers on stream responses. See :ref:`deploy/streaming` for web server configuration."
msgstr ""
#: ../../content/developer/reference/cli.rst:470
msgid "Logging"
msgstr ""
#: ../../content/developer/reference/cli.rst:472
msgid "By default, Odoo displays all logging of level_ ``INFO``, ``WARNING`` and ``ERROR``. All logs independently of the level are output on ``stderr``. Various options are available to redirect logging to other destinations and to customize the verbosity."
msgstr ""
#: ../../content/developer/reference/cli.rst:478
msgid "sends logging output to the specified file instead of ``stderr``. On Unix, the file `can be managed by external log rotation programs <https://docs.python.org/3/library/logging.handlers.html#watchedfilehandler>`_ and will automatically be reopened when replaced"
msgstr ""
#: ../../content/developer/reference/cli.rst:485
msgid "logs to the system's event logger: `syslog on unices <https://docs.python.org/3/library/logging.handlers.html#sysloghandler>`_ and `the Event Log on Windows <https://docs.python.org/3/library/logging.handlers.html#nteventloghandler>`_."
msgstr ""
#: ../../content/developer/reference/cli.rst:488
msgid "Neither is configurable"
msgstr ""
#: ../../content/developer/reference/cli.rst:492
msgid "logs to the ``ir.logging`` model (``ir_logging`` table) of the specified database. The database can be the name of a database in the \"current\" PostgreSQL, or `a PostgreSQL URI`_ for e.g. log aggregation."
msgstr ""
#: ../../content/developer/reference/cli.rst:498
msgid ":samp:`{LOGGER}:{LEVEL}`, enables ``LOGGER`` at the provided ``LEVEL`` e.g. ``odoo.models:DEBUG`` will enable all logging messages at or above ``DEBUG`` level in the models."
msgstr ""
#: ../../content/developer/reference/cli.rst:502
msgid "The colon ``:`` is mandatory"
msgstr ""
#: ../../content/developer/reference/cli.rst:503
msgid "The logger can be omitted to configure the root (default) handler"
msgstr ""
#: ../../content/developer/reference/cli.rst:504
msgid "If the level is omitted, the logger is set to ``INFO``"
msgstr ""
#: ../../content/developer/reference/cli.rst:506
msgid "The option can be repeated to configure multiple loggers e.g."
msgstr ""
#: ../../content/developer/reference/cli.rst:514
msgid "enables DEBUG logging of HTTP requests and responses, equivalent to ``--log-handler=odoo.http:DEBUG``"
msgstr ""
#: ../../content/developer/reference/cli.rst:519
msgid "enables DEBUG logging of SQL querying, equivalent to ``--log-handler=odoo.sql_db:DEBUG``"
msgstr ""
#: ../../content/developer/reference/cli.rst:524
msgid "Shortcut to more easily set predefined levels on specific loggers. \"real\" levels (``critical``, ``error``, ``warn``, ``debug``) are set on the ``odoo`` and ``werkzeug`` loggers (except for ``debug`` which is only set on ``odoo``)."
msgstr ""
#: ../../content/developer/reference/cli.rst:529
msgid "Odoo also provides debugging pseudo-levels which apply to different sets of loggers:"
msgstr ""
#: ../../content/developer/reference/cli.rst:534
msgid "``debug_sql``"
msgstr ""
#: ../../content/developer/reference/cli.rst:533
msgid "sets the SQL logger to ``debug``"
msgstr ""
#: ../../content/developer/reference/cli.rst:535
msgid "equivalent to ``--log-sql``"
msgstr ""
#: ../../content/developer/reference/cli.rst:538
msgid "``debug_rpc``"
msgstr ""
#: ../../content/developer/reference/cli.rst:537
msgid "sets the ``odoo`` and HTTP request loggers to ``debug``"
msgstr ""
#: ../../content/developer/reference/cli.rst:539
msgid "equivalent to ``--log-level debug --log-request``"
msgstr ""
#: ../../content/developer/reference/cli.rst:544
msgid "``debug_rpc_answer``"
msgstr ""
#: ../../content/developer/reference/cli.rst:541
msgid "sets the ``odoo`` and HTTP request and response loggers to ``debug``"
msgstr ""
#: ../../content/developer/reference/cli.rst:544
msgid "equivalent to ``--log-level debug --log-request --log-response``"
msgstr ""
#: ../../content/developer/reference/cli.rst:548
msgid "In case of conflict between :option:`--log-level` and :option:`--log-handler`, the latter is used"
msgstr ""
#: ../../content/developer/reference/cli.rst:554
msgid "Multiprocessing"
msgstr ""
#: ../../content/developer/reference/cli.rst:558
msgid "if ``count`` is not 0 (the default), enables multiprocessing and sets up the specified number of HTTP workers (sub-processes processing HTTP and RPC requests)."
msgstr ""
#: ../../content/developer/reference/cli.rst:562
msgid "multiprocessing mode is only available on Unix-based systems"
msgstr ""
#: ../../content/developer/reference/cli.rst:564
msgid "A number of options allow limiting and recycling workers:"
msgstr ""
#: ../../content/developer/reference/cli.rst:568
msgid "Number of requests a worker will process before being recycled and restarted."
msgstr ""
#: ../../content/developer/reference/cli.rst:571
msgid "Defaults to *8196*."
msgstr ""
#: ../../content/developer/reference/cli.rst:575
msgid "Maximum allowed virtual memory per worker in bytes. If the limit is exceeded, the worker is killed and recycled at the end of the current request."
msgstr ""
#: ../../content/developer/reference/cli.rst:578
msgid "Defaults to *2048MiB (2048\\*1024\\*1024B)*."
msgstr ""
#: ../../content/developer/reference/cli.rst:582
msgid "Hard limit on virtual memory in bytes, any worker exceeding the limit will be immediately killed without waiting for the end of the current request processing."
msgstr ""
#: ../../content/developer/reference/cli.rst:586
msgid "Defaults to *2560MiB (2560\\*1024\\*1024B)*."
msgstr ""
#: ../../content/developer/reference/cli.rst:590
msgid "Prevents the worker from using more than <limit> CPU seconds for each request. If the limit is exceeded, the worker is killed."
msgstr ""
#: ../../content/developer/reference/cli.rst:593
msgid "Defaults to *60*."
msgstr ""
#: ../../content/developer/reference/cli.rst:597
msgid "Prevents the worker from taking longer than <limit> seconds to process a request. If the limit is exceeded, the worker is killed."
msgstr ""
#: ../../content/developer/reference/cli.rst:600
msgid "Differs from :option:`--limit-time-cpu` in that this is a \"wall time\" limit including e.g. SQL queries."
msgstr ""
#: ../../content/developer/reference/cli.rst:603
msgid "Defaults to *120*."
msgstr ""
#: ../../content/developer/reference/cli.rst:607
msgid "number of workers dedicated to :ref:`cron <reference/actions/cron>` jobs. Defaults to *2*. The workers are threads in multi-threading mode and processes in multi-processing mode."
msgstr ""
#: ../../content/developer/reference/cli.rst:610
msgid "For multi-processing mode, this is in addition to the HTTP worker processes."
msgstr ""
#: ../../content/developer/reference/cli.rst:615
msgid "Configuration file"
msgstr ""
#: ../../content/developer/reference/cli.rst:619
msgid "Most of the command-line options can also be specified via a configuration file. Most of the time, they use similar names with the prefix ``-`` removed and other ``-`` are replaced by ``_`` e.g. :option:`--db-template` becomes ``db_template``."
msgstr ""
#: ../../content/developer/reference/cli.rst:624
msgid "Some conversions don't match the pattern:"
msgstr ""
#: ../../content/developer/reference/cli.rst:626
msgid ":option:`--db-filter` becomes ``dbfilter``"
msgstr ""
#: ../../content/developer/reference/cli.rst:627
msgid ":option:`--no-http` corresponds to the ``http_enable`` boolean"
msgstr ""
#: ../../content/developer/reference/cli.rst:628
msgid "logging presets (all options starting with ``--log-`` except for :option:`--log-handler` and :option:`--log-db`) just add content to ``log_handler``, use that directly in the configuration file"
msgstr ""
#: ../../content/developer/reference/cli.rst:631
msgid ":option:`--smtp` is stored as ``smtp_server``"
msgstr ""
#: ../../content/developer/reference/cli.rst:632
msgid ":option:`--database` is stored as ``db_name``"
msgstr ""
#: ../../content/developer/reference/cli.rst:633
msgid ":option:`--i18n-import` and :option:`--i18n-export` aren't available at all from configuration files"
msgstr ""
#: ../../content/developer/reference/cli.rst:638
msgid "The default configuration file is :file:`{$HOME}/.odoorc` which can be overridden using :option:`--config <odoo-bin -c>`. Specifying :option:`--save <odoo-bin -s>` will save the current configuration state back to that file. The configuration items relative to the command-line are to be specified in the section ``[options]``."
msgstr ""
#: ../../content/developer/reference/cli.rst:644
msgid "Here is a sample file:"
msgstr ""
#: ../../content/developer/reference/cli.rst:669
msgid "Shell"
msgstr ""
#: ../../content/developer/reference/cli.rst:671
msgid "The Odoo command line also allows launching Odoo as a Python console environment, enabling direct interaction with the :ref:`orm <reference/orm>` and its functionalities."
msgstr ""
#: ../../content/developer/reference/cli.rst:680
msgid "Adding an exclamation mark to all contacts' names:"
msgstr ""
#: ../../content/developer/reference/cli.rst:696
msgid "By default, the shell is running in transaction mode. This means that any change made to the database is rolled back when exiting the shell. To commit changes, use `env.cr.commit()`."
msgstr ""
#: ../../content/developer/reference/cli.rst:701
msgid "Specify a preferred REPL to use in shell mode. This shell is started with the `env` variable already initialized to be able to access the ORM and other Odoo modules."
msgstr ""
#: ../../content/developer/reference/cli.rst:705
msgid ":ref:`reference/orm/environment`"
msgstr ""
#: ../../content/developer/reference/cli.rst:710
msgid "Scaffolding"
msgstr ""
#: ../../content/developer/reference/cli.rst:714
msgid "Scaffolding is the automated creation of a skeleton structure to simplify bootstrapping (of new modules, in the case of Odoo). While not necessary it avoids the tedium of setting up basic structures and looking up what all starting requirements are."
msgstr ""
#: ../../content/developer/reference/cli.rst:719
msgid "Scaffolding is available via the :command:`odoo-bin scaffold` subcommand."
msgstr ""
#: ../../content/developer/reference/cli.rst:727
msgid "the name of the module to create, may munged in various manners to generate programmatic names (e.g. module directory name, model names, …)"
msgstr ""
#: ../../content/developer/reference/cli.rst:732
msgid "directory in which to create the new module, defaults to the current directory"
msgstr ""
#: ../../content/developer/reference/cli.rst:737
msgid "a template directory, files are passed through jinja2_ then copied to the ``destination`` directory"
msgstr ""
#: ../../content/developer/reference/cli.rst:741
msgid "This will create module *my_module* in directory */addons/*."
msgstr ""
#: ../../content/developer/reference/cli.rst:746
msgid "Database Population"
msgstr ""
#: ../../content/developer/reference/cli.rst:750
msgid "Odoo CLI supports database population features. If the feature is :ref:`implemented on a given model <reference/performance/populate/methods>`, it allows automatic data generation of the model's records to test your modules in databases containing non-trivial amounts of records."
msgstr ""
#: ../../content/developer/reference/cli.rst:761
msgid "list of models for which the database should be filled"
msgstr ""
#: ../../content/developer/reference/cli.rst:765
msgid "population size, the actual records number depends on the model's `_populate_sizes` attribute. The generated records content is specified by the :meth:`~odoo.models._populate_factories` method of a given model (cf. the :file:`populate` folder of modules for further details)."
msgstr ""
#: ../../content/developer/reference/cli.rst:770
msgid ":ref:`reference/performance/populate`"
msgstr ""
#: ../../content/developer/reference/cli.rst:775
msgid "Cloc"
msgstr ""
#: ../../content/developer/reference/cli.rst:779
msgid "Odoo Cloc is a tool to count the number of relevant lines written in Python, Javascript, CSS, SCSS, or XML. This can be used as a rough metric for pricing maintenance of extra modules."
msgstr ""
#: ../../content/developer/reference/cli.rst:784
msgid "Command-line options"
msgstr ""
#: ../../content/developer/reference/cli.rst:789
msgid "Process the code of all extra modules installed on the provided database, and of all server actions and computed fields manually created in the provided database."
msgstr ""
#: ../../content/developer/reference/cli.rst:791
msgid "The :option:`--addons-path` option is required to specify the path(s) to the module folder(s)."
msgstr ""
#: ../../content/developer/reference/cli.rst:794
msgid "If combined with :option:`--path`, the count will be that of the sum of both options' results (with possible overlaps). At least one of these two options is required to specify which code to process."
msgstr ""
#: ../../content/developer/reference/cli.rst:801
msgid ":ref:`reference/cmdline/cloc/database-option`"
msgstr ""
#: ../../content/developer/reference/cli.rst:806
msgid "Process the files in the provided path."
msgstr ""
#: ../../content/developer/reference/cli.rst:809
msgid "If combined with :option:`--database`, the count will be that of the sum of both options' results (with possible overlaps). At least one of these two options is required to specify which code to process."
msgstr ""
#: ../../content/developer/reference/cli.rst:816
msgid "Multiple paths can be provided by repeating the option."
msgstr ""
#: ../../content/developer/reference/cli.rst:823
msgid ":ref:`reference/cmdline/cloc/path-option`"
msgstr ""
#: ../../content/developer/reference/cli.rst:830
msgid "Required if the :option:`--database` option is used."
msgstr ""
#: ../../content/developer/reference/cli.rst:835
msgid "Specify a configuration file to use in place of the :option:`--addons-path` option."
msgstr ""
#: ../../content/developer/reference/cli.rst:844
msgid "Show the details of lines counted for each file."
msgstr ""
#: ../../content/developer/reference/cli.rst:848
msgid "Processed files"
msgstr ""
#: ../../content/developer/reference/cli.rst:853
msgid "With the :option:`--database` option"
msgstr ""
#: ../../content/developer/reference/cli.rst:855
msgid "Odoo Cloc counts the lines in each file of extra installed modules in a given database. In addition, it counts the Python lines of server actions and custom computed fields that have been directly created in the database or imported. Finally, it counts the lines of code of Javascript, CSS, and SCSS files, and of QWeb views from imported modules."
msgstr ""
#: ../../content/developer/reference/cli.rst:861
msgid "Some files are excluded from the count by default:"
msgstr ""
#: ../../content/developer/reference/cli.rst:863
msgid "The manifest (:file:`__manifest__.py` or :file:`__openerp__.py`)"
msgstr ""
#: ../../content/developer/reference/cli.rst:864
msgid "The contents of the folder :file:`static/lib`"
msgstr ""
#: ../../content/developer/reference/cli.rst:865
msgid "The tests defined in the folder :file:`tests` and :file:`static/tests`"
msgstr ""
#: ../../content/developer/reference/cli.rst:866
msgid "The migrations scripts defined in the folder :file:`migrations` and `upgrades`"
msgstr ""
#: ../../content/developer/reference/cli.rst:867
msgid "The XML files declared in the ``demo`` or ``demo_xml`` sections of the manifest"
msgstr ""
#: ../../content/developer/reference/cli.rst:869
msgid "For special cases, a list of files that should be ignored by Odoo Cloc can be defined per module. This is specified by the ``cloc_exclude`` entry of the manifest:"
msgstr ""
#: ../../content/developer/reference/cli.rst:882
msgid "The pattern ``**/*`` can be used to ignore an entire module. This can be useful to exclude a module from maintenance service costs."
msgstr ""
#: ../../content/developer/reference/cli.rst:884
msgid "For more information about the pattern syntax, see `glob <https://docs.python.org/3/library/pathlib.html#pathlib.Path.glob>`_."
msgstr ""
#: ../../content/developer/reference/cli.rst:889
msgid "With the :option:`--path` option"
msgstr ""
#: ../../content/developer/reference/cli.rst:891
msgid "This method works the same as with the :ref:`--database option <reference/cmdline/cloc/database-option>` if a manifest file is present in the given folder. Otherwise, it counts all files."
msgstr ""
#: ../../content/developer/reference/cli.rst:897
msgid "Identifying Extra Modules"
msgstr ""
#: ../../content/developer/reference/cli.rst:899
msgid "To distinguish between standard and extra modules, Odoo Cloc uses the following heuristic: modules that are located (real file system path, after following symbolic links) in the same parent directory as the ``base``, ``web`` or ``web_enterprise`` standard modules are considered standard. Other modules are treated as extra modules."
msgstr ""
#: ../../content/developer/reference/cli.rst:906
#: ../../content/developer/reference/frontend/services.rst:662
msgid "Error Handling"
msgstr ""
#: ../../content/developer/reference/cli.rst:908
msgid "Some file cannot be counted by Odoo Cloc. Those file are reported at the end of the output."
msgstr ""
#: ../../content/developer/reference/cli.rst:912
msgid "Max file size exceeded"
msgstr ""
#: ../../content/developer/reference/cli.rst:914
msgid "Odoo Cloc rejects any file larger than 25MB. Usually, source files are smaller than 1 MB. If a file is rejected, it may be:"
msgstr ""
#: ../../content/developer/reference/cli.rst:917
msgid "A generated XML file that contains lots of data. It should be excluded in the manifest."
msgstr ""
#: ../../content/developer/reference/cli.rst:918
msgid "A JavaScript library that should be placed in the :file:`static/lib` folder."
msgstr ""
#: ../../content/developer/reference/cli.rst:921
msgid "Syntax Error"
msgstr ""
#: ../../content/developer/reference/cli.rst:923
msgid "Odoo Cloc cannot count the lines of code of a Python file with a syntax problem. If an extra module contains such files, they should be fixed to allow the module to load. If the module works despite the presence of those files, they are probably not loaded and should therefore be removed from the module, or at least excluded in the manifest via ``cloc_exclude``."
msgstr ""
#: ../../content/developer/reference/cli.rst:930
msgid "TSConfig Generator"
msgstr ""
#: ../../content/developer/reference/cli.rst:934
msgid "When working on javascript, there are ways to help your editor providing you with powerful auto-completion. One of those ways is the use of a tsconfig.json file. Originally meant for typescript, editors can use its information with plain javascript also. With this config file, you will now have full auto-completion across modules."
msgstr ""
#: ../../content/developer/reference/cli.rst:939
msgid "The command to generate this files takes as many unnamed arguments as you need. Those are relative paths to your addon directories. In the example below, we move up one folder to save the tsconfig file in the folder containing community and enterprise."
msgstr ""
#: ../../content/developer/reference/external_api.rst:3
msgid "External API"
msgstr ""
#: ../../content/developer/reference/external_api.rst:5
msgid "Odoo is usually extended internally via modules, but many of its features and all of its data are also available from the outside for external analysis or integration with various tools. Part of the :ref:`reference/orm/model` API is easily available over XML-RPC_ and accessible from a variety of languages."
msgstr ""
#: ../../content/developer/reference/external_api.rst:11
msgid "Starting with PHP8, the XML-RPC extension may not be available by default. Check out the `manual <https://www.php.net/manual/en/xmlrpc.installation.php>`_ for the installation steps."
msgstr ""
#: ../../content/developer/reference/external_api.rst:16
msgid ":doc:`Tutorial on web services <../howtos/web_services>`"
msgstr ""
#: ../../content/developer/reference/external_api.rst:19
msgid "Connection"
msgstr ""
#: ../../content/developer/reference/external_api.rst:22
msgid "Configuration"
msgstr ""
#: ../../content/developer/reference/external_api.rst:24
msgid "If you already have an Odoo server installed, you can just use its parameters."
msgstr ""
#: ../../content/developer/reference/external_api.rst:28
msgid "For Odoo Online instances (<domain>.odoo.com), users are created without a *local* password (as a person you are logged in via the Odoo Online authentication system, not by the instance itself). To use XML-RPC on Odoo Online instances, you will need to set a password on the user account you want to use:"
msgstr ""
#: ../../content/developer/reference/external_api.rst:34
msgid "Log in your instance with an administrator account."
msgstr ""
#: ../../content/developer/reference/external_api.rst:35
msgid "Go to :menuselection:`Settings --> Users & Companies --> Users`."
msgstr ""
#: ../../content/developer/reference/external_api.rst:36
msgid "Click on the user you want to use for XML-RPC access."
msgstr ""
#: ../../content/developer/reference/external_api.rst:37
msgid "Click on :guilabel:`Action` and select :guilabel:`Change Password`."
msgstr ""
#: ../../content/developer/reference/external_api.rst:38
msgid "Set a :guilabel:`New Password` value then click :guilabel:`Change Password`."
msgstr ""
#: ../../content/developer/reference/external_api.rst:40
msgid "The *server url* is the instance's domain (e.g. *https://mycompany.odoo.com*), the *database name* is the name of the instance (e.g. *mycompany*). The *username* is the configured user's login as shown by the *Change Password* screen."
msgstr ""
#: ../../content/developer/reference/external_api.rst:87
msgid "API Keys"
msgstr ""
#: ../../content/developer/reference/external_api.rst:91
msgid "Odoo has support for **api keys** and (depending on modules or settings) may **require** these keys to perform webservice operations."
msgstr ""
#: ../../content/developer/reference/external_api.rst:94
msgid "The way to use API Keys in your scripts is to simply replace your **password** by the key. The login remains in-use. You should store the API Key as carefully as the password as they essentially provide the same access to your user account (although they can not be used to log-in via the interface)."
msgstr ""
#: ../../content/developer/reference/external_api.rst:99
msgid "In order to add a key to your account, simply go to your :guilabel:`Preferences` (or :guilabel:`My Profile`):"
msgstr ""
#: ../../content/developer/reference/external_api.rst:105
msgid "then open the :guilabel:`Account Security` tab, and click :guilabel:`New API Key`:"
msgstr ""
#: ../../content/developer/reference/external_api.rst:111
msgid "Input a description for the key, **this description should be as clear and complete as possible**: it is the only way you will have to identify your keys later and know whether you should remove them or keep them around."
msgstr ""
#: ../../content/developer/reference/external_api.rst:115
msgid "Click :guilabel:`Generate Key`, then copy the key provided. **Store this key carefully**: it is equivalent to your password, and just like your password the system will not be able to retrieve or show the key again later on. If you lose this key, you will have to create a new one (and probably delete the one you lost)."
msgstr ""
#: ../../content/developer/reference/external_api.rst:121
msgid "Once you have keys configured on your account, they will appear above the :guilabel:`New API Key` button, and you will be able to delete them:"
msgstr ""
#: ../../content/developer/reference/external_api.rst:127
msgid "**A deleted API key can not be undeleted or re-set**. You will have to generate a new key and update all the places where you used the old one."
msgstr ""
#: ../../content/developer/reference/external_api.rst:131
msgid "Test database"
msgstr ""
#: ../../content/developer/reference/external_api.rst:133
msgid "To make exploration simpler, you can also ask https://demo.odoo.com for a test database:"
msgstr ""
#: ../../content/developer/reference/external_api.rst:150
msgid "PHP"
msgstr ""
#: ../../content/developer/reference/external_api.rst:159
msgid "These examples use the `Ripcord <https://code.google.com/p/ripcord/>`_ library, which provides a simple XML-RPC API. Ripcord requires that `XML-RPC support be enabled <https://php.net/manual/en/xmlrpc.installation.php>`_ in your PHP installation."
msgstr ""
#: ../../content/developer/reference/external_api.rst:165
msgid "Since calls are performed over `HTTPS <https://en.wikipedia.org/wiki/HTTP_Secure>`_, it also requires that the `OpenSSL extension <https://php.net/manual/en/openssl.installation.php>`_ be enabled."
msgstr ""
#: ../../content/developer/reference/external_api.rst:170
msgid "Java"
msgstr ""
#: ../../content/developer/reference/external_api.rst:187
msgid "These examples use the `Apache XML-RPC library <https://ws.apache.org/xmlrpc/>`_."
msgstr ""
#: ../../content/developer/reference/external_api.rst:189
#: ../../content/developer/reference/external_api.rst:210
msgid "The examples do not include imports as these imports couldn't be pasted in the code."
msgstr ""
#: ../../content/developer/reference/external_api.rst:192
msgid "Go"
msgstr ""
#: ../../content/developer/reference/external_api.rst:208
msgid "These examples use the `github.com/kolo/xmlrpc library <https://github.com/kolo/xmlrpc>`_."
msgstr ""
#: ../../content/developer/reference/external_api.rst:214
msgid "Logging in"
msgstr ""
#: ../../content/developer/reference/external_api.rst:216
msgid "Odoo requires users of the API to be authenticated before they can query most data."
msgstr ""
#: ../../content/developer/reference/external_api.rst:219
msgid "The ``xmlrpc/2/common`` endpoint provides meta-calls which don't require authentication, such as the authentication itself or fetching version information. To verify if the connection information is correct before trying to authenticate, the simplest call is to ask for the server's version. The authentication itself is done through the ``authenticate`` function and returns a user identifier (``uid``) used in authenticated calls instead of the login."
msgstr ""
#: ../../content/developer/reference/external_api.rst:261
#: ../../content/developer/reference/external_api.rst:373
#: ../../content/developer/reference/external_api.rst:428
#: ../../content/developer/reference/external_api.rst:481
#: ../../content/developer/reference/external_api.rst:534
#: ../../content/developer/reference/external_api.rst:622
#: ../../content/developer/reference/external_api.rst:669
#: ../../content/developer/reference/external_api.rst:731
#: ../../content/developer/reference/external_api.rst:831
#: ../../content/developer/reference/external_api.rst:915
#: ../../content/developer/reference/external_api.rst:1009
#: ../../content/developer/reference/external_api.rst:1082
#: ../../content/developer/reference/external_api.rst:1222
#: ../../content/developer/reference/external_api.rst:1438
#: ../../content/developer/tutorials/web.rst:649
msgid "Result:"
msgstr ""
#: ../../content/developer/reference/external_api.rst:304
msgid "Calling methods"
msgstr ""
#: ../../content/developer/reference/external_api.rst:306
msgid "The second endpoint is ``xmlrpc/2/object``. It is used to call methods of odoo models via the ``execute_kw`` RPC function."
msgstr ""
#: ../../content/developer/reference/external_api.rst:309
msgid "Each call to ``execute_kw`` takes the following parameters:"
msgstr ""
#: ../../content/developer/reference/external_api.rst:311
msgid "the database to use, a string"
msgstr ""
#: ../../content/developer/reference/external_api.rst:312
msgid "the user id (retrieved through ``authenticate``), an integer"
msgstr ""
#: ../../content/developer/reference/external_api.rst:313
msgid "the user's password, a string"
msgstr ""
#: ../../content/developer/reference/external_api.rst:314
msgid "the model name, a string"
msgstr ""
#: ../../content/developer/reference/external_api.rst:315
msgid "the method name, a string"
msgstr ""
#: ../../content/developer/reference/external_api.rst:316
msgid "an array/list of parameters passed by position"
msgstr ""
#: ../../content/developer/reference/external_api.rst:317
msgid "a mapping/dict of parameters to pass by keyword (optional)"
msgstr ""
#: ../../content/developer/reference/external_api.rst:321
msgid "For instance, to see if we can read the ``res.partner`` model, we can call ``check_access_rights`` with ``operation`` passed by position and ``raise_exception`` passed by keyword (in order to get a true/false result rather than true/error):"
msgstr ""
#: ../../content/developer/reference/external_api.rst:380
msgid "List records"
msgstr ""
#: ../../content/developer/reference/external_api.rst:382
msgid "Records can be listed and filtered via :meth:`~odoo.models.Model.search`."
msgstr ""
#: ../../content/developer/reference/external_api.rst:384
msgid ":meth:`~odoo.models.Model.search` takes a mandatory :ref:`domain <reference/orm/domains>` filter (possibly empty), and returns the database identifiers of all records matching the filter."
msgstr ""
#: ../../content/developer/reference/external_api.rst:390
msgid "To list customer companies, for instance:"
msgstr ""
#: ../../content/developer/reference/external_api.rst:435
msgid "Pagination"
msgstr ""
#: ../../content/developer/reference/external_api.rst:437
msgid "By default a search will return the ids of all records matching the condition, which may be a huge number. ``offset`` and ``limit`` parameters are available to only retrieve a subset of all matched records."
msgstr ""
#: ../../content/developer/reference/external_api.rst:488
msgid "Count records"
msgstr ""
#: ../../content/developer/reference/external_api.rst:490
msgid "Rather than retrieve a possibly gigantic list of records and count them, :meth:`~odoo.models.Model.search_count` can be used to retrieve only the number of records matching the query. It takes the same :ref:`domain <reference/orm/domains>` filter as :meth:`~odoo.models.Model.search` and no other parameter."
msgstr ""
#: ../../content/developer/reference/external_api.rst:541
msgid "Calling ``search`` then ``search_count`` (or the other way around) may not yield coherent results if other users are using the server: stored data could have changed between the calls."
msgstr ""
#: ../../content/developer/reference/external_api.rst:546
msgid "Read records"
msgstr ""
#: ../../content/developer/reference/external_api.rst:548
msgid "Record data are accessible via the :meth:`~odoo.models.Model.read` method, which takes a list of ids (as returned by :meth:`~odoo.models.Model.search`), and optionally a list of fields to fetch. By default, it fetches all the fields the current user can read, which tends to be a huge amount."
msgstr ""
#: ../../content/developer/reference/external_api.rst:628
msgid "Conversely, picking only three fields deemed interesting."
msgstr ""
#: ../../content/developer/reference/external_api.rst:676
msgid "Even if the ``id`` field is not requested, it is always returned."
msgstr ""
#: ../../content/developer/reference/external_api.rst:679
msgid "List record fields"
msgstr ""
#: ../../content/developer/reference/external_api.rst:681
msgid ":meth:`~odoo.models.Model.fields_get` can be used to inspect a model's fields and check which ones seem to be of interest."
msgstr ""
#: ../../content/developer/reference/external_api.rst:684
msgid "Because it returns a large amount of meta-information (it is also used by client programs) it should be filtered before printing, the most interesting items for a human user are ``string`` (the field's label), ``help`` (a help text if available) and ``type`` (to know which values to expect, or to send when updating a record)."
msgstr ""
#: ../../content/developer/reference/external_api.rst:773
msgid "Search and read"
msgstr ""
#: ../../content/developer/reference/external_api.rst:775
msgid "Because it is a very common task, Odoo provides a :meth:`~odoo.models.Model.search_read` shortcut which, as its name suggests, is equivalent to a :meth:`~odoo.models.Model.search` followed by a :meth:`~odoo.models.Model.read`, but avoids having to perform two requests and keep ids around."
msgstr ""
#: ../../content/developer/reference/external_api.rst:781
msgid "Its arguments are similar to :meth:`~odoo.models.Model.search`'s, but it can also take a list of ``fields`` (like :meth:`~odoo.models.Model.read`, if that list is not provided it will fetch all fields of matched records)."
msgstr ""
#: ../../content/developer/reference/external_api.rst:869
msgid "Create records"
msgstr ""
#: ../../content/developer/reference/external_api.rst:871
msgid "Records of a model are created using :meth:`~odoo.models.Model.create`. The method creates a single record and returns its database identifier."
msgstr ""
#: ../../content/developer/reference/external_api.rst:874
msgid ":meth:`~odoo.models.Model.create` takes a mapping of fields to values, used to initialize the record. For any field which has a default value and is not set through the mapping argument, the default value will be used."
msgstr ""
#: ../../content/developer/reference/external_api.rst:922
msgid "While most value types are what would expect (integer for :class:`~odoo.fields.Integer`, string for :class:`~odoo.fields.Char` or :class:`~odoo.fields.Text`),"
msgstr ""
#: ../../content/developer/reference/external_api.rst:926
msgid ":class:`~odoo.fields.Date`, :class:`~odoo.fields.Datetime` and :class:`~odoo.fields.Binary` fields use string values"
msgstr ""
#: ../../content/developer/reference/external_api.rst:928
msgid ":class:`~odoo.fields.One2many` and :class:`~odoo.fields.Many2many` use a special command protocol detailed in :meth:`the documentation to the write method <odoo.models.Model.write>`."
msgstr ""
#: ../../content/developer/reference/external_api.rst:933
msgid "Update records"
msgstr ""
#: ../../content/developer/reference/external_api.rst:935
msgid "Records can be updated using :meth:`~odoo.models.Model.write`. It takes a list of records to update and a mapping of updated fields to values similar to :meth:`~odoo.models.Model.create`."
msgstr ""
#: ../../content/developer/reference/external_api.rst:939
msgid "Multiple records can be updated simultaneously, but they will all get the same values for the fields being set. It is not possible to perform \"computed\" updates (where the value being set depends on an existing value of a record)."
msgstr ""
#: ../../content/developer/reference/external_api.rst:1016
msgid "Delete records"
msgstr ""
#: ../../content/developer/reference/external_api.rst:1018
msgid "Records can be deleted in bulk by providing their ids to :meth:`~odoo.models.Model.unlink`."
msgstr ""
#: ../../content/developer/reference/external_api.rst:1089
msgid "Inspection and introspection"
msgstr ""
#: ../../content/developer/reference/external_api.rst:1091
msgid "While we previously used :meth:`~odoo.models.Model.fields_get` to query a model and have been using an arbitrary model from the start, Odoo stores most model metadata inside a few meta-models which allow both querying the system and altering models and fields (with some limitations) on the fly over XML-RPC."
msgstr ""
#: ../../content/developer/reference/external_api.rst:1100
msgid "``ir.model``"
msgstr ""
#: ../../content/developer/reference/external_api.rst:1102
msgid "Provides information about Odoo models via its various fields."
msgstr ""
#: ../../content/developer/reference/external_api.rst:1105
msgid "a human-readable description of the model"
msgstr ""
#: ../../content/developer/reference/external_api.rst:1106
#: ../../content/developer/reference/user_interface/view_architectures.rst:2718
msgid "``model``"
msgstr ""
#: ../../content/developer/reference/external_api.rst:1107
msgid "the name of each model in the system"
msgstr ""
#: ../../content/developer/reference/external_api.rst:1109
msgid "whether the model was generated in Python code (``base``) or by creating an ``ir.model`` record (``manual``)"
msgstr ""
#: ../../content/developer/reference/external_api.rst:1112
msgid "``field_id``"
msgstr ""
#: ../../content/developer/reference/external_api.rst:1112
msgid "list of the model's fields through a :class:`~odoo.fields.One2many` to :ref:`reference/webservice/inspection/fields`"
msgstr ""
#: ../../content/developer/reference/external_api.rst:1115
msgid ":class:`~odoo.fields.One2many` to the :doc:`../reference/user_interface/view_architectures` defined for the model"
msgstr ""
#: ../../content/developer/reference/external_api.rst:1119
msgid "``access_ids``"
msgstr ""
#: ../../content/developer/reference/external_api.rst:1118
msgid ":class:`~odoo.fields.One2many` relation to the :ref:`reference/security/acl` set on the model"
msgstr ""
#: ../../content/developer/reference/external_api.rst:1121
msgid "``ir.model`` can be used to"
msgstr ""
#: ../../content/developer/reference/external_api.rst:1123
msgid "Query the system for installed models (as a precondition to operations on the model or to explore the system's content)."
msgstr ""
#: ../../content/developer/reference/external_api.rst:1125
msgid "Get information about a specific model (generally by listing the fields associated with it)."
msgstr ""
#: ../../content/developer/reference/external_api.rst:1127
msgid "Create new models dynamically over RPC."
msgstr ""
#: ../../content/developer/reference/external_api.rst:1130
msgid "Custom model names must start with ``x_``."
msgstr ""
#: ../../content/developer/reference/external_api.rst:1131
msgid "The ``state`` must be provided and set to ``manual``, otherwise the model will not be loaded."
msgstr ""
#: ../../content/developer/reference/external_api.rst:1133
msgid "It is not possible to add new *methods* to a custom model, only fields."
msgstr ""
#: ../../content/developer/reference/external_api.rst:1137
msgid "A custom model will initially contain only the \"built-in\" fields available on all models:"
msgstr ""
#: ../../content/developer/reference/external_api.rst:1260
msgid "``ir.model.fields``"
msgstr ""
#: ../../content/developer/reference/external_api.rst:1262
msgid "Provides information about the fields of Odoo models and allows adding custom fields without using Python code."
msgstr ""
#: ../../content/developer/reference/external_api.rst:1266
msgid ":class:`~odoo.fields.Many2one` to :ref:`reference/webservice/inspection/models` to which the field belongs"
msgstr ""
#: ../../content/developer/reference/external_api.rst:1269
msgid "the field's technical name (used in ``read`` or ``write``)"
msgstr ""
#: ../../content/developer/reference/external_api.rst:1270
msgid "``field_description``"
msgstr ""
#: ../../content/developer/reference/external_api.rst:1271
msgid "the field's user-readable label (e.g. ``string`` in ``fields_get``)"
msgstr ""
#: ../../content/developer/reference/external_api.rst:1272
msgid "``ttype``"
msgstr ""
#: ../../content/developer/reference/external_api.rst:1273
msgid "the :ref:`type <reference/orm/fields>` of field to create"
msgstr ""
#: ../../content/developer/reference/external_api.rst:1275
msgid "whether the field was created via Python code (``base``) or via ``ir.model.fields`` (``manual``)"
msgstr ""
#: ../../content/developer/reference/external_api.rst:1277
msgid "``required``, ``readonly``, ``translate``"
msgstr ""
#: ../../content/developer/reference/external_api.rst:1278
msgid "enables the corresponding flag on the field"
msgstr ""
#: ../../content/developer/reference/external_api.rst:1280
msgid ":ref:`field-level access control <reference/security/fields>`, a :class:`~odoo.fields.Many2many` to ``res.groups``"
msgstr ""
#: ../../content/developer/reference/external_api.rst:1284
msgid "``selection``, ``size``, ``on_delete``, ``relation``, ``relation_field``, ``domain``"
msgstr ""
#: ../../content/developer/reference/external_api.rst:1283
msgid "type-specific properties and customizations, see :ref:`the fields documentation <reference/orm/fields>` for details"
msgstr ""
#: ../../content/developer/reference/external_api.rst:1287
msgid "Like custom models, only new fields created with ``state=\"manual\"`` are activated as actual fields on the model."
msgstr ""
#: ../../content/developer/reference/external_api.rst:1289
msgid "Computed fields can not be added via ``ir.model.fields``, some field meta-information (defaults, onchange) can not be set either."
msgstr ""
#: ../../content/developer/reference/extract_api.rst:3
msgid "Extract API"
msgstr ""
#: ../../content/developer/reference/extract_api.rst:5
msgid "Odoo provides a service to automate the processing of documents of type **invoices**, **expenses** or **resumes**."
msgstr ""
#: ../../content/developer/reference/extract_api.rst:8
msgid "The service scans documents using an :abbr:`OCR (Optical Character Recognition)` engine and then uses :abbr:`AI(Artificial Intelligence)`-based algorithms to extract fields of interest such as the total, due date, or invoice lines for *invoices*, the total, date for *expenses*, or the name, email, phone number for *resumes*."
msgstr ""
#: ../../content/developer/reference/extract_api.rst:13
msgid "This service is a paid service. Each document processing will cost you one credit. Credits can be bought on `iap.odoo.com <https://iap.odoo.com/iap/in-app-services/259?sortby=date>`_."
msgstr ""
#: ../../content/developer/reference/extract_api.rst:16
msgid "You can either use this service directly in the Accounting, Expense, or Recruitment App or through the API. The Extract API, which is detailed in the next section, allows you to integrate our service directly into your own projects."
msgstr ""
#: ../../content/developer/reference/extract_api.rst:24
msgid "The extract API uses the JSON-RPC2_ protocol; its endpoint routes are located at `https://extract.api.odoo.com`."
msgstr ""
#: ../../content/developer/reference/extract_api.rst:30
msgid "Version"
msgstr ""
#: ../../content/developer/reference/extract_api.rst:32
msgid "The version of the Extract API is specified in the route."
msgstr ""
#: ../../content/developer/reference/extract_api.rst:37
msgid "The latest versions are:"
msgstr ""
#: ../../content/developer/reference/extract_api.rst:35
msgid "invoices: 122"
msgstr ""
#: ../../content/developer/reference/extract_api.rst:36
msgid "expenses: 132"
msgstr ""
#: ../../content/developer/reference/extract_api.rst:37
msgid "applicant: 102"
msgstr ""
#: ../../content/developer/reference/extract_api.rst:40
msgid "Flow"
msgstr ""
#: ../../content/developer/reference/extract_api.rst:42
msgid "The flow is the same for each document type."
msgstr ""
#: ../../content/developer/reference/extract_api.rst:0
msgid "Call :ref:`/parse <extract_api/parse>` to submit your documents (one call for each document). On success, you receive a `document_token` in the response."
msgstr ""
#: ../../content/developer/reference/extract_api.rst:0
msgid "You then have to regularly poll :ref:`/get_result <extract_api/get_result>` to get the document's parsing status."
msgstr ""
#: ../../content/developer/reference/extract_api.rst:0
msgid "Alternatively, you can provide a `webhook_url` at the time of the call to :ref:`/parse <extract_api/parse>` and you will be notified (via a POST request) when the result is ready."
msgstr ""
#: ../../content/developer/reference/extract_api.rst:52
msgid "The HTTP POST method should be used for all of them. A python implementation of the full flow for invoices can be found :download:`here <extract_api/implementation.py>` and a token for integration testing is provided in the :ref:`integration testing section <latestextract_api/integration_testing>`."
msgstr ""
#: ../../content/developer/reference/extract_api.rst:59
msgid "Parse"
msgstr ""
#: ../../content/developer/reference/extract_api.rst:61
msgid "Request the processing of a document from the OCR. The route will return a `document_token`, you can use it to obtain the result of your request."
msgstr ""
#: ../../content/developer/reference/extract_api.rst:67
#: ../../content/developer/reference/extract_api.rst:213
msgid "Routes"
msgstr ""
#: ../../content/developer/reference/extract_api.rst:69
msgid "/api/extract/invoice/2/parse"
msgstr ""
#: ../../content/developer/reference/extract_api.rst:70
msgid "/api/extract/expense/2/parse"
msgstr ""
#: ../../content/developer/reference/extract_api.rst:71
msgid "/api/extract/applicant/2/parse"
msgstr ""
#: ../../content/developer/reference/extract_api.rst:78
#: ../../content/developer/reference/extract_api.rst:224
msgid "``jsonrpc`` (required)"
msgstr ""
#: ../../content/developer/reference/extract_api.rst:79
#: ../../content/developer/reference/extract_api.rst:81
#: ../../content/developer/reference/extract_api.rst:83
#: ../../content/developer/reference/extract_api.rst:167
#: ../../content/developer/reference/extract_api.rst:169
#: ../../content/developer/reference/extract_api.rst:225
#: ../../content/developer/reference/extract_api.rst:227
#: ../../content/developer/reference/extract_api.rst:229
#: ../../content/developer/reference/extract_api.rst:263
#: ../../content/developer/reference/extract_api.rst:265
msgid "see JSON-RPC2_"
msgstr ""
#: ../../content/developer/reference/extract_api.rst:80
#: ../../content/developer/reference/extract_api.rst:226
msgid "``method`` (required)"
msgstr ""
#: ../../content/developer/reference/extract_api.rst:82
#: ../../content/developer/reference/extract_api.rst:228
msgid "``id`` (required)"
msgstr ""
#: ../../content/developer/reference/extract_api.rst:131
#: ../../content/developer/reference/extract_api.rst:238
msgid "``params``"
msgstr ""
#: ../../content/developer/reference/extract_api.rst:88
#: ../../content/developer/reference/extract_api.rst:238
msgid "``account_token`` (required)"
msgstr ""
#: ../../content/developer/reference/extract_api.rst:88
msgid "The token of the account from which credits will be taken. Each successful call costs one token."
msgstr ""
#: ../../content/developer/reference/extract_api.rst:91
#: ../../content/developer/reference/extract_api.rst:233
msgid "``version`` (required)"
msgstr ""
#: ../../content/developer/reference/extract_api.rst:91
msgid "The version will determine the format of your requests and the format of the server response. You should use the :ref:`latest version available <extract_api/version>`."
msgstr ""
#: ../../content/developer/reference/extract_api.rst:97
msgid "``documents`` (required)"
msgstr ""
#: ../../content/developer/reference/extract_api.rst:94
msgid "The document must be provided as a string in the ASCII encoding. The list should contain only one string. If multiple strings are provided only the first string corresponding to a pdf will be processed. If no pdf is found, the first string will be processed. This field is a list only for legacy reasons. The supported extensions are *pdf*, *png*, *jpg* and *bmp*."
msgstr ""
#: ../../content/developer/reference/extract_api.rst:99
msgid "``dbuuid`` (optional)"
msgstr ""
#: ../../content/developer/reference/extract_api.rst:100
msgid "Unique identifier of the Odoo database."
msgstr ""
#: ../../content/developer/reference/extract_api.rst:102
msgid "``webhook_url`` (optional)"
msgstr ""
#: ../../content/developer/reference/extract_api.rst:102
msgid "A webhook URL can be provided. An empty POST request will be sent to ``webhook_url/document_token`` when the result is ready."
msgstr ""
#: ../../content/developer/reference/extract_api.rst:131
msgid "``user_infos`` (optional)"
msgstr ""
#: ../../content/developer/reference/extract_api.rst:105
msgid "Information concerning the person sending the document to the extract service. It can be the client or the supplier (depending on the ``perspective``). This information is not required in order for the service to work but it greatly improves the quality of the result."
msgstr ""
#: ../../content/developer/reference/extract_api.rst:111
msgid "``user_company_vat`` (optional)"
msgstr ""
#: ../../content/developer/reference/extract_api.rst:112
msgid "VAT number of the user."
msgstr ""
#: ../../content/developer/reference/extract_api.rst:113
msgid "``user_company_name`` (optional)"
msgstr ""
#: ../../content/developer/reference/extract_api.rst:114
msgid "Name of the users company."
msgstr ""
#: ../../content/developer/reference/extract_api.rst:116
msgid "``user_company_country_code`` (optional)"
msgstr ""
#: ../../content/developer/reference/extract_api.rst:116
msgid "Country code of the user. Format: `ISO3166 alpha-2 <https://www.iban.com/country-codes>`_."
msgstr ""
#: ../../content/developer/reference/extract_api.rst:118
msgid "``user_lang`` (optional)"
msgstr ""
#: ../../content/developer/reference/extract_api.rst:119
msgid "The user language. Format: *language_code + _ + locale* (e.g. fr_FR, en_US)."
msgstr ""
#: ../../content/developer/reference/extract_api.rst:120
msgid "``user_email`` (optional)"
msgstr ""
#: ../../content/developer/reference/extract_api.rst:121
msgid "The user email."
msgstr ""
#: ../../content/developer/reference/extract_api.rst:122
msgid "``purchase_order_regex`` (optional)"
msgstr ""
#: ../../content/developer/reference/extract_api.rst:123
msgid "Regex for purchase order identification. Will default to Odoo PO format if not provided."
msgstr ""
#: ../../content/developer/reference/extract_api.rst:131
msgid "``perspective`` (optional)"
msgstr ""
#: ../../content/developer/reference/extract_api.rst:127
msgid "Can be ``client`` or ``supplier``. This field is useful for invoices only. ``client`` means that the user information provided are related to the client of the invoice. ``supplier`` means that it's related to the supplier. If not provided, client will be used."
msgstr ""
#: ../../content/developer/reference/extract_api.rst:158
msgid "The ``user_infos`` parameter is optional but it greatly improves the quality of the result, especially for invoices. The more information you can provide, the better."
msgstr ""
#: ../../content/developer/reference/extract_api.rst:166
#: ../../content/developer/reference/extract_api.rst:262
msgid "``jsonrpc``"
msgstr ""
#: ../../content/developer/reference/extract_api.rst:178
#: ../../content/developer/reference/extract_api.rst:279
msgid "``result``"
msgstr ""
#: ../../content/developer/reference/extract_api.rst:173
#: ../../content/developer/reference/extract_api.rst:269
msgid "``status``"
msgstr ""
#: ../../content/developer/reference/extract_api.rst:174
#: ../../content/developer/reference/extract_api.rst:270
msgid "The code indicating the status of the request. See the table below."
msgstr ""
#: ../../content/developer/reference/extract_api.rst:175
#: ../../content/developer/reference/extract_api.rst:271
msgid "``status_msg``"
msgstr ""
#: ../../content/developer/reference/extract_api.rst:176
#: ../../content/developer/reference/extract_api.rst:272
msgid "A string giving verbose details about the request status."
msgstr ""
#: ../../content/developer/reference/extract_api.rst:178
msgid "``document_token``"
msgstr ""
#: ../../content/developer/reference/extract_api.rst:178
#: ../../content/developer/reference/extract_api.rst:274
msgid "Only present if the request is successful."
msgstr ""
#: ../../content/developer/reference/extract_api.rst:181
#: ../../content/developer/reference/extract_api.rst:282
#: ../../content/developer/tutorials/getting_started/08_relations.rst:244
msgid "status"
msgstr ""
#: ../../content/developer/reference/extract_api.rst:181
#: ../../content/developer/reference/extract_api.rst:282
msgid "status_msg"
msgstr ""
#: ../../content/developer/reference/extract_api.rst:183
#: ../../content/developer/reference/extract_api.rst:284
msgid "`success`"
msgstr ""
#: ../../content/developer/reference/extract_api.rst:184
#: ../../content/developer/reference/extract_api.rst:285
msgid "`error_unsupported_version`"
msgstr ""
#: ../../content/developer/reference/extract_api.rst:184
#: ../../content/developer/reference/extract_api.rst:285
msgid "Unsupported version"
msgstr ""
#: ../../content/developer/reference/extract_api.rst:185
#: ../../content/developer/reference/extract_api.rst:286
msgid "`error_internal`"
msgstr ""
#: ../../content/developer/reference/extract_api.rst:185
#: ../../content/developer/reference/extract_api.rst:286
msgid "An error occurred"
msgstr ""
#: ../../content/developer/reference/extract_api.rst:186
msgid "`error_no_credit`"
msgstr ""
#: ../../content/developer/reference/extract_api.rst:186
msgid "You don't have enough credit"
msgstr ""
#: ../../content/developer/reference/extract_api.rst:187
msgid "`error_unsupported_format`"
msgstr ""
#: ../../content/developer/reference/extract_api.rst:187
msgid "Unsupported file format"
msgstr ""
#: ../../content/developer/reference/extract_api.rst:188
#: ../../content/developer/reference/extract_api.rst:287
msgid "`error_maintenance`"
msgstr ""
#: ../../content/developer/reference/extract_api.rst:188
#: ../../content/developer/reference/extract_api.rst:287
msgid "Server is currently under maintenance, please try again later"
msgstr ""
#: ../../content/developer/reference/extract_api.rst:204
msgid "The API does not actually use the JSON-RPC error scheme. Instead the API has its own error scheme bundled inside a successful JSON-RPC result."
msgstr ""
#: ../../content/developer/reference/extract_api.rst:208
msgid "Get results"
msgstr ""
#: ../../content/developer/reference/extract_api.rst:215
msgid "/api/extract/invoice/2/get_result"
msgstr ""
#: ../../content/developer/reference/extract_api.rst:216
msgid "/api/extract/expense/2/get_result"
msgstr ""
#: ../../content/developer/reference/extract_api.rst:217
msgid "/api/extract/applicant/2/get_result"
msgstr ""
#: ../../content/developer/reference/extract_api.rst:234
msgid "The version should match the version passed to the :ref:`/parse <extract_api/parse>` request."
msgstr ""
#: ../../content/developer/reference/extract_api.rst:235
msgid "``document_token`` (required)"
msgstr ""
#: ../../content/developer/reference/extract_api.rst:236
msgid "The ``document_token`` for which you want to get the current parsing status."
msgstr ""
#: ../../content/developer/reference/extract_api.rst:238
msgid "The token of the account that was used to submit the document."
msgstr ""
#: ../../content/developer/reference/extract_api.rst:256
msgid "When getting the results from the parse, the detected field vary a lot depending on the type of document. Each response is a list of dictionaries, one for each document. The keys of the dictionary are the name of the field and the value is the value of the field."
msgstr ""
#: ../../content/developer/reference/extract_api.rst:279
msgid "``results``"
msgstr ""
#: ../../content/developer/reference/extract_api.rst:279
msgid "``full_text_annotation``"
msgstr ""
#: ../../content/developer/reference/extract_api.rst:279
msgid "Contains the unprocessed full result from the OCR for the document"
msgstr ""
#: ../../content/developer/reference/extract_api.rst:288
msgid "`error_document_not_found`"
msgstr ""
#: ../../content/developer/reference/extract_api.rst:288
msgid "The document could not be found"
msgstr ""
#: ../../content/developer/reference/extract_api.rst:289
msgid "`error_unsupported_size`"
msgstr ""
#: ../../content/developer/reference/extract_api.rst:289
msgid "The document has been rejected because it is too small"
msgstr ""
#: ../../content/developer/reference/extract_api.rst:290
msgid "`error_no_page_count`"
msgstr ""
#: ../../content/developer/reference/extract_api.rst:290
msgid "Unable to get page count of the PDF file"
msgstr ""
#: ../../content/developer/reference/extract_api.rst:291
msgid "`error_pdf_conversion_to_images`"
msgstr ""
#: ../../content/developer/reference/extract_api.rst:291
msgid "Couldn't convert the PDF to images"
msgstr ""
#: ../../content/developer/reference/extract_api.rst:292
msgid "`error_password_protected`"
msgstr ""
#: ../../content/developer/reference/extract_api.rst:292
msgid "The PDF file is protected by a password"
msgstr ""
#: ../../content/developer/reference/extract_api.rst:293
msgid "`error_too_many_pages`"
msgstr ""
#: ../../content/developer/reference/extract_api.rst:293
msgid "The document contains too many pages"
msgstr ""
#: ../../content/developer/reference/extract_api.rst:317
msgid "Common fields"
msgstr ""
#: ../../content/developer/reference/extract_api.rst:322
msgid "``feature_result``"
msgstr ""
#: ../../content/developer/reference/extract_api.rst:324
msgid "Each field of interest we want to extract from the document such as the total or the due date are also called **features**. An exhaustive list of all the extracted features associated to a type of document can be found in the sections below."
msgstr ""
#: ../../content/developer/reference/extract_api.rst:328
msgid "For each feature, we return a list of candidates and we spotlight the candidate our model predicts to be the best fit for the feature."
msgstr ""
#: ../../content/developer/reference/extract_api.rst:333
msgid "``selected_value`` (optional)"
msgstr ""
#: ../../content/developer/reference/extract_api.rst:334
msgid "The best candidate for this feature."
msgstr ""
#: ../../content/developer/reference/extract_api.rst:335
msgid "``selected_values`` (optional)"
msgstr ""
#: ../../content/developer/reference/extract_api.rst:336
msgid "The best candidates for this feature."
msgstr ""
#: ../../content/developer/reference/extract_api.rst:338
msgid "``candidates`` (optional)"
msgstr ""
#: ../../content/developer/reference/extract_api.rst:338
msgid "List of all the candidates for this feature ordered by decreasing confidence score."
msgstr ""
#: ../../content/developer/reference/extract_api.rst:348
msgid "candidate"
msgstr ""
#: ../../content/developer/reference/extract_api.rst:350
msgid "For each candidate we give its representation and position in the document. Candidates are sorted by decreasing order of suitability."
msgstr ""
#: ../../content/developer/reference/extract_api.rst:355
msgid "``content``"
msgstr ""
#: ../../content/developer/reference/extract_api.rst:356
msgid "Representation of the candidate."
msgstr ""
#: ../../content/developer/reference/extract_api.rst:361
msgid "``coords``"
msgstr ""
#: ../../content/developer/reference/extract_api.rst:360
msgid "``[center_x, center_y, width, height, rotation_angle]``. The position and dimensions are relative to the size of the page and are therefore between 0 and 1. The angle is a clockwise rotation measured in degrees."
msgstr ""
#: ../../content/developer/reference/extract_api.rst:364
msgid "Page of the original document on which the candidate is located (starts at 0)."
msgstr ""
#: ../../content/developer/reference/extract_api.rst:379
msgid "Invoices"
msgstr ""
#: ../../content/developer/reference/extract_api.rst:381
msgid "Invoices are complex and can have a lot of different fields. The following table gives an exhaustive list of all the fields we can extract from an invoice."
msgstr ""
#: ../../content/developer/reference/extract_api.rst:385
#: ../../content/developer/reference/extract_api.rst:489
#: ../../content/developer/reference/extract_api.rst:509
msgid "Feature name"
msgstr ""
#: ../../content/developer/reference/extract_api.rst:385
#: ../../content/developer/reference/extract_api.rst:489
#: ../../content/developer/reference/extract_api.rst:509
msgid "Specifities"
msgstr ""
#: ../../content/developer/reference/extract_api.rst:387
msgid "``SWIFT_code``"
msgstr ""
#: ../../content/developer/reference/extract_api.rst:387
msgid "``content`` is a dictionary encoded as a string."
msgstr ""
#: ../../content/developer/reference/extract_api.rst:389
msgid "It contains information about the detected SWIFT code (or `BIC <https://www.iso9362.org/isobic/overview.html>`_)."
msgstr ""
#: ../../content/developer/reference/extract_api.rst:392
msgid "Keys:"
msgstr ""
#: ../../content/developer/reference/extract_api.rst:396
msgid "``bic``"
msgstr ""
#: ../../content/developer/reference/extract_api.rst:397
msgid "detected BIC (string)."
msgstr ""
#: ../../content/developer/reference/extract_api.rst:398
msgid "``name`` (optional)"
msgstr ""
#: ../../content/developer/reference/extract_api.rst:399
msgid "bank name (string)."
msgstr ""
#: ../../content/developer/reference/extract_api.rst:400
msgid "``country_code``"
msgstr ""
#: ../../content/developer/reference/extract_api.rst:401
msgid "ISO3166 alpha-2 country code of the bank (string)."
msgstr ""
#: ../../content/developer/reference/extract_api.rst:402
msgid "``city`` (optional)"
msgstr ""
#: ../../content/developer/reference/extract_api.rst:403
msgid "city of the bank (string)."
msgstr ""
#: ../../content/developer/reference/extract_api.rst:405
msgid "``verified_bic``"
msgstr ""
#: ../../content/developer/reference/extract_api.rst:405
msgid "True if the BIC has been found in our DB (bool)."
msgstr ""
#: ../../content/developer/reference/extract_api.rst:407
msgid "Name and city are present only if verified_bic is true."
msgstr ""
#: ../../content/developer/reference/extract_api.rst:409
msgid "``iban``"
msgstr ""
#: ../../content/developer/reference/extract_api.rst:409
#: ../../content/developer/reference/extract_api.rst:411
#: ../../content/developer/reference/extract_api.rst:413
#: ../../content/developer/reference/extract_api.rst:420
#: ../../content/developer/reference/extract_api.rst:422
#: ../../content/developer/reference/extract_api.rst:424
#: ../../content/developer/reference/extract_api.rst:428
#: ../../content/developer/reference/extract_api.rst:430
#: ../../content/developer/reference/extract_api.rst:432
#: ../../content/developer/reference/extract_api.rst:440
#: ../../content/developer/reference/extract_api.rst:446
#: ../../content/developer/reference/extract_api.rst:448
#: ../../content/developer/reference/extract_api.rst:450
#: ../../content/developer/reference/extract_api.rst:452
#: ../../content/developer/reference/extract_api.rst:491
#: ../../content/developer/reference/extract_api.rst:493
#: ../../content/developer/reference/extract_api.rst:495
#: ../../content/developer/reference/extract_api.rst:499
#: ../../content/developer/reference/extract_api.rst:511
#: ../../content/developer/reference/extract_api.rst:513
#: ../../content/developer/reference/extract_api.rst:515
#: ../../content/developer/reference/extract_api.rst:517
msgid "``content`` is a string"
msgstr ""
#: ../../content/developer/reference/extract_api.rst:411
msgid "``aba``"
msgstr ""
#: ../../content/developer/reference/extract_api.rst:413
msgid "``VAT_Number``"
msgstr ""
#: ../../content/developer/reference/extract_api.rst:415
msgid "Depending on the value of perspective in the user_infos, this will be the VAT number of the supplier or the client. If perspective is client, it'll be the supplier's VAT number. If it's supplier, it's the client's VAT number."
msgstr ""
#: ../../content/developer/reference/extract_api.rst:420
msgid "``qr-bill``"
msgstr ""
#: ../../content/developer/reference/extract_api.rst:422
msgid "``payment_ref``"
msgstr ""
#: ../../content/developer/reference/extract_api.rst:424
msgid "``purchase_order``"
msgstr ""
#: ../../content/developer/reference/extract_api.rst:426
msgid "Uses ``selected_values`` instead of ``selected_value``"
msgstr ""
#: ../../content/developer/reference/extract_api.rst:428
#: ../../content/developer/reference/extract_api.rst:493
msgid "``country``"
msgstr ""
#: ../../content/developer/reference/extract_api.rst:430
#: ../../content/developer/reference/extract_api.rst:499
msgid "``currency``"
msgstr ""
#: ../../content/developer/reference/extract_api.rst:432
#: ../../content/developer/reference/extract_api.rst:495
msgid "``date``"
msgstr ""
#: ../../content/developer/reference/extract_api.rst:434
msgid "Format : *YYYY-MM-DD*"
msgstr ""
#: ../../content/developer/reference/extract_api.rst:436
msgid "``due_date``"
msgstr ""
#: ../../content/developer/reference/extract_api.rst:436
msgid "Same as for ``date``"
msgstr ""
#: ../../content/developer/reference/extract_api.rst:438
msgid "``total_tax_amount``"
msgstr ""
#: ../../content/developer/reference/extract_api.rst:438
#: ../../content/developer/reference/extract_api.rst:442
#: ../../content/developer/reference/extract_api.rst:444
#: ../../content/developer/reference/extract_api.rst:497
msgid "``content`` is a float"
msgstr ""
#: ../../content/developer/reference/extract_api.rst:440
msgid "``invoice_id``"
msgstr ""
#: ../../content/developer/reference/extract_api.rst:442
msgid "``subtotal``"
msgstr ""
#: ../../content/developer/reference/extract_api.rst:444
#: ../../content/developer/reference/extract_api.rst:497
msgid "``total``"
msgstr ""
#: ../../content/developer/reference/extract_api.rst:446
msgid "``supplier``"
msgstr ""
#: ../../content/developer/reference/extract_api.rst:448
msgid "``client``"
msgstr ""
#: ../../content/developer/reference/extract_api.rst:450
#: ../../content/developer/reference/extract_api.rst:513
msgid "``email``"
msgstr ""
#: ../../content/developer/reference/extract_api.rst:457
msgid "``feature_result`` for the ``invoice_lines`` feature"
msgstr ""
#: ../../content/developer/reference/extract_api.rst:459
msgid "It follows a more specific structure. It is basically a list of dictionaries where each dictionary represents an invoice line. Each value follows a :ref:`latestextract_api/get_result/feature_result` structure."
msgstr ""
#: ../../content/developer/reference/extract_api.rst:483
msgid "Expense"
msgstr ""
#: ../../content/developer/reference/extract_api.rst:485
msgid "The expenses are less complex than invoices. The following table gives an exhaustive list of all the fields we can extract from an expense report."
msgstr ""
#: ../../content/developer/reference/extract_api.rst:503
msgid "Applicant"
msgstr ""
#: ../../content/developer/reference/extract_api.rst:505
msgid "This third type of document is meant for processing resumes. The following table gives an exhaustive list of all the fields we can extract from a resume."
msgstr ""
#: ../../content/developer/reference/extract_api.rst:515
msgid "``phone``"
msgstr ""
#: ../../content/developer/reference/extract_api.rst:517
msgid "``mobile``"
msgstr ""
#: ../../content/developer/reference/extract_api.rst:525
msgid "You can test your integration by using *integration_token* as ``account_token`` in the :ref:`/parse <extract_api/parse>` request."
msgstr ""
#: ../../content/developer/reference/extract_api.rst:528
msgid "Using this token put you in test mode and allows you to simulate the entire flow without really parsing a document and without being billed one credit for each successful **document** parsing."
msgstr ""
#: ../../content/developer/reference/extract_api.rst:531
msgid "The only technical differences in test mode is that the document you send is not parsed by the system and that the response you get from :ref:`/get_result <extract_api/get_result>` is a hard-coded one."
msgstr ""
#: ../../content/developer/reference/extract_api.rst:535
msgid "A python implementation of the full flow for invoices can be found :download:`here <extract_api/implementation.py>`."
msgstr ""
#: ../../content/developer/reference/frontend.rst:5
msgid "JavaScript framework"
msgstr ""
#: ../../content/developer/reference/frontend/assets.rst:8
msgid "Managing assets in Odoo is not as straightforward as it is in some other apps. One of the reasons is that we have a variety of situations where some, but not all of the assets are required. For example, the needs of the web client, the point of sale app, the website or even the mobile application are different. Also, some assets may be large, but are seldom needed: in that case we may want them to be :ref:`loaded lazily (on demand) <frontend/assets/lazy_loading>`."
msgstr ""
#: ../../content/developer/reference/frontend/assets.rst:16
msgid "Asset types"
msgstr ""
#: ../../content/developer/reference/frontend/assets.rst:18
msgid "There are three different asset types: code (`js` files), style (`css` or `scss` files) and templates (`xml` files)."
msgstr ""
#: ../../content/developer/reference/frontend/assets.rst:27
#: ../../../odoo/addons/account/models/account_account.py:docstring of odoo.addons.account.models.account_account.AccountAccount.code:1
msgid "Code"
msgstr ""
#: ../../content/developer/reference/frontend/assets.rst:22
msgid "Odoo supports :ref:`three different kinds of javascript files<frontend/js_modules>`. All these files are then processed (native JS modules are transformed into odoo modules), then minified (if not in `debug=assets` :ref:`mode <frontend/framework/assets_debug_mode>`) and concatenated. The result is then saved as a file attachment. These file attachments are usually loaded via a `<script>` tag in the `<head>` part of the page (as a static file)."
msgstr ""
#: ../../content/developer/reference/frontend/assets.rst:35
msgid "Style"
msgstr ""
#: ../../content/developer/reference/frontend/assets.rst:30
msgid "Styling can be done with either `css` or `scss <https://sass-lang.com/>`_. Like the javascript files, these files are processed (`scss` files are converted into `css`), then minified (again, if not in `debug=assets` :ref:`mode <frontend/framework/assets_debug_mode>`) and concatenated. The result is then saved as a file attachment. They are then usually loaded via a `<link>` tag in the `<head>` part of the page (as a static file)."
msgstr ""
#: ../../content/developer/reference/frontend/assets.rst:42
msgid "Template"
msgstr ""
#: ../../content/developer/reference/frontend/assets.rst:38
msgid "Templates (static `xml` files) are handled in a different way: they are simply read from the file system whenever they are needed, and concatenated."
msgstr ""
#: ../../content/developer/reference/frontend/assets.rst:41
msgid "Whenever the browser loads odoo, it calls the `/web/webclient/qweb/` controller to fetch the :ref:`templates <reference/qweb>`."
msgstr ""
#: ../../content/developer/reference/frontend/assets.rst:44
msgid "It is useful to know that in most cases, a browser only performs a request the first time it loads a page. This is because each of these assets are associated with a checksum, which is injected into the page source. The checksum is then added to the url, which means that it is possible to safely set the cache headers to a long period."
msgstr ""
#: ../../content/developer/reference/frontend/assets.rst:53
msgid "Bundles"
msgstr ""
#: ../../content/developer/reference/frontend/assets.rst:55
msgid "Odoo assets are grouped by *bundles*. Each bundle (a *list of file paths* of specific types: `xml`, `js`, `css` or `scss`) is listed in the :ref:`module manifest <reference/module/manifest>`. Files can be declared using `glob <https://en.wikipedia.org/wiki/Glob_(programming)>`_ syntax, meaning that you can declare several asset files using a single line."
msgstr ""
#: ../../content/developer/reference/frontend/assets.rst:61
msgid "The bundles are defined in each module's :file:`__manifest__.py`, with a dedicated `assets` key which contains a dictionary. The dictionary maps bundle names (keys) to the list of files they contain (values). It looks like this:"
msgstr ""
#: ../../content/developer/reference/frontend/assets.rst:83
msgid "Here is a list of some important bundles that most odoo developers will need to know:"
msgstr ""
#: ../../content/developer/reference/frontend/assets.rst:86
msgid "`web.assets_common`: this bundle contains most assets which are common to the web client, the website and also the point of sale. This is supposed to contain lower level building blocks for the odoo framework. Note that it contains the :file:`boot.js` file, which defines the odoo module system."
msgstr ""
#: ../../content/developer/reference/frontend/assets.rst:91
msgid "`web.assets_backend`: this bundle contains the code specific to the web client (notably the web client/action manager/views/static XML templates)"
msgstr ""
#: ../../content/developer/reference/frontend/assets.rst:94
msgid "`web.assets_frontend`: this bundle is about all that is specific to the public website: ecommerce, portal, forum, blog, ..."
msgstr ""
#: ../../content/developer/reference/frontend/assets.rst:97
msgid "`web.qunit_suite_tests`: all javascript qunit testing code (tests, helpers, mocks)"
msgstr ""
#: ../../content/developer/reference/frontend/assets.rst:99
msgid "`web.qunit_mobile_suite_tests`: mobile specific qunit testing code"
msgstr ""
#: ../../content/developer/reference/frontend/assets.rst:105
msgid "Typically, handling assets is simple: you just need to add some new files to a frequently used bundle like `assets_common` or `assets_backend`. But there are other operations available to cover some more specific use cases."
msgstr ""
#: ../../content/developer/reference/frontend/assets.rst:109
msgid "Note that all directives targeting a certain asset file (i.e. `before`, `after`, `replace` and `remove`) need that file to be declared beforehand, either in manifests higher up in the hierarchy or in ``ir.asset`` records with a lower sequence."
msgstr ""
#: ../../content/developer/reference/frontend/assets.rst:115
msgid "`append`"
msgstr ""
#: ../../content/developer/reference/frontend/assets.rst:117
msgid "This operation adds one or multiple file(s). Since it is the most common operation, it can be done by simply using the file name:"
msgstr ""
#: ../../content/developer/reference/frontend/assets.rst:126
msgid "By default, adding a simple string to a bundle will append the files matching the glob pattern at the end of the bundle. Obviously, the pattern may also be directly a single file path."
msgstr ""
#: ../../content/developer/reference/frontend/assets.rst:131
msgid "`prepend`"
msgstr ""
#: ../../content/developer/reference/frontend/assets.rst:133
msgid "Add one or multiple file(s) at the beginning of the bundle."
msgstr ""
#: ../../content/developer/reference/frontend/assets.rst:135
msgid "Useful when you need to put a certain file before the others in a bundle (for example with css files). The `prepend` operation is invoked with the following syntax: `('prepend', <path>)`."
msgstr ""
#: ../../content/developer/reference/frontend/assets.rst:146
msgid "`before`"
msgstr ""
#: ../../content/developer/reference/frontend/assets.rst:148
msgid "Add one or multiple file(s) before a specific file."
msgstr ""
#: ../../content/developer/reference/frontend/assets.rst:150
msgid "Prepending a file at the beginning of a bundle might not be precise enough. The `before` directive can be used to add the given file(s) right *before* the target file. It is declared by replacing the normal path with a 3-element tuple `('before', <target>, <path>)`."
msgstr ""
#: ../../content/developer/reference/frontend/assets.rst:162
msgid "`after`"
msgstr ""
#: ../../content/developer/reference/frontend/assets.rst:164
msgid "Add one or multiple file(s) after a specific file."
msgstr ""
#: ../../content/developer/reference/frontend/assets.rst:166
msgid "Same as `before`, with the matching file(s) appended right *after* the target file. It is declared by replacing the normal path with a 3-element tuple `('after', <target>, <path>)`."
msgstr ""
#: ../../content/developer/reference/frontend/assets.rst:177
msgid "`include`"
msgstr ""
#: ../../content/developer/reference/frontend/assets.rst:179
msgid "Use nested bundles."
msgstr ""
#: ../../content/developer/reference/frontend/assets.rst:181
msgid "The `include` directive is a way to use a bundle in other bundles to minimize the size of your manifest. In Odoo we use sub bundles (prefixed with an underscore by convention) to batch files used in multiple other bundles. You can then specify the sub bundle as a pair `('include', <bundle>)` like this:"
msgstr ""
#: ../../content/developer/reference/frontend/assets.rst:193
msgid "`remove`"
msgstr ""
#: ../../content/developer/reference/frontend/assets.rst:195
msgid "Remove one or multiple file(s)."
msgstr ""
#: ../../content/developer/reference/frontend/assets.rst:197
msgid "In some cases, you may want to remove one or multiple files from a bundle. This can be done using the `remove` directive by specifying a pair `('remove', <target>)`:"
msgstr ""
#: ../../content/developer/reference/frontend/assets.rst:208
msgid "`replace`"
msgstr ""
#: ../../content/developer/reference/frontend/assets.rst:210
msgid "Replace an asset file with one or multiple file(s)."
msgstr ""
#: ../../content/developer/reference/frontend/assets.rst:212
msgid "Let us say that an asset needs not only to be removed, but you also want to insert your new version of that asset at the same exact position. This can be done with the `replace` directive, using a 3-element tuple `('replace', <target>, <path>)`:"
msgstr ""
#: ../../content/developer/reference/frontend/assets.rst:224
msgid "Loading order"
msgstr ""
#: ../../content/developer/reference/frontend/assets.rst:226
msgid "The order in which assets are loaded is sometimes critical and must be deterministic, mostly for stylesheets priorities and setup scripts. Assets in Odoo are processed as follows:"
msgstr ""
#: ../../content/developer/reference/frontend/assets.rst:230
msgid "When an asset bundle is called (e.g. `t-call-assets=\"web.assets_common\"`), an empty list of assets is generated"
msgstr ""
#: ../../content/developer/reference/frontend/assets.rst:233
msgid "All records of type `ir.asset` matching the bundle are fetched and sorted by sequence number. Then all records with a sequence strictly less than 16 are processed and applied to the current list of assets."
msgstr ""
#: ../../content/developer/reference/frontend/assets.rst:237
msgid "All modules declaring assets for said bundle in their manifest apply their assets operations to this list. This is done following the order of modules dependencies (e.g. `web` assets is processed before `website`). If a directive tries to add a file already present in the list, nothing is done for that file. In other word, only the first occurrence of a file is kept in the list."
msgstr ""
#: ../../content/developer/reference/frontend/assets.rst:243
msgid "The remaining `ir.asset` records (those with a sequence greater than or equal to 16) are then processed and applied as well."
msgstr ""
#: ../../content/developer/reference/frontend/assets.rst:246
msgid "Assets declared in the manifest may need to be loaded in a particular order, for example :file:`jquery.js` must be loaded before all other jquery scripts when loading the lib folder. One solution would be to create an :ref:`ir.asset <frontend/assets/ir_asset>` record with a lower sequence or a 'prepend' directive, but there is another simpler way to do so."
msgstr ""
#: ../../content/developer/reference/frontend/assets.rst:252
msgid "Since the unicity of each file path in the list of assets is guaranteed, you can mention any specific file before a glob that includes it. That file will thus appear in the list before all the others included in the glob."
msgstr ""
#: ../../content/developer/reference/frontend/assets.rst:265
msgid "A module *b* removing/replacing the assets declared in a module *a* will have to depend on it. Trying to operate on assets that have yet to be declared will result in an error."
msgstr ""
#: ../../content/developer/reference/frontend/assets.rst:272
msgid "Lazy loading"
msgstr ""
#: ../../content/developer/reference/frontend/assets.rst:274
msgid "It is sometimes useful to load files and/or asset bundles dynamically, for example to only load a library once it is needed. To do that, the Odoo framework provides a few helper functions, located in :file:`@web/core/assets`."
msgstr ""
#: ../../content/developer/reference/frontend/assets.rst:0
#: ../../content/developer/reference/frontend/framework_overview.rst:0
#: ../../content/developer/reference/frontend/hooks.rst:0
#: ../../content/developer/reference/frontend/javascript_reference.rst:0
#: ../../content/developer/reference/frontend/mobile.rst:0
#: ../../content/developer/reference/frontend/patching_code.rst:0
#: ../../content/developer/reference/frontend/qweb.rst:0
#: ../../content/developer/reference/frontend/registries.rst:0
#: ../../content/developer/reference/frontend/services.rst:0
msgid "Arguments"
msgstr ""
#: ../../content/developer/reference/frontend/assets.rst:287
#: ../../content/developer/reference/frontend/assets.rst:310
msgid "a description of various assets that should be loaded"
msgstr ""
#: ../../content/developer/reference/frontend/assets.rst:288
msgid "Promise<void>"
msgstr ""
#: ../../content/developer/reference/frontend/assets.rst:290
msgid "Load the assets described py the `assets` parameter. It is an object that may contain the following keys:"
msgstr ""
#: ../../content/developer/reference/frontend/assets.rst:298
#: ../../content/developer/reference/frontend/framework_overview.rst:264
#: ../../content/developer/reference/frontend/hooks.rst:226
#: ../../content/developer/reference/frontend/hooks.rst:352
#: ../../content/developer/reference/frontend/odoo_editor.rst:147
#: ../../content/developer/reference/frontend/odoo_editor.rst:173
#: ../../content/developer/reference/frontend/odoo_editor.rst:217
#: ../../content/developer/reference/frontend/owl_components.rst:234
#: ../../content/developer/reference/frontend/owl_components.rst:322
#: ../../content/developer/reference/frontend/owl_components.rst:357
#: ../../content/developer/reference/frontend/owl_components.rst:468
#: ../../content/developer/reference/frontend/owl_components.rst:515
#: ../../content/developer/reference/frontend/owl_components.rst:720
#: ../../content/developer/reference/frontend/owl_components.rst:839
#: ../../content/developer/reference/frontend/owl_components.rst:888
#: ../../content/developer/reference/frontend/owl_components.rst:1063
#: ../../content/developer/reference/frontend/services.rst:246
#: ../../content/developer/reference/frontend/services.rst:438
#: ../../content/developer/reference/frontend/services.rst:466
#: ../../content/developer/reference/frontend/services.rst:736
#: ../../content/developer/reference/frontend/services.rst:851
#: ../../content/developer/tutorials/getting_started/04_basicmodel.rst:187
#: ../../content/developer/tutorials/getting_started/08_relations.rst:71
#: ../../content/developer/tutorials/getting_started/08_relations.rst:178
#: ../../content/developer/tutorials/getting_started/08_relations.rst:241
#: ../../content/developer/tutorials/getting_started/09_compute_onchange.rst:173
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:216
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:263
#: ../../content/developer/tutorials/getting_started/13_inheritance.rst:155
#: ../../../odoo/addons/account/models/account_account.py:docstring of odoo.addons.account.models.account_account.AccountAccount.account_type:1
msgid "Type"
msgstr ""
#: ../../content/developer/reference/frontend/assets.rst:300
msgid "`jsLibs`"
msgstr ""
#: ../../content/developer/reference/frontend/assets.rst:301
#: ../../content/developer/reference/frontend/assets.rst:304
msgid "`string[]`"
msgstr ""
#: ../../content/developer/reference/frontend/assets.rst:302
msgid "a list of urls of javascript files"
msgstr ""
#: ../../content/developer/reference/frontend/assets.rst:303
msgid "`cssLibs`"
msgstr ""
#: ../../content/developer/reference/frontend/assets.rst:305
msgid "a list of urls of css files"
msgstr ""
#: ../../content/developer/reference/frontend/assets.rst:312
msgid "This hook is useful when components need to load some assets in their `onWillStart` method. It internally calls `loadAssets`."
msgstr ""
#: ../../content/developer/reference/frontend/assets.rst:318
msgid "The asset model (`ir.asset`)"
msgstr ""
#: ../../content/developer/reference/frontend/assets.rst:320
msgid "In most cases the assets declared in the manifest will largely suffice. Yet for more flexibility, the framework also supports dynamic assets declared in the database."
msgstr ""
#: ../../content/developer/reference/frontend/assets.rst:324
msgid "This is done by creating `ir.asset` records. Those will be processed as if they were found in a module manifest, and they give the same expressive power as their manifest counterparts."
msgstr ""
#: ../../../odoo/odoo/addons/base/models/ir_asset.py:docstring of odoo.addons.base.models.ir_asset.IrAsset:1
msgid "This model contributes to two things:"
msgstr ""
#: ../../../odoo/odoo/addons/base/models/ir_asset.py:docstring of odoo.addons.base.models.ir_asset.IrAsset:3
msgid "1. It provides a function returning a list of all file paths declared in a given list of addons (see _get_addon_paths);"
msgstr ""
#: ../../../odoo/odoo/addons/base/models/ir_asset.py:docstring of odoo.addons.base.models.ir_asset.IrAsset:6
msgid "2. It allows to create 'ir.asset' records to add additional directives to certain bundles."
msgstr ""
#: ../../content/developer/reference/frontend/assets.rst:333
#: ../../content/developer/reference/frontend/odoo_editor.rst:149
#: ../../content/developer/reference/frontend/odoo_editor.rst:175
#: ../../content/developer/reference/frontend/services.rst:468
msgid "`name`"
msgstr ""
#: ../../content/developer/reference/frontend/assets.rst:333
msgid "Name of the asset record (for identification purpose)."
msgstr ""
#: ../../content/developer/reference/frontend/assets.rst:336
msgid "`bundle`"
msgstr ""
#: ../../content/developer/reference/frontend/assets.rst:336
msgid "Bundle in which the asset will be applied."
msgstr ""
#: ../../content/developer/reference/frontend/assets.rst:348
msgid "`directive` (default= `append`)"
msgstr ""
#: ../../content/developer/reference/frontend/assets.rst:339
msgid "This field determines how the `path` (and `target` if needed) will be interpreted. Here is the list of available directives along with their required arguments:"
msgstr ""
#: ../../content/developer/reference/frontend/assets.rst:342
msgid "**append**: `path`"
msgstr ""
#: ../../content/developer/reference/frontend/assets.rst:343
msgid "**prepend**: `path`"
msgstr ""
#: ../../content/developer/reference/frontend/assets.rst:344
msgid "**before**: `target`, `path`"
msgstr ""
#: ../../content/developer/reference/frontend/assets.rst:345
msgid "**after**: `target`, `path`"
msgstr ""
#: ../../content/developer/reference/frontend/assets.rst:346
msgid "**include**: `path` (interpreted as a **bundle name**)"
msgstr ""
#: ../../content/developer/reference/frontend/assets.rst:347
msgid "**remove**: `path` (interpreted as a **target asset** to remove)"
msgstr ""
#: ../../content/developer/reference/frontend/assets.rst:348
msgid "**replace**: `target`, `path`"
msgstr ""
#: ../../content/developer/reference/frontend/assets.rst:356
msgid "`path`"
msgstr ""
#: ../../content/developer/reference/frontend/assets.rst:351
msgid "A string defining one of the following:"
msgstr ""
#: ../../content/developer/reference/frontend/assets.rst:353
msgid "a **relative path** to an asset file in the addons file system;"
msgstr ""
#: ../../content/developer/reference/frontend/assets.rst:354
msgid "a **glob pattern** to a set of asset files in the addons file system;"
msgstr ""
#: ../../content/developer/reference/frontend/assets.rst:355
msgid "a **URL** to an attachment or external asset file;"
msgstr ""
#: ../../content/developer/reference/frontend/assets.rst:356
msgid "a **bundle name**, when using the `include` directive."
msgstr ""
#: ../../content/developer/reference/frontend/assets.rst:360
msgid "`target`"
msgstr ""
#: ../../content/developer/reference/frontend/assets.rst:359
msgid "Target file to specify a position in the bundle. Can only be used with the directives `replace`, `before` and `after`."
msgstr ""
#: ../../content/developer/reference/frontend/assets.rst:363
msgid "`active` (default= `True`)"
msgstr ""
#: ../../content/developer/reference/frontend/assets.rst:363
msgid "Whether the record is active"
msgstr ""
#: ../../content/developer/reference/frontend/assets.rst:366
msgid "`sequence` (default= `16`)"
msgstr ""
#: ../../content/developer/reference/frontend/assets.rst:366
msgid "Loading order of the asset records (ascending). A sequence lower than 16 means that the asset will be processed *before* the ones declared in the manifest."
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:3
msgid "Framework Overview"
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:6
#: ../../content/developer/reference/frontend/mobile.rst:8
msgid "Introduction"
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:8
msgid "The Odoo Javascript framework is a set of features/building blocks provided by the ``web/`` addon to help build odoo applications running in the browser. At the same time, the Odoo Javascript framework is a single page application, usually known as the *web client* (available at the url ``/web``)."
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:13
msgid "The web client started as an application made with a custom class and widget system, but it is now transitioning to using native javascript classes instead, and Owl as a component system. This explains why both systems are currently in use in the codebase."
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:18
msgid "From a high-level perspective, the web client is a single-page application: it does not need to request a full page from the server each time the user performs an action. Instead, it only requests what it needs and then replaces/updates the current screen accordingly. Also, it manages the url to keep it in sync with the current state."
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:24
msgid "The javascript framework (all or some parts) is also used in other situations, such as the Odoo website or the point of sale. This reference is mostly focused on the web client."
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:30
msgid "It is common in the Odoo ecosystem to see the words *frontend* and *backend* as synonyms for the odoo website (public) and the web client, respectively. This terminology is not to be confused with the more common use of browser-code (frontend) and server (backend)."
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:37
msgid "In this documentation, the word *component* always refers to new Owl components, and *widget* refers to old Odoo widgets."
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:42
msgid "All new development should be done in Owl, if possible!"
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:45
msgid "Code structure"
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:47
msgid "The ``web/static/src`` folder contains all the ``web/`` javascript (and css and templates) codebase. Here is a list of the most important folders:"
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:50
msgid "``core/`` most of the low level features"
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:51
msgid "``fields/`` all field components"
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:52
msgid "``views/`` all javascript views components (``form``, ``list``, ...)"
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:53
msgid "``search/`` control panel, search bar, search panel, ..."
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:54
msgid "``webclient/`` the web client specific code: navbar, user menu, action service, ..."
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:56
msgid "The ``web/static/src`` is the root folder. Everything inside can simply be imported by using the ``@web`` prefix. For example, here is how one can import the ``memoize`` function located in ``web/static/src/core/utils/functions``:"
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:65
msgid "WebClient Architecture"
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:67
msgid "As mentioned above, the web client is an owl application. Here is a slightly simplified version of its template:"
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:80
msgid "As we can see, it basically is a wrapper for a navbar, the current action and some additional components. The ``ActionContainer`` is a higher order component that will display the current action controller (so, a client action, or a specific view in the case of actions of type ``act_window``). Managing actions is a huge part of its work: the action service keeps in memory a stack of all active actions (represented in the breadcrumbs), and coordinates each change."
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:88
msgid "Another interesting thing to note is the ``MainComponentsContainer``: it is simply a component that displays all components registered in the ``main_components`` registry. This is how other parts of the system can extend the web client."
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:98
msgid "As an Owl application, the Odoo web client defines its own environment (components can access it using ``this.env``). Here is a description of what Odoo adds to the shared ``env`` object:"
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:107
msgid "Value"
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:109
msgid "required by Owl (contains all templates)"
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:110
msgid "`bus`"
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:111
msgid ":ref:`main bus <frontend/framework/bus>`, used to coordinate some generic events"
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:112
msgid "`services`"
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:113
msgid "all deployed :ref:`services <frontend/services>` (should usually be accessed with the `useService` hook)"
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:115
msgid "`debug`"
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:116
msgid "string. If non empty, the web client is in :ref:`debug mode <frontend/framework/debug_mode>`"
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:117
msgid "`_t`"
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:118
msgid "translation function"
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:119
msgid "`isSmall`"
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:120
msgid "boolean. If true, the web client is currently in mobile mode (screen width <= 767px)"
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:122
msgid "So, for example, to translate a string in a component (note: templates are automatically translated, so no specific action is required in that case), one can do this:"
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:133
msgid "Having a reference to the environment is quite powerful, because it provides access to all services. This is useful in many cases: for example, user menu items are mostly defined as a string, and a function taking the `env` as unique argument. This is enough to express all user menu needs."
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:139
msgid "Building Blocks"
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:141
msgid "Most of the web client is built with a few types of abstractions: registries, services, components and hooks."
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:145
#: ../../content/developer/reference/frontend/javascript_reference.rst:714
#: ../../content/developer/reference/frontend/registries.rst:5
msgid "Registries"
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:147
msgid ":ref:`Registries <frontend/registries>` are basically a simple key/value mapping that stores some specific kind of objects. They are an important part of the extensibility of the UI: once some object is registered, the rest of the web client can use it. For example, the field registry contains all field components (or widgets) that can be used in views."
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:163
msgid "Note that we import the main registry from ``@web/core/registry`` then open the sub registry ``fields``."
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:167
#: ../../content/developer/reference/frontend/javascript_reference.rst:822
#: ../../content/developer/reference/frontend/services.rst:6
msgid "Services"
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:169
msgid ":ref:`Services <frontend/services>` are long lived pieces of code that provide a feature. They may be imported by components (with ``useService``) or by other services. Also, they can declare a set of dependencies. In that sense, services are basically a DI (dependency injection) system. For example, the ``notification`` service provides a way to display a notification, or the ``rpc`` service is the proper way to perform a request to the Odoo server."
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:176
msgid "The following example registers a simple service that displays a notification every 5 second:"
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:198
msgid "Components and Hooks"
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:200
msgid ":ref:`Components <frontend/components>` and :ref:`hooks <frontend/hooks>` are ideas coming from the `Owl component system <https://github.com/odoo/owl/blob/master/doc/readme.md>`_. Odoo components are simply owl components that are part of the web client."
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:204
msgid "`Hooks <https://github.com/odoo/owl/blob/master/doc/reference/hooks.md>`_ are a way to factorize code, even if it depends on lifecycle. This is a composable/functional way to inject a feature in a component. They can be seen as a kind of mixin."
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:221
msgid "Context"
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:223
msgid "An important concept in the Odoo javascript is the *context*: it provides a way for code to give more context to a function call or a rpc, so other parts of the system can properly react to that information. In some way, it is like a bag of information that is propagated everywhere. It is useful in some situations, such as letting the Odoo server know that a model rpc comes from a specific form view, or activating/disabling some features in a component."
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:230
msgid "There are two different contexts in the Odoo web client: the *user context* and the *action context* (so, we should be careful when using the word *context*: it could mean a different thing depending on the situation)."
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:235
msgid "The `context` object may be useful in many cases, but one should be careful not to overuse it! Many problems can be solved in a standard way without modifying the context."
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:242
msgid "User Context"
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:244
msgid "The *user context* is a small object containing various informations related to the current user. It is available through the `user` service:"
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:256
msgid "It contains the following information:"
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:266
msgid "`allowed_company_ids`"
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:267
msgid "`number[]`"
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:268
msgid "the list of active company ids for the user"
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:269
msgid "`lang`"
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:270
#: ../../content/developer/reference/frontend/framework_overview.rst:273
#: ../../content/developer/reference/frontend/odoo_editor.rst:150
#: ../../content/developer/reference/frontend/odoo_editor.rst:176
#: ../../content/developer/reference/frontend/odoo_editor.rst:179
#: ../../content/developer/reference/frontend/odoo_editor.rst:182
#: ../../content/developer/reference/frontend/odoo_editor.rst:185
#: ../../content/developer/reference/frontend/owl_components.rst:726
#: ../../content/developer/reference/frontend/owl_components.rst:729
#: ../../content/developer/reference/frontend/owl_components.rst:735
#: ../../content/developer/reference/frontend/owl_components.rst:894
#: ../../content/developer/reference/frontend/owl_components.rst:903
#: ../../content/developer/reference/frontend/owl_components.rst:912
#: ../../content/developer/reference/frontend/services.rst:742
msgid "`string`"
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:271
msgid "the user language code (such as \"en_us\")"
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:272
msgid "`tz`"
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:274
msgid "the user current timezone (for example \"Europe/Brussels\")"
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:276
msgid "In practice, the `orm` service automatically adds the user context to each of its requests. This is why it is usually not necessary to import it directly in most cases."
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:281
msgid "The first element of the `allowed_company_ids` is the main company of the user."
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:284
msgid "Action Context"
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:286
msgid "The :ref:`ir.actions.act_window<reference/actions/window>` and :ref:`ir.actions.client<reference/actions/client>` support an optional `context` field. This field is a `char` that represents an object. Whenever the corresponding action is loaded in the web client, this context field will be evaluated as an object and given to the component that corresponds to the action."
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:296
msgid "It can be used in many different ways. For example, the views add the action context to every requests made to the server. Another important use is to activate some search filter by default (see example above)."
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:300
msgid "Sometimes, when we execute new actions manually (so, programmatically, in javascript), it is useful to be able to extend the action context. This can be done with the `additional_context` argument."
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:316
msgid "In this example, the action with xml_id `addon_name.something` will be loaded, and its context will be extended with the `default_period_id` value. This is a very important usecase that lets developers combine actions together by providing some information to the next action."
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:324
msgid "Python Interpreter"
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:326
msgid "The Odoo framework features a built-in small python interpreter. Its purpose is to evaluate small python expressions. This is important, because views in Odoo have modifiers written in python, but they need to be evaluated by the browser."
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:331
#: ../../content/developer/reference/frontend/registries.rst:292
msgid "Example:"
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:340
msgid "The ``py`` javascript code exports 5 functions:"
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:344
msgid "the expression to tokenize"
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:345
msgid "Token[] a list of token"
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:349
msgid "a list of tokens"
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:350
#: ../../content/developer/reference/frontend/framework_overview.rst:355
msgid "AST an abstract syntax tree structure representing the expression"
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:354
#: ../../content/developer/reference/frontend/framework_overview.rst:365
msgid "a string representing a valid python expression"
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:359
msgid "a AST structure that represents an expression"
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:360
#: ../../content/developer/reference/frontend/framework_overview.rst:366
msgid "an object that provides an additional evaluation context"
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:361
#: ../../content/developer/reference/frontend/framework_overview.rst:367
msgid "any the resulting value of the expression, with respect to the context"
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:372
#: ../../content/developer/tutorials/backend.rst:618
#: ../../content/developer/tutorials/getting_started/07_basicviews.rst:194
msgid "Domains"
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:374
msgid "Broadly speaking, domains in Odoo represent a set of records that matches some specified conditions. In javascript, they are usually represented either as a list of conditions (or of operators: `|`, `&` or `!` in prefix notation), or as string expressions. They don't have to be normalized (the `&` operator is implied if necessary). For example:"
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:394
msgid "String expressions are more powerful than list expressions: they can contain python expressions and unevaluated values, that depends on some evaluation context. However, manipulating string expressions is more difficult."
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:398
msgid "Since domains are quite important in the web client, Odoo provides a `Domain` class:"
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:412
msgid "Here is the `Domain` class description:"
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:416
msgid "a domain description"
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:421
msgid "a record object"
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:422
#: ../../content/developer/reference/frontend/owl_components.rst:471
#: ../../content/developer/reference/frontend/owl_components.rst:489
#: ../../content/developer/reference/frontend/owl_components.rst:492
#: ../../content/developer/reference/frontend/registries.rst:74
#: ../../content/developer/reference/frontend/services.rst:447
#: ../../content/developer/reference/frontend/services.rst:475
msgid "boolean"
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:424
msgid "Returns true if the record matches all the condition specified by the domain"
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:428
#: ../../content/developer/reference/frontend/hooks.rst:229
#: ../../content/developer/reference/frontend/hooks.rst:355
#: ../../content/developer/reference/frontend/owl_components.rst:474
#: ../../content/developer/reference/frontend/owl_components.rst:477
#: ../../content/developer/reference/frontend/owl_components.rst:480
#: ../../content/developer/reference/frontend/owl_components.rst:483
#: ../../content/developer/reference/frontend/owl_components.rst:495
#: ../../content/developer/reference/frontend/owl_components.rst:498
#: ../../content/developer/reference/frontend/owl_components.rst:525
#: ../../content/developer/reference/frontend/owl_components.rst:528
#: ../../content/developer/reference/frontend/owl_components.rst:531
#: ../../content/developer/reference/frontend/registries.rst:146
#: ../../content/developer/reference/frontend/services.rst:441
#: ../../content/developer/reference/frontend/services.rst:450
#: ../../content/developer/reference/frontend/services.rst:469
#: ../../content/developer/reference/user_interface/view_architectures.rst:0
msgid "string"
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:430
msgid "Returns a string description for the domain"
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:434
msgid "evaluation context"
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:435
#: ../../content/developer/reference/frontend/registries.rst:80
msgid "any[]"
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:437
msgid "Returns a list description for the domain. Note that this method takes an optional `context` object that will be used to replace all free variables."
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:444
msgid "The `Domain` class also provides 4 useful static methods to combine domains:"
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:463
#: ../../content/developer/reference/frontend/framework_overview.rst:471
#: ../../content/developer/reference/frontend/framework_overview.rst:487
msgid "a list of domain representations"
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:465
#: ../../content/developer/reference/frontend/framework_overview.rst:473
#: ../../content/developer/reference/frontend/framework_overview.rst:481
#: ../../content/developer/reference/frontend/framework_overview.rst:492
msgid "Domain"
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:467
msgid "Returns a domain representing the intersection of all domains."
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:475
msgid "Returns a domain representing the union of all domains."
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:479
msgid "a domain representation"
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:483
msgid "Returns a domain representing the negation of the domain argument"
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:489
msgid "an operator"
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:494
msgid "Returns a domain representing either the intersection or the union of all the domains, depending on the value of the operator argument."
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:500
msgid "Bus"
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:502
msgid "The web client :ref:`environment <frontend/framework/environment>` object contains an event bus, named `bus`. Its purpose is to allow various parts of the system to properly coordinate themselves, without coupling them. The `env.bus` is an owl `EventBus <https://github.com/odoo/owl/blob/master/doc/reference/event_bus.md>`_, that should be used for global events of interest."
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:514
msgid "Here is a list of the events that can be triggered on this bus:"
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:519
msgid "Message"
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:520
msgid "Payload"
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:521
msgid "Trigger"
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:522
msgid "``ACTION_MANAGER:UI-UPDATED``"
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:523
msgid "a mode indicating what part of the ui has been updated ('current', 'new' or 'fullscreen')"
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:524
msgid "the rendering of the action requested to the action manager is done"
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:525
msgid "``ACTION_MANAGER:UPDATE``"
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:526
msgid "next rendering info"
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:527
msgid "the action manager has finished computing the next interface"
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:528
msgid "``MENUS:APP-CHANGED``"
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:529
#: ../../content/developer/reference/frontend/framework_overview.rst:532
#: ../../content/developer/reference/frontend/framework_overview.rst:541
#: ../../content/developer/reference/frontend/framework_overview.rst:544
#: ../../content/developer/reference/frontend/framework_overview.rst:547
msgid "none"
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:530
msgid "the menu service's current app has changed"
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:531
msgid "``ROUTE_CHANGE``"
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:533
msgid "the url hash was changed"
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:534
msgid "``RPC:REQUEST``"
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:535
#: ../../content/developer/reference/frontend/framework_overview.rst:538
msgid "rpc id"
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:536
msgid "a rpc request has just started"
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:537
msgid "``RPC:RESPONSE``"
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:539
msgid "a rpc request is completed"
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:540
msgid "``WEB_CLIENT_READY``"
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:542
msgid "the web client has been mounted"
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:543
msgid "``FOCUS-VIEW``"
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:545
msgid "the main view should focus itself"
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:546
msgid "``CLEAR-CACHES``"
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:548
msgid "all internal caches should be cleared"
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:549
msgid "``CLEAR-UNCOMMITTED-CHANGES``"
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:550
msgid "list of functions"
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:551
msgid "all views with uncommitted changes should clear them, and push a callback in the list"
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:555
msgid "Browser Object"
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:557
msgid "The javascript framework also provides a special object ``browser`` that provides access to many browser APIs, like ``location``, ``localStorage`` or ``setTimeout``. For example, here is how one could use the ``browser.setTimeout`` function:"
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:569
msgid "It is mostly interesting for testing purposes: all code using the browser object can be tested easily by mocking the relevant functions for the duration of the test."
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:573
msgid "It contains the following content:"
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:577
msgid "`addEventListener`"
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:578
msgid "`cancelAnimationFrame`"
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:579
msgid "`clearInterval`"
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:580
msgid "`clearTimeout`"
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:581
msgid "`console`"
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:582
msgid "`Date`"
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:583
msgid "`fetch`"
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:584
msgid "`history`"
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:585
msgid "`localStorage`"
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:586
msgid "`location`"
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:587
msgid "`navigator`"
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:588
msgid "`open`"
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:589
msgid "`random`"
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:590
msgid "`removeEventListener`"
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:591
msgid "`requestAnimationFrame`"
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:592
msgid "`sessionStorage`"
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:593
msgid "`setInterval`"
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:594
msgid "`setTimeout`"
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:595
msgid "`XMLHttpRequest`"
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:602
msgid "Debug mode"
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:604
msgid "Odoo can sometimes operate in a special mode called the `debug` mode. It is used for two main purposes:"
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:607
msgid "display additional information/fields for some particular screens,"
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:608
msgid "provide some additional tools to help developer debug the Odoo interface."
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:610
msgid "The `debug` mode is described by a string. An empty string means that the `debug` mode is not active. Otherwise, it is active. If the string contains `assets` or `tests`, then the corresponding specific sub modes are activated (see below). Both modes can be active at the same time, for example with the string `assets,tests`."
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:615
msgid "The `debug` mode current value can be read in the :ref:`environment<frontend/framework/environment>`: `env.debug`."
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:620
msgid "To show menus, fields or view elements only in debug mode, you should target the group `base.group_no_one`:"
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:628
msgid ":ref:`Activate the debug mode <developer-mode>`"
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:634
msgid "Assets mode"
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:636
msgid "The `debug=assets` sub mode is useful to debug javascript code: once activated, the :ref:`assets<reference/assets>` bundles are no longer minified, and source-maps are generated as well. This makes it useful to debug all kind of javascript code."
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:643
msgid "Tests mode"
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:645
msgid "There is another sub mode named `tests`: if enabled, the server injects the bundle `web.assets_tests` in the page. This bundle contains mostly test tours (tours whose purpose is to test a feature, not to show something interesting to users). The `tests` mode is then useful to be able to run these tours."
msgstr ""
#: ../../content/developer/reference/frontend/framework_overview.rst:651
#: ../../content/developer/reference/frontend/owl_components.rst:98
msgid "`Owl Repository <https://github.com/odoo/owl>`_"
msgstr ""
#: ../../content/developer/reference/frontend/hooks.rst:5
msgid "Hooks"
msgstr ""
#: ../../content/developer/reference/frontend/hooks.rst:7
msgid "`Owl hooks <https://github.com/odoo/owl/blob/master/doc/reference/hooks.md>`_ are a way to factorize code, even if it depends on some component lifecycle. Most hooks provided by Owl are related to the lifecycle of a component, but some of them (such as `useComponent <https://github.com/odoo/owl/blob/master/doc/reference/hooks.md#usecomponent>`_) provide a way to build specific hooks."
msgstr ""
#: ../../content/developer/reference/frontend/hooks.rst:13
msgid "Using these hooks, it is possible to build many customized hooks that help solve a specific problem, or make some common tasks easier. The rest of this page documents the list of hooks provided by the Odoo web framework."
msgstr ""
#: ../../content/developer/reference/frontend/hooks.rst:22
#: ../../content/developer/reference/frontend/owl_components.rst:143
#: ../../content/developer/reference/frontend/services.rst:118
msgid "Short Description"
msgstr ""
#: ../../content/developer/reference/frontend/hooks.rst:23
msgid ":ref:`useAssets <frontend/hooks/useassets>`"
msgstr ""
#: ../../content/developer/reference/frontend/hooks.rst:24
msgid "load assets"
msgstr ""
#: ../../content/developer/reference/frontend/hooks.rst:25
msgid ":ref:`useAutofocus <frontend/hooks/useAutofocus>`"
msgstr ""
#: ../../content/developer/reference/frontend/hooks.rst:26
msgid "focus automatically an element referenced by autofocus"
msgstr ""
#: ../../content/developer/reference/frontend/hooks.rst:27
msgid ":ref:`useBus <frontend/hooks/usebus>`"
msgstr ""
#: ../../content/developer/reference/frontend/hooks.rst:28
msgid "subscribe and unsubscribe to a bus"
msgstr ""
#: ../../content/developer/reference/frontend/hooks.rst:29
msgid ":ref:`usePager <frontend/hooks/usepager>`"
msgstr ""
#: ../../content/developer/reference/frontend/hooks.rst:30
msgid "Display the pager of the control panel of a view."
msgstr ""
#: ../../content/developer/reference/frontend/hooks.rst:31
msgid ":ref:`usePosition <frontend/hooks/useposition>`"
msgstr ""
#: ../../content/developer/reference/frontend/hooks.rst:32
msgid "position an element relative to a target"
msgstr ""
#: ../../content/developer/reference/frontend/hooks.rst:33
msgid ":ref:`useSpellCheck <frontend/hooks/useSpellCheck>`"
msgstr ""
#: ../../content/developer/reference/frontend/hooks.rst:34
msgid "activate spellcheck on focus for input or textarea"
msgstr ""
#: ../../content/developer/reference/frontend/hooks.rst:39
msgid "useAssets"
msgstr ""
#: ../../content/developer/reference/frontend/hooks.rst:42
#: ../../content/developer/reference/frontend/hooks.rst:59
#: ../../content/developer/reference/frontend/hooks.rst:99
#: ../../content/developer/reference/frontend/hooks.rst:136
#: ../../content/developer/reference/frontend/hooks.rst:182
#: ../../content/developer/reference/frontend/hooks.rst:296
#: ../../content/developer/reference/frontend/owl_components.rst:167
#: ../../content/developer/reference/frontend/owl_components.rst:298
#: ../../content/developer/reference/frontend/owl_components.rst:337
#: ../../content/developer/reference/frontend/owl_components.rst:416
#: ../../content/developer/reference/frontend/owl_components.rst:695
#: ../../content/developer/reference/frontend/owl_components.rst:815
#: ../../content/developer/reference/frontend/owl_components.rst:866
#: ../../content/developer/reference/frontend/owl_components.rst:1044
msgid "Location"
msgstr ""
#: ../../content/developer/reference/frontend/hooks.rst:44
msgid "`@web/core/assets`"
msgstr ""
#: ../../content/developer/reference/frontend/hooks.rst:49
msgid "See the section on :ref:`lazy loading assets <frontend/assets/lazy_loading>` for more details."
msgstr ""
#: ../../content/developer/reference/frontend/hooks.rst:56
msgid "useAutofocus"
msgstr ""
#: ../../content/developer/reference/frontend/hooks.rst:61
#: ../../content/developer/reference/frontend/hooks.rst:101
#: ../../content/developer/reference/frontend/hooks.rst:298
msgid "`@web/core/utils/hooks`"
msgstr ""
#: ../../content/developer/reference/frontend/hooks.rst:66
msgid "Focus an element referenced by a t-ref=\"autofocus\" in the current component as soon as it appears in the DOM and if it was not displayed before."
msgstr ""
#: ../../content/developer/reference/frontend/hooks.rst:91
msgid "the element reference."
msgstr ""
#: ../../content/developer/reference/frontend/hooks.rst:96
msgid "useBus"
msgstr ""
#: ../../content/developer/reference/frontend/hooks.rst:106
msgid "Add and clear an event listener to a bus. This hook ensures that the listener is properly cleared when the component is unmounted."
msgstr ""
#: ../../content/developer/reference/frontend/hooks.rst:126
msgid "the target event bus"
msgstr ""
#: ../../content/developer/reference/frontend/hooks.rst:127
msgid "the name of the event that we want to listen to"
msgstr ""
#: ../../content/developer/reference/frontend/hooks.rst:128
msgid "listener callback"
msgstr ""
#: ../../content/developer/reference/frontend/hooks.rst:133
msgid "usePager"
msgstr ""
#: ../../content/developer/reference/frontend/hooks.rst:138
msgid "`@web/search/pager_hook`"
msgstr ""
#: ../../content/developer/reference/frontend/hooks.rst:143
msgid "Display the :ref:`Pager <frontend/pager>` of the control panel of a view. This hooks correctly sets `env.config` to provide the props to the pager."
msgstr ""
#: ../../content/developer/reference/frontend/hooks.rst:174
msgid "function that returns the pager props."
msgstr ""
#: ../../content/developer/reference/frontend/hooks.rst:179
msgid "usePosition"
msgstr ""
#: ../../content/developer/reference/frontend/hooks.rst:184
msgid "`@web/core/position_hook`"
msgstr ""
#: ../../content/developer/reference/frontend/hooks.rst:189
msgid "Helps positioning an HTMLElement (the `popper`) relatively to another HTMLElement (the `reference`). This hook ensures the positioning is updated when the window is resized/scrolled."
msgstr ""
#: ../../content/developer/reference/frontend/hooks.rst:210
msgid "You should indicate your `popper` element using a `t-ref directive <https://github.com/odoo/owl/blob/master/doc/reference/hooks.md#useref>`_."
msgstr ""
#: ../../content/developer/reference/frontend/hooks.rst:217
msgid "the target HTMLElement to be positioned from"
msgstr ""
#: ../../content/developer/reference/frontend/hooks.rst:219
msgid "the positioning options (see table below)"
msgstr ""
#: ../../content/developer/reference/frontend/hooks.rst:225
#: ../../content/developer/reference/frontend/hooks.rst:351
msgid "Option"
msgstr ""
#: ../../content/developer/reference/frontend/hooks.rst:228
msgid "`popper`"
msgstr ""
#: ../../content/developer/reference/frontend/hooks.rst:230
msgid "this is a `useRef reference <https://github.com/odoo/owl/blob/master/doc/reference/hooks.md#useref>`_ for the element that will get positioned. Default is `\"popper\"`."
msgstr ""
#: ../../content/developer/reference/frontend/hooks.rst:232
msgid "`container`"
msgstr ""
#: ../../content/developer/reference/frontend/hooks.rst:233
msgid "HTMLElement"
msgstr ""
#: ../../content/developer/reference/frontend/hooks.rst:234
msgid "the container from which the popper is expected not to overflow. If overflowing occurs, other popper positions are tried until a not overflowing one is found. (default: the `<html/>` node)"
msgstr ""
#: ../../content/developer/reference/frontend/hooks.rst:237
msgid "`margin`"
msgstr ""
#: ../../content/developer/reference/frontend/hooks.rst:238
msgid "number"
msgstr ""
#: ../../content/developer/reference/frontend/hooks.rst:239
msgid "added margin between popper and reference elements (default: `0`)"
msgstr ""
#: ../../content/developer/reference/frontend/hooks.rst:240
#: ../../content/developer/reference/frontend/owl_components.rst:497
msgid "`position`"
msgstr ""
#: ../../content/developer/reference/frontend/hooks.rst:241
msgid "Direction[-Variant]"
msgstr ""
#: ../../content/developer/reference/frontend/hooks.rst:242
msgid "the desired position. It is a string composed of one `Direction` and one `Variant` separated by a dash character. `Direction` could be: `top`, `bottom`, `right`, `left`. `Variant` could be: `start`, `middle`, `end`, `fit`. The variant can be omitted (default variant is `middle`). The `fit` variant means that the popper would have the exact same width or height, depending on the chosen direction. Examples of valid positions: `right-end`, `top-start`, `left-middle`, `left`, `bottom-fit`. (default position: `bottom`)"
msgstr ""
#: ../../content/developer/reference/frontend/hooks.rst:251
msgid "`onPositioned`"
msgstr ""
#: ../../content/developer/reference/frontend/hooks.rst:252
msgid "(el: HTMLElement, position: PositioningSolution) => void"
msgstr ""
#: ../../content/developer/reference/frontend/hooks.rst:253
msgid "a callback that will be called everytime a positioning occurs (e.g. on component mounted/patched, document scroll, window resize...). Can be used i.e. for dynamic styling regarding the current position. The `PositioningSolution` is an object having the following type: `{ direction: Direction, variant: Variant, top: number, left: number }`."
msgstr ""
#: ../../content/developer/reference/frontend/hooks.rst:293
msgid "useSpellCheck"
msgstr ""
#: ../../content/developer/reference/frontend/hooks.rst:303
msgid "Activate the spellcheck state to an input or textarea on focus by a `t-ref=\"spellcheck\"` in the current component. This state is then removed on blur, as well as the red outline, which improves readability of the content."
msgstr ""
#: ../../content/developer/reference/frontend/hooks.rst:307
msgid "The hook can also be used on any HTML element with the `contenteditable` attribute. To disable spellcheck completely on elements that might be enabled by the hook, set explicitly the `spellcheck` attribute as `false` on the element."
msgstr ""
#: ../../content/developer/reference/frontend/hooks.rst:313
msgid "In the following example, the spellcheck will be enabled on the first input, the textarea and the div with `contenteditable=\"true\"`."
msgstr ""
#: ../../content/developer/reference/frontend/hooks.rst:345
msgid "the spellcheck options (see table below)"
msgstr ""
#: ../../content/developer/reference/frontend/hooks.rst:354
msgid "`refName`"
msgstr ""
#: ../../content/developer/reference/frontend/hooks.rst:356
msgid "this is a `useRef reference <https://github.com/odoo/owl/blob/master/doc/reference/hooks.md#useref>`_ for the element that will be spellcheck enabled."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_modules.rst:5
msgid "Javascript Modules"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_modules.rst:7
msgid "Odoo supports three different kinds of javascript files:"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_modules.rst:9
msgid ":ref:`plain javascript files <frontend/modules/plain_js>` (no module system),"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_modules.rst:10
msgid ":ref:`native javascript module <frontend/modules/native_js>`."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_modules.rst:11
msgid ":ref:`Odoo modules <frontend/modules/odoo_module>` (using a custom module system),"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_modules.rst:13
msgid "As described in the :ref:`assets management page <reference/assets>`, all javascript files are bundled together and served to the browser. Note that native javascript files are processed by the Odoo server and transformed into Odoo custom modules."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_modules.rst:17
msgid "Let us briefly explain the purpose behind each kind of javascript file. Plain javascript files should be reserved only for external libraries and some small specific low level purposes. All new javascript files should be created in the native javascript module system. The custom module system is only useful for old, not yet converted files."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_modules.rst:26
msgid "Plain Javascript files"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_modules.rst:28
msgid "Plain javascript files can contain arbitrary content. It is advised to use the *iife* :dfn:`immediately invoked function execution` style when writing such a file:"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_modules.rst:39
msgid "The advantages of such files is that we avoid leaking local variables to the global scope."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_modules.rst:42
msgid "Clearly, plain javascript files do not offer the benefits of a module system, so one needs to be careful about the order in the bundle (since the browser will execute them precisely in that order)."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_modules.rst:47
msgid "In Odoo, all external libraries are loaded as plain javascript files."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_modules.rst:52
msgid "Native Javascript Modules"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_modules.rst:54
msgid "Most new Odoo javascript code should use the native javascript module system. This is simpler, and brings the benefits of a better developer experience with a better integration with the IDE."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_modules.rst:58
msgid "There is a very important point to know: Odoo needs to know which files should be translated into :ref:`Odoo modules <frontend/modules/odoo_module>` and which files should not be translated. This is an opt-in system: Odoo will look at the first line of a JS file and check if it contains the string *@odoo-module*. If so, it will automatically be converted to an Odoo module."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_modules.rst:64
msgid "For example, let us consider the following module, located in :file:`web/static/src/file_a.js`:"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_modules.rst:75
msgid "Note the comment in the first line: it describes that this file should be converted. Any file without this comment will be kept as-is (which will most likely be an error). This file will then be translated into an Odoo module that look like this:"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_modules.rst:94
msgid "So, as you can see, the transformation is basically adding `odoo.define` on top, and updating the import/export statements."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_modules.rst:97
msgid "Another important point is that the translated module has an official name: *@web/file_a*. This is the actual name of the module. Every relative imports will be converted as well. Every file located in an Odoo addon :file:`some_addon/static/src/path/to/file.js` will be assigned a name prefixed by the addon name like this: *@some_addon/path/to/file*."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_modules.rst:103
msgid "Relative imports work, but only if the modules are in the same Odoo addon. So, imagine that we have the following file structure:"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_modules.rst:119
msgid "The file :file:`file_b` can import :file:`file_a` like this:"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_modules.rst:126
msgid "But :file:`file_c` need to use the full name:"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_modules.rst:135
msgid "Aliased modules"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_modules.rst:137
msgid "Because :ref:`Odoo modules <frontend/modules/odoo_module>` follow a different module naming pattern, a system exists to allow a smooth transition towards the new system. Currently, if a file is converted to a module (and therefore follow the new naming convention), other files not yet converted to ES6-like syntax in the project won't be able to require the module. Aliases are here to map old names with new ones by creating a small proxy function. The module can then be called by its new *and* old name."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_modules.rst:143
msgid "To add such alias, the comment tag on top of the file should look like this:"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_modules.rst:154
msgid "Then, the translated module will also create an alias with the requested name:"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_modules.rst:162
msgid "The default behaviour of aliases is to re-export the ``default`` value of the module they alias. This is because \"classic\" modules generally export a single value which would be used directly, roughly matching the semantics of default exports. However it is also possible to delegate more directly, and follow the exact behaviour of the aliased module:"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_modules.rst:178
msgid "In that case, this will define an alias with exactly the values exported by the original module:"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_modules.rst:188
msgid "Only one alias can be defined using this method. If you were to need another one to have, for example, three names to call the same module, you would have to add a proxy manually. This is not good practice and should be avoided unless there is no other options."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_modules.rst:193
#: ../../content/developer/reference/user_interface/view_architectures.rst:3158
msgid "Limitations"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_modules.rst:195
msgid "For performance reasons, Odoo does not use a full javascript parser to transform native modules. There are, therefore, a number of limitations including but not limited to:"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_modules.rst:199
msgid "an `import` or `export` keyword cannot be preceded by a non-space character,"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_modules.rst:200
msgid "a multiline comment or string cannot have a line starting by `import` or `export`"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_modules.rst:226
msgid "when you export an object, it can't contain a comment"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_modules.rst:253
msgid "Odoo needs a way to determine if a module is described by a path (like :file:`./views/form_view`) or a name (like `web.FormView`). It has to use a heuristic to do just that: if there is a `/` in the name, it is considered a path. This means that Odoo does not really support module names with a `/` anymore."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_modules.rst:258
msgid "As \"classic\" modules are not deprecated and there is currently no plan to remove them, you can and should keep using them if you encounter issues with, or are constrained by the limitations of, native modules. Both styles can coexist within the same Odoo addon."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_modules.rst:266
msgid "Odoo Module System"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_modules.rst:268
msgid "Odoo has defined a small module system (located in the file :file:`addons/web/static/src/js/boot.js`, which needs to be loaded first). The Odoo module system, inspired by AMD, works by defining the function `define` on the global odoo object. We then define each javascript module by calling that function. In the Odoo framework, a module is a piece of code that will be executed as soon as possible. It has a name and potentially some dependencies. When its dependencies are loaded, a module will then be loaded as well. The value of the module is then the return value of the function defining the module."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_modules.rst:277
msgid "As an example, it may look like this:"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_modules.rst:301
msgid "An alternative way to define a module is to give explicitly a list of dependencies in the second argument."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_modules.rst:316
msgid "If some dependencies are missing/non ready, then the module will simply not be loaded. There will be a warning in the console after a few seconds."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_modules.rst:319
msgid "Note that circular dependencies are not supported. It makes sense, but it means that one needs to be careful."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_modules.rst:323
msgid "Defining a module"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_modules.rst:325
msgid "The `odoo.define` method is given three arguments:"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_modules.rst:327
msgid "`moduleName`: the name of the javascript module. It should be a unique string. The convention is to have the name of the odoo addon followed by a specific description. For example, `web.Widget` describes a module defined in the `web` addon, which exports a `Widget` class (because the first letter is capitalized)"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_modules.rst:332
msgid "If the name is not unique, an exception will be thrown and displayed in the console."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_modules.rst:335
msgid "`dependencies`: the second argument is optional. If given, it should be a list of strings, each corresponding to a javascript module. This describes the dependencies that are required to be loaded before the module is executed. If the dependencies are not explicitly given here, then the module system will extract them from the function by calling toString on it, then using a regexp to find all the `require` statements."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_modules.rst:353
msgid "finally, the last argument is a function which defines the module. Its return value is the value of the module, which may be passed to other modules requiring it. Note that there is a small exception for asynchronous modules, see the next section."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_modules.rst:358
msgid "If an error happens, it will be logged (in debug mode) in the console:"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_modules.rst:360
msgid "`Missing dependencies`: These modules do not appear in the page. It is possible that the JavaScript file is not in the page or that the module name is wrong"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_modules.rst:363
msgid "`Failed modules`: A javascript error is detected"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_modules.rst:365
msgid "`Rejected modules`: The module returns a rejected Promise. It (and its dependent modules) is not loaded."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_modules.rst:368
msgid "`Rejected linked modules`: Modules who depend on a rejected module"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_modules.rst:370
msgid "`Non loaded modules`: Modules who depend on a missing or a failed module"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_modules.rst:374
msgid "Asynchronous modules"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_modules.rst:376
msgid "It can happen that a module needs to perform some work before it is ready. For example, it could do an rpc to load some data. In that case, the module can simply return a promise. The module system will simply wait for the promise to complete before registering the module."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:7
msgid "Javascript Reference"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:9
msgid "This document presents the Odoo Javascript framework. This framework is not a large application in term of lines of code, but it is quite generic, because it is basically a machine to turn a declarative interface description into a live application, able to interact with every model and records in the database. It is even possible to use the web client to modify the interface of the web client."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:19
msgid "The Javascript framework is designed to work with three main use cases:"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:21
msgid "the *web client*: this is the private web application, where one can view and edit business data. This is a single page application (the page is never reloaded, only the new data is fetched from the server whenever it is needed)"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:24
msgid "the *website*: this is the public part of Odoo. It allows an unidentified user to browse some content, to shop or to perform many actions, as a client. This is a classical website: various routes with controllers and some javascript to make it work."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:28
msgid "the *point of sale*: this is the interface for the point of sale. It is a specialized single page application."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:31
msgid "Some javascript code is common to these three use cases, and is bundled together (see below in the assets section). This document will focus mostly on the web client design."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:36
msgid "Web client"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:39
msgid "Single Page Application"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:41
msgid "In short, the *webClient*, instance of *WebClient* is the root component of the whole user interface. Its responsibility is to orchestrate all various subcomponents, and to provide services, such as rpcs, local storage and more."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:45
msgid "In runtime, the web client is a single page application. It does not need to request a full page from the server each time the user perform an action. Instead, it only requests what it needs, and then replaces/updates the view. Also, it manages the url: it is kept in sync with the web client state."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:50
msgid "It means that while a user is working on Odoo, the web client class (and the action manager) actually creates and destroys many sub components. The state is highly dynamic, and each widget could be destroyed at any time."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:55
msgid "Overview of web client JS code"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:57
msgid "Here, we give a very quick overview on the web client code, in the *web/static/src/js* addon. Note that it is deliberately not exhaustive. We only cover the most important files/folders."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:61
msgid "*boot.js*: this is the file that defines the module system. It needs to be loaded first."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:63
msgid "*core/*: this is a collection of lower level building blocks. Notably, it contains the class system, the widget system, concurrency utilities, and many other class/functions."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:66
msgid "*chrome/*: in this folder, we have most large widgets which make up most of the user interface."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:68
msgid "*chrome/abstract_web_client.js* and *chrome/web_client.js*: together, these files define the WebClient widget, which is the root widget for the web client."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:70
msgid "*chrome/action_manager.js*: this is the code that will convert an action into a widget (for example a kanban or a form view)"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:72
msgid "*chrome/search_X.js* all these files define the search view (it is not a view in the point of view of the web client, only from the server point of view)"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:74
msgid "*fields*: all main view field widgets are defined here"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:75
msgid "*views*: this is where the views are located"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:79
msgid "What to do if a file is not loaded/updated"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:81
msgid "There are many different reasons why a file may not be properly loaded. Here are a few things you can try to solve the issue:"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:84
msgid "once the server is started, it does not know if an asset file has been modified. So, you can simply restart the server to regenerate the assets."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:86
msgid "check the console (in the dev tools, usually opened with F12) to make sure there are no obvious errors"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:88
msgid "try to add a `console.log()` at the beginning of your file (before any module definition), so you can see if a file has been loaded or not"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:90
msgid "when in any debug mode, there is an option in the debug manager menu (bug icon) to force the server to update its assets files."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:92
msgid "use the *debug=assets* mode. This will actually bypass the asset bundles (note that it does not actually solve the issue. The server still uses outdated bundles)"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:94
msgid "finally, the most convenient way to do it, for a developer, is to start the server with the *--dev=all* option. This activates the file watcher options, which will automatically invalidate assets when necessary. Note that it does not work very well if the OS is Windows."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:98
msgid "remember to refresh your page!"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:99
msgid "or maybe to save your code file..."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:102
msgid "Once an asset file has been recreated, you need to refresh the page, to reload the proper files (if that does not work, the files may be cached)."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:107
msgid "Loading Javascript Code"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:109
msgid "Large applications are usually broken up into smaller files, that need to be connected together. Some file may need to use some part of code defined in another file. There are two ways of sharing code between files:"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:113
msgid "use the global scope (the *window* object) to write/read references to some objects or functions,"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:116
msgid "use a module system that will provide a way for each modules to export or import values, and will make sure that they are loaded in a proper order."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:119
msgid "While it's possible to work in the global scope, this has a number of issues:"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:121
msgid "It is difficult to ensure that implementation details are not exposed by work done in the global scope directly."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:123
msgid "Dependencies are implicit, leading to fragile and unreliable load ordering."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:125
msgid "The lack of insight into execution means it's impossible to use various optimisations (e.g. deferred and asynchronous loading)."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:128
msgid "Module systems help resolve these issues: because modules specify their dependencies the module system can ensure the necessary order of loading is respected, and because modules can precisely specify their exports it is less likely that they will leak implementation details."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:132
msgid "For most Odoo code, we want to use a module system. Because of the way assets work in Odoo (and in particular, the fact that each installed odoo addon can modify the list of files contained in a bundle), Odoo has to resolve modules browser side. To do that, Odoo provides a small module system described just below (see :ref:`frontend/modules/odoo_module`)."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:138
msgid "However, Odoo also provides support for native javascript modules (see :ref:`frontend/modules/native_js`). These modules will simply be translated by the server into odoo modules. It is encouraged to write all javascript code as a native module, for a better IDE integration. In the future, the Odoo module system should be considered an implementation detail, not the primary way to write javascript code."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:146
msgid "Native javascript modules are the primary way to define javascript code."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:149
msgid "Class System"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:151
msgid "Odoo was developed before ECMAScript 6 classes were available. In Ecmascript 5, the standard way to define a class is to define a function and to add methods on its prototype object. This is fine, but it is slightly complex when we want to use inheritance, mixins."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:156
msgid "For these reasons, Odoo decided to use its own class system, inspired by John Resig. The base Class is located in *web.Class*, in the file *class.js*."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:162
msgid "Note that the custom class system should be avoided for creating new code. It will be deprecated at some point, and then removed. New classes should use the standard ES6 class system."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:168
msgid "Creating a subclass"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:170
msgid "Let us discuss how classes are created. The main mechanism is to use the *extend* method (this is more or less the equivalent of *extend* in ES6 classes)."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:192
msgid "In this example, the *init* function is the constructor. It will be called when an instance is created. Making an instance is done by using the *new* keyword."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:196
#: ../../content/developer/reference/user_interface/view_records.rst:169
#: ../../content/developer/tutorials/backend.rst:521
msgid "Inheritance"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:198
msgid "It is convenient to be able to inherit an existing class. This is simply done by using the *extend* method on the superclass. When a method is called, the framework will secretly rebind a special method: *_super* to the currently called method. This allows us to use *this._super* whenever we need to call a parent method."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:222
msgid "Mixins"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:224
msgid "The odoo Class system does not support multiple inheritance, but for those cases when we need to share some behaviour, we have a mixin system: the *extend* method can actually take an arbitrary number of arguments, and will combine all of them in the new class."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:244
msgid "In this example, the *Hamster* class is a subclass of Animal, but it also mix the DanceMixin in."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:248
msgid "Patching an existing class"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:250
msgid "It is not common, but we sometimes need to modify another class *in place*. The goal is to have a mechanism to change a class and all future/present instances. This is done by using the *include* method:"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:266
msgid "This is obviously a dangerous operation and should be done with care. But with the way Odoo is structured, it is sometimes necessary in one addon to modify the behavior of a widget/class defined in another addon. Note that it will modify all instances of the class, even if they have already been created."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:272
#: ../../content/developer/reference/frontend/javascript_reference.rst:1993
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:95
msgid "Widgets"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:274
msgid "The *Widget* class is really an important building block of the user interface. Pretty much everything in the user interface is under the control of a widget. The Widget class is defined in the module *web.Widget*, in *widget.js*."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:278
msgid "In short, the features provided by the Widget class include:"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:280
msgid "parent/child relationships between widgets (*PropertiesMixin*)"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:281
msgid "extensive lifecycle management with safety features (e.g. automatically destroying children widgets during the destruction of a parent)"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:283
msgid "automatic rendering with :ref:`qweb <reference/qweb>`"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:284
msgid "various utility functions to help interacting with the outside environment."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:286
msgid "Here is an example of a basic counter widget:"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:307
msgid "For this example, assume that the template *some.template* (and is properly loaded: the template is in a file, which is properly defined in the assets of the module manifest, see :ref:`assets <reference/assets>`.) is given by:"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:319
msgid "This example widget can be used in the following manner:"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:328
msgid "This example illustrates a few of the features of the *Widget* class, including the event system, the template system, the constructor with the initial *parent* argument."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:332
msgid "Widget Lifecycle"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:334
msgid "Like many component systems, the widget class has a well defined lifecycle. The usual lifecycle is the following: *init* is called, then *willStart*, then the rendering takes place, then *start* and finally *destroy*."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:340
msgid "this is the constructor. The init method is supposed to initialize the base state of the widget. It is synchronous and can be overridden to take more parameters from the widget's creator/parent"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:344
msgid "the new widget's parent, used to handle automatic destruction and event propagation. Can be ``null`` for the widget to have no parent."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:351
msgid "this method will be called once by the framework when a widget is created and in the process of being appended to the DOM. The *willStart* method is a hook that should return a promise. The JS framework will wait for this promise to complete before moving on to the rendering step. Note that at this point, the widget does not have a DOM root element. The *willStart* hook is mostly useful to perform some asynchronous work, such as fetching data from the server"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:360
msgid "This step is automatically done by the framework. What happens is that the framework checks if a template key is defined on the widget. If that is the case, then it will render that template with the *widget* key bound to the widget in the rendering context (see the example above: we use *widget.count* in the QWeb template to read the value from the widget). If no template is defined, we read the *tagName* key and create a corresponding DOM element. When the rendering is done, we set the result as the $el property of the widget. After this, we automatically bind all events in the events and custom_events keys."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:372
msgid "when the rendering is complete, the framework will automatically call the *start* method. This is useful to perform some specialized post-rendering work. For example, setting up a library."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:376
msgid "Must return a promise to indicate when its work is done."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:378
msgid "promise"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:382
msgid "This is always the final step in the life of a widget. When a widget is destroyed, we basically perform all necessary cleanup operations: removing the widget from the component tree, unbinding all events, ..."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:386
msgid "Automatically called when the widget's parent is destroyed, must be called explicitly if the widget has no parent or if it is removed but its parent remains."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:390
msgid "Note that the willStart and start method are not necessarily called. A widget can be created (the *init* method will be called) and then destroyed (*destroy* method) without ever having been appended to the DOM. If that is the case, the willStart and start will not even be called."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:396
msgid "Widget API"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:400
msgid "Used if the widget has no template defined. Defaults to ``div``, will be used as the tag name to create the DOM element to set as the widget's DOM root. It is possible to further customize this generated DOM root with the following attributes:"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:408
msgid "Used to generate an ``id`` attribute on the generated DOM root. Note that this is rarely needed, and is probably not a good idea if a widget can be used more than once."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:414
msgid "Used to generate a ``class`` attribute on the generated DOM root. Note that it can actually contain more than one css class: *'some-class other-class'*"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:420
msgid "Mapping (object literal) of attribute names to attribute values. Each of these k:v pairs will be set as a DOM attribute on the generated DOM root."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:426
msgid "raw DOM element set as root to the widget (only available after the start lifecycle method)"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:431
msgid "jQuery wrapper around :attr:`~Widget.el`. (only available after the start lifecycle method)"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:436
msgid "Should be set to the name of a :ref:`QWeb template <reference/qweb>`. If set, the template will be rendered after the widget has been initialized but before it has been started. The root element generated by the template will be set as the DOM root of the widget."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:443
msgid "Events are a mapping of an event selector (an event name and an optional CSS selector separated by a space) to a callback. The callback can be the name of a widget's method or a function object. In either case, the ``this`` will be set to the widget:"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:457
msgid "The selector is used for jQuery's event delegation, the callback will only be triggered for descendants of the DOM root matching the selector. If the selector is left out (only an event name is specified), the event will be set directly on the widget's DOM root."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:463
msgid "Note: the use of an inline function is discouraged, and will probably be removed sometimes in the future."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:468
msgid "this is almost the same as the *events* attribute, but the keys are arbitrary strings. They represent business events triggered by some sub widgets. When an event is triggered, it will 'bubble up' the widget tree (see the section on component communication for more details)."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:475
msgid "``true`` if the widget is being or has been destroyed, ``false`` otherwise"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:480
msgid "Applies the CSS selector specified as parameter to the widget's DOM root:"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:487
msgid "is functionally identical to:"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:493
msgid "CSS selector"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:494
msgid "jQuery object"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:496
msgid "this helper method is similar to ``Backbone.View.$``"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:500
msgid "Re-sets the widget's DOM root to the provided element, also handles re-setting the various aliases of the DOM root as well as unsetting and re-setting delegated events."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:504
msgid "a DOM element or jQuery object to set as the widget's DOM root"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:508
msgid "Inserting a widget in the DOM"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:512
msgid "Renders the widget and inserts it as the last child of the target, uses `.appendTo()`_"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:517
msgid "Renders the widget and inserts it as the first child of the target, uses `.prependTo()`_"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:522
msgid "Renders the widget and inserts it as the preceding sibling of the target, uses `.insertAfter()`_"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:527
msgid "Renders the widget and inserts it as the following sibling of the target, uses `.insertBefore()`_"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:530
msgid "All of these methods accept whatever the corresponding jQuery method accepts (CSS selectors, DOM nodes or jQuery objects). They all return a promise and are charged with three tasks:"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:534
msgid "rendering the widget's root element via :func:`~Widget.renderElement`"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:535
msgid "inserting the widget's root element in the DOM using whichever jQuery method they match"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:537
msgid "starting the widget, and returning the result of starting it"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:540
msgid "Widget Guidelines"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:542
msgid "Identifiers (``id`` attribute) should be avoided. In generic applications and modules, ``id`` limits the re-usability of components and tends to make code more brittle. Most of the time, they can be replaced with nothing, classes or keeping a reference to a DOM node or jQuery element."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:547
msgid "If an ``id`` is absolutely necessary (because a third-party library requires one), the id should be partially generated using ``_.uniqueId()`` e.g.:"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:554
msgid "Avoid predictable/common CSS class names. Class names such as \"content\" or \"navigation\" might match the desired meaning/semantics, but it is likely an other developer will have the same need, creating a naming conflict and unintended behavior. Generic class names should be prefixed with e.g. the name of the component they belong to (creating \"informal\" namespaces, much as in C or Objective-C)."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:561
msgid "Global selectors should be avoided. Because a component may be used several times in a single page (an example in Odoo is dashboards), queries should be restricted to a given component's scope. Unfiltered selections such as ``$(selector)`` or ``document.querySelectorAll(selector)`` will generally lead to unintended or incorrect behavior. Odoo Web's :class:`~Widget` has an attribute providing its DOM root (:attr:`~Widget.$el`), and a shortcut to select nodes directly (:func:`~Widget.$`)."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:570
msgid "More generally, never assume your components own or controls anything beyond its own personal :attr:`~Widget.$el` (so, avoid using a reference to the parent widget)"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:574
msgid "Html templating/rendering should use QWeb unless absolutely trivial."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:576
msgid "All interactive components (components displaying information to the screen or intercepting DOM events) must inherit from :class:`~Widget` and correctly implement and use its API and life cycle."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:580
msgid "Make sure to wait for start to be finished before using $el e.g.:"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:612
msgid "QWeb Template Engine"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:614
msgid "The web client uses the :doc:`qweb` template engine to render widgets (unless they override the *renderElement* method to do something else). The Qweb JS template engine is based on XML, and is mostly compatible with the python implementation."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:619
msgid "The web client will wait for that list of template (included into the current asset) to be loaded, before starting its first widget."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:623
msgid "Event system"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:625
msgid "There are currently two event systems supported by Odoo: a simple system which allows adding listeners and triggering events, and a more complete system that also makes events 'bubble up'."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:629
msgid "Both of these event systems are implemented in the *EventDispatcherMixin*, in the file *mixins.js*. This mixin is included in the *Widget* class."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:633
msgid "Base Event system"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:635
msgid "This event system was historically the first. It implements a simple bus pattern. We have 4 main methods:"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:638
msgid "*on*: this is used to register a listener on an event."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:639
msgid "*off*: useful to remove events listener."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:640
msgid "*once*: this is used to register a listener that will only be called once."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:641
msgid "*trigger*: trigger an event. This will cause each listeners to be called."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:643
msgid "Here is an example on how this event system could be used:"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:668
msgid "the use of this event system is discouraged, we plan to replace each *trigger* method by the *trigger_up* method from the extended event system"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:672
msgid "Extended Event System"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:674
msgid "The custom event widgets is a more advanced system, which mimic the DOM events API. Whenever an event is triggered, it will 'bubble up' the component tree, until it reaches the root widget, or is stopped."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:678
msgid "*trigger_up*: this is the method that will create a small *OdooEvent* and dispatch it in the component tree. Note that it will start with the component that triggered the event"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:681
msgid "*custom_events*: this is the equivalent of the *event* dictionary, but for odoo events."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:684
msgid "The OdooEvent class is very simple. It has three public attributes: *target* (the widget that triggered the event), *name* (the event name) and *data* (the payload). It also has 2 methods: *stopPropagation* and *is_stopped*."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:688
msgid "The previous example can be updated to use the custom event system:"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:716
msgid "A common need in the Odoo ecosystem is to extend/change the behaviour of the base system from the outside (by installing an application, i.e. a different module). For example, one may need to add a new widget type in some views. In that case, and many others, the usual process is to create the desired component, then add it to a registry (registering step), to make the rest of the web client aware of its existence."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:723
msgid "There are a few registries available in the system:"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:738
msgid "field registry (exported by :js:data:`web.field_registry`)"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:726
msgid "The field registry contains all field widgets known to the web client. Whenever a view (typically form or list/kanban) needs a field widget, this is where it will look. A typical use case look like this:"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:738
msgid "Note that each value should be a subclass of *AbstractField*"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:743
msgid "view registry"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:741
msgid "This registry contains all JS views known to the web client (and in particular, the view manager). Each value of this registry should be a subclass of *AbstractView*."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:749
msgid "action registry"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:746
msgid "We keep track of all client actions in this registry. This is where the action manager looks up whenever it needs to create a client action. In version 11, each value should simply be a subclass of *Widget*. However, in version 12, the values are required to be *AbstractAction*."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:752
msgid "Communication between widgets"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:754
msgid "There are many ways to communicate between components."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:762
msgid "From a parent to its child"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:757
msgid "This is a simple case. The parent widget can simply call a method on its child:"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:789
msgid "From a widget to its parent/some ancestor"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:765
msgid "In this case, the widget's job is simply to notify its environment that something happened. Since we do not want the widget to have a reference to its parent (this would couple the widget with its parent's implementation), the best way to proceed is usually to trigger an event, which will bubble up the component tree, by using the ``trigger_up`` method:"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:775
msgid "This event will be triggered on the widget, then will bubble up and be eventually caught by some upstream widget:"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:819
msgid "Cross component"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:792
msgid "Cross component communication can be achieved by using a bus. This is not the preferred form of communication, because it has the disadvantage of making the code harder to maintain. However, it has the advantage of decoupling the components. In that case, this is simply done by triggering and listening to events on a bus. For example:"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:824
msgid "In version 11.0, we introduced the notion of *service*. The main idea is to give to sub components a controlled way to access their environment, in a way that allow the framework enough control, and which is testable."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:828
msgid "The service system is organized around three ideas: services, service providers and widgets. The way it works is that widgets trigger (with *trigger_up*) events, these events bubble up to a service provider, which will ask a service to perform a task, then maybe return an answer."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:834
msgid "Service"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:836
msgid "A service is an instance of the *AbstractService* class. It basically only has a name and a few methods. Its job is to perform some work, typically something depending on the environment."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:840
msgid "For example, we have the *ajax* service (job is to perform a rpc), the *localStorage* (interact with the browser local storage) and many others."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:843
msgid "Here is a simplified example on how the ajax service is implemented:"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:856
msgid "This service is named 'ajax' and define one method, *rpc*."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:859
msgid "Service Provider"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:861
msgid "For services to work, it is necessary that we have a service provider ready to dispatch the custom events. In the *backend* (web client), this is done by the main web client instance. Note that the code for the service provider comes from the *ServiceProviderMixin*."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:867
msgid "Widget"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:869
msgid "The widget is the part that requests a service. In order to do that, it simply triggers an event *call_service* (typically by using the helper function *call*). This event will bubble up and communicate the intent to the rest of the system."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:873
msgid "In practice, some functions are so frequently called that we have some helpers functions to make them easier to use. For example, the *_rpc* method is a helper that helps making a rpc."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:889
msgid "If a widget is destroyed, it will be detached from the main component tree and will not have a parent. In that case, the events will not bubble up, which means that the work will not be done. This is usually exactly what we want from a destroyed widget."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:895
msgid "RPCs"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:897
msgid "The rpc functionality is supplied by the ajax service. But most people will probably only interact with the *_rpc* helpers."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:900
msgid "There are typically two usecases when working on Odoo: one may need to call a method on a (python) model (this goes through a controller *call_kw*), or one may need to directly call a controller (available on some route)."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:904
msgid "Calling a method on a python model:"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:914
msgid "Directly calling a controller:"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:924
msgid "Notifications"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:926
msgid "The Odoo framework has a standard way to communicate various information to the user: notifications, which are displayed on the top right of the user interface."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:929
msgid "There are two types of notifications:"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:931
msgid "*notification*: useful to display some feedback. For example, whenever a user unsubscribed to a channel."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:934
msgid "*warning*: useful to display some important/urgent information. Typically most kind of (recoverable) errors in the system."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:937
msgid "Also, notifications can be used to ask a question to the user without disturbing its workflow. Imagine a phone call received through VOIP: a sticky notification could be displayed with two buttons *Accept* and *Decline*."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:942
msgid "Notification system"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:944
msgid "The notification system in Odoo is designed with the following components:"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:946
msgid "a *Notification* widget: this is a simple widget that is meant to be created and displayed with the desired information"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:949
msgid "a *NotificationService*: a service whose responsibility is to create and destroy notifications whenever a request is done (with a custom_event). Note that the web client is a service provider."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:953
msgid "a client action *display_notification*: this allows to trigger the display of a notification from python (e.g. in the method called when the user clicked on a button of type object)."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:957
msgid "an helper function in *ServiceMixin*: *displayNotification*"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:960
msgid "Displaying a notification"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:962
msgid "The most common way to display a notification is by using the method that come from the *ServiceMixin*:"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:985
msgid "*displayNotification(options)*:"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:966
msgid "Display a notification with the following *options*:"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:968
msgid "*title*: string, optional. This will be displayed on the top as a title."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:970
msgid "*subtitle*: string, optional. This will be displayed on the top as a subtitle."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:973
msgid "*message*: string, optional. The content of the notification. Do not forget to escape your message via the markup function if needed."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:976
msgid "*sticky*: boolean, optional (default false). If true, the notification will stay until the user dismisses it. Otherwise, the notification will be automatically closed after a short delay."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:980
msgid "*type*: string, optional (default 'warning'). Determines the style of the notification. Possible values: 'info', 'success', 'warning', 'danger', ''."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:983
msgid "*className*: string, optional. This is a css class name that will be automatically added to the notification. This could be useful for styling purpose, even though its use is discouraged."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:987
msgid "Here are two examples on how to use these methods:"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1002
msgid "Here an example in python:"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1019
msgid "Systray"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1021
msgid "The Systray is the right part of the menu bar in the interface, where the web client displays a few widgets, such as a messaging menu."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1024
msgid "When the SystrayMenu is created by the menu, it will look for all registered widgets and add them as a sub widget at the proper place."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1027
msgid "There is currently no specific API for systray widgets. They are supposed to be simple widgets, and can communicate with their environment just like other widgets with the *trigger_up* method."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1032
msgid "Adding a new Systray Item"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1034
msgid "There is no systray registry. The proper way to add a widget is to add it to the class variable SystrayMenu.items."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1048
msgid "Ordering"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1050
msgid "Before adding the widget to himself, the Systray Menu will sort the items by a sequence property. If that property is not present on the prototype, it will use 50 instead. So, to position a systray item to be on the right, one can set a very high sequence number (and conversely, a low number to put it on the left)."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1061
msgid "Translation management"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1063
msgid "Some translations are made on the server side (basically all text strings rendered or processed by the server), but there are strings in the static files that need to be translated. The way it currently works is the following:"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1067
msgid "each translatable string is tagged with the special function *_t* (available in the JS module *web.core*"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1069
msgid "these strings are used by the server to generate the proper PO files"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1070
msgid "whenever the web client is loaded, it will call the route */web/webclient/translations*, which returns a list of all translatable terms"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1072
msgid "in runtime, whenever the function *_t* is called, it will look up in this list in order to find a translation, and return it or the original string if none is found."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1076
msgid "Note that translations are explained in more details, from the server point of view, in the document :doc:`/developer/howtos/translations`."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1079
msgid "There are two important functions for the translations in javascript: *_t* and *_lt*. The difference is that *_lt* is lazily evaluated."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1098
msgid "In this example, the *_lt* is necessary because the translations are not ready when the module is loaded."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1101
msgid "Note that translation functions need some care. The string given in argument should not be dynamic."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1105
msgid "Session"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1107
msgid "There is a specific module provided by the web client which contains some information specific to the user current *session*. Some notable keys are"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1110
msgid "uid: the current user ID (its ID as a *res.users*)"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1111
msgid "user_name: the user name, as a string"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1112
msgid "the user context (user ID, language and timezone)"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1113
msgid "partner_id: the ID of the partner associated to the current user"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1114
msgid "db: the name of the database currently being in use"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1117
msgid "Adding information to the session"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1119
msgid "When the /web route is loaded, the server will inject some session information in the template a script tag. The information will be read from the method *session_info* of the model *ir.http*. So, if one wants to add a specific information, it can be done by overriding the session_info method and adding it to the dictionary."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1139
msgid "Now, the value can be obtained in javascript by reading it in the session:"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1147
msgid "Note that this mechanism is designed to reduce the amount of communication needed by the web client to be ready. It is more appropriate for data which is cheap to compute (a slow session_info call will delay the loading for the web client for everyone), and for data which is required early in the initialization process."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1156
msgid "The word 'view' has more than one meaning. This section is about the design of the javascript code of the views, not the structure of the *arch* or anything else."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1160
msgid "In 2017, Odoo replaced the previous view code with a new architecture. The main need was to separate the rendering logic from the model logic."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1163
msgid "Views (in a generic sense) are now described with 4 pieces: a View, a Controller, a Renderer and a Model. The API of these 4 pieces is described in the AbstractView, AbstractController, AbstractRenderer and AbstractModel classes."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1184
msgid "the View is the factory. Its job is to get a set of fields, arch, context and some other parameters, then to construct a Controller/Renderer/Model triplet."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1187
msgid "The view's role is to properly setup each piece of the MVC pattern, with the correct information. Usually, it has to process the arch string and extract the data necessary for each other parts of the view."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1191
msgid "Note that the view is a class, not a widget. Once its job has been done, it can be discarded."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1194
msgid "the Renderer has one job: representing the data being viewed in a DOM element. Each view can render the data in a different way. Also, it should listen on appropriate user actions and notify its parent (the Controller) if necessary."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1198
msgid "The Renderer is the V in the MVC pattern."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1200
msgid "the Model: its job is to fetch and hold the state of the view. Usually, it represents in some way a set of records in the database. The Model is the owner of the 'business data'. It is the M in the MVC pattern."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1204
msgid "the Controller: its job is to coordinate the renderer and the model. Also, it is the main entry point for the rest of the web client. For example, when the user changes something in the search view, the *update* method of the controller will be called with the appropriate information."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1209
msgid "It is the C in the MVC pattern."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1212
msgid "The JS code for the views has been designed to be usable outside of the context of a view manager/action manager. They could be used in a client action, or, they could be displayed in the public website (with some work on the assets)."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1221
msgid "A good part of the web client experience is about editing and creating data. Most of that work is done with the help of field widgets, which are aware of the field type and of the specific details on how a value should be displayed and edited."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1228
msgid "Decorations"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1230
msgid "Like the list view, field widgets have a simple support for decorations. The goal of decorations is to have a simple way to specify a text color depending on the record current state. For example:"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1238
msgid "The valid decoration names are:"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1240
msgid "`decoration-bf`"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1241
msgid "`decoration-it`"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1242
msgid "`decoration-danger`"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1243
msgid "`decoration-info`"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1244
msgid "`decoration-muted`"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1245
msgid "`decoration-primary`"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1246
msgid "`decoration-success`"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1247
msgid "`decoration-warning`"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1249
msgid "Each decoration *decoration-X* will be mapped to a css class *text-X*, which is a standard bootstrap css class (except for *text-it* and *text-bf*, which are handled by odoo and correspond to italic and bold, respectively). Note that the value of the decoration attribute should be a valid python expression, which will be evaluated with the record as evaluation context."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1256
msgid "Non-relational fields"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1258
msgid "We document here all non relational fields available by default, in no particular order."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1292
msgid "Integer (`integer`)"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1262
msgid "This is the default field type for fields of type `integer`."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1264
#: ../../content/developer/reference/frontend/javascript_reference.rst:1474
msgid "Supported field types: `integer`"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1266
#: ../../content/developer/reference/frontend/javascript_reference.rst:1307
#: ../../content/developer/reference/frontend/javascript_reference.rst:1380
#: ../../content/developer/reference/frontend/javascript_reference.rst:1404
#: ../../content/developer/reference/frontend/javascript_reference.rst:1421
#: ../../content/developer/reference/frontend/javascript_reference.rst:1453
#: ../../content/developer/reference/frontend/javascript_reference.rst:1504
#: ../../content/developer/reference/frontend/javascript_reference.rst:1538
#: ../../content/developer/reference/frontend/javascript_reference.rst:1568
#: ../../content/developer/reference/frontend/javascript_reference.rst:1601
#: ../../content/developer/reference/frontend/javascript_reference.rst:1637
#: ../../content/developer/reference/frontend/javascript_reference.rst:1663
#: ../../content/developer/reference/frontend/javascript_reference.rst:1699
#: ../../content/developer/reference/frontend/javascript_reference.rst:1784
#: ../../content/developer/reference/frontend/javascript_reference.rst:1814
#: ../../content/developer/reference/frontend/javascript_reference.rst:1884
#: ../../content/developer/reference/frontend/javascript_reference.rst:1899
#: ../../content/developer/reference/frontend/javascript_reference.rst:1910
#: ../../content/developer/reference/frontend/javascript_reference.rst:1958
#: ../../content/developer/reference/frontend/javascript_reference.rst:1987
msgid "Options:"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1268
#: ../../content/developer/reference/frontend/javascript_reference.rst:1309
msgid "`type`: setting the input type (`\"text\"` by default, can be set on `\"number\"`)"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1270
#: ../../content/developer/reference/frontend/javascript_reference.rst:1311
msgid "In edit mode, the field is rendered as an input with the HTML attribute type set on `\"number\"` (so user can benefit the native support, especially on mobile). In this case, the default formatting is disabled to avoid incompability."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1278
#: ../../content/developer/reference/frontend/javascript_reference.rst:1319
msgid "`step`: set the step to the value up and down when the user click on buttons (only for input of type number, `1` by default)"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1285
#: ../../content/developer/reference/frontend/javascript_reference.rst:1326
msgid "`format`: should the number be formatted. (`true` by default)"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1287
#: ../../content/developer/reference/frontend/javascript_reference.rst:1328
msgid "By default, numbers are formatted according to locale parameters. This option will prevent the field's value from being formatted."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1333
msgid "Float (`float`)"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1295
msgid "This is the default field type for fields of type `float`."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1297
#: ../../content/developer/reference/frontend/javascript_reference.rst:1340
#: ../../content/developer/reference/frontend/javascript_reference.rst:1347
#: ../../content/developer/reference/frontend/javascript_reference.rst:1356
msgid "Supported field types: `float`"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1299
#: ../../content/developer/reference/frontend/javascript_reference.rst:1558
#: ../../content/developer/reference/frontend/javascript_reference.rst:1733
#: ../../content/developer/reference/frontend/javascript_reference.rst:1767
#: ../../content/developer/reference/frontend/javascript_reference.rst:1807
#: ../../content/developer/reference/frontend/javascript_reference.rst:1878
msgid "Attributes:"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1301
msgid "`digits`: displayed precision"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1340
msgid "Time (`float_time`)"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1336
msgid "The goal of this widget is to display properly a float value that represents a time interval (in hours). So, for example, `0.5` should be formatted as `0:30`, or `4.75` correspond to `4:45`."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1347
msgid "Float Factor (`float_factor`)"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1343
msgid "This widget aims to display properly a float value that converted using a factor given in its options. So, for example, the value saved in database is `0.5` and the factor is `3`, the widget value should be formatted as `1.5`."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1360
msgid "Float Toggle (`float_toggle`)"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1350
msgid "The goal of this widget is to replace the input field by a button containing a range of possible values (given in the options). Each click allows the user to loop in the range. The purpose here is to restrict the field value to a predefined selection. Also, the widget support the factor conversion as the `float_factor` widget (Range values should be the result of the conversion)."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1365
msgid "Boolean (`boolean`)"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1363
msgid "This is the default field type for fields of type `boolean`."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1365
#: ../../content/developer/reference/frontend/javascript_reference.rst:1649
#: ../../content/developer/reference/frontend/javascript_reference.rst:1655
msgid "Supported field types: `boolean`"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1370
msgid "Char (`char`)"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1368
msgid "This is the default field type for fields of type `char`."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1370
#: ../../content/developer/reference/frontend/javascript_reference.rst:1481
#: ../../content/developer/reference/frontend/javascript_reference.rst:1489
#: ../../content/developer/reference/frontend/javascript_reference.rst:1498
#: ../../content/developer/reference/frontend/javascript_reference.rst:1520
#: ../../content/developer/reference/frontend/javascript_reference.rst:1527
#: ../../content/developer/reference/frontend/javascript_reference.rst:1731
msgid "Supported field types: `char`"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1394
msgid "Date (`date`)"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1375
msgid "This is the default field type for fields of type `date`. It consists of a text box and a date picker."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1378
msgid "Supported field types: `date`"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1382
msgid "`min_date` / `max_date`: sets limit dates for accepted values. By default, the earliest accepted date is **1000-01-01** and the latest is **9999-12-31**. Accepted values are SQL-formatted dates (`yyyy-MM-dd HH:mm:ss`) or `\"today\"`."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1390
msgid "warn_future: displays a warning if the value is in the future (based on today)."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1414
msgid "Date & Time (`datetime`)"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1399
msgid "This is the default field type for fields of type `datetime`. The values are always in the client's timezone."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1402
msgid "Supported field types: `datetime`"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1406
msgid "see :ref:`Date Field <reference/javascript_reference/date_field>` options"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1408
msgid "`rounding`: increment used to generate available minutes in the time picker. This does not affect the actual value, just the amount of available options in the select dropdown (default: `5`)."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1437
msgid "Date Range (`daterange`)"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1417
msgid "This widget allows the user to select start and end date from a single picker."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1419
#: ../../content/developer/reference/frontend/javascript_reference.rst:1444
msgid "Supported field types: `date`, `datetime`"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1423
msgid "see :ref:`Date Field <reference/javascript_reference/date_field>` or :ref:`Date & Time Field <reference/javascript_reference/datetime_field>` options"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1425
msgid "`start_date_field`: field used to get/set the start value of the date range (cannot be used with `end_date_field`)."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1432
msgid "`end_date_field`: field used to get/set the end value of the date range (cannot be used with `start_date_field`)."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1444
msgid "Remaining Days (`remaining_days`)"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1440
msgid "This widget can be used on date and datetime fields. In readonly, it displays the delta (in days) between the value of the field and today. The widget turns into a regular date or datetime field in edit mode."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1459
msgid "Monetary (`monetary`)"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1447
msgid "This is the default field type for fields of type `monetary`. It is used to display a currency. If there is a currency fields given in option, it will use that, otherwise it will fall back to the default currency (in the session)"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1451
msgid "Supported field types: `monetary`, `float`"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1455
msgid "`currency_field`: another field name which should be a many2one on currency."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1465
msgid "Text (`text`)"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1462
msgid "This is the default field type for fields of type `text`."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1464
msgid "Supported field types: `text`"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1475
msgid "Handle (`handle`)"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1468
msgid "This field's job is to be displayed as a `handle`, and allows reordering the various records by drag and dropping them."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1471
msgid "It has to be specified on the field by which records are sorted."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1472
msgid "Having more than one field with a handle widget on the same list is not supported."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1481
msgid "Email (`email`)"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1478
msgid "This field displays email address. The main reason to use it is that it is rendered as an anchor tag with the proper href, in readonly mode."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1489
msgid "Phone (`phone`)"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1484
msgid "This field displays a phone number. The main reason to use it is that it is rendered as an anchor tag with the proper href, in readonly mode, but only in some cases: we only want to make it clickable if the device can call this particular number."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1508
msgid "URL (`url`)"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1492
msgid "This field displays an url (in readonly mode). The main reason to use it is that it is rendered as an anchor tag with the proper css classes and href."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1495
msgid "Also, the text of the anchor tag can be customized with the *text* attribute (it won't change the href value)."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1506
msgid "`website_path`: (default: `false`) by default, the widget forces (if not already the case) the href value to begin with `\"http://\"` except if this option is set to `true`, thus allowing redirections to the database's own website."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1520
msgid "Domain (`domain`)"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1511
msgid "The `domain` field allows the user to construct a technical-prefix domain thanks to a tree-like interface and see the selected records in real time. In debug mode, an input is also there to be able to enter the prefix char domain directly (or to build advanced domains the tree-like interface does not allow to)."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1517
msgid "Note that this is limited to **static** domains (no dynamic expressions, or access to context variable)."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1527
msgid "Link button (`link_button`)"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1523
msgid "The `LinkButton` widget actually simply displays a span with an icon and the text value as content. The link is clickable and will open a new browser window with its value as url."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1551
msgid "Image File (`image`)"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1530
msgid "This widget is used to represent a binary value as an image. In some cases, the server returns a `bin_size` instead of the real image (a `bin_size` is a string representing a file size, such as `\"6.5kb\"`). In that case, the widget will make an image with a source attribute corresponding to an image on the server."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1536
#: ../../content/developer/reference/frontend/javascript_reference.rst:1556
msgid "Supported field types: `binary`"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1540
msgid "`preview_image`: if the image is only loaded as a `bin_size`, then this option is useful to inform the web client that the default field name is not the name of the current field, but the name of another field."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1548
msgid "`accepted_file_extensions`: the file extension the user can pick from the file input dialog box (default value is `\"image/\\*\"`)"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1551
#: ../../content/developer/reference/frontend/javascript_reference.rst:1572
#: ../../content/developer/reference/frontend/javascript_reference.rst:1903
msgid "(cf: ``accept`` attribute on `<input type=\"file\" />`)"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1572
msgid "Binary File (`binary`)"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1554
msgid "Generic widget to allow saving/downloading a binary file."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1560
msgid "`filename`: saving a binary file will lose its file name, since it only saves the binary value. The file name can be saved in another field. To do that, a `filename` attribute should be set to a field present in the view."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1570
#: ../../content/developer/reference/frontend/javascript_reference.rst:1901
msgid "`accepted_file_extensions`: the file extension the user can pick from the file input dialog box"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1581
msgid "Priority (`priority`)"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1575
msgid "This widget is rendered as a set of stars, allowing the user to click on it to select a value or not. This is useful for example to mark a task as high priority."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1579
msgid "Note that this widget also works in `readonly` mode, which is unusual."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1581
#: ../../content/developer/reference/frontend/javascript_reference.rst:1599
#: ../../content/developer/reference/frontend/javascript_reference.rst:1626
#: ../../content/developer/reference/frontend/javascript_reference.rst:1635
#: ../../content/developer/reference/frontend/javascript_reference.rst:1765
msgid "Supported field types: `selection`"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1593
msgid "Image Attachment (`attachment_image`)"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1584
msgid "Image widget for `many2one` fields. If the field is set, this widget will be rendered as an image with the proper src url. This widget does not have a different behaviour in edit or readonly mode, it is only useful to view an image."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1589
#: ../../content/developer/reference/frontend/javascript_reference.rst:1805
#: ../../content/developer/reference/frontend/javascript_reference.rst:1850
#: ../../content/developer/reference/frontend/javascript_reference.rst:1859
msgid "Supported field types: `many2one`"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1617
msgid "Label Selection (`label_selection`)"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1596
msgid "This widget renders a simple non-editable label. This is only useful to display some information, not to edit it."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1603
msgid "`classes`: a mapping from a selection value to a CSS class name"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1630
msgid "State Selection (`state_selection`)"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1620
msgid "This is a specialized selection widget. It assumes that the record has some hardcoded fields, present in the view: `stage_id`, `legend_normal`, `legend_blocked`, `legend_done`. This is mostly used to display and change the state of a task in a project, with additional information displayed in the dropdown."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1643
msgid "State Selection - List View (`list.state_selection`)"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1633
msgid "In list views, the `state_selection` field displays by default the label next to the icon."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1639
msgid "`hide_label`: hide the label next to the icon"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1649
msgid "Favorite (`boolean_favorite`)"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1646
msgid "This widget is displayed as an empty (or not) star, depending on a boolean value. Note that it also can be edited in readonly mode."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1655
msgid "Toggle (`boolean_toggle`)"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1652
msgid "Displays a toggle switch to represent a boolean. This is a subfield of the `boolean` field, mostly used to have a different look."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1680
msgid "Stat Info (`statinfo`)"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1658
msgid "This widget is meant to represent statistical information in a `stat button`. It is basically just a label with a number."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1661
#: ../../content/developer/reference/frontend/javascript_reference.rst:1688
#: ../../content/developer/reference/frontend/javascript_reference.rst:1697
msgid "Supported field types: `integer`, `float`"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1665
msgid "`label_field`: if given, the widget will use the value of the `label_field` as text."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1692
msgid "Percent Pie (`percentpie`)"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1683
msgid "This widget is meant to represent statistical information in a `stat button`. This is similar to a statinfo widget, but the information is represented in a **pie chart** (empty to full). Note that the value is interpreted as a percentage (a number between `0` and `100`)."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1723
msgid "Progress Bar (`progressbar`)"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1695
msgid "Represent a value as a progress bar (from `0` to some value)"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1701
msgid "`editable`: boolean determining whether the `value` is editable"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1703
msgid "`current_value`: get the current value from the field that must be present in the view"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1705
msgid "`max_value`: get the maximum value from the field that must be present in the view"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1707
msgid "`edit_max_value`: boolean determining whether the `max_value` is editable"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1709
msgid "`title`: title of the bar, displayed on top of the bar"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1711
msgid "-> not translated, use `title` attribute (not option) instead if the term must be translated"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1739
msgid "Journal Dashboard Graph (`dashboard_graph`)"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1726
msgid "This is a more specialized widget, useful to display a graph representing a set of data. For example, it is used in the accounting dashboard kanban view."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1729
msgid "It assumes that the field is a JSON serialization of a set of data."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1735
msgid "`graph_type`: string, can be either `\"line\"` or `\"bar\"`"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1745
msgid "Ace Editor (`ace`)"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1742
msgid "This widget is intended to be used on Text fields. It provides Ace Editor for editing XML and Python."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1745
msgid "Supported field types: `char`, `text`"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1758
msgid "Badge (`badge`)"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1748
msgid "Displays the value inside a bootstrap badge pill."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1750
msgid "Supported field types: `char`, `selection`, `many2one`"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1752
msgid "By default, the badge has a light grey background, but it can be customized by using the :ref:`Decoration <reference/javascript_reference/field_decoration>` mechanism. For instance, to display a red badge under a given condition:"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1763
msgid "Selection (`selection`)"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1769
msgid "`placeholder`: a string which is used to display some info when no value is selected"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1790
msgid "Radio (`radio`)"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1776
msgid "This is a subfield of `FielSelection`, but specialized to display all the valid choices as radio buttons."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1779
msgid "Note that if used on a many2one records, then more rpcs will be done to fetch the name_gets of the related records."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1782
#: ../../content/developer/reference/frontend/javascript_reference.rst:1796
#: ../../content/developer/reference/frontend/javascript_reference.rst:1978
msgid "Supported field types: `selection`, `many2one`"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1786
msgid "`horizontal`: if `true`, radio buttons will be displayed horizontally."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1800
msgid "Badge Selection (`selection_badge`)"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1793
msgid "This is a subfield of `selection` field, but specialized to display all the valid choices as rectangular badges."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1839
msgid "Many2one (`many2one`)"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1803
msgid "Default widget for many2one fields."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1809
msgid "`can_create`: allow the creation of related records (takes precedence over `no_create` option)"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1812
msgid "`can_write`: allow the editing of related records (default: `true`)"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1816
msgid "`quick_create`: allow the quick creation of related records (default: `true`)"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1818
msgid "`no_create`: prevent the creation of related records - hide both the **Create \"xxx\"** and **Create and Edit** dropdown menu items (default: `false`)"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1821
msgid "`no_quick_create`: prevent the quick creation of related records - hide the **Create \"xxx\"** dropdown menu item (default: `false`)"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1824
msgid "`no_create_edit`: hide the **Create and Edit** dropdown menu item (default: `false`)"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1826
msgid "`create_name_field`: when creating a related record, if this option is set, the value of the `create_name_field` will be filled with the value of the input (default: `name`)"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1830
msgid "`always_reload`: boolean, default to `false`. If `true`, the widget will always do an additional `name_get` to fetch its name value. This is used for the situations where the `name_get` method is overridden (please do not do that)"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1834
msgid "`no_open`: boolean, default to `false`. If set to `true`, the many2one will not redirect on the record when clicking on it (in readonly mode)"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1850
msgid "Many2one Barcode (`many2one_barcode`)"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1842
msgid "Widget for `many2one` fields allows to open the camera from a mobile device (Android/iOS) to scan a barcode."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1844
msgid "Specialization of `many2one` field where the user is allowed to use the native camera to scan a barcode. Then it uses `name_search` to search this value."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1847
msgid "If this widget is set and user is not using the mobile application, it will fallback to regular `many2one` (`Many2OneField`)"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1859
msgid "Many2one Avatar (`many2one_avatar`)"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1853
msgid "This widget is only supported on `many2one` fields pointing to a model which inherits from `image.mixin`. In readonly, it displays the image of the related record next to its `display_name`. Note that the `display_name` isn't a clickable link in this case. In edit, it behaves exactly like the regular `many2one`."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1866
msgid "Many2one Avatar User (`many2one_avatar_user`)"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1862
msgid "This widget is a specialization of the `Many2OneAvatar`. When the avatar is clicked, we open a chat window with the corresponding user. This widget can only be set on `many2one` fields pointing to the `res.users` model."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1866
msgid "Supported field types: `many2one` (pointing to `res.users`)"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1871
msgid "Many2one Avatar Employee (`many2one_avatar_employee`)"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1869
msgid "Same as `many2one_avatar_user`, but for `many2one` fields pointing to `hr.employee`."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1871
msgid "Supported field types: `many2one` (pointing to `hr.employee`)"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1890
msgid "Many2many (`many2many`)"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1874
msgid "Default widget for `many2many` fields."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1876
#: ../../content/developer/reference/frontend/javascript_reference.rst:1897
#: ../../content/developer/reference/frontend/javascript_reference.rst:1908
#: ../../content/developer/reference/frontend/javascript_reference.rst:1936
#: ../../content/developer/reference/frontend/javascript_reference.rst:1941
#: ../../content/developer/reference/frontend/javascript_reference.rst:1950
msgid "Supported field types: `many2many`"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1880
msgid "`mode`: string, default view to display"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1882
msgid "`domain`: restrict the data to a specific domain"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1886
msgid "`create_text`: allow the customization of the text displayed when adding a new record"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1888
msgid "`link`: domain determining whether records can be added to the relation (default: `true`)."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1890
msgid "`unlink`: domain determining whether records can be removed from the relation (default: `true`)."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1903
msgid "Many2many Binary File (`many2many_binary`)"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1893
msgid "This widget helps the user to upload or delete one or more files at the same time."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1895
msgid "Note that this widget is specific to the model `ir.attachment`."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1930
msgid "Many2many Tags (`many2many_tags`)"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1906
msgid "Display a `many2many` field as a list of tags."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1912
msgid "`create`: domain determining whether or not new tags can be created (default: `true`)."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1918
msgid "`color_field`: the name of a numeric field, which should be present in the view. A color will be chosen depending on its value."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1925
msgid "`no_edit_color`: set to `true` to remove the possibility to change the color of the tags (default: `false`)."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1936
msgid "Many2many Tags - Form View (`form.many2many_tags`)"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1933
msgid "Specialization of `many2many_tags` widget for form views. It has some extra code to allow editing the color of a tag."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1941
msgid "Many2many Tags - Kanban View (`kanban.many2many_tags`)"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1939
msgid "Specialization of `many2many_tags` widget for kanban views."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1950
msgid "Many2many Checkboxes (`many2many_checkboxes`)"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1944
msgid "This field displays a list of checkboxes and allows the user to select a subset of the choices. Note that the number of displayed values is limited to `100`. This limit isn't customizable. It simply allows to handle extreme cases where this widget is wrongly set on a field with a huge comodel. In those cases, a list view is more adequate as it allows pagination and filtering."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1972
msgid "One2many (`one2many`)"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1953
msgid "Default widget for `one2many` fields. It usually displays data in a sub list view, or a sub kanban view."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1956
msgid "Supported field types: `one2many`"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1960
msgid "`create`: domain determining whether or not related records can be created (default: `true`)."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1962
msgid "`delete`: domain determining whether or not related records can be deleted (default: `true`)."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1968
msgid "`create_text`: a string that is used to customize the 'Add' label/text."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1978
msgid "Status Bar (`statusbar`)"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1975
msgid "This is a field specific to the form views. It is the bar on top of many forms which represent a flow, and allow selecting a specific state."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1990
msgid "Reference (`reference`)"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1981
msgid "The `reference` field is a combination of a select (for the model) and a `many2one` field (for its value). It allows the selection of a record on an arbitrary model."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1985
msgid "Supported field types: `char`, `reference`"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1989
msgid "`model_field`: name of an `ir.model` containing the model of the records that can be selected. When this option is set, the select part of the `reference` field isn't displayed."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:2001
msgid "Week Days (`week_days`)"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:1996
msgid "This widget displays a list of checkboxes for week days, 1 checkbox for each day and allow the user to select a subset of the choices."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:2004
msgid "Client actions"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:2006
msgid "The idea of a client action is a customized widget that is integrated into the web client interface, just like an *act_window_action*. This is useful when you need a component that is not closely linked to an existing view or a specific model. For example, the Discuss application is actually a client action."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:2012
msgid "A client action is a term that has various meanings, depending on the context:"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:2014
msgid "from the perspective of the server, it is a record of the model *ir_action*, with a field *tag* of type char"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:2016
msgid "from the perspective of the web client, it is a widget, which inherits from the class AbstractAction, and is supposed to be registered in the action registry under the corresponding key (from the field char)"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:2020
msgid "Whenever a menu item is associated with a client action, opening it will simply fetch the action definition from the server, then lookup into its action registry to get the Widget definition at the appropriate key, and finally, it will instantiate and append the widget to the proper place in the DOM."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:2026
msgid "Adding a client action"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:2028
msgid "A client action is a widget that will control the part of the screen below the menu bar. It can have a control panel, if necessary. Defining a client action can be done in two steps: implementing a new widget and registering the widget in the action registry."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:2043
msgid "Implementing a new client action."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:2034
msgid "This is done by creating a widget:"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:2065
msgid "Registering the client action:"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:2046
msgid "As usual, we need to make the web client aware of the mapping between client actions and the actual class:"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:2056
msgid "Then, to use the client action in the web client, we need to create a client action record (a record of the model ``ir.actions.client``) with the proper ``tag`` attribute:"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:2068
msgid "Using the control panel"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:2070
msgid "By default, the client action does not display a control panel. To do that, several steps should be done."
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:2073
msgid "Set the *hasControlPanel* to *true*. In the widget code:"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:2083
msgid "Call the method *updateControlPanel* whenever we need to update the control panel. For example:"
msgstr ""
#: ../../content/developer/reference/frontend/javascript_reference.rst:2112
msgid "The ``updateControlPanel`` is the main method to customize the content in the control panel. For more information, look into the `control_panel_renderer.js <https://github.com/odoo/odoo/blob/17.0/addons/web/static/src/js/views/control_panel/control_panel_renderer.js#L130>`_ file."
msgstr ""
#: ../../content/developer/reference/frontend/mobile.rst:5
msgid "Mobile JavaScript"
msgstr ""
#: ../../content/developer/reference/frontend/mobile.rst:10
msgid "In Odoo 10.0 we released a mobile app which allows you to access all **Odoo apps** (even your customized modules)."
msgstr ""
#: ../../content/developer/reference/frontend/mobile.rst:13
msgid "The application is a combination of **Odoo Web** and **Native Mobile components**. In other words it is a Odoo Web instance loaded inside a native, mobile, WebView container."
msgstr ""
#: ../../content/developer/reference/frontend/mobile.rst:16
msgid "This page documents how you can access mobile native components like Camera, Vibration, Notification and Toast through Odoo Web (via JavaScript). For this, you do not need to be a mobile developer, if you know Odoo JavaScript API you can access all available mobile features."
msgstr ""
#: ../../content/developer/reference/frontend/mobile.rst:22
msgid "These features work with **Odoo Enterprise 10.0+** only"
msgstr ""
#: ../../content/developer/reference/frontend/mobile.rst:25
msgid "How does it work?"
msgstr ""
#: ../../content/developer/reference/frontend/mobile.rst:27
msgid "Internal workings of the mobile application:"
msgstr ""
#: ../../content/developer/reference/frontend/mobile.rst:31
msgid "Of course, it is a web page that loads on a Mobile Native Web container. But it is integrated in such a way that you can access native resources from your web JavaScript."
msgstr ""
#: ../../content/developer/reference/frontend/mobile.rst:35
msgid "WebPages (Odoo Web) is on the top of each layer, where the second layer is a Bridge between Odoo Web (JS) and the native mobile components."
msgstr ""
#: ../../content/developer/reference/frontend/mobile.rst:38
msgid "When any call from JavaScript is triggered it passes through Bridge and Bridge passes it to the native invoker to perform that action."
msgstr ""
#: ../../content/developer/reference/frontend/mobile.rst:41
msgid "When the native component has done its work, it is passed to the Bridge again and you get the output in JavaScript."
msgstr ""
#: ../../content/developer/reference/frontend/mobile.rst:44
msgid "Process time taken by the Native component depends on what you are requesting from the Native resources. For example the Camera or GPS Location."
msgstr ""
#: ../../content/developer/reference/frontend/mobile.rst:48
msgid "How to use it?"
msgstr ""
#: ../../content/developer/reference/frontend/mobile.rst:50
msgid "Just like the Odoo Web Framework, the Mobile API can be used anywhere by getting the object from **web_mobile.rpc**"
msgstr ""
#: ../../content/developer/reference/frontend/mobile.rst:55
msgid "The mobile RPC object provides a list of methods that are available (this only works with the mobile app)."
msgstr ""
#: ../../content/developer/reference/frontend/mobile.rst:58
msgid "Check if the method is available and then execute it."
msgstr ""
#: ../../content/developer/reference/frontend/mobile.rst:61
msgid "Methods"
msgstr ""
#: ../../content/developer/reference/frontend/mobile.rst:63
msgid "Each of the methods returns a JQuery Deferred object which returns a data JSON dictionary"
msgstr ""
#: ../../content/developer/reference/frontend/mobile.rst:67
msgid "Show Toast in device"
msgstr ""
#: ../../content/developer/reference/frontend/mobile.rst:71
msgid "**message** text to display"
msgstr ""
#: ../../content/developer/reference/frontend/mobile.rst:73
msgid "A toast provides simple feedback about an operation in a small popup. It only fills the amount of space required for the message and the current activity remains visible and interactive."
msgstr ""
#: ../../content/developer/reference/frontend/mobile.rst:84
msgid "Vibrating device"
msgstr ""
#: ../../content/developer/reference/frontend/mobile.rst:88
msgid "Vibrates constantly for the specified period of time (in milliseconds)."
msgstr ""
#: ../../content/developer/reference/frontend/mobile.rst:91
msgid "Vibrate mobile device with given duration."
msgstr ""
#: ../../content/developer/reference/frontend/mobile.rst:98
msgid "Show snackbar with action"
msgstr ""
#: ../../content/developer/reference/frontend/mobile.rst:102
msgid "(*required*) **Message** to show in snackbar and action **button label** in Snackbar (optional)"
msgstr ""
#: ../../content/developer/reference/frontend/mobile.rst:103
msgid "``True`` if the user clicks on the Action button, ``False`` if SnackBar auto dismissed after some time."
msgstr ""
#: ../../content/developer/reference/frontend/mobile.rst:105
msgid "Snackbars provide lightweight feedback about an operation. They show a brief message at the bottom of the screen on mobile or in the lower left corner on larger devices. Snackbars appear above all the other elements on the screen and only one can be displayed at a time."
msgstr ""
#: ../../content/developer/reference/frontend/mobile.rst:123
msgid "Showing notification"
msgstr ""
#: ../../content/developer/reference/frontend/mobile.rst:127
msgid "**title** (first row) of the notification, **message** (second row) of the notification, in a standard notification."
msgstr ""
#: ../../content/developer/reference/frontend/mobile.rst:129
msgid "A notification is a message you can display to the user outside of your application's normal UI. When you tell the system to issue a notification, it first appears as an icon in the notification area. To see the details of the notification, the user opens the notification drawer. Both the notification area and the notification drawer are system-controlled areas that the user can view at any time."
msgstr ""
#: ../../content/developer/reference/frontend/mobile.rst:144
msgid "Create contact in device"
msgstr ""
#: ../../content/developer/reference/frontend/mobile.rst:148
msgid "Dictionary with contact details. Possible keys (name, mobile, phone, fax, email, website, street, street2, country_id, state_id, city, zip, parent_id, function and image)"
msgstr ""
#: ../../content/developer/reference/frontend/mobile.rst:150
msgid "Create a new device contact with the given contact details."
msgstr ""
#: ../../content/developer/reference/frontend/mobile.rst:177
msgid "Scanning barcodes"
msgstr ""
#: ../../content/developer/reference/frontend/mobile.rst:181
msgid "Scanned ``code`` from any barcode"
msgstr ""
#: ../../content/developer/reference/frontend/mobile.rst:183
msgid "The barcode API detects barcodes in real-time, on the device, in any orientation."
msgstr ""
#: ../../content/developer/reference/frontend/mobile.rst:185
msgid "The barcode API can read the following barcode formats:"
msgstr ""
#: ../../content/developer/reference/frontend/mobile.rst:187
msgid "1D barcodes: EAN-13, EAN-8, UPC-A, UPC-E, Code-39, Code-93, Code-128, ITF, Codabar"
msgstr ""
#: ../../content/developer/reference/frontend/mobile.rst:188
msgid "2D barcodes: QR Code, Data Matrix, PDF-417, AZTEC"
msgstr ""
#: ../../content/developer/reference/frontend/mobile.rst:199
msgid "Switching account in device"
msgstr ""
#: ../../content/developer/reference/frontend/mobile.rst:203
msgid "Use switchAccount to switch from one account to another on the device."
msgstr ""
#: ../../content/developer/reference/frontend/odoo_editor.rst:3
msgid "Odoo Editor"
msgstr ""
#: ../../content/developer/reference/frontend/odoo_editor.rst:5
msgid "Odoo Editor is Odoo's own rich text editor. Its sources can be found in the `odoo-editor directory <https://github.com/odoo/odoo/blob/17.0/addons/web_editor/static/src/js/editor/odoo-editor>`_."
msgstr ""
#: ../../content/developer/reference/frontend/odoo_editor.rst:10
msgid "Powerbox"
msgstr ""
#: ../../content/developer/reference/frontend/odoo_editor.rst:12
msgid "The Powerbox is a piece of user interface that contains :ref:`commands <reference/frontend/odoo_editor/powerbox/command>` organized into :ref:`categories <reference/frontend/odoo_editor/powerbox/category>`. It appears when typing `/` in the editor. The commands can be filtered when the user inputs text, and navigated with the arrow keys."
msgstr ""
#: ../../content/developer/reference/frontend/odoo_editor.rst:-1
msgid "The Powerbox opened after typing \"/\"."
msgstr ""
#: ../../content/developer/reference/frontend/odoo_editor.rst:23
msgid "Modifying the Powerbox"
msgstr ""
#: ../../content/developer/reference/frontend/odoo_editor.rst:25
msgid "Only one Powerbox should be instantiated at the time, and that job is done by the editor itself. Its Powerbox instance can be found in its `powerbox` instance variable. To change the Powerbox's contents and options, change the options passed to the editor before it gets instantiated."
msgstr ""
#: ../../content/developer/reference/frontend/odoo_editor.rst:32
msgid "Never instantiate the Powerbox yourself. Always use the current editor's own instance instead."
msgstr ""
#: ../../content/developer/reference/frontend/odoo_editor.rst:36
msgid "Say we want to add a new command `Document` to the Powerbox, just for the `mass_mailing` module. We want to add it to a new category called `Documentation` and we want it all the way at the top of the Powerbox."
msgstr ""
#: ../../content/developer/reference/frontend/odoo_editor.rst:40
msgid "`mass_mailing` `extends <https://github.com/odoo/odoo/blob/17.0/addons/mass_mailing/static/src/js/wysiwyg.js>`_ `web_editor`'s `Wysiwyg class <https://github.com/odoo/odoo/blob/17.0/addons/web_editor/static/src/js/wysiwyg/wysiwyg.js>`_, which instantiates the editor in its `start` method. Before doing so, it calls its own `_getPowerboxOptions` method, which can conveniently be overridden to add our new commands."
msgstr ""
#: ../../content/developer/reference/frontend/odoo_editor.rst:48
msgid "Since `mass_mailing` already overrides `_getPowerboxOptions`, let's just add our new command to it:"
msgstr ""
#: ../../content/developer/reference/frontend/odoo_editor.rst:71
msgid "In order to allow the names and descriptions of your commands and categories to be translated, make sure to wrap them in the `_t` function."
msgstr ""
#: ../../content/developer/reference/frontend/odoo_editor.rst:75
msgid "To avoid out-of-control escalations, don't use random numbers for your priorities: look at which other priorities already exist and choose your value accordingly (like you would do for a `z-index`)."
msgstr ""
#: ../../content/developer/reference/frontend/odoo_editor.rst:80
msgid "Opening a custom Powerbox"
msgstr ""
#: ../../content/developer/reference/frontend/odoo_editor.rst:82
msgid "It is possible to open the Powerbox with a custom set of categories and commands, bypassing all pre-existing ones. To do that, call the `open` method of the Powerbox and pass it your custom commands and categories."
msgstr ""
#: ../../content/developer/reference/frontend/odoo_editor.rst:-1
msgid "The Powerbox opened with custom categories and commands when pasting an\n"
"image URL."
msgstr ""
#: ../../content/developer/reference/frontend/odoo_editor.rst:92
msgid "We need the current instance of the Powerbox, which can be found in the current editor. In the `Wysiwyg class <https://github.com/odoo/odoo/blob/17.0/addons/web_editor/static/src/js/wysiwyg/wysiwyg.js>`_, you will find it as `this.odooEditor.powerbox`."
msgstr ""
#: ../../content/developer/reference/frontend/odoo_editor.rst:97
msgid "Now to open it with our custom \"Document\" command in a custom \"Documentation\" category:"
msgstr ""
#: ../../content/developer/reference/frontend/odoo_editor.rst:117
msgid "Filtering commands"
msgstr ""
#: ../../content/developer/reference/frontend/odoo_editor.rst:119
msgid "There are three ways to filter commands:"
msgstr ""
#: ../../content/developer/reference/frontend/odoo_editor.rst:121
msgid "Via the `powerboxFilters` :ref:`Powerbox option <reference/frontend/odoo_editor/powerbox/options>`."
msgstr ""
#: ../../content/developer/reference/frontend/odoo_editor.rst:123
msgid "Via a given :ref:`command <reference/frontend/odoo_editor/powerbox/command>`'s `isDisabled` entry."
msgstr ""
#: ../../content/developer/reference/frontend/odoo_editor.rst:126
msgid "The user can filter commands by simply typing text after opening the Powerbox. It will fuzzy-match that text with the names of the categories and commands."
msgstr ""
#: ../../content/developer/reference/frontend/odoo_editor.rst:-1
msgid "The Powerbox with its commands filtered using the word \"head\"."
msgstr ""
#: ../../content/developer/reference/frontend/odoo_editor.rst:140
#: ../../content/developer/reference/frontend/registries.rst:107
msgid "Category"
msgstr ""
#: ../../content/developer/reference/frontend/odoo_editor.rst:151
msgid "the name of the category"
msgstr ""
#: ../../content/developer/reference/frontend/odoo_editor.rst:152
#: ../../content/developer/reference/frontend/odoo_editor.rst:187
msgid "`priority`"
msgstr ""
#: ../../content/developer/reference/frontend/odoo_editor.rst:153
#: ../../content/developer/reference/frontend/odoo_editor.rst:188
#: ../../content/developer/reference/frontend/owl_components.rst:375
#: ../../content/developer/reference/frontend/owl_components.rst:842
#: ../../content/developer/reference/frontend/owl_components.rst:845
#: ../../content/developer/reference/frontend/owl_components.rst:848
#: ../../content/developer/reference/frontend/owl_components.rst:1072
msgid "`number`"
msgstr ""
#: ../../content/developer/reference/frontend/odoo_editor.rst:154
msgid "used to order the category: a category with a higher priority is displayed higher into the Powerbox (categories with the same priority are ordered alphabetically)"
msgstr ""
#: ../../content/developer/reference/frontend/odoo_editor.rst:159
msgid "If several categories exist with the same name, they will be grouped into one. Its priority will be that defined in the version of the category that was declared last."
msgstr ""
#: ../../content/developer/reference/frontend/odoo_editor.rst:166
msgid "Command"
msgstr ""
#: ../../content/developer/reference/frontend/odoo_editor.rst:177
msgid "the name of the command"
msgstr ""
#: ../../content/developer/reference/frontend/odoo_editor.rst:178
msgid "`category`"
msgstr ""
#: ../../content/developer/reference/frontend/odoo_editor.rst:180
msgid "the name of the category the command belongs to"
msgstr ""
#: ../../content/developer/reference/frontend/odoo_editor.rst:181
msgid "`description`"
msgstr ""
#: ../../content/developer/reference/frontend/odoo_editor.rst:183
msgid "a short text to describe the command"
msgstr ""
#: ../../content/developer/reference/frontend/odoo_editor.rst:184
msgid "`fontawesome`"
msgstr ""
#: ../../content/developer/reference/frontend/odoo_editor.rst:186
msgid "the name of a *Font Awesome* that will serve as the command's icon"
msgstr ""
#: ../../content/developer/reference/frontend/odoo_editor.rst:189
msgid "used to order the command: a command with a higher priority is displayed higher into the Powerbox (commands with the same priority are ordered alphabetically)"
msgstr ""
#: ../../content/developer/reference/frontend/odoo_editor.rst:192
msgid "`callback`"
msgstr ""
#: ../../content/developer/reference/frontend/odoo_editor.rst:193
#: ../../content/developer/reference/frontend/odoo_editor.rst:196
msgid "`function` (`() => void`)"
msgstr ""
#: ../../content/developer/reference/frontend/odoo_editor.rst:194
msgid "the function to execute when the command is picked (can be asynchronous)"
msgstr ""
#: ../../content/developer/reference/frontend/odoo_editor.rst:195
msgid "`isDisabled` (optional)"
msgstr ""
#: ../../content/developer/reference/frontend/odoo_editor.rst:197
msgid "a function used to disable the command under certain conditions (when it returns `true`, the command will be disabled)"
msgstr ""
#: ../../content/developer/reference/frontend/odoo_editor.rst:201
msgid "If the command points to a category that doesn't exist yet, that category will be created and appended at the end of the Powerbox."
msgstr ""
#: ../../content/developer/reference/frontend/odoo_editor.rst:209
msgid "The following options can be passed to OdooEditor, that will then be passed to the instance of the Powerbox:"
msgstr ""
#: ../../content/developer/reference/frontend/odoo_editor.rst:219
msgid "`commands`"
msgstr ""
#: ../../content/developer/reference/frontend/odoo_editor.rst:220
msgid "`array of commands`"
msgstr ""
#: ../../content/developer/reference/frontend/odoo_editor.rst:221
msgid "commands to add to the default defined by the editor"
msgstr ""
#: ../../content/developer/reference/frontend/odoo_editor.rst:222
msgid "`categories`"
msgstr ""
#: ../../content/developer/reference/frontend/odoo_editor.rst:223
msgid "`array of categories`"
msgstr ""
#: ../../content/developer/reference/frontend/odoo_editor.rst:224
msgid "categories to add to the default defined by the editor"
msgstr ""
#: ../../content/developer/reference/frontend/odoo_editor.rst:225
msgid "`powerboxFilters`"
msgstr ""
#: ../../content/developer/reference/frontend/odoo_editor.rst:226
msgid "`array of functions` (`commands => commands`)"
msgstr ""
#: ../../content/developer/reference/frontend/odoo_editor.rst:227
msgid "functions used to filter commands displayed in the Powerbox"
msgstr ""
#: ../../content/developer/reference/frontend/odoo_editor.rst:228
msgid "`getContextFromParentRect`"
msgstr ""
#: ../../content/developer/reference/frontend/odoo_editor.rst:229
msgid "`function` (`() => DOMRect`)"
msgstr ""
#: ../../content/developer/reference/frontend/odoo_editor.rst:230
msgid "a function that returns the `DOMRect` of an ancestor of the editor (can be useful when the editor is in an iframe)"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:5
msgid "Owl components"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:7
msgid "The Odoo Javascript framework uses a custom component framework called Owl. It is a declarative component system, loosely inspired by Vue and React. Components are defined using :doc:`QWeb templates <qweb>`, enriched with some Owl specific directives. The official `Owl documentation <https://github.com/odoo/owl/blob/master/doc/readme.md>`_ contains a complete reference and a tutorial."
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:16
msgid "Although the code can be found in the `web` module, it is maintained from a separate GitHub repository. Any modification to Owl should therefore be made through a pull request on https://github.com/odoo/owl."
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:21
msgid "Currently, all Odoo versions (starting in version 14) share the same Owl version."
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:24
msgid "Using Owl components"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:26
msgid "The `Owl documentation`_ already documents in detail the Owl framework, so this page will only provide Odoo specific information. But first, let us see how we can make a simple component in Odoo."
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:49
msgid "This example shows that Owl is available as a library in the global namespace as `owl`: it can simply be used like most libraries in Odoo. Note that we defined here the template as a static property, but without using the `static` keyword, which is not available in some browsers (Odoo javascript code should be Ecmascript 2019 compliant)."
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:55
msgid "We define here the template in the javascript code, with the help of the `xml` helper. However, it is only useful to get started. In practice, templates in Odoo should be defined in an xml file, so they can be translated. In that case, the component should only define the template name."
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:60
msgid "In practice, most components should define 2 or 3 files, located at the same place: a javascript file (`my_component.js`), a template file (`my_component.xml`) and optionally a scss (or css) file (`my_component.scss`). These files should then be added to some assets bundle. The web framework will take care of loading the javascript/css files, and loading the templates into Owl."
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:66
msgid "Here is how the component above should be defined:"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:77
msgid "And the template is now located in the corresponding xml file:"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:94
msgid "Template names should follow the convention `addon_name.ComponentName`."
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:103
msgid "Best practices"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:105
msgid "First of all, components are classes, so they have a constructor. But constructors are special methods in javascript that are not overridable in any way. Since this is an occasionally useful pattern in Odoo, we need to make sure that no component in Odoo directly uses the constructor method. Instead, components should use the `setup` method:"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:127
msgid "Another good practice is to use a consistent convention for template names: `addon_name.ComponentName`. This prevents name collision between odoo addons."
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:131
#: ../../content/developer/reference/frontend/registries.rst:101
#: ../../content/developer/reference/frontend/services.rst:111
msgid "Reference List"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:133
msgid "The Odoo web client is built with `Owl <https://github.com/odoo/owl>`_ components. To make it easier, the Odoo javascript framework provides a suite of generic components that can be reused in some common situations, such as dropdowns, checkboxes or datepickers. This page explains how to use these generic components."
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:142
#: ../../content/developer/reference/frontend/services.rst:117
msgid "Technical Name"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:144
msgid ":ref:`ActionSwiper <frontend/owl/actionswiper>`"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:145
msgid "a swiper component to perform actions on touch swipe"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:146
msgid ":ref:`CheckBox <frontend/owl/checkbox>`"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:147
msgid "a simple checkbox component with a label next to it"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:148
msgid ":ref:`ColorList <frontend/owl/colorlist>`"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:149
msgid "a list of colors to choose from"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:150
msgid ":ref:`Dropdown <frontend/owl/dropdown>`"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:151
msgid "full-featured dropdown"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:152
msgid ":ref:`Notebook <frontend/owl/notebook>`"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:153
msgid "a component to navigate between pages using tabs"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:154
msgid ":ref:`Pager <frontend/pager>`"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:155
msgid "a small component to handle pagination"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:156
msgid ":ref:`SelectMenu <frontend/select_menu>`"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:157
msgid "a dropdown component to choose between different options"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:158
msgid ":ref:`TagsList <frontend/tags_list>`"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:159
msgid "a list of tags displayed in rounded pills"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:164
msgid "ActionSwiper"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:169
msgid "`@web/core/action_swiper/action_swiper`"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:174
msgid "This is a component that can perform actions when an element is swiped horizontally. The swiper is wrapping a target element to add actions to it. The action is executed once the user has released the swiper passed a portion of its width."
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:185
msgid "The simplest way to use the component is to use it around your target element directly in an xml template as shown above. But sometimes, you may want to extend an existing element and would not want to duplicate the template. It is possible to do just that."
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:189
msgid "If you want to extend the behavior of an existing element, you must place the element inside, by wrapping it directly. Also, you can conditionnally add props to manage when the element might be swipable, its animation and the minimum portion to swipe to perform the action."
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:193
msgid "You can use the component to interact easily with records, messages, items in lists and much more."
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:-1
msgid "Example of ActionSwiper usage"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:200
msgid "The following example creates a basic ActionSwiper component. Here, the swipe is enabled in both directions."
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:224
msgid "Actions are permuted when using right-to-left (RTL) languages."
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:227
#: ../../content/developer/reference/frontend/owl_components.rst:315
#: ../../content/developer/reference/frontend/owl_components.rst:350
#: ../../content/developer/reference/frontend/owl_components.rst:455
#: ../../content/developer/reference/frontend/owl_components.rst:713
#: ../../content/developer/reference/frontend/owl_components.rst:832
#: ../../content/developer/reference/frontend/owl_components.rst:881
#: ../../content/developer/reference/frontend/owl_components.rst:1056
msgid "Props"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:236
msgid "`animationOnMove`"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:237
msgid "`Boolean`"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:238
msgid "optional boolean to determine if a translate effect is present during the swipe"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:239
msgid "`animationType`"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:240
msgid "`String`"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:241
msgid "optional animation that is used after the swipe ends (`bounce` or `forwards`)"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:242
msgid "`onLeftSwipe`"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:243
#: ../../content/developer/reference/frontend/owl_components.rst:246
msgid "`Object`"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:244
msgid "if present, the actionswiper can be swiped to the left"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:245
msgid "`onRightSwipe`"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:247
msgid "if present, the actionswiper can be swiped to the right"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:248
msgid "`swipeDistanceRatio`"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:249
msgid "`Number`"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:250
msgid "optional minimum width ratio that must be swiped to perform the action"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:252
msgid "You can use both `onLeftSwipe` and `onRightSwipe` props at the same time."
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:254
msgid "The `Object`'s used for the left/right swipe must contain:"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:256
msgid "`action`, which is the callable `Function` serving as a callback. Once the swipe has been completed in the given direction, that action is performed."
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:259
msgid "`icon` is the icon class to use, usually to represent the action. It must be a `string`."
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:261
msgid "`bgColor` is the background color, given to decorate the action. can be one of the following `bootstrap contextual color <https://getbootstrap.com/docs/3.3/components/#available-variations>`_ (`danger`, `info`, `secondary`, `success` or `warning`)."
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:266
msgid "Those values must be given to define the behavior and the visual aspect of the swiper."
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:270
msgid "Example: Extending existing components"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:272
msgid "In the following example, you can use `xpath`'s to wrap an existing element in the ActionSwiper component. Here, a swiper has been added to mark a message as read in mail."
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:295
msgid "CheckBox"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:300
msgid "`@web/core/checkbox/checkbox`"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:305
msgid "This is a simple checkbox component with a label next to it. The checkbox is linked to the label: the checkbox is toggled whenever the label is clicked."
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:324
#: ../../content/developer/reference/frontend/owl_components.rst:914
msgid "`value`"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:325
#: ../../content/developer/reference/frontend/owl_components.rst:328
#: ../../content/developer/reference/frontend/owl_components.rst:360
#: ../../content/developer/reference/frontend/owl_components.rst:366
#: ../../content/developer/reference/frontend/owl_components.rst:369
#: ../../content/developer/reference/frontend/owl_components.rst:854
#: ../../content/developer/reference/frontend/owl_components.rst:857
#: ../../content/developer/reference/frontend/owl_components.rst:900
#: ../../content/developer/reference/frontend/owl_components.rst:906
#: ../../content/developer/reference/frontend/owl_components.rst:909
#: ../../content/developer/reference/frontend/owl_components.rst:1066
#: ../../content/developer/reference/frontend/owl_components.rst:1069
msgid "`boolean`"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:326
msgid "if true, the checkbox is checked, otherwise it is unchecked"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:327
#: ../../content/developer/reference/frontend/owl_components.rst:491
msgid "`disabled`"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:329
msgid "if true, the checkbox is disabled, otherwise it is enabled"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:334
msgid "ColorList"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:339
msgid "`@web/core/colorlist/colorlist`"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:344
msgid "The ColorList let you choose a color from a predefined list. By default, the component displays the current selected color, and is not expandable until the `canToggle` props is present. Different props can change its behavior, to always expand the list, or make it act as a toggler once it is clicked, to display the list of available colors until a choice is selected."
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:359
msgid "`canToggle`"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:361
msgid "optional. Whether the colorlist can expand the list on click"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:362
msgid "`colors`"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:363
#: ../../content/developer/reference/frontend/owl_components.rst:732
#: ../../content/developer/reference/frontend/owl_components.rst:741
#: ../../content/developer/reference/frontend/owl_components.rst:891
#: ../../content/developer/reference/frontend/owl_components.rst:897
#: ../../content/developer/reference/frontend/owl_components.rst:1075
msgid "`array`"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:364
msgid "list of colors to display in the component. Each color has a unique `id`"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:365
msgid "`forceExpanded`"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:367
msgid "optional. If true, the list is always expanded"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:368
msgid "`isExpanded`"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:370
msgid "optional. If true, the list is expanded by default"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:371
msgid "`onColorSelected`"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:372
#: ../../content/developer/reference/frontend/owl_components.rst:738
#: ../../content/developer/reference/frontend/owl_components.rst:851
#: ../../content/developer/reference/frontend/owl_components.rst:918
msgid "`function`"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:373
msgid "callback executed once a color is selected"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:374
msgid "`selectedColor`"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:376
msgid "optional. The color `id` that is selected"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:378
msgid "Color `id`'s are the following:"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:383
msgid "Id"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:385
msgid "`0`"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:386
msgid "`No color`"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:387
#: ../../content/developer/reference/user_interface/view_architectures.rst:584
msgid "`1`"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:388
msgid "`Red`"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:389
#: ../../content/developer/reference/user_interface/view_architectures.rst:575
msgid "`2`"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:390
msgid "`Orange`"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:391
msgid "`3`"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:392
msgid "`Yellow`"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:393
msgid "`4`"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:394
msgid "`Light blue`"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:395
msgid "`5`"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:396
msgid "`Dark purple`"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:397
msgid "`6`"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:398
msgid "`Salmon pink`"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:399
msgid "`7`"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:400
msgid "`Medium blue`"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:401
msgid "`8`"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:402
msgid "`Dark blue`"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:403
msgid "`9`"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:404
msgid "`Fuchsia`"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:405
msgid "`12`"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:406
msgid "`Green`"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:407
msgid "`11`"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:408
msgid "`Purple`"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:413
#: ../../content/developer/reference/frontend/owl_components.rst:467
msgid "Dropdown"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:418
msgid "`@web/core/dropdown/dropdown` and `@web/core/dropdown/dropdown_item`"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:423
msgid "Dropdowns are surprisingly complicated components. They need to provide many features such as:"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:426
msgid "Toggle the item list on click"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:427
msgid "Direct siblings dropdowns: when one is open, toggle others on hover"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:428
msgid "Close on outside click"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:429
msgid "Optionally close the item list when an item is selected"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:430
msgid "Call a function when the item is selected"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:431
msgid "Support sub dropdowns, up to any level"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:432
msgid "SIY: style it yourself"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:433
msgid "Configurable hotkey to open/close a dropdown or select a dropdown item"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:434
msgid "Keyboard navigation (arrows, tab, shift+tab, home, end, enter and escape)"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:435
msgid "Reposition itself whenever the page scrolls or is resized"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:436
msgid "Smartly chose the direction it should open (right-to-left direction is automatically handled)."
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:438
msgid "To solve these issues once and for all, the Odoo framework provides a set of two components: a `Dropdown` component (the actual dropdown), and `DropdownItem`, for each element in the item list."
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:457
msgid "A `<Dropdown/>` component is simply a `<div class=\"dropdown\"/>` having a `<button class=\"dropdown-toggle\"/>` next to menu div (`<div class=\"dropdown-menu\"/>`). The button is responsible for the menu being present in the DOM or not."
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:470
msgid "`startOpen`"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:472
msgid "initial dropdown open state (defaults to `false`)"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:473
msgid "`menuClass`"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:475
msgid "additional css class applied to the dropdown menu `<div class=\"dropdown-menu\"/>`"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:476
#: ../../content/developer/reference/frontend/owl_components.rst:902
msgid "`togglerClass`"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:478
msgid "additional css class applied to the toggler `<button class=\"dropdown-toggle\"/>`"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:479
#: ../../content/developer/reference/frontend/owl_components.rst:524
msgid "`hotkey`"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:481
msgid "hotkey to toggle the opening through keyboard"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:482
msgid "`tooltip`"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:484
msgid "add a tooltip on the toggler"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:485
msgid "`beforeOpen`"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:486
#: ../../content/developer/reference/frontend/services.rst:453
#: ../../content/developer/reference/frontend/services.rst:472
msgid "function"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:487
msgid "hook to execute logic just before opening. May be asynchronous."
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:488
msgid "`manualOnly`"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:490
msgid "if true, only toggle the dropdown when the button is clicked on (defaults to `false`)"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:493
msgid "disable (if true) the dropdown button (defaults to `false`)"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:494
#: ../../content/developer/reference/frontend/owl_components.rst:530
#: ../../content/developer/reference/frontend/services.rst:440
msgid "`title`"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:496
msgid "title attribute content for the `<button class=\"dropdown-toggle\"/>` (default: none)"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:499
msgid "defines the desired menu opening position. RTL direction is automatically applied. Should be a valid :ref:`usePosition <frontend/hooks/useposition>` hook position. (default: `bottom-start`)"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:500
msgid "`toggler`"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:501
msgid "`\"parent\"` or `undefined`"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:502
msgid "when set to `\"parent\"` the `<button class=\"dropdown-toggle\"/>` is not rendered (thus `toggler` slot is ignored) and the toggling feature is handled by the parent node (e.g. use case: pivot cells). (default: `undefined`)"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:507
msgid "A `<DropdownItem/>` is simply a span (`<span class=\"dropdown-item\"/>`). When a `<DropdownItem/>` is selected, it calls its `onSelected` prop. If this prop is a method, make sure it is bound if the method need to use the `this` value."
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:514
msgid "DropdownItem"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:517
msgid "`onSelected`"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:518
msgid "Function"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:519
msgid "a function that will be called when the dropdown item is selected."
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:520
msgid "`parentClosingMode`"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:521
msgid "`none` | `closest` | `all`"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:522
msgid "when the item is selected, control which parent dropdown will get closed: none, closest or all (default = `all`)"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:526
msgid "optional hotkey to select the item"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:527
msgid "`href`"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:529
msgid "if provided the DropdownItem will become an `<a href=\"value\" class=\"dropdown-item\"/>` instead of a `<span class=\"dropdown-item\"/>`. (default: not provided)"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:532
msgid "optional title attribute which will be passed to the root node of the DropdownItem. (default: not provided)"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:533
msgid "`dataset`"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:534
msgid "Object"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:535
msgid "optional object containing values that should be added to the root element's dataset. This can be used so that the element is easier to find programmatically, for example in tests or tours."
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:538
msgid "Technical notes"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:540
msgid "The rendered DOM is structured like this:"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:553
msgid "To properly use a `<Dropdown/>` component, you need to populate two `OWL slots <https://github.com/odoo/owl/blob/master/doc/reference/slots.md>`_ :"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:557
msgid "`toggler` slot: it contains the *toggler* elements of your dropdown and is rendered inside the dropdown `button` (unless the `toggler` prop is set to `parent`),"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:559
msgid "`default` slot: it contains the *elements* of the dropdown menu itself and is rendered inside the `<div class=\"dropdown-menu\"/>`. Although it is not mandatory, there is usually at least one `DropdownItem` inside the `menu` slot."
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:564
msgid "When several dropdowns share the same parent element in the DOM, then they are considered part of a group, and will notify each other about their state changes. This means that when one of these dropdowns is open, the others will automatically open themselves on mouse hover, without the need for a click."
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:571
msgid "Example: Direct Siblings Dropdown"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:573
msgid "When one dropdown toggler is clicked (**File** , **Edit** or **About**), the others will open themselves on hover."
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:599
msgid "Example: Multi-level Dropdown (with `t-call`)"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:601
msgid "This example shows how one could make a `File` dropdown menu, with submenus for the `New` and `Save as...` sub elements."
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:633
msgid "Example: Multi-level Dropdown (nested)"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:654
msgid "Example: Recursive Multi-level Dropdown"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:656
msgid "In this example, we recursively call a template to display a tree-like structure."
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:692
msgid "Notebook"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:697
msgid "`@web/core/notebook/notebook`"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:702
msgid "The Notebook is made to display multiple pages in a tabbed interface. Tabs can be located at the top of the element to display horizontally, or at the left for a vertical layout."
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:705
msgid "There are two ways to define your Notebook pages to instanciate, either by using `slot`'s, or by passing a dedicated `props`."
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:708
msgid "A page can be disabled with the `isDisabled` attribute, set directly on the slot node, or in the page declaration, if the Notebook is used with the `pages` given as props. Once disabled, the corresponding tab is greyed out and set as inactive as well."
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:722
msgid "`anchors`"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:723
msgid "`object`"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:724
msgid "optional. Allow anchors navigation to elements inside tabs that are not visible."
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:725
#: ../../content/developer/reference/frontend/services.rst:449
msgid "`className`"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:727
msgid "optional. Classname set on the root of the component."
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:728
msgid "`defaultPage`"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:730
msgid "optional. Page `id` to display by default."
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:731
msgid "`icons`"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:733
msgid "optional. List of icons used in the tabs."
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:734
msgid "`orientation`"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:736
msgid "optional. Whether tabs direction is `horizontal` or `vertical`."
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:737
msgid "`onPageUpdate`"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:739
msgid "optional. Callback executed once the page has changed."
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:740
msgid "`pages`"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:742
msgid "optional. Contain the list of `page`'s to populate from a template."
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:746
msgid "The first approach is to set the pages in the slots of the component."
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:760
msgid "The other way to define your pages is by passing the props. This can be useful if some pages share the same structure. Create first a component for each page template that you may use."
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:801
msgid "Both examples are shown here:"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:0
msgid "Examples with vertical and horizontal layout"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:812
msgid "Pager"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:817
msgid "`@web/core/pager/pager`"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:822
msgid "The Pager is a small component to handle pagination. A page is defined by an `offset` and a `limit` (the size of the page). It displays the current page and the `total` number of elements, for instance, \"9-12 / 20\". In the previous example, `offset` is 8, `limit` is 4 and `total` is 20. It has two buttons (\"Previous\" and \"Next\") to navigate between pages."
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:825
msgid "The pager can be used anywhere but its main use is in the control panel. See the :ref:`usePager <frontend/hooks/usepager>` hook in order to manipulate the pager of the control panel."
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:841
msgid "`offset`"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:843
msgid "Index of the first element of the page. It starts with 0 but the pager displays `offset + 1`."
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:844
msgid "`limit`"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:846
msgid "Size of the page. The sum of `offset` and `limit` corresponds to the index of the last element of the page."
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:847
msgid "`total`"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:849
msgid "Total number of elements the page can reach."
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:850
msgid "`onUpdate`"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:852
msgid "Function that is called when page is modified by the pager. This function can be async, the pager cannot be edited while this function is executing."
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:853
msgid "`isEditable`"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:855
msgid "Allows to click on the current page to edit it (`true` by default)."
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:856
msgid "`withAccessKey`"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:858
msgid "Binds access key `p` on the previous page button and `n` on the next page one (`true` by default)."
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:863
msgid "SelectMenu"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:868
msgid "`@web/core/select_menu/select_menu`"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:873
msgid "This component can be used when you want to do more than using the native `select` element. You can define your own option template, allowing to search between your options, or group them in subsections."
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:877
msgid "Prefer the native HTML `select` element, as it provides by default accessibility features, and has a better user interface on mobile devices. This component is designed to be used for more complex use cases, to overcome limitations of the native element."
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:890
msgid "`choices`"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:892
msgid "optional. List of `choice`'s to display in the dropdown."
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:893
msgid "`class`"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:895
msgid "optional. Classname set on the root of the SelectMenu component."
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:896
msgid "`groups`"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:898
msgid "optional. List of `group`'s, containing `choices` to display in the dropdown."
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:899
msgid "`multiSelect`"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:901
msgid "optional. Enable multiple selections. When multiple selection is enabled, selected values are displayed as :ref:`tag <frontend/tags_list>`'s in the SelectMenu input."
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:904
msgid "optional. classname set on the toggler button."
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:905
msgid "`required`"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:907
msgid "optional. Whether the selected value can be unselected."
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:908
msgid "`searchable`"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:910
msgid "optional. Whether a search box is visible in the dropdown."
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:911
msgid "`searchPlaceholder`"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:913
msgid "optional. Text displayed as the search box placeholder."
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:915
msgid "`any`"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:916
msgid "optional. Current selected value. It can be from any kind of type."
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:917
msgid "`onSelect`"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:919
msgid "optional. Callback executed when an option is chosen."
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:921
msgid "The shape of a `choice` is the following:"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:923
msgid "`value` is actual value of the choice. It is usually a technical string, but can be from `any` type."
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:924
msgid "`label` is the displayed text associated with the option. This one is usually a more friendly and translated `string`."
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:926
msgid "The shape of a `group` is the following:"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:928
msgid "`choices` is the list of `choice`'s to display for this group."
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:929
msgid "`label` is the displayed text associated with the group. This is a `string` displayed at the top of the group."
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:933
msgid "In the following example, the SelectMenu will display four choices. One of them is displayed on top of the options, since no groups are associated with it, but the other ones are separated by the label of their group."
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:984
msgid "You can also customize the appearance of the toggler and set a custom template for the choices, using the appropriate component `slot`'s."
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:0
msgid "Example of SelectMenu usage and customization"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:1006
msgid "When SelectMenu is used with multiple selection, the `value` props must be an `Array` containing the values of the selected choices."
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:0
msgid "Example of SelectMenu used with multiple selection"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:1013
msgid "For more advanced use cases, you can customize the bottom area of the dropdown, using the `bottomArea` slot. Here, we choose to display a button with the corresponding value set in the search input."
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:0
msgid "Example of SelectMenu's bottom area customization"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:1041
msgid "TagsList"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:1046
msgid "`@web/core/tags_list/tags_list`"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:1051
msgid "This component can display a list of tags in rounded pills. Those tags can either simply list a few values, or can be editable, allowing the removal of items. It can be possible to limit the number of displayed items using the `itemsVisible` props. If the list is longer than this limit, the number of additional items is shown in a circle next to the last tag."
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:1065
msgid "`displayBadge`"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:1067
msgid "optional. Whether the tag is displayed as a badge."
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:1068
msgid "`displayText`"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:1070
msgid "optional. Whether the tag is displayed with a text or not."
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:1071
msgid "`itemsVisible`"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:1073
msgid "optional. Limit of visible tags in the list."
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:1074
msgid "`tags`"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:1076
msgid "list of `tag`'s elements given to the component."
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:1078
msgid "The shape of a `tag` is the following:"
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:1080
msgid "`colorIndex` is an optional color id."
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:1081
msgid "`icon` is an optional icon displayed just before the displayed text."
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:1082
msgid "`id` is a unique identifier for the tag."
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:1083
msgid "`img` is an optional image displayed in a circle, just before the displayed text."
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:1084
msgid "`onClick` is an optional callback that can be given to the element. This allows the parent element to handle any functionality depending on the tag clicked."
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:1085
msgid "`onDelete` is an optional callback that can be given to the element. This makes the removal of the item from the list of tags possible, and must be handled by the parent element."
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:1086
msgid "`text` is the displayed `string` associated with the tag."
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:1090
msgid "In the next example, a TagsList component is used to display multiple tags. It's at the developer to handle from the parent what would happen when the tag is pressed, or when the delete button is clicked."
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:1119
msgid "Depending the attributes given to each tag, their appearance and behavior will differ."
msgstr ""
#: ../../content/developer/reference/frontend/owl_components.rst:0
msgid "Examples of TagsList using different props and attributes"
msgstr ""
#: ../../content/developer/reference/frontend/patching_code.rst:3
msgid "Patching code"
msgstr ""
#: ../../content/developer/reference/frontend/patching_code.rst:5
msgid "Sometimes, we need to customize the way the UI works. Many common needs are covered by some supported API. For example, all registries are good extension points: the field registry allows adding/removing specialized field components, or the main component registry allows adding components that should be displayed all the time."
msgstr ""
#: ../../content/developer/reference/frontend/patching_code.rst:11
msgid "However, there are situations for which it is not sufficient. In those cases, we may need to modify an object or a class in place. To achieve that, Odoo provides the utility function `patch`. It is mostly useful to override/update the behavior of some other component/piece of code that one does not control."
msgstr ""
#: ../../content/developer/reference/frontend/patching_code.rst:19
msgid "The patch function is located in `@web/core/utils/patch`:"
msgstr ""
#: ../../content/developer/reference/frontend/patching_code.rst:23
msgid "the object that should be patched"
msgstr ""
#: ../../content/developer/reference/frontend/patching_code.rst:24
msgid "an object mapping each key to an extension"
msgstr ""
#: ../../content/developer/reference/frontend/patching_code.rst:25
msgid "a function to remove the patch"
msgstr ""
#: ../../content/developer/reference/frontend/patching_code.rst:27
msgid "The `patch` function modifies in place the `objToPatch` object (or class) and applies all key/value described in the `extension` object. An unpatch function is returned, so it can be used to remove the patch later if necessary."
msgstr ""
#: ../../content/developer/reference/frontend/patching_code.rst:31
msgid "Most patch operations provide access to the parent value by using the native `super` keyword (see below in the examples)."
msgstr ""
#: ../../content/developer/reference/frontend/patching_code.rst:35
msgid "Patching a simple object"
msgstr ""
#: ../../content/developer/reference/frontend/patching_code.rst:37
msgid "Here is a simple example of how an object can be patched:"
msgstr ""
#: ../../content/developer/reference/frontend/patching_code.rst:57
msgid "When patching functions, we usually want to be able to access the ``parent`` function. To do so, we can simply use the native ``super`` keyword:"
msgstr ""
#: ../../content/developer/reference/frontend/patching_code.rst:71
msgid "``super`` can only be used in a method not a function. This means that the following constructs are invalid for javascript."
msgstr ""
#: ../../content/developer/reference/frontend/patching_code.rst:87
msgid "Getters and setters are supported too:"
msgstr ""
#: ../../content/developer/reference/frontend/patching_code.rst:103
msgid "Patching a javascript class"
msgstr ""
#: ../../content/developer/reference/frontend/patching_code.rst:105
msgid "The ``patch`` function is designed to work with anything: object or ES6 class."
msgstr ""
#: ../../content/developer/reference/frontend/patching_code.rst:107
msgid "However, since javascript classes work with the prototypal inheritance, when one wishes to patch a standard method from a class, then we actually need to patch the `prototype`:"
msgstr ""
#: ../../content/developer/reference/frontend/patching_code.rst:129
msgid "Also, Javascript handles the constructor in a special native way which makes it impossible to be patched. The only workaround is to call a method in the original constructor and patch that method instead:"
msgstr ""
#: ../../content/developer/reference/frontend/patching_code.rst:153
msgid "It is impossible to patch directly the `constructor` of a class!"
msgstr ""
#: ../../content/developer/reference/frontend/patching_code.rst:156
msgid "Patching a component"
msgstr ""
#: ../../content/developer/reference/frontend/patching_code.rst:158
msgid "Components are defined by javascript classes, so all the information above still holds. For these reasons, Owl components should use the `setup` method, so they can easily be patched as well (see the section on :ref:`best practices<frontend/owl/best_practices>`)."
msgstr ""
#: ../../content/developer/reference/frontend/patching_code.rst:171
msgid "Removing a patch"
msgstr ""
#: ../../content/developer/reference/frontend/patching_code.rst:173
msgid "The `patch` function returns its counterpart. This is mostly useful for testing purposes, when we patch something at the beginning of a test, and unpatch it at the end."
msgstr ""
#: ../../content/developer/reference/frontend/patching_code.rst:184
msgid "Applying the same patch to multiple objects"
msgstr ""
#: ../../content/developer/reference/frontend/patching_code.rst:186
msgid "It could happen that one wants to apply the same patch to multiple objects but because of the way the `super` keyword works, the `extension` can only be used for patching once and cannot be copied/cloned (`check the documentation of the keyword <https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/super#description>`_). A function returning the object used to patch can be used to make it unique."
msgstr ""
#: ../../content/developer/reference/frontend/patching_code.rst:219
msgid "If an `extension` is based on another then the two extensions should be applied separately. Do not copy/clone an extension."
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:7
msgid "QWeb Templates"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:9
msgid "QWeb is the primary templating_ engine used by Odoo\\ [#othertemplates]_. It is an XML templating engine\\ [#genshif]_ and used mostly to generate HTML_ fragments and pages."
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:13
msgid "Template directives are specified as XML attributes prefixed with ``t-``, for instance ``t-if`` for :ref:`reference/qweb/conditionals`, with elements and other attributes being rendered directly."
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:17
msgid "To avoid element rendering, a placeholder element ``<t>`` is also available, which executes its directive but doesn't generate any output in and of itself::"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:29
msgid "if ``condition`` is true, but::"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:44
msgid "Data output"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:46
msgid "QWeb's output directive ``out`` will automatically HTML-escape its input, limiting XSS_ risks when displaying user-provided content."
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:49
msgid "``out`` takes an expression, evaluates it and injects the result in the document::"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:53
msgid "rendered with the value ``value`` set to ``42`` yields::"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:57
msgid "See :ref:`reference/qweb/advanced-output` for more advanced topics (e.g. injecting raw HTML, etc...)."
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:63
#: ../../content/developer/tutorials/web.rst:721
msgid "Conditionals"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:65
msgid "QWeb has a conditional directive ``if``, which evaluates an expression given as attribute value::"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:74
msgid "The element is rendered if the condition is true::"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:80
msgid "but if the condition is false it is removed from the result::"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:85
msgid "The conditional rendering applies to the bearer of the directive, which does not have to be ``<t>``::"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:92
msgid "will give the same results as the previous example."
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:94
msgid "Extra conditional branching directives ``t-elif`` and ``t-else`` are also available::"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:107
msgid "Loops"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:109
msgid "QWeb has an iteration directive ``foreach`` which take an expression returning the collection to iterate on, and a second parameter ``t-as`` providing the name to use for the \"current item\" of the iteration::"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:117
#: ../../content/developer/reference/frontend/qweb.rst:210
#: ../../content/developer/reference/frontend/qweb.rst:224
#: ../../content/developer/reference/frontend/qweb.rst:240
#: ../../content/developer/reference/frontend/qweb.rst:250
msgid "will be rendered as::"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:123
msgid "Like conditions, ``foreach`` applies to the element bearing the directive's attribute, and"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:132
msgid "is equivalent to the previous example."
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:134
msgid "``foreach`` can iterate on an array (the current item will be the current value) or a mapping (the current item will be the current key). Iterating on an integer (equivalent to iterating on an array between 0 inclusive and the provided integer exclusive) is still supported but deprecated."
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:139
msgid "In addition to the name passed via ``t-as``, ``foreach`` provides a few other variables for various data points:"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:142
msgid "``$as`` will be replaced by the name passed to ``t-as``"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:149
msgid ":samp:`{$as}_all` (deprecated)"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:147
msgid "the object being iterated over"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:149
msgid "This variable is only available on JavaScript QWeb, not Python."
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:152
msgid ":samp:`{$as}_value`"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:152
msgid "the current iteration value, identical to ``$as`` for lists and integers, but for mappings it provides the value (where ``$as`` provides the key)"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:154
msgid ":samp:`{$as}_index`"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:155
msgid "the current iteration index (the first item of the iteration has index 0)"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:156
msgid ":samp:`{$as}_size`"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:157
msgid "the size of the collection if it is available"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:159
msgid ":samp:`{$as}_first`"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:159
msgid "whether the current item is the first of the iteration (equivalent to :samp:`{$as}_index == 0`)"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:163
msgid ":samp:`{$as}_last`"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:162
msgid "whether the current item is the last of the iteration (equivalent to :samp:`{$as}_index + 1 == {$as}_size`), requires the iteratee's size be available"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:165
msgid ":samp:`{$as}_parity` (deprecated)"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:166
msgid "either ``\"even\"`` or ``\"odd\"``, the parity of the current iteration round"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:168
msgid ":samp:`{$as}_even` (deprecated)"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:168
msgid "a boolean flag indicating that the current iteration round is on an even index"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:172
msgid ":samp:`{$as}_odd` (deprecated)"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:171
msgid "a boolean flag indicating that the current iteration round is on an odd index"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:174
msgid "These extra variables provided and all new variables created into the ``foreach`` are only available in the scope of the ``foreach``. If the variable exists outside the context of the ``foreach``, the value is copied at the end of the foreach into the global context."
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:198
msgid "QWeb can compute attributes on-the-fly and set the result of the computation on the output node. This is done via the ``t-att`` (attribute) directive which exists in 3 different forms:"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:211
msgid ":samp:`t-att-{$name}`"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:205
msgid "an attribute called ``$name`` is created, the attribute value is evaluated and the result is set as the attribute's value::"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:232
msgid ":samp:`t-attf-{$name}`"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:214
msgid "same as previous, but the parameter is a :term:`format string` instead of just an expression, often useful to mix literal and non-literal string (e.g. classes)::"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:231
msgid "There are two equivalent syntaxes for format strings: ``\"plain_text {{code}}\"`` (aka jinja-style) and ``\"plain_text #{code}\"`` (aka ruby-style)."
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:241
msgid ":samp:`t-att=mapping`"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:235
msgid "if the parameter is a mapping, each (key, value) pair generates a new attribute and its value::"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:252
msgid ":samp:`t-att=pair`"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:244
msgid "if the parameter is a pair (tuple or array of 2 element), the first item of the pair is the name of the attribute and the second item is the value::"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:257
msgid "setting variables"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:259
msgid "QWeb allows creating variables from within the template, to memoize a computation (to use it multiple times), give a piece of data a clearer name, ..."
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:262
msgid "This is done via the ``set`` directive, which takes the name of the variable to create. The value to set can be provided in two ways:"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:265
msgid "a ``t-value`` attribute containing an expression, and the result of its evaluation will be set::"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:271
msgid "will print ``3``"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:272
msgid "if there is no ``t-value`` attribute, the node's body is rendered and set as the variable's value::"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:285
msgid "calling sub-templates"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:287
msgid "QWeb templates can be used for top-level rendering, but they can also be used from within another template (to avoid duplication or give names to parts of templates) using the ``t-call`` directive::"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:293
msgid "This calls the named template with the execution context of the parent, if ``other_template`` is defined as::"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:298
msgid "the call above will be rendered as ``<p/>`` (no content), but::"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:303
msgid "will be rendered as ``<p>1</p>``."
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:305
msgid "However, this has the problem of being visible from outside the ``t-call``. Alternatively, content set in the body of the ``call`` directive will be evaluated *before* calling the sub-template, and can alter a local context::"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:314
msgid "The body of the ``call`` directive can be arbitrarily complex (not just ``set`` directives), and its rendered form will be available within the called template as a magical ``0`` variable::"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:323
msgid "being called thus::"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:339
msgid "Advanced Output"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:341
msgid "By default, ``out`` should HTML-escape content which needs to be escaped, protecting the system against XSS_"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:344
msgid "Content which does *not* need to be escaped will instead be injected as-is in the document, and may become part of the document's actual markup."
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:347
msgid "The only cross-platform \"safe\" content is the output of :ref:`t-call <reference/qweb/call>` or a :ref:`t-set <reference/qweb/set>` used with a \"body\" (as opposed to ``t-value`` or ``t-valuef``)."
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:354
msgid "Usually you should not have to care too much: APIs for which it makes sense should generate \"safe\" content automatically, and things should work transparently."
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:358
msgid "For the cases where things need to be clearer though the following APIs output safe content which will by default not be (re-)escaped when injected into templates:"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:362
msgid ":class:`HTML fields <odoo.fields.Html>`."
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:363
msgid ":func:`~odoo.tools.misc.html_escape` and :func:`markupsafe.escape` (they are aliases, and have no risk of double-escaping)."
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:365
msgid ":func:`~odoo.tools.mail.html_sanitize`."
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:366
msgid ":class:`markupsafe.Markup`."
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:368
msgid ":class:`markupsafe.Markup` is an unsafe API, it's an *assertion* that you want the content to be markup-safe but necessarily can not check that, it should be used with care."
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:371
msgid ":func:`~odoo.tools.pycompat.to_text` does not mark the content as safe, but will not strip that information from safe content."
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:375
msgid "forcing double-escaping"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:377
msgid "If content is marked as safe but for some reason needs to be escaped anyway (e.g. printing the markup of an HTML fields), it can just be converted back to a normal string to \"strip\" the safety flag e.g. `str(content)` in Python and `String(content)` in Javascript."
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:384
msgid "Because :class:`~markupsafe.Markup` is a much richer type than :js:class:`Markup`, some operations will strip the safety information from a :js:class:`Markup` but not a :class:`~markupsafe.Markup` e.g. string concatenation (``'' + content``) in Python will result in a :class:`~markupsafe.Markup` with the other operand having been properly escaped, while in Javascript will yield a :js:class:`String` where the other operand was *not* escaped before the concatenation."
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:393
msgid "Deprecated output directives"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:399
msgid "``esc``"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:398
msgid "An alias for ``out``, would originally HTML-escape its input. Not yet formally deprecated as the only difference between ``out`` and ``esc`` is that the latter is a bit unclear / incorrect."
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:411
msgid "``raw``"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:402
msgid "A version of ``out`` which *never* escapes its content. Content is emitted as-is, whether it's safe or not."
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:407
msgid "Use ``out`` with a :class:`markupsafe.Markup` value instead."
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:409
msgid "``t-raw`` was deprecated because as the code *producting* the content evolves it can be hard to track that it's going to be used for markup, leading to more complicated reviews and more dangerous lapses."
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:417
#: ../../content/developer/reference/frontend/qweb.rst:754
msgid "Exclusive directives"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:420
msgid "Asset bundles"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:422
msgid "have fme write these up because I've no idea how they work"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:425
msgid "\"smart records\" fields formatting"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:427
msgid "The ``t-field`` directive can only be used when performing field access (``a.b``) on a \"smart\" record (result of the ``browse`` method). It is able to automatically format based on field type, and is integrated in the website's rich text editing."
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:432
msgid "``t-options`` can be used to customize fields, the most common option is ``widget``, other options are field- or widget-dependent."
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:436
msgid "Debugging"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:446
#: ../../content/developer/reference/frontend/qweb.rst:887
msgid "``t-debug``"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:441
msgid "with an empty value, invokes the :func:`breakpoint` builtin function, which usually invokes a debugger (:mod:`pdb` by default)."
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:445
msgid "The behaviour can be configured via :envvar:`PYTHONBREAKPOINT` or :func:`sys.breakpointhook`."
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:449
msgid "Rendering cache:"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:451
msgid "``t-cache=\"key_cache\"`` tags part of template to be cached at rendering time. Every sub-directives will be call only during the first rendering. It means that the sql queries excecuted during the rendering of those sub-directives are also done only once."
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:456
msgid "``t-nocache=\"documentation\"`` tags part of template to be render every time. The content can only use the root values."
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:460
msgid "Why and when to use ``t-cache``?"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:462
msgid "This directive is used to speed up the rendering, by caching parts of the final document, which may save queries to the database. However, it should be used sparingly, as ``t-cache`` will inevitably complicate templates (and their understanding of ``t-set`` for example)."
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:467
msgid "However, in order to actually save database queries, it might be necessary to render the template with values that are evaluated lazily. If those lazy values are used in a cached part, they will not be evaluated if the part is available in cache."
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:472
msgid "The ``t-cache`` directive is useful for template parts using values that depend on a limited amount of data. We recommend to analyze the rendering of the template with the profiler (by activating the \"**Add qweb directive context**\" option). Passing lazy values to the rendering in controllers allow you to display the directives using these values and triggering the queries."
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:478
msgid "A concern of using such a cache are making it available to different users (different users should render the cached parts the same way). Another potential issue is to invalidate its entries when necessary. For the latter, the **key expression** should be chosen wisely. Using the ``write_date`` of a recordset can make a cache key out-of-date without having to discard it explicitly from the cache, for instance."
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:485
msgid "One should also pay attention to the fact that the values in ``t-cache`` parts are scoped. This implies that if there are ``t-set`` directives in this part of the template, the rendering of what comes after it could be different than if there was no ``t-cache`` directive."
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:491
msgid "What if there is a ``t-cache`` inside a ``t-cache``?"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:493
msgid "The parts are cached. Each containing only the string corresponding to its rendering. Thus, the ``t-cache`` inside will probably be read less often, its cache key will not necessarily be used. If this must be the case, then you may need to add a ``t-nocache`` (on the same node or a parent)."
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:499
msgid "What is ``t-nocache`` used for?"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:501
msgid "If you want to cache part of a template with ``t-cache`` but a small piece must remain dynamic and be evaluated at cache times. However, the part in ``t-nocache`` will not have access to the ``t-set`` value of the template. Only the values provided by the controller are accessible there. For example, the menu is cached because it's the same all the time and takes time to render (using the performance devtools with the qweb context lets you investigate). However, in the menu, we want the ecommerce cart to be always up to date. So there is a ``t-nocache`` to keep this part dynamic."
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:511
msgid "The base of ``t-cache``"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:513
msgid "The ``t-cache`` directive allows you to store the rendered result of a template. The **key expression** (eg 42: ``t-cache=\"42\"``) will be evaluated as a python expression. This will be used to generate the **cache key**. So there can be different **cache values** (cached render part) for the same template part. If the **key expression** is a tuple or a list, it will be searched when generating the **cache key**. If one or more recordsets are returned by the **key expression**, then the model, ids and their corresponding write_date will be used to generate the **cache key**. Special case: If the **key expression** returns a Falsy value, then the content will not be cached."
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:530
msgid "In this case, there may be values (string) in the cache corresponding to each record already returned with a true condition, as well as for the false condition. And if a module modifies the record, the write_date being modified, the cached value is discarded."
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:536
msgid "``t-cache`` and scoped values (``t-set``, ``t-foreach``...)"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:538
msgid "Values in ``t-cache`` are scoped, this involves a change in behavior between having or not having ``t-cache`` on one of the parent nodes. Don't forget to take into account that Odoo uses a lot of templates, ``t-call`` and view inheritance. Adding a ``t-cache`` can therefore modify the rendering of a template that you do not see when editing. (``t-foreach`` it's like a ``t-set`` for each iteration)"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:563
msgid "Will render::"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:575
msgid "The base of ``t-nocache``"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:577
msgid "The template part contained in a node with a ``t-nocache`` attribute is not cached. This content is therefore **dynamic** and is rendered systematically. However the available values are those provided by the controller (when calling the ``_render`` method)."
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:591
#: ../../content/developer/reference/frontend/qweb.rst:628
msgid "Will render (counter = 1)::"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:600
msgid "Here the ``<i>`` tag that contains the container will always be rendered. While the rest is as a single string in the cache."
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:604
msgid "``t-nocache`` and scoped root values (``t-set``, ``t-foreach``...)"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:606
msgid "The contents of the ``t-nocache`` tag can be used for documentation and to explain why the directive is added. The values are scoped into ``t-nocache``, these values are root values only (values provided by the controller and/or when calling the ``_render`` method of ``ir.qweb``). ``t-set`` can be done in the template part, but will not be available elsewhere."
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:641
msgid "Here the ``<i>`` tag that contains the container will always be rendered. While the rest is as a single string in the cache. The counter is not updated by the ``t-set`` out of the ``t-nocache``"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:646
msgid "``t-nocache-*`` add some primitive values in the cache"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:648
msgid "In order to be able to use values generated in the template, it is possible to cache them. The directive is used as ``t-nocache-*=\"expr\"`` where ``*`` is the name of the chosen value and ``expr`` the python expression so the result will be cached. The cached value must be primitive type."
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:667
msgid "The value ``cached_value`` is cached with the cached template part of ``t-cache=\"records\"`` and add to the scoped root values each time."
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:671
#: ../../content/developer/reference/frontend/qweb.rst:900
msgid "Helpers"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:674
msgid "Request-based"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:676
msgid "Most Python-side uses of QWeb are in controllers (and during HTTP requests), in which case templates stored in the database (as :ref:`views <reference/view_architectures/qweb>`) can be trivially rendered by calling :meth:`odoo.http.HttpRequest.render`:"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:687
msgid "This automatically creates a :class:`~odoo.http.Response` object which can be returned from the controller (or further customized to suit)."
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:691
msgid "View-based"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:693
msgid "At a deeper level than the previous helper is the ``_render`` method on ``ir.qweb`` (use the datable) and the public module method ``render`` (don't use the database):"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:699
msgid "Renders a QWeb view/template by database id or :term:`external id`. Templates are automatically loaded from ``ir.qweb`` records."
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:702
msgid "``_prepare_environment`` method sets up a number of default values in the rendering context. The ``http_routing`` and ``website`` addons, also default values they need. You can use ``minimal_qcontext=False`` option to avoid this default value like the public method ``render``:"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:710
msgid "``request``"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:711
msgid "the current :class:`~odoo.http.Request` object, if any"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:712
msgid "``debug``"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:713
msgid "whether the current request (if any) is in ``debug`` mode"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:714
msgid ":func:`quote_plus <werkzeug.urls.url_quote_plus>`"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:715
msgid "url-encoding utility function"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:716
msgid ":mod:`json`"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:717
#: ../../content/developer/reference/frontend/qweb.rst:719
#: ../../content/developer/reference/frontend/qweb.rst:721
msgid "the corresponding standard library module"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:718
msgid ":mod:`time`"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:720
msgid ":mod:`datetime`"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:722
msgid "`relativedelta <https://labix.org/python-dateutil#head-ba5ffd4df8111d1b83fc194b97ebecf837add454>`_"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:723
msgid "see module"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:725
msgid "``keep_query``"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:725
msgid "the ``keep_query`` helper function"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:727
msgid "context values to pass to QWeb for rendering"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:728
msgid "name of the Odoo model to use for rendering, can be used to expand or customize QWeb locally (by creating a \"new\" qweb based on ``ir.qweb`` with alterations)"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:734
msgid ":func:`load(ref)`"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:735
msgid "returns etree object, ref"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:739
msgid "the members below are no longer relevant, section to rewrite"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:757
msgid "Defining templates"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:759
msgid "The ``t-name`` directive can only be placed at the top-level of a template file (direct children to the document root)::"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:768
msgid "It takes no other parameter, but can be used with a ``<t>`` element or any other. With a ``<t>`` element, the ``<t>`` should have a single child."
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:771
msgid "The template name is an arbitrary string, although when multiple templates are related (e.g. called sub-templates) it is customary to use dot-separated names to indicate hierarchical relationships."
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:778
msgid "Template inheritance"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:780
msgid "Template inheritance is used to either:"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:781
msgid "Alter existing templates in-place, e.g. to add information to templates"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:783
msgid "created by other modules."
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:783
msgid "Create a new template from a given parent template"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:789
msgid "Template inheritance is performed via the use of two directives:"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:786
msgid "``t-inherit`` which is the name of the template to inherit from,"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:787
msgid "``t-inherit-mode`` which is the behaviour of the inheritance: it can either be set to ``primary`` to create a new child template from the parented one or to ``extension`` to alter the parent template in place."
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:791
msgid "An optional ``t-name`` directive can also be specified. It will be the name of the newly created template if used in primary mode, else it will be added as a comment on the transformed template to help retrace inheritances."
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:795
msgid "For the inheritance itself, the changes are done using xpaths directives. See the XPATH_ documentation for the complete set of available instructions."
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:798
msgid "Primary inheritance (child template)::"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:806
msgid "Extension inheritance (in-place transformation)::"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:815
msgid "Old inheritance mechanism (deprecated)"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:817
msgid "Template inheritance is performed via the ``t-extend`` directive which takes the name of the template to alter as parameter."
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:820
msgid "The directive ``t-extend`` will act as a primary inheritance when combined with ``t-name`` and as an extension one when used alone."
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:823
msgid "In both cases the alteration is then performed with any number of ``t-jquery`` sub-directives::"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:832
msgid "The ``t-jquery`` directives takes a `CSS selector`_. This selector is used on the extended template to select *context nodes* to which the specified ``t-operation`` is applied:"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:839
msgid "``append``"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:839
msgid "the node's body is appended at the end of the context node (after the context node's last child)"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:842
msgid "``prepend``"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:842
msgid "the node's body is prepended to the context node (inserted before the context node's first child)"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:844
#: ../../content/developer/tutorials/backend.rst:587
#: ../../content/developer/tutorials/getting_started/13_inheritance.rst:214
msgid "``before``"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:845
msgid "the node's body is inserted right before the context node"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:846
#: ../../content/developer/tutorials/backend.rst:589
#: ../../content/developer/tutorials/getting_started/13_inheritance.rst:216
msgid "``after``"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:847
msgid "the node's body is inserted right after the context node"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:848
msgid "``inner``"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:849
msgid "the node's body replaces the context node's children"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:850
#: ../../content/developer/tutorials/backend.rst:585
#: ../../content/developer/tutorials/getting_started/13_inheritance.rst:212
msgid "``replace``"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:851
msgid "the node's body is used to replace the context node itself"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:855
#: ../../content/developer/tutorials/backend.rst:593
#: ../../content/developer/tutorials/getting_started/13_inheritance.rst:220
msgid "``attributes``"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:853
msgid "the nodes's body should be any number of ``attribute`` elements, each with a ``name`` attribute and some textual content, the named attribute of the context node will be set to the specified value (either replaced if it already existed or added if not)"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:863
msgid "No operation"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:858
msgid "if no ``t-operation`` is specified, the template body is interpreted as javascript code and executed with the context node as ``this``"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:861
msgid "while much more powerful than other operations, this mode is also much harder to debug and maintain, it is recommended to avoid it"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:866
msgid "debugging"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:868
msgid "The javascript QWeb implementation provides a few debugging hooks:"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:878
msgid "``t-log``"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:873
msgid "takes an expression parameter, evaluates the expression during rendering and logs its result with ``console.log``::"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:879
msgid "will print ``42`` to the console"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:881
msgid "triggers a debugger breakpoint during template rendering::"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:887
msgid "will stop execution if debugging is active (exact condition depend on the browser and its development tools)"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:897
msgid "``t-js``"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:890
msgid "the node's body is javascript code executed during template rendering. Takes a ``context`` parameter, which is the name under which the rendering context will be available in the ``t-js``'s body::"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:904
msgid "(core is the ``web.core`` module) An instance of :js:class:`QWeb2.Engine` with all module-defined template files loaded, and references to standard helper objects ``_`` (underscore), ``_t`` (translation function) and JSON_."
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:908
msgid ":js:func:`core.qweb.render <QWeb2.Engine.render>` can be used to easily render basic module templates"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:918
msgid "The QWeb \"renderer\", handles most of QWeb's logic (loading, parsing, compiling and rendering templates)."
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:921
msgid "Odoo Web instantiates one for the user in the core module, and exports it to ``core.qweb``. It also loads all the template files of the various modules into that QWeb instance."
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:925
msgid "A :js:class:`QWeb2.Engine` also serves as a \"template namespace\"."
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:929
msgid "Renders a previously loaded template to a String, using ``context`` (if provided) to find the variables accessed during template rendering (e.g. strings to display)."
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:933
msgid "the name of the template to render"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:934
msgid "the basic namespace to use for template rendering"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:936
msgid "String"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:938
msgid "The engine exposes an other method which may be useful in some cases (e.g. if you need a separate template namespace with, in Odoo Web, Kanban views get their own :js:class:`QWeb2.Engine` instance so their templates don't collide with more general \"module\" templates):"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:946
msgid "Loads a template file (a collection of templates) in the QWeb instance. The templates can be specified as:"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:951
msgid "An XML string"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:950
msgid "QWeb will attempt to parse it to an XML document then load it."
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:955
msgid "A URL"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:954
msgid "QWeb will attempt to download the URL content, then load the resulting XML string."
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:960
msgid "A ``Document`` or ``Node``"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:958
msgid "QWeb will traverse the first level of the document (the child nodes of the provided root) and load any named template or template override."
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:964
msgid "A :js:class:`QWeb2.Engine` also exposes various attributes for behavior customization:"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:969
msgid "Prefix used to recognize directives during parsing. A string. By default, ``t``."
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:974
msgid "Boolean flag putting the engine in \"debug mode\". Normally, QWeb intercepts any error raised during template execution. In debug mode, it leaves all exceptions go through without intercepting them."
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:981
msgid "The jQuery instance used during template inheritance processing. Defaults to ``window.jQuery``."
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:986
msgid "A ``Function``. If present, called before compiling each DOM node to template code. In Odoo Web, this is used to automatically translate text content and some attributes in templates. Defaults to ``null``."
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:991
msgid "it is similar in that to Genshi_, although it does not use (and has no support for) `XML namespaces`_"
msgstr ""
#: ../../content/developer/reference/frontend/qweb.rst:994
msgid "although it uses a few others, either for historical reasons or because they remain better fits for the use case. Odoo 9.0 still depends on Jinja_ and Mako_."
msgstr ""
#: ../../content/developer/reference/frontend/registries.rst:7
msgid "Registries are (ordered) key/value maps. They are the main web client extension points: many features provided by the Odoo javascript framework simply look up into a registry whenever it needs a definition for some object (such as fields, views, client actions or services). Customizing the web client is then simply done by adding specific values in the correct registry."
msgstr ""
#: ../../content/developer/reference/frontend/registries.rst:23
msgid "A useful feature of registries is that they maintain a set of sub registries, obtained by the `category` method. If the sub registry does not exist yet, it is created on the fly. All registries used by the web client are obtained in such a way from one root registry, exported in `@web/core/registry`."
msgstr ""
#: ../../content/developer/reference/frontend/registries.rst:37
msgid "Registry API"
msgstr ""
#: ../../content/developer/reference/frontend/registries.rst:41
msgid "Creates a new registry. Note that a registry is an event bus, so one can listen to the `UPDATE` event if necessary. Registries are ordered: the :js:meth:`getAll <Registry.getAll>` method returns a list of values ordered according to their sequence number."
msgstr ""
#: ../../content/developer/reference/frontend/registries.rst:48
msgid "key for the new entry"
msgstr ""
#: ../../content/developer/reference/frontend/registries.rst:49
msgid "value for the new entry"
msgstr ""
#: ../../content/developer/reference/frontend/registries.rst:50
msgid "options"
msgstr ""
#: ../../content/developer/reference/frontend/registries.rst:51
msgid "do not throw if key already exists"
msgstr ""
#: ../../content/developer/reference/frontend/registries.rst:52
msgid "sequence number (useful to order entries)"
msgstr ""
#: ../../content/developer/reference/frontend/registries.rst:53
#: ../../content/developer/reference/frontend/registries.rst:95
msgid "Registry"
msgstr ""
#: ../../content/developer/reference/frontend/registries.rst:55
msgid "Inserts a value at a specific key. If the key is already used, this method throws an error (unless the option `force` is set to true). The option `sequence` is useful to insert the value at a specific position. This method also triggers an `UPDATE` event."
msgstr ""
#: ../../content/developer/reference/frontend/registries.rst:60
msgid "Returns the same registry, so `add` method calls can be chained."
msgstr ""
#: ../../content/developer/reference/frontend/registries.rst:64
#: ../../content/developer/reference/frontend/registries.rst:73
msgid "key for the entry"
msgstr ""
#: ../../content/developer/reference/frontend/registries.rst:65
msgid "return value if no entry for key exists"
msgstr ""
#: ../../content/developer/reference/frontend/registries.rst:67
msgid "Returns the value corresponding to the `key` argument. If the registry does not contain that key, this method returns `defaultValue` if given, or throws an error otherwise."
msgstr ""
#: ../../content/developer/reference/frontend/registries.rst:76
msgid "Returns `true` if `key` is present in the registry"
msgstr ""
#: ../../content/developer/reference/frontend/registries.rst:82
msgid "Returns the list of all elements in the registry. It is ordered according to the sequence numbers."
msgstr ""
#: ../../content/developer/reference/frontend/registries.rst:87
msgid "the key for the entry that should be removed"
msgstr ""
#: ../../content/developer/reference/frontend/registries.rst:89
msgid "Removes a key/value pair from the registry. This operation triggers an `UPDATE` event."
msgstr ""
#: ../../content/developer/reference/frontend/registries.rst:94
msgid "the name for the sub category"
msgstr ""
#: ../../content/developer/reference/frontend/registries.rst:97
msgid "Returns the sub registry associated with the `subcategory`. If it does not exist yet, the sub registry is created on the fly."
msgstr ""
#: ../../content/developer/reference/frontend/registries.rst:108
#: ../../content/developer/tutorials/discover_js_framework.rst:46
#: ../../content/developer/tutorials/master_odoo_web_framework.rst:55
msgid "Content"
msgstr ""
#: ../../content/developer/reference/frontend/registries.rst:109
msgid ":ref:`effects <frontend/registries/effects>`"
msgstr ""
#: ../../content/developer/reference/frontend/registries.rst:110
msgid "implementation for all available effects"
msgstr ""
#: ../../content/developer/reference/frontend/registries.rst:111
msgid ":ref:`formatters <frontend/registries/formatters>`"
msgstr ""
#: ../../content/developer/reference/frontend/registries.rst:112
msgid "utility functions to format values (mostly used for field values)"
msgstr ""
#: ../../content/developer/reference/frontend/registries.rst:113
msgid ":ref:`main_components <frontend/registries/main_components>`"
msgstr ""
#: ../../content/developer/reference/frontend/registries.rst:114
msgid "top level components"
msgstr ""
#: ../../content/developer/reference/frontend/registries.rst:115
msgid ":ref:`parsers <frontend/registries/parsers>`"
msgstr ""
#: ../../content/developer/reference/frontend/registries.rst:116
msgid "utility functions to parse values (mostly used for field values)"
msgstr ""
#: ../../content/developer/reference/frontend/registries.rst:117
msgid ":ref:`services <frontend/registries/services>`"
msgstr ""
#: ../../content/developer/reference/frontend/registries.rst:118
msgid "all services that should be activated"
msgstr ""
#: ../../content/developer/reference/frontend/registries.rst:119
msgid ":ref:`systray <frontend/registries/systray>`"
msgstr ""
#: ../../content/developer/reference/frontend/registries.rst:120
msgid "components displayed in the systray zone in the navbar"
msgstr ""
#: ../../content/developer/reference/frontend/registries.rst:121
msgid ":ref:`user_menuitems <frontend/registries/usermenu>`"
msgstr ""
#: ../../content/developer/reference/frontend/registries.rst:122
msgid "menu items displayed in the user menu (top right of navbar)"
msgstr ""
#: ../../content/developer/reference/frontend/registries.rst:127
msgid "Effect registry"
msgstr ""
#: ../../content/developer/reference/frontend/registries.rst:129
msgid "The `effects` registry contains the implementations of all available effects. See the section on the :ref:`effect service <frontend/services/effect_registry>` for more details."
msgstr ""
#: ../../content/developer/reference/frontend/registries.rst:136
msgid "Formatter registry"
msgstr ""
#: ../../content/developer/reference/frontend/registries.rst:138
msgid "The `formatters` registry contains functions to format values. Each formatter has the following API:"
msgstr ""
#: ../../content/developer/reference/frontend/registries.rst:143
msgid "a value of a specific type, or `false` if no value is given"
msgstr ""
#: ../../content/developer/reference/frontend/registries.rst:145
msgid "various options"
msgstr ""
#: ../../content/developer/reference/frontend/registries.rst:148
msgid "Formats a value and returns a string"
msgstr ""
#: ../../content/developer/reference/frontend/registries.rst:151
msgid ":ref:`Parsers registry <frontend/registries/parsers>`"
msgstr ""
#: ../../content/developer/reference/frontend/registries.rst:156
msgid "Main components registry"
msgstr ""
#: ../../content/developer/reference/frontend/registries.rst:158
msgid "The main component registry (`main_components`) is useful for adding top level components in the web client. The webclient has a `MainComponentsContainer` as direct child. This component is basically a live representation of the ordered list of components registered in the main components registry."
msgstr ""
#: ../../content/developer/reference/frontend/registries.rst:172
msgid "For example, the `LoadingIndicator` component can be added in the registry like this:"
msgstr ""
#: ../../content/developer/reference/frontend/registries.rst:184
msgid "Parser registry"
msgstr ""
#: ../../content/developer/reference/frontend/registries.rst:186
msgid "The `parsers` registry contains functions to parse values. Each parser has the following API:"
msgstr ""
#: ../../content/developer/reference/frontend/registries.rst:192
msgid "a string representing a value"
msgstr ""
#: ../../content/developer/reference/frontend/registries.rst:194
msgid "various options (parser specific)"
msgstr ""
#: ../../content/developer/reference/frontend/registries.rst:195
msgid "T a valid value"
msgstr ""
#: ../../content/developer/reference/frontend/registries.rst:197
msgid "Parses a string and returns a value. If the string does not represent a valid value, parsers can fail and throw errors."
msgstr ""
#: ../../content/developer/reference/frontend/registries.rst:201
msgid ":ref:`Formatters registry <frontend/registries/formatters>`"
msgstr ""
#: ../../content/developer/reference/frontend/registries.rst:206
msgid "Service registry"
msgstr ""
#: ../../content/developer/reference/frontend/registries.rst:208
msgid "The service registry (category: `services`) contains all :ref:`services <frontend/services>` that should be activated by the Odoo framework."
msgstr ""
#: ../../content/developer/reference/frontend/registries.rst:228
msgid "Systray registry"
msgstr ""
#: ../../content/developer/reference/frontend/registries.rst:230
msgid "The systray is the zone on the right of the navbar that contains various small components, that usually display some sort of information (like the number of unread messages), notifications and/or let the user interact with them."
msgstr ""
#: ../../content/developer/reference/frontend/registries.rst:234
msgid "The `systray` registry contains a description of these systray items, as objects with the following three keys:"
msgstr ""
#: ../../content/developer/reference/frontend/registries.rst:237
msgid "`Component`: the component class that represents the item. Its root element should be a `<li>` tag, otherwise it might not be styled properly."
msgstr ""
#: ../../content/developer/reference/frontend/registries.rst:239
msgid "`props (optional)`: props that should be given to the component"
msgstr ""
#: ../../content/developer/reference/frontend/registries.rst:240
msgid "`isDisplayed (optional)`: a function that takes the :ref:`env <frontend/framework/environment>` and returns a boolean. If true, the systray item is displayed. Otherwise it is removed."
msgstr ""
#: ../../content/developer/reference/frontend/registries.rst:244
#: ../../content/developer/reference/frontend/services.rst:548
#: ../../content/developer/reference/frontend/services.rst:579
#: ../../content/developer/tutorials/master_odoo_web_framework/01_build_clicker_game.rst:294
msgid "For example:"
msgstr ""
#: ../../content/developer/reference/frontend/registries.rst:259
msgid "The systray registry is an ordered registry (with the `sequence` number):"
msgstr ""
#: ../../content/developer/reference/frontend/registries.rst:268
msgid "The sequence number defaults to 50. If given, this number will be used to order the items. The lowest sequence is on the right and the highest sequence is on the left in the systray menu."
msgstr ""
#: ../../content/developer/reference/frontend/registries.rst:275
msgid "Usermenu registry"
msgstr ""
#: ../../content/developer/reference/frontend/registries.rst:277
msgid "The user menu registry (category: `user_menuitems`) contains all menu items that are shown when opening the user menu (the navbar element with the user name, on the top right)."
msgstr ""
#: ../../content/developer/reference/frontend/registries.rst:281
msgid "User menu items are defined by a function taking the :ref:`env <frontend/framework/environment>` and returning a plain object, containing the following information:"
msgstr ""
#: ../../content/developer/reference/frontend/registries.rst:284
msgid "`description` : the menu item text,"
msgstr ""
#: ../../content/developer/reference/frontend/registries.rst:285
msgid "`href` : (optional) if given (and truthy), the item text is put in a `a` tag with given attribute href,"
msgstr ""
#: ../../content/developer/reference/frontend/registries.rst:286
msgid "`callback` : callback to call when the item is selected,"
msgstr ""
#: ../../content/developer/reference/frontend/registries.rst:287
msgid "`hide`: (optional) indicates if the item should be hidden (default: `false`),"
msgstr ""
#: ../../content/developer/reference/frontend/registries.rst:288
msgid "`sequence`: (optional) determines the rank of the item among the other dropwdown items (default: 100)."
msgstr ""
#: ../../content/developer/reference/frontend/registries.rst:290
msgid "The user menu calls all the functions defining items every time it is opened."
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:8
msgid "Services are long lived pieces of code that provide a feature. They may be imported by components (with ``useService``) or by other services. Also, they can declare a set of dependencies. In that sense, services are basically a DI :dfn:`dependency injection` system. For example, the ``notification`` service provides a way to display a notification, or the ``rpc`` service is the proper way to perform a request to the Odoo server."
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:15
#: ../../content/developer/tutorials/discover_js_framework/02_build_a_dashboard.rst:86
msgid "The following example registers a simple service that displays a notification every 5 seconds:"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:34
msgid "At startup, the web client starts all services present in the `services` registry. Note that the name used in the registry is the name of the service."
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:39
msgid "Most code that is not a component should be *packaged* in a service, in particular if it performs some side effect. This is very useful for testing purposes: tests can choose which services are active, so there are less chance for unwanted side effects interfering with the code being tested."
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:45
msgid "Defining a service"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:47
msgid "A service needs to implement the following interface:"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:51
msgid "Optional list of strings. It is the list of all dependencies (other services) that this service needs"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:56
msgid "the application environment"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:57
msgid "all requested dependencies"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:58
msgid "value of service or Promise<value of service>"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:60
msgid "This is the main definition for the service. It can return either a value or a promise. In that case, the service loader simply waits for the promise to resolve to a value, which is then the value of the service."
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:64
msgid "Some services do not export any value. They may just do their work without a need to be directly called by other code. In that case, their value will be set to ``null`` in ``env.services``."
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:70
msgid "Optional value. If given, it should be `true` or a list of strings."
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:72
msgid "Some services need to provide an asynchronous API. For example, the `rpc` service is an asynchronous function, or the `orm` service provides a set of functions to call the Odoo server."
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:76
msgid "In that case, it is possible for components that use a service to be destroyed before the end of an asynchronous function call. Most of the time, the asynchronous function call needs to be ignored. Doing otherwise is potentially very risky, because the underlying component is no longer active. The `async` flag is a way to do just that: it signals to the service creator that all asynchronous calls coming from components should be left pending if the component is destroyed."
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:86
msgid "Using a service"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:88
msgid "A service that depends on other services and has properly declared its ``dependencies`` simply receives a reference to the corresponding services in the second argument of the ``start`` method."
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:92
msgid "The ``useService`` hook is the proper way to use a service in a component. It simply returns a reference to the service value, that can then be used by the component later. For example:"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:119
msgid ":ref:`cookie <frontend/services/cookie>`"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:120
msgid "read or modify cookies"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:121
msgid ":ref:`effect <frontend/services/effect>`"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:122
msgid "display graphical effects"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:123
msgid ":ref:`http <frontend/services/http>`"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:124
msgid "perform low level http calls"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:125
msgid ":ref:`notification <frontend/services/notification>`"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:126
msgid "display notifications"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:127
msgid ":ref:`router <frontend/services/router>`"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:128
msgid "manage the browser url"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:129
msgid ":ref:`rpc <frontend/services/rpc>`"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:130
msgid "send requests to the server"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:131
msgid ":ref:`scroller <frontend/services/scroller>`"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:132
msgid "handle clicks on anchors elements"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:133
msgid ":ref:`title <frontend/services/title>`"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:134
msgid "read or modify the window title"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:135
msgid ":ref:`user <frontend/services/user>`"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:136
msgid "provides some information related to the current user"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:141
msgid "Cookie service"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:146
msgid "Technical name: `cookie`"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:147
#: ../../content/developer/reference/frontend/services.rst:525
#: ../../content/developer/reference/frontend/services.rst:615
#: ../../content/developer/reference/frontend/services.rst:711
#: ../../content/developer/reference/frontend/services.rst:762
msgid "Dependencies: none"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:149
msgid "Provides a way to manipulate cookies. For example:"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:160
msgid "Object representing each cookie and its value if any (or empty string)"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:164
msgid "the name of the cookie that should be set"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:165
msgid "optional. If given, the cookie will be set to that value"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:166
msgid "optional. the time in seconds before the cookie will be deleted (default=1 year)"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:168
msgid "Sets the cookie `name` to the value `value` with a max age of `ttl`"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:172
msgid "name of the cookie"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:174
msgid "Deletes the cookie `name`."
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:179
msgid "Effect service"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:184
msgid "Technical name: `effect`"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:185
#: ../../content/developer/reference/frontend/services.rst:365
#: ../../content/developer/reference/frontend/services.rst:411
msgid "Dependencies: None"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:187
msgid "Effects are graphical elements that can be temporarily displayed on top of the page, usually to provide feedback to the user that something interesting happened."
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:189
msgid "A good example would be the rainbow man:"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:-1
msgid "The rainbow man effect"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:197
msgid "Here's how this can be displayed:"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:208
msgid "The hook `useEffect` is not related to the effect service."
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:215
msgid "the options for the effect. They will get passed along to the underlying effect component."
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:217
msgid "Display an effect."
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:219
#: ../../content/developer/reference/frontend/services.rst:431
msgid "The options are defined by:"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:230
msgid "Available effects"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:232
msgid "Currently, the only effect is the rainbow man."
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:235
msgid "RainbowMan"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:248
msgid "`params.Component`"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:249
msgid "`owl.Component?`"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:250
msgid "Component class to instantiate inside the RainbowMan (will replace the message)."
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:251
msgid "`params.props`"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:252
msgid "`object?={}`"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:253
msgid "If params.Component is given, its props can be passed with this argument."
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:254
msgid "`params.message`"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:255
msgid "`string?=\"Well Done!\"`"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:256
msgid "Message is the notice the rainbowman holds."
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:258
msgid "If effects are disabled for the user, the rainbowman won't appear and a simple notification will get displayed as a fallback."
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:261
msgid "If effects are enabled and params.Component is given, params.message is not used."
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:263
msgid "The message is a simple string or a string representing html (prefer using params.Component if you want interactions in the DOM)."
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:265
msgid "`params.messageIsHtml`"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:266
msgid "`boolean?=false`"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:267
msgid "Set to true if the message represents html, s.t. it will be correctly inserted into the DOM."
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:268
msgid "`params.img_url`"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:269
msgid "`string?=/web/static/img/smile.svg`"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:270
msgid "The url of the image to display inside the rainbow."
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:271
msgid "`params.fadeout`"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:272
msgid "`(\"slow\"|\"medium\"|\"fast\"|\"no\")?=\"medium\"`"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:273
msgid "Delay for rainbowman to disappear."
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:275
msgid "`\"fast\"` will make rainbowman dissapear quickly."
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:277
msgid "`\"medium\"` and `\"slow\"` will wait little longer before disappearing (can be used when `params.message` is longer)."
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:279
msgid "`\"no\"` will keep rainbowman on screen until user clicks anywhere outside rainbowman."
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:283
msgid "How to add an effect"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:287
msgid "The effects are stored in a registry called `effects`. You can add new effects by providing a name and a function."
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:295
msgid "The function must follow this API:"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:299
msgid "the environment received by the service"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:301
msgid "the params received from the add function on the service."
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:303
msgid "`({Component, props} | void)` A component and its props or nothing."
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:305
msgid "This function must create a component and return it. This component is mounted inside the effect component container."
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:311
msgid "Let's say we want to add an effect that add a sepia look at the page."
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:343
msgid "And then, call it somewhere you want and you will see the result. Here, it is called in webclient.js to make it visible everywhere for the example."
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:-1
msgid "Odoo in sepia"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:359
msgid "Http Service"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:364
msgid "Technical name: `http`"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:367
msgid "While most interactions between the client and the server in odoo are `RPCs` (`XMLHTTPRequest`), lower level control on requests may sometimes be required."
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:370
msgid "This service provides a way to send `get` and `post` `http requests <https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods>`_."
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:377
#: ../../content/developer/reference/frontend/services.rst:385
msgid "the url to send the request to"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:378
#: ../../content/developer/reference/frontend/services.rst:387
msgid "the response content type. Can be \"text\", \"json\", \"formData\", \"blob\", \"arrayBuffer\"."
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:379
#: ../../content/developer/reference/frontend/services.rst:388
msgid "the result of the request with the format defined by the readMethod argument."
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:381
msgid "Sends a get request."
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:386
msgid "key value data to be set in the form data part of the request"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:390
msgid "Sends a post request."
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:405
msgid "Notification service"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:410
msgid "Technical name: `notification`"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:413
msgid "The `notification` service allows to display notifications on the screen."
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:425
msgid "the notification message to display"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:426
msgid "the options of the notification"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:427
msgid "a function to close the notification"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:429
msgid "Shows a notification."
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:442
msgid "Add a title to the notification"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:443
msgid "`type`"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:444
msgid "`warning` | `danger` | `success` | `info`"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:445
msgid "Changes the background color according to the type"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:446
msgid "`sticky`"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:448
msgid "Whether or not the notification should stay until dismissed"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:451
msgid "additional css class that will be added to the notification"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:452
msgid "`onClose`"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:454
msgid "callback to be executed when the notification closes"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:455
msgid "`buttons`"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:456
msgid "button[] (see below)"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:457
msgid "list of button to display in the notification"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:459
msgid "The buttons are defined by:"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:470
msgid "The button text"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:471
msgid "`onClick`"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:473
msgid "callback to execute when the button is clicked"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:474
msgid "`primary`"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:476
msgid "whether the button should be styled as a primary button"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:481
msgid "A notification for when a sale deal is made with a button to go some kind of commission page."
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:-1
msgid "Example of notification"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:508
msgid "A notification that closes after a second:"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:519
msgid "Router Service"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:524
msgid "Technical name: `router`"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:527
msgid "The `router` service provides three features:"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:529
msgid "information about the current route"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:530
msgid "a way for the application to update the url, depending on its state"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:531
msgid "listens to every hash change, and notifies the rest of the application"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:539
msgid "The current route can be accessed with the ``current`` key. It is an object with the following information:"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:542
msgid "`pathname (string)`: the path for the current location (most likely `/web` )"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:543
msgid "`search (object)`: a dictionary mapping each search keyword (the querystring) from the url to its value. An empty string is the value if no value was explicitely given"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:546
msgid "`hash (object)`: same as above, but for values described in the hash."
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:558
msgid "Updating the URL is done with the `pushState` method:"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:562
msgid "object containing a mapping from some keys to some values"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:563
msgid "if true, the url will be replaced, otherwise only key/value pairs from the `hash` will be updated."
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:566
msgid "Updates the URL with each key/value pair from the `hash` object. If a value is set to an empty string, the key is added to the url without any corresponding value."
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:570
msgid "If true, the `replace` argument tells the router that the url hash should be completely replaced (so values not present in the `hash` object will be removed)."
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:573
msgid "This method call does not reload the page. It also does not trigger a `hashchange` event, nor a `ROUTE_CHANGE` in the :ref:`main bus <frontend/framework/bus>`. This is because this method is intended to only updates the url. The code calling this method has the responsibility to make sure that the screen is updated as well."
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:590
msgid "Finally, the `redirect` method will redirect the browser to a specified url:"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:594
msgid "a valid url"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:595
msgid "if true, wait for the server to be ready, and redirect after"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:597
msgid "Redirect the browser to `url`. This method reloads the page. The `wait` argument is rarely used: it is useful in some cases where we know that the server will be unavailable for a short duration, typically just after an addon update or install operation."
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:603
msgid "The router service emits a `ROUTE_CHANGE` event on the :ref:`main bus <frontend/framework/bus>` whenever the current route has changed."
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:609
msgid "RPC service"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:614
msgid "Technical name: `rpc`"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:617
msgid "The `rpc` service provides a single asynchronous function to send requests to the server. Calling a controller is very simple: the route should be the first argument and optionally, a ``params`` object can be given as a second argument."
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:631
msgid "Note that the ``rpc`` service is considered a low-level service. It should only be used to interact with Odoo controllers. To work with models (which is by far the most important usecase), one should use the ``orm`` service instead."
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:641
msgid "route targeted by the request"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:642
msgid "(optional) parameters sent to the server"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:643
msgid "(optional) request settings (see below)"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:645
msgid "The ``settings`` object can contain:"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:647
msgid "``xhr``, which should be a ``XMLHTTPRequest`` object. In that case, the ``rpc`` method will simply use it instead of creating a new one. This is useful when one accesses advanced features of the `XMLHTTPRequest` API."
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:650
msgid "``silent (boolean)`` If set to ``true``, the web client will not provide a feedback that there is a pending rpc."
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:653
msgid "The ``rpc`` service communicates with the server by using a ``XMLHTTPRequest`` object, configured to work with the ``application/json`` content type. So clearly the content of the request should be JSON serializable. Each request done by this service uses the ``POST`` http method."
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:658
msgid "Server errors actually return the response with an http code 200. But the ``rpc`` service will treat them as error."
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:664
msgid "An rpc can fail for two main reasons:"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:666
msgid "either the odoo server returns an error (so, we call this a ``server`` error). In that case the http request will return with an http code 200 BUT with a response object containing an ``error`` key."
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:670
msgid "or there is some other kind of network error"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:672
msgid "When a rpc fails, then:"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:674
msgid "the promise representing the rpc is rejected, so the calling code will crash, unless it handles the situation"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:676
msgid "an event ``RPC_ERROR`` is triggered on the main application bus. The event payload contains a description of the cause of the error:"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:679
msgid "If it is a server error (the server code threw an exception). In that case the event payload will be an object with the following keys:"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:683
msgid "``type = 'server'``"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:684
msgid "``message(string)``"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:686
msgid "``code(number)``"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:689
msgid "``name(string)`` (optional, used by the error service to look for an appropriate dialog to use when handling the error)"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:692
msgid "``subType(string)`` (optional, often used to determine the dialog title)"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:693
msgid "``data(object)`` (optional object that can contain various keys among which ``debug`` : the main debug information, with the call stack)"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:696
msgid "If it is a network error, then the error description is simply an object ``{type: 'network'}``. When a network error occurs, a :ref:`notification <frontend/services/notification>` is displayed and the server is regularly contacted until it responds. The notification is closed as soon as the server responds."
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:705
msgid "Scroller service"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:710
msgid "Technical name: `scroller`"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:713
msgid "Whenever the user clicks on an anchor in the web client, this service automatically scrolls to the target (if appropriate)."
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:716
msgid "The service adds an event listener to get `click`'s on the document. The service checks if the selector contained in its href attribute is valid to distinguish anchors and Odoo actions (e.g. `<a href=\"#target_element\"></a>`). It does nothing if it is not the case."
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:720
msgid "An event `SCROLLER:ANCHOR_LINK_CLICKED` is triggered on the main application bus if the click seems to be targeted at an element. The event contains a custom event containing the `element` matching and its `id` as a reference. It may allow other parts to handle a behavior relative to anchors themselves. The original event is also given as it might need to be prevented. If the event is not prevented, then the user interface will scroll to the target element."
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:729
msgid "The following values are contained in the `anchor-link-clicked` custom event explained above."
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:738
msgid "`element`"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:739
msgid "`HTMLElement | null`"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:740
msgid "The anchor element targeted by the href"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:741
msgid "`id`"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:743
msgid "The id contained in the href"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:744
msgid "`originalEv`"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:745
msgid "`Event`"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:746
msgid "The original click event"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:749
msgid "The scroller service emits a `SCROLLER:ANCHOR_LINK_CLICKED` event on the :ref:`main bus <frontend/framework/bus>`. To avoid the default scroll behavior of the scroller service, you must use `preventDefault()` on the event given to the listener so that you can implement your own behavior correctly from the listener."
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:756
msgid "Title Service"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:761
msgid "Technical name: `title`"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:764
msgid "The `title` service offers a simple API that allows to read/modify the document title. For example, if the current document title is \"Odoo\", we can change it to \"Odoo 15 - Apple\" by using the following command:"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:779
msgid "The ``title`` service manipulates the following interface:"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:787
msgid "Each key represents the identity of a part of the title, and each value is the string that is displayed, or `null` if it has been removed."
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:790
msgid "Its API is:"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:795
msgid "This is a string representing the current title. It is structured in the following way: ``value_1 - ... - value_n`` where each `value_i` is a (non null) value found in the `Parts` object (returned by the `getParts` function)"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:801
msgid "Parts the current `Parts` object maintained by the title service"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:805
msgid "object representing the required change"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:807
msgid "The ``setParts`` method allows to add/replace/delete several parts of the title. Delete a part (a value) is done by setting the associated key value to `null`."
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:810
msgid "Note that one can only modify a single part without affecting the other parts. For example, if the title is composed of the following parts:"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:817
msgid "with ``current`` value being ``Odoo - Import`` , then"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:825
msgid "will change the title to ``Odoo``."
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:831
msgid "User service"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:836
msgid "Technical name: `user`"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:837
msgid "Dependencies: `rpc`"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:839
msgid "The `user` service provides a bunch of data and a few helper functions concerning the connected user."
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:854
#: ../../content/developer/reference/frontend/services.rst:857
msgid "``Object``"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:855
msgid "The :ref:`user context<frontend/framework/user_context>`"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:856
msgid "``db``"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:858
msgid "Info about the database"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:859
msgid "``home_action_id``"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:860
msgid "``(number | false)``"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:861
msgid "Id of the action used as home for the user"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:862
msgid "``isAdmin``"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:863
#: ../../content/developer/reference/frontend/services.rst:866
msgid "``boolean``"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:864
msgid "Whether the user is an admin (group `base.group_erp_manager` or superuser)"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:865
msgid "``isSystem``"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:867
msgid "Whether the user is part of the system group (`base.group_system`)"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:868
msgid "``lang``"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:869
#: ../../content/developer/reference/frontend/services.rst:872
#: ../../content/developer/reference/frontend/services.rst:878
#: ../../content/developer/reference/frontend/services.rst:884
#: ../../content/developer/reference/user_interface/view_architectures.rst:3268
#: ../../content/developer/reference/user_interface/view_architectures.rst:3530
#: ../../content/developer/reference/user_interface/view_architectures.rst:3686
#: ../../content/developer/tutorials/backend.rst:908
msgid "``string``"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:870
msgid "language used"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:873
msgid "Name of the user"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:874
msgid "``partnerId``"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:875
#: ../../content/developer/reference/frontend/services.rst:881
msgid "``number``"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:876
msgid "Id of the partner instance of the user"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:877
msgid "``tz``"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:879
msgid "The timezone of the user"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:880
msgid "``userId``"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:882
msgid "Id of the user"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:883
msgid "``userName``"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:885
msgid "Alternative nick name of the user"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:890
msgid "the object to update the context with"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:892
msgid "update the :ref:`user context<frontend/framework/user_context>` with the given object."
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:900
msgid "the key of the targeted attribute"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:902
msgid "remove the value with the given key from the :ref:`user context<frontend/framework/user_context>`"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:910
msgid "the xml_id of the group to look for"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:912
msgid "`Promise<boolean>` is the user in the group"
msgstr ""
#: ../../content/developer/reference/frontend/services.rst:914
msgid "check if the user is part of a group"
msgstr ""
#: ../../content/developer/reference/standard_modules.rst:5
msgid "Standard modules"
msgstr ""
#: ../../content/developer/reference/standard_modules/account.rst:5
msgid "Accounting"
msgstr ""
#: ../../content/developer/reference/standard_modules/account/account_account.rst:5
#: ../../../odoo/addons/account/models/account_tax.py:docstring of odoo.addons.account.models.account_tax.AccountTaxRepartitionLine.account_id:1
msgid "Account"
msgstr ""
#: ../../../odoo/addons/account/models/account_account.py:docstring of odoo.addons.account.models.account_account.AccountAccount:1
#: ../../../odoo/addons/account/models/account_account.py:docstring of odoo.addons.account.models.account_account.AccountGroup:1
#: ../../../odoo/addons/account/models/account_account_tag.py:docstring of odoo.addons.account.models.account_account_tag.AccountAccountTag:1
#: ../../../odoo/addons/account/models/account_report.py:docstring of odoo.addons.account.models.account_report.AccountReport:1
#: ../../../odoo/addons/account/models/account_report.py:docstring of odoo.addons.account.models.account_report.AccountReportLine:1
#: ../../../odoo/addons/account/models/account_tax.py:docstring of odoo.addons.account.models.account_tax.AccountTax:1
#: ../../../odoo/addons/account/models/account_tax.py:docstring of odoo.addons.account.models.account_tax.AccountTaxRepartitionLine:1
#: ../../../odoo/addons/account/models/partner.py:docstring of odoo.addons.account.models.partner.AccountFiscalPosition:1
msgid "Original definition from `account`"
msgstr ""
#: ../../content/developer/tutorials/getting_started/04_basicmodel.rst:262
#: ../../content/developer/tutorials/getting_started/04_basicmodel.rst:263
#: ../../content/developer/tutorials/getting_started/08_relations.rst:73
#: ../../content/developer/tutorials/getting_started/08_relations.rst:180
#: ../../content/developer/tutorials/getting_started/08_relations.rst:245
#: ../../content/developer/tutorials/getting_started/08_relations.rst:246
#: ../../../odoo/addons/account/models/account_account.py:docstring of odoo.addons.account.models.account_account.AccountAccount.account_type:0
#: ../../../odoo/addons/account/models/account_account.py:docstring of odoo.addons.account.models.account_account.AccountAccount.code:0
#: ../../../odoo/addons/account/models/account_account.py:docstring of odoo.addons.account.models.account_account.AccountAccount.name:0
#: ../../../odoo/addons/account/models/account_account.py:docstring of odoo.addons.account.models.account_account.AccountGroup.name:0
#: ../../../odoo/addons/account/models/account_account_tag.py:docstring of odoo.addons.account.models.account_account_tag.AccountAccountTag.applicability:0
#: ../../../odoo/addons/account/models/account_account_tag.py:docstring of odoo.addons.account.models.account_account_tag.AccountAccountTag.name:0
#: ../../../odoo/addons/account/models/account_report.py:docstring of odoo.addons.account.models.account_report.AccountReport.name:0
#: ../../../odoo/addons/account/models/account_report.py:docstring of odoo.addons.account.models.account_report.AccountReportLine.hierarchy_level:0
#: ../../../odoo/addons/account/models/account_report.py:docstring of odoo.addons.account.models.account_report.AccountReportLine.name:0
#: ../../../odoo/addons/account/models/account_report.py:docstring of odoo.addons.account.models.account_report.AccountReportLine.report_id:0
#: ../../../odoo/addons/account/models/account_tax.py:docstring of odoo.addons.account.models.account_tax.AccountTax.amount:0
#: ../../../odoo/addons/account/models/account_tax.py:docstring of odoo.addons.account.models.account_tax.AccountTax.amount_type:0
#: ../../../odoo/addons/account/models/account_tax.py:docstring of odoo.addons.account.models.account_tax.AccountTax.name:0
#: ../../../odoo/addons/account/models/account_tax.py:docstring of odoo.addons.account.models.account_tax.AccountTax.sequence:0
#: ../../../odoo/addons/account/models/account_tax.py:docstring of odoo.addons.account.models.account_tax.AccountTax.tax_group_id:0
#: ../../../odoo/addons/account/models/account_tax.py:docstring of odoo.addons.account.models.account_tax.AccountTax.type_tax_use:0
#: ../../../odoo/addons/account/models/account_tax.py:docstring of odoo.addons.account.models.account_tax.AccountTaxRepartitionLine.document_type:0
#: ../../../odoo/addons/account/models/account_tax.py:docstring of odoo.addons.account.models.account_tax.AccountTaxRepartitionLine.factor_percent:0
#: ../../../odoo/addons/account/models/account_tax.py:docstring of odoo.addons.account.models.account_tax.AccountTaxRepartitionLine.repartition_type:0
#: ../../../odoo/addons/account/models/partner.py:docstring of odoo.addons.account.models.partner.AccountFiscalPosition.name:0
msgid "required"
msgstr ""
#: ../../../odoo/addons/account/models/account_account.py:docstring of odoo.addons.account.models.account_account.AccountAccount.name:1
msgid "Account Name"
msgstr ""
#: ../../../odoo/addons/account/models/account_account.py:docstring of odoo.addons.account.models.account_account.AccountAccount.currency_id:1
msgid "Account Currency"
msgstr ""
#: ../../../odoo/addons/account/models/account_account.py:docstring of odoo.addons.account.models.account_account.AccountAccount.currency_id:0
#: ../../../odoo/addons/account/models/account_account.py:docstring of odoo.addons.account.models.account_account.AccountAccount.tag_ids:0
#: ../../../odoo/addons/account/models/account_account.py:docstring of odoo.addons.account.models.account_account.AccountAccount.tax_ids:0
#: ../../../odoo/addons/account/models/account_account.py:docstring of odoo.addons.account.models.account_account.AccountGroup.parent_id:0
#: ../../../odoo/addons/account/models/account_account_tag.py:docstring of odoo.addons.account.models.account_account_tag.AccountAccountTag.country_id:0
#: ../../../odoo/addons/account/models/account_report.py:docstring of odoo.addons.account.models.account_report.AccountReport.column_ids:0
#: ../../../odoo/addons/account/models/account_report.py:docstring of odoo.addons.account.models.account_report.AccountReport.country_id:0
#: ../../../odoo/addons/account/models/account_report.py:docstring of odoo.addons.account.models.account_report.AccountReport.line_ids:0
#: ../../../odoo/addons/account/models/account_report.py:docstring of odoo.addons.account.models.account_report.AccountReport.root_report_id:0
#: ../../../odoo/addons/account/models/account_report.py:docstring of odoo.addons.account.models.account_report.AccountReportLine.action_id:0
#: ../../../odoo/addons/account/models/account_report.py:docstring of odoo.addons.account.models.account_report.AccountReportLine.children_ids:0
#: ../../../odoo/addons/account/models/account_report.py:docstring of odoo.addons.account.models.account_report.AccountReportLine.expression_ids:0
#: ../../../odoo/addons/account/models/account_report.py:docstring of odoo.addons.account.models.account_report.AccountReportLine.parent_id:0
#: ../../../odoo/addons/account/models/account_report.py:docstring of odoo.addons.account.models.account_report.AccountReportLine.report_id:0
#: ../../../odoo/addons/account/models/account_tax.py:docstring of odoo.addons.account.models.account_tax.AccountTax.cash_basis_transition_account_id:0
#: ../../../odoo/addons/account/models/account_tax.py:docstring of odoo.addons.account.models.account_tax.AccountTax.children_tax_ids:0
#: ../../../odoo/addons/account/models/account_tax.py:docstring of odoo.addons.account.models.account_tax.AccountTax.invoice_repartition_line_ids:0
#: ../../../odoo/addons/account/models/account_tax.py:docstring of odoo.addons.account.models.account_tax.AccountTax.refund_repartition_line_ids:0
#: ../../../odoo/addons/account/models/account_tax.py:docstring of odoo.addons.account.models.account_tax.AccountTax.tax_group_id:0
#: ../../../odoo/addons/account/models/account_tax.py:docstring of odoo.addons.account.models.account_tax.AccountTaxRepartitionLine.account_id:0
#: ../../../odoo/addons/account/models/account_tax.py:docstring of odoo.addons.account.models.account_tax.AccountTaxRepartitionLine.tag_ids:0
#: ../../../odoo/addons/account/models/account_tax.py:docstring of odoo.addons.account.models.account_tax.AccountTaxRepartitionLine.tax_id:0
#: ../../../odoo/addons/account/models/partner.py:docstring of odoo.addons.account.models.partner.AccountFiscalPosition.account_ids:0
#: ../../../odoo/addons/account/models/partner.py:docstring of odoo.addons.account.models.partner.AccountFiscalPosition.country_group_id:0
#: ../../../odoo/addons/account/models/partner.py:docstring of odoo.addons.account.models.partner.AccountFiscalPosition.country_id:0
#: ../../../odoo/addons/account/models/partner.py:docstring of odoo.addons.account.models.partner.AccountFiscalPosition.state_ids:0
#: ../../../odoo/addons/account/models/partner.py:docstring of odoo.addons.account.models.partner.AccountFiscalPosition.tax_ids:0
msgid "comodel"
msgstr ""
#: ../../../odoo/addons/account/models/account_account.py:docstring of odoo.addons.account.models.account_account.AccountAccount.currency_id:1
msgid ":ref:`res.currency <model-res-currency>`"
msgstr ""
#: ../../../odoo/addons/account/models/account_account.py:docstring of odoo.addons.account.models.account_account.AccountAccount.currency_id:0
#: ../../../odoo/addons/account/models/account_account_tag.py:docstring of odoo.addons.account.models.account_account_tag.AccountAccountTag.country_id:0
#: ../../../odoo/addons/account/models/account_report.py:docstring of odoo.addons.account.models.account_report.AccountReport.country_id:0
#: ../../../odoo/addons/account/models/partner.py:docstring of odoo.addons.account.models.partner.AccountFiscalPosition.country_id:0
msgid "possible_values"
msgstr ""
#: ../../../odoo/addons/account/models/account_account.py:docstring of odoo.addons.account.models.account_account.AccountAccount.currency_id:1
msgid "`odoo/addons/base/data/res_currency_data.xml <https://github.com/odoo/odoo/blob/17.0/odoo/addons/base/data/res_currency_data.xml>`__"
msgstr ""
#: ../../../odoo/addons/account/models/account_account.py:docstring of odoo.addons.account.models.account_account.AccountAccount.currency_id:1
msgid "Forces all journal items in this account to have a specific currency (i.e. bank journals). If no currency is set, entries can use any currency."
msgstr ""
#: ../../../odoo/addons/account/models/account_account.py:docstring of odoo.addons.account.models.account_account.AccountAccount.account_type:0
#: ../../../odoo/addons/account/models/account_account_tag.py:docstring of odoo.addons.account.models.account_account_tag.AccountAccountTag.applicability:0
#: ../../../odoo/addons/account/models/account_report.py:docstring of odoo.addons.account.models.account_report.AccountReport.availability_condition:0
#: ../../../odoo/addons/account/models/account_report.py:docstring of odoo.addons.account.models.account_report.AccountReport.default_opening_date_filter:0
#: ../../../odoo/addons/account/models/account_report.py:docstring of odoo.addons.account.models.account_report.AccountReport.filter_account_type:0
#: ../../../odoo/addons/account/models/account_report.py:docstring of odoo.addons.account.models.account_report.AccountReport.filter_hierarchy:0
#: ../../../odoo/addons/account/models/account_report.py:docstring of odoo.addons.account.models.account_report.AccountReport.filter_multi_company:0
#: ../../../odoo/addons/account/models/account_tax.py:docstring of odoo.addons.account.models.account_tax.AccountTax.amount_type:0
#: ../../../odoo/addons/account/models/account_tax.py:docstring of odoo.addons.account.models.account_tax.AccountTax.tax_exigibility:0
#: ../../../odoo/addons/account/models/account_tax.py:docstring of odoo.addons.account.models.account_tax.AccountTax.tax_scope:0
#: ../../../odoo/addons/account/models/account_tax.py:docstring of odoo.addons.account.models.account_tax.AccountTax.type_tax_use:0
#: ../../../odoo/addons/account/models/account_tax.py:docstring of odoo.addons.account.models.account_tax.AccountTaxRepartitionLine.document_type:0
#: ../../../odoo/addons/account/models/account_tax.py:docstring of odoo.addons.account.models.account_tax.AccountTaxRepartitionLine.repartition_type:0
msgid "selection"
msgstr ""
#: ../../../odoo/addons/account/models/account_account.py:docstring of odoo.addons.account.models.account_account.AccountAccount.account_type:1
msgid "``asset_receivable``: Receivable ``asset_cash``: Bank and Cash ``asset_current``: Current Assets ``asset_non_current``: Non-current Assets ``asset_prepayments``: Prepayments ``asset_fixed``: Fixed Assets ``liability_payable``: Payable ``liability_credit_card``: Credit Card ``liability_current``: Current Liabilities ``liability_non_current``: Non-current Liabilities ``equity``: Equity ``equity_unaffected``: Current Year Earnings ``income``: Income ``income_other``: Other Income ``expense``: Expenses ``expense_depreciation``: Depreciation ``expense_direct_cost``: Cost of Revenue ``off_balance``: Off-Balance Sheet"
msgstr ""
#: ../../../odoo/addons/account/models/account_account.py:docstring of odoo.addons.account.models.account_account.AccountAccount.account_type:1
msgid "Account Type is used for information purpose, to generate country-specific legal reports, and set the rules to close a fiscal year and generate opening entries."
msgstr ""
#: ../../../odoo/addons/account/models/account_account.py:docstring of odoo.addons.account.models.account_account.AccountAccount.reconcile:1
msgid "Allow Reconciliation"
msgstr ""
#: ../../../odoo/addons/account/models/account_account.py:docstring of odoo.addons.account.models.account_account.AccountAccount.reconcile:1
msgid "Check this box if this account allows invoices & payments matching of journal items."
msgstr ""
#: ../../../odoo/addons/account/models/account_account.py:docstring of odoo.addons.account.models.account_account.AccountAccount.note:1
msgid "Internal Notes"
msgstr ""
#: ../../../odoo/addons/account/models/account_account.py:docstring of odoo.addons.account.models.account_account.AccountAccount.tax_ids:1
msgid "Default Taxes"
msgstr ""
#: ../../../odoo/addons/account/models/account_account.py:docstring of odoo.addons.account.models.account_account.AccountAccount.tax_ids:1
#: ../../../odoo/addons/account/models/account_tax.py:docstring of odoo.addons.account.models.account_tax.AccountTax.children_tax_ids:1
#: ../../../odoo/addons/account/models/account_tax.py:docstring of odoo.addons.account.models.account_tax.AccountTaxRepartitionLine.tax_id:1
msgid ":ref:`account.tax <model-account-tax>`"
msgstr ""
#: ../../../odoo/addons/account/models/account_account.py:docstring of odoo.addons.account.models.account_account.AccountAccount.tag_ids:1
msgid "Tags"
msgstr ""
#: ../../../odoo/addons/account/models/account_account.py:docstring of odoo.addons.account.models.account_account.AccountAccount.tag_ids:1
#: ../../../odoo/addons/account/models/account_tax.py:docstring of odoo.addons.account.models.account_tax.AccountTaxRepartitionLine.tag_ids:1
msgid ":ref:`account.account.tag <model-account-account-tag>`"
msgstr ""
#: ../../../odoo/addons/account/models/account_account.py:docstring of odoo.addons.account.models.account_account.AccountAccount.tag_ids:1
msgid "Optional tags you may want to assign for custom reporting"
msgstr ""
#: ../../content/developer/reference/standard_modules/account/account_account_tag.rst:5
msgid "Account Tag"
msgstr ""
#: ../../../odoo/addons/account/models/account_account_tag.py:docstring of odoo.addons.account.models.account_account_tag.AccountAccountTag.name:1
msgid "Tag Name"
msgstr ""
#: ../../../odoo/addons/account/models/account_account_tag.py:docstring of odoo.addons.account.models.account_account_tag.AccountAccountTag.applicability:1
msgid "Applicability"
msgstr ""
#: ../../../odoo/addons/account/models/account_account_tag.py:docstring of odoo.addons.account.models.account_account_tag.AccountAccountTag.applicability:1
msgid "``accounts``: Accounts ``taxes``: Taxes ``products``: Products"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:0
#: ../../content/developer/reference/user_interface/view_architectures/button_attribute_context.rst:0
#: ../../content/developer/reference/user_interface/view_architectures/button_attribute_help.rst:0
#: ../../content/developer/reference/user_interface/view_architectures/button_attribute_icon.rst:0
#: ../../content/developer/reference/user_interface/view_architectures/button_attribute_name.rst:0
#: ../../content/developer/reference/user_interface/view_architectures/button_attribute_string.rst:0
#: ../../content/developer/reference/user_interface/view_architectures/field_attribute_readonly.rst:0
#: ../../content/developer/reference/user_interface/view_architectures/field_attribute_required.rst:0
#: ../../content/developer/reference/user_interface/view_architectures/field_attribute_string.rst:0
#: ../../content/developer/reference/user_interface/view_architectures/field_attribute_widget.rst:0
#: ../../content/developer/reference/user_interface/view_architectures/generic_attribute_class.rst:0
#: ../../content/developer/reference/user_interface/view_architectures/generic_attribute_column_invisible.rst:0
#: ../../content/developer/reference/user_interface/view_architectures/generic_attribute_groups.rst:0
#: ../../content/developer/reference/user_interface/view_architectures/generic_attribute_invisible.rst:0
#: ../../content/developer/reference/user_interface/view_architectures/root_attribute_banner_route.rst:0
#: ../../content/developer/reference/user_interface/view_architectures/root_attribute_create.rst:0
#: ../../content/developer/reference/user_interface/view_architectures/root_attribute_default_group_by.rst:0
#: ../../content/developer/reference/user_interface/view_architectures/root_attribute_default_order.rst:0
#: ../../content/developer/reference/user_interface/view_architectures/root_attribute_delete.rst:0
#: ../../content/developer/reference/user_interface/view_architectures/root_attribute_edit.rst:0
#: ../../content/developer/reference/user_interface/view_architectures/root_attribute_sample.rst:0
#: ../../content/developer/reference/user_interface/view_architectures/root_attribute_string.rst:0
#: ../../content/developer/reference/user_interface/view_records.rst:0
#: ../../../odoo/addons/account/models/account_account_tag.py:docstring of odoo.addons.account.models.account_account_tag.AccountAccountTag.active:0
#: ../../../odoo/addons/account/models/account_account_tag.py:docstring of odoo.addons.account.models.account_account_tag.AccountAccountTag.applicability:0
#: ../../../odoo/addons/account/models/account_tax.py:docstring of odoo.addons.account.models.account_tax.AccountTax.active:0
#: ../../../odoo/addons/account/models/account_tax.py:docstring of odoo.addons.account.models.account_tax.AccountTax.amount:0
#: ../../../odoo/addons/account/models/account_tax.py:docstring of odoo.addons.account.models.account_tax.AccountTax.amount_type:0
#: ../../../odoo/addons/account/models/account_tax.py:docstring of odoo.addons.account.models.account_tax.AccountTax.include_base_amount:0
#: ../../../odoo/addons/account/models/account_tax.py:docstring of odoo.addons.account.models.account_tax.AccountTax.is_base_affected:0
#: ../../../odoo/addons/account/models/account_tax.py:docstring of odoo.addons.account.models.account_tax.AccountTax.price_include:0
#: ../../../odoo/addons/account/models/account_tax.py:docstring of odoo.addons.account.models.account_tax.AccountTax.sequence:0
#: ../../../odoo/addons/account/models/account_tax.py:docstring of odoo.addons.account.models.account_tax.AccountTax.tax_exigibility:0
#: ../../../odoo/addons/account/models/account_tax.py:docstring of odoo.addons.account.models.account_tax.AccountTax.type_tax_use:0
#: ../../../odoo/addons/account/models/account_tax.py:docstring of odoo.addons.account.models.account_tax.AccountTaxRepartitionLine.factor_percent:0
#: ../../../odoo/addons/account/models/account_tax.py:docstring of odoo.addons.account.models.account_tax.AccountTaxRepartitionLine.repartition_type:0
#: ../../content/developer/reference/user_interface/view_architectures/button_attribute_context.rst:0
#: ../../content/developer/reference/user_interface/view_architectures/button_attribute_help.rst:0
#: ../../content/developer/reference/user_interface/view_architectures/button_attribute_icon.rst:0
#: ../../content/developer/reference/user_interface/view_architectures/button_attribute_name.rst:0
#: ../../content/developer/reference/user_interface/view_architectures/button_attribute_string.rst:0
#: ../../content/developer/reference/user_interface/view_architectures/field_attribute_readonly.rst:0
#: ../../content/developer/reference/user_interface/view_architectures/field_attribute_required.rst:0
#: ../../content/developer/reference/user_interface/view_architectures/field_attribute_string.rst:0
#: ../../content/developer/reference/user_interface/view_architectures/field_attribute_widget.rst:0
#: ../../content/developer/reference/user_interface/view_architectures/generic_attribute_class.rst:0
#: ../../content/developer/reference/user_interface/view_architectures/generic_attribute_column_invisible.rst:0
#: ../../content/developer/reference/user_interface/view_architectures/generic_attribute_groups.rst:0
#: ../../content/developer/reference/user_interface/view_architectures/generic_attribute_invisible.rst:0
#: ../../content/developer/reference/user_interface/view_architectures/root_attribute_banner_route.rst:0
#: ../../content/developer/reference/user_interface/view_architectures/root_attribute_create.rst:0
#: ../../content/developer/reference/user_interface/view_architectures/root_attribute_default_group_by.rst:0
#: ../../content/developer/reference/user_interface/view_architectures/root_attribute_default_order.rst:0
#: ../../content/developer/reference/user_interface/view_architectures/root_attribute_delete.rst:0
#: ../../content/developer/reference/user_interface/view_architectures/root_attribute_edit.rst:0
#: ../../content/developer/reference/user_interface/view_architectures/root_attribute_sample.rst:0
#: ../../content/developer/reference/user_interface/view_architectures/root_attribute_string.rst:0
msgid "default"
msgstr ""
#: ../../../odoo/addons/account/models/account_account_tag.py:docstring of odoo.addons.account.models.account_account_tag.AccountAccountTag.applicability:1
msgid "accounts"
msgstr ""
#: ../../../odoo/addons/account/models/account_account_tag.py:docstring of odoo.addons.account.models.account_account_tag.AccountAccountTag.color:1
msgid "Color Index"
msgstr ""
#: ../../../odoo/addons/account/models/account_account_tag.py:docstring of odoo.addons.account.models.account_account_tag.AccountAccountTag.active:1
#: ../../../odoo/addons/account/models/account_tax.py:docstring of odoo.addons.account.models.account_tax.AccountTax.active:1
msgid "Active"
msgstr ""
#: ../../../odoo/addons/account/models/account_account_tag.py:docstring of odoo.addons.account.models.account_account_tag.AccountAccountTag.active:1
msgid "Set active to false to hide the Account Tag without removing it."
msgstr ""
#: ../../../odoo/addons/account/models/account_account_tag.py:docstring of odoo.addons.account.models.account_account_tag.AccountAccountTag.tax_negate:1
msgid "Negate Tax Balance"
msgstr ""
#: ../../../odoo/addons/account/models/account_account_tag.py:docstring of odoo.addons.account.models.account_account_tag.AccountAccountTag.tax_negate:1
msgid "Check this box to negate the absolute value of the balance of the lines associated with this tag in tax report computation."
msgstr ""
#: ../../../odoo/addons/account/models/account_account_tag.py:docstring of odoo.addons.account.models.account_account_tag.AccountAccountTag.country_id:1
#: ../../../odoo/addons/account/models/account_report.py:docstring of odoo.addons.account.models.account_report.AccountReport.country_id:1
#: ../../../odoo/addons/account/models/partner.py:docstring of odoo.addons.account.models.partner.AccountFiscalPosition.country_id:1
msgid "Country"
msgstr ""
#: ../../../odoo/addons/account/models/account_account_tag.py:docstring of odoo.addons.account.models.account_account_tag.AccountAccountTag.country_id:1
#: ../../../odoo/addons/account/models/account_report.py:docstring of odoo.addons.account.models.account_report.AccountReport.country_id:1
#: ../../../odoo/addons/account/models/partner.py:docstring of odoo.addons.account.models.partner.AccountFiscalPosition.country_id:1
msgid ":ref:`res.country <model-res-country>`"
msgstr ""
#: ../../../odoo/addons/account/models/account_account_tag.py:docstring of odoo.addons.account.models.account_account_tag.AccountAccountTag.country_id:1
#: ../../../odoo/addons/account/models/account_report.py:docstring of odoo.addons.account.models.account_report.AccountReport.country_id:1
#: ../../../odoo/addons/account/models/partner.py:docstring of odoo.addons.account.models.partner.AccountFiscalPosition.country_id:1
msgid "`odoo/addons/base/data/res_country_data.xml <https://github.com/odoo/odoo/blob/17.0/odoo/addons/base/data/res_country_data.xml>`__"
msgstr ""
#: ../../../odoo/addons/account/models/account_account_tag.py:docstring of odoo.addons.account.models.account_account_tag.AccountAccountTag.country_id:1
msgid "Country for which this tag is available, when applied on taxes."
msgstr ""
#: ../../content/developer/reference/standard_modules/account/account_fiscal_position.rst:5
#: ../../../odoo/addons/account/models/partner.py:docstring of odoo.addons.account.models.partner.AccountFiscalPosition.name:1
msgid "Fiscal Position"
msgstr ""
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:218
#: ../../../odoo/addons/account/models/account_tax.py:docstring of odoo.addons.account.models.account_tax.AccountTax.sequence:1
#: ../../../odoo/addons/account/models/partner.py:docstring of odoo.addons.account.models.partner.AccountFiscalPosition.sequence:1
msgid "Sequence"
msgstr ""
#: ../../../odoo/addons/account/models/partner.py:docstring of odoo.addons.account.models.partner.AccountFiscalPosition.account_ids:1
msgid "Account Mapping"
msgstr ""
#: ../../../odoo/addons/account/models/partner.py:docstring of odoo.addons.account.models.partner.AccountFiscalPosition.account_ids:1
msgid ":ref:`account.fiscal.position.account <model-account-fiscal-position-account>`"
msgstr ""
#: ../../../odoo/addons/account/models/partner.py:docstring of odoo.addons.account.models.partner.AccountFiscalPosition.tax_ids:1
msgid "Tax Mapping"
msgstr ""
#: ../../../odoo/addons/account/models/partner.py:docstring of odoo.addons.account.models.partner.AccountFiscalPosition.tax_ids:1
msgid ":ref:`account.fiscal.position.tax <model-account-fiscal-position-tax>`"
msgstr ""
#: ../../../odoo/addons/account/models/partner.py:docstring of odoo.addons.account.models.partner.AccountFiscalPosition.note:1
msgid "Notes"
msgstr ""
#: ../../../odoo/addons/account/models/partner.py:docstring of odoo.addons.account.models.partner.AccountFiscalPosition.note:1
msgid "Legal mentions that have to be printed on the invoices."
msgstr ""
#: ../../../odoo/addons/account/models/partner.py:docstring of odoo.addons.account.models.partner.AccountFiscalPosition.auto_apply:1
msgid "Detect Automatically"
msgstr ""
#: ../../../odoo/addons/account/models/partner.py:docstring of odoo.addons.account.models.partner.AccountFiscalPosition.auto_apply:1
msgid "Apply tax & account mappings on invoices automatically if the matching criterias (VAT/Country) are met."
msgstr ""
#: ../../../odoo/addons/account/models/partner.py:docstring of odoo.addons.account.models.partner.AccountFiscalPosition.vat_required:1
msgid "VAT required"
msgstr ""
#: ../../../odoo/addons/account/models/partner.py:docstring of odoo.addons.account.models.partner.AccountFiscalPosition.vat_required:1
msgid "Apply only if partner has a VAT number."
msgstr ""
#: ../../../odoo/addons/account/models/partner.py:docstring of odoo.addons.account.models.partner.AccountFiscalPosition.country_id:1
msgid "Apply only if delivery country matches."
msgstr ""
#: ../../../odoo/addons/account/models/partner.py:docstring of odoo.addons.account.models.partner.AccountFiscalPosition.country_group_id:1
msgid "Country Group"
msgstr ""
#: ../../../odoo/addons/account/models/partner.py:docstring of odoo.addons.account.models.partner.AccountFiscalPosition.country_group_id:1
msgid ":ref:`res.country.group <model-res-country-group>`"
msgstr ""
#: ../../../odoo/addons/account/models/partner.py:docstring of odoo.addons.account.models.partner.AccountFiscalPosition.country_group_id:1
msgid "Apply only if delivery country matches the group."
msgstr ""
#: ../../../odoo/addons/account/models/partner.py:docstring of odoo.addons.account.models.partner.AccountFiscalPosition.state_ids:1
msgid "Federal States"
msgstr ""
#: ../../../odoo/addons/account/models/partner.py:docstring of odoo.addons.account.models.partner.AccountFiscalPosition.state_ids:1
msgid ":ref:`res.country.state <model-res-country-state>`"
msgstr ""
#: ../../../odoo/addons/account/models/partner.py:docstring of odoo.addons.account.models.partner.AccountFiscalPosition.zip_from:1
msgid "Zip Range From"
msgstr ""
#: ../../../odoo/addons/account/models/partner.py:docstring of odoo.addons.account.models.partner.AccountFiscalPosition.zip_to:1
msgid "Zip Range To"
msgstr ""
#: ../../content/developer/reference/standard_modules/account/account_group.rst:5
msgid "Account Group"
msgstr ""
#: ../../../odoo/addons/account/models/account_account.py:docstring of odoo.addons.account.models.account_account.AccountGroup.parent_id:1
msgid "Parent"
msgstr ""
#: ../../../odoo/addons/account/models/account_account.py:docstring of odoo.addons.account.models.account_account.AccountGroup.parent_id:1
msgid "this field is not supposed to/cannot be set manually"
msgstr ""
#: ../../../odoo/addons/account/models/account_account.py:docstring of odoo.addons.account.models.account_account.AccountGroup.parent_id:1
msgid ":ref:`account.group <model-account-group>`"
msgstr ""
#: ../../../odoo/addons/account/models/account_account.py:docstring of odoo.addons.account.models.account_account.AccountGroup.code_prefix_start:1
msgid "Code Prefix Start"
msgstr ""
#: ../../../odoo/addons/account/models/account_account.py:docstring of odoo.addons.account.models.account_account.AccountGroup.code_prefix_end:1
msgid "Code Prefix End"
msgstr ""
#: ../../content/developer/reference/standard_modules/account/account_report.rst:3
msgid "Report"
msgstr ""
#: ../../../odoo/addons/account/models/account_report.py:docstring of odoo.addons.account.models.account_report.AccountReport.line_ids:1
msgid "Lines"
msgstr ""
#: ../../../odoo/addons/account/models/account_report.py:docstring of odoo.addons.account.models.account_report.AccountReport.line_ids:1
#: ../../../odoo/addons/account/models/account_report.py:docstring of odoo.addons.account.models.account_report.AccountReportLine.children_ids:1
#: ../../../odoo/addons/account/models/account_report.py:docstring of odoo.addons.account.models.account_report.AccountReportLine.parent_id:1
msgid ":ref:`account.report.line <model-account-report-line>`"
msgstr ""
#: ../../../odoo/addons/account/models/account_report.py:docstring of odoo.addons.account.models.account_report.AccountReport.column_ids:1
msgid ":ref:`account.report.column <model-account-report-column>`"
msgstr ""
#: ../../../odoo/addons/account/models/account_report.py:docstring of odoo.addons.account.models.account_report.AccountReport.root_report_id:1
msgid "Root Report"
msgstr ""
#: ../../../odoo/addons/account/models/account_report.py:docstring of odoo.addons.account.models.account_report.AccountReport.root_report_id:1
#: ../../../odoo/addons/account/models/account_report.py:docstring of odoo.addons.account.models.account_report.AccountReportLine.report_id:1
msgid ":ref:`account.report <model-account-report>`"
msgstr ""
#: ../../../odoo/addons/account/models/account_report.py:docstring of odoo.addons.account.models.account_report.AccountReport.root_report_id:1
msgid "The report this report is a variant of."
msgstr ""
#: ../../../odoo/addons/account/models/account_report.py:docstring of odoo.addons.account.models.account_report.AccountReport.only_tax_exigible:1
msgid "Only Tax Exigible Lines"
msgstr ""
#: ../../../odoo/addons/account/models/account_report.py:docstring of odoo.addons.account.models.account_report.AccountReport.availability_condition:1
msgid "Availability"
msgstr ""
#: ../../../odoo/addons/account/models/account_report.py:docstring of odoo.addons.account.models.account_report.AccountReport.availability_condition:1
msgid "``country``: Country Matches ``coa``: Chart of Accounts Matches ``always``: Always"
msgstr ""
#: ../../../odoo/addons/account/models/account_report.py:docstring of odoo.addons.account.models.account_report.AccountReport.load_more_limit:1
msgid "Load More Limit"
msgstr ""
#: ../../../odoo/addons/account/models/account_report.py:docstring of odoo.addons.account.models.account_report.AccountReport.search_bar:1
msgid "Search Bar"
msgstr ""
#: ../../../odoo/addons/account/models/account_report.py:docstring of odoo.addons.account.models.account_report.AccountReport.default_opening_date_filter:1
msgid "Default Opening"
msgstr ""
#: ../../../odoo/addons/account/models/account_report.py:docstring of odoo.addons.account.models.account_report.AccountReport.default_opening_date_filter:1
msgid "``this_year``: This Year ``this_quarter``: This Quarter ``this_month``: This Month ``today``: Today ``last_month``: Last Month ``last_quarter``: Last Quarter ``last_year``: Last Year ``this_tax_period``: This Tax Period ``last_tax_period``: Last Tax Period"
msgstr ""
#: ../../../odoo/addons/account/models/account_report.py:docstring of odoo.addons.account.models.account_report.AccountReport.filter_multi_company:1
msgid "Multi-Company"
msgstr ""
#: ../../../odoo/addons/account/models/account_report.py:docstring of odoo.addons.account.models.account_report.AccountReport.filter_multi_company:1
msgid "``disabled``: Disabled ``selector``: Use Company Selector ``tax_units``: Use Tax Units"
msgstr ""
#: ../../../odoo/addons/account/models/account_report.py:docstring of odoo.addons.account.models.account_report.AccountReport.filter_date_range:1
msgid "Date Range"
msgstr ""
#: ../../../odoo/addons/account/models/account_report.py:docstring of odoo.addons.account.models.account_report.AccountReport.filter_show_draft:1
msgid "Draft Entries"
msgstr ""
#: ../../../odoo/addons/account/models/account_report.py:docstring of odoo.addons.account.models.account_report.AccountReport.filter_unreconciled:1
msgid "Unreconciled Entries"
msgstr ""
#: ../../../odoo/addons/account/models/account_report.py:docstring of odoo.addons.account.models.account_report.AccountReport.filter_unfold_all:1
msgid "Unfold All"
msgstr ""
#: ../../../odoo/addons/account/models/account_report.py:docstring of odoo.addons.account.models.account_report.AccountReport.filter_period_comparison:1
msgid "Period Comparison"
msgstr ""
#: ../../../odoo/addons/account/models/account_report.py:docstring of odoo.addons.account.models.account_report.AccountReport.filter_growth_comparison:1
msgid "Growth Comparison"
msgstr ""
#: ../../../odoo/addons/account/models/account_report.py:docstring of odoo.addons.account.models.account_report.AccountReport.filter_journals:1
msgid "Journals"
msgstr ""
#: ../../../odoo/addons/account/models/account_report.py:docstring of odoo.addons.account.models.account_report.AccountReport.filter_analytic:1
msgid "Analytic Filter"
msgstr ""
#: ../../../odoo/addons/account/models/account_report.py:docstring of odoo.addons.account.models.account_report.AccountReport.filter_hierarchy:1
msgid "Account Groups"
msgstr ""
#: ../../../odoo/addons/account/models/account_report.py:docstring of odoo.addons.account.models.account_report.AccountReport.filter_hierarchy:1
msgid "``by_default``: Enabled by Default ``optional``: Optional ``never``: Never"
msgstr ""
#: ../../../odoo/addons/account/models/account_report.py:docstring of odoo.addons.account.models.account_report.AccountReport.filter_account_type:1
msgid "Account Types"
msgstr ""
#: ../../../odoo/addons/account/models/account_report.py:docstring of odoo.addons.account.models.account_report.AccountReport.filter_account_type:1
msgid "``both``: Payable and receivable ``payable``: Payable ``receivable``: Receivable ``disabled``: Disabled"
msgstr ""
#: ../../../odoo/addons/account/models/account_report.py:docstring of odoo.addons.account.models.account_report.AccountReport.filter_partner:1
msgid "Partners"
msgstr ""
#: ../../../odoo/addons/account/models/account_report.py:docstring of odoo.addons.account.models.account_report.AccountReport.filter_fiscal_position:1
msgid "Filter Multivat"
msgstr ""
#: ../../content/developer/reference/standard_modules/account/account_report_line.rst:3
msgid "Report Line"
msgstr ""
#: ../../../odoo/addons/account/models/account_report.py:docstring of odoo.addons.account.models.account_report.AccountReportLine.expression_ids:1
msgid ":ref:`account.report.expression <model-account-report-expression>`"
msgstr ""
#: ../../../odoo/addons/account/models/account_report.py:docstring of odoo.addons.account.models.account_report.AccountReportLine.report_id:1
msgid "Parent Report"
msgstr ""
#: ../../../odoo/addons/account/models/account_report.py:docstring of odoo.addons.account.models.account_report.AccountReportLine.hierarchy_level:1
msgid "Level"
msgstr ""
#: ../../../odoo/addons/account/models/account_report.py:docstring of odoo.addons.account.models.account_report.AccountReportLine.parent_id:1
msgid "Parent Line"
msgstr ""
#: ../../../odoo/addons/account/models/account_report.py:docstring of odoo.addons.account.models.account_report.AccountReportLine.children_ids:1
msgid "Child Lines"
msgstr ""
#: ../../../odoo/addons/account/models/account_report.py:docstring of odoo.addons.account.models.account_report.AccountReportLine.foldable:1
msgid "Foldable"
msgstr ""
#: ../../../odoo/addons/account/models/account_report.py:docstring of odoo.addons.account.models.account_report.AccountReportLine.foldable:1
msgid "By default, we always unfold the lines that can be. If this is checked, the line won't be unfolded by default, and a folding button will be displayed."
msgstr ""
#: ../../../odoo/addons/account/models/account_report.py:docstring of odoo.addons.account.models.account_report.AccountReportLine.print_on_new_page:1
msgid "Print On New Page"
msgstr ""
#: ../../../odoo/addons/account/models/account_report.py:docstring of odoo.addons.account.models.account_report.AccountReportLine.print_on_new_page:1
msgid "When checked this line and everything after it will be printed on a new page."
msgstr ""
#: ../../../odoo/addons/account/models/account_report.py:docstring of odoo.addons.account.models.account_report.AccountReportLine.action_id:1
msgid "Action"
msgstr ""
#: ../../../odoo/addons/account/models/account_report.py:docstring of odoo.addons.account.models.account_report.AccountReportLine.action_id:1
msgid ":ref:`ir.actions.actions <model-ir-actions-actions>`"
msgstr ""
#: ../../../odoo/addons/account/models/account_report.py:docstring of odoo.addons.account.models.account_report.AccountReportLine.action_id:1
msgid "Setting this field will turn the line into a link, executing the action when clicked."
msgstr ""
#: ../../../odoo/addons/account/models/account_report.py:docstring of odoo.addons.account.models.account_report.AccountReportLine.hide_if_zero:1
msgid "Hide if Zero"
msgstr ""
#: ../../../odoo/addons/account/models/account_report.py:docstring of odoo.addons.account.models.account_report.AccountReportLine.hide_if_zero:1
msgid "This line and its children will be hidden when all of their columns are 0."
msgstr ""
#: ../../../odoo/addons/account/models/account_tax.py:docstring of odoo.addons.account.models.account_tax.AccountTax.name:1
msgid "Tax Name"
msgstr ""
#: ../../../odoo/addons/account/models/account_tax.py:docstring of odoo.addons.account.models.account_tax.AccountTax.type_tax_use:1
msgid "Tax Type"
msgstr ""
#: ../../../odoo/addons/account/models/account_tax.py:docstring of odoo.addons.account.models.account_tax.AccountTax.type_tax_use:1
msgid "``sale``: Sales ``purchase``: Purchases ``none``: None"
msgstr ""
#: ../../../odoo/addons/account/models/account_tax.py:docstring of odoo.addons.account.models.account_tax.AccountTax.type_tax_use:1
msgid "sale"
msgstr ""
#: ../../../odoo/addons/account/models/account_tax.py:docstring of odoo.addons.account.models.account_tax.AccountTax.type_tax_use:1
msgid "Determines where the tax is selectable. Note: 'None' means a tax can't be used by itself, however it can still be used in a group. 'adjustment' is used to perform tax adjustment."
msgstr ""
#: ../../../odoo/addons/account/models/account_tax.py:docstring of odoo.addons.account.models.account_tax.AccountTax.tax_scope:1
msgid "Tax Scope"
msgstr ""
#: ../../../odoo/addons/account/models/account_tax.py:docstring of odoo.addons.account.models.account_tax.AccountTax.tax_scope:1
msgid "``service``: Services ``consu``: Goods"
msgstr ""
#: ../../../odoo/addons/account/models/account_tax.py:docstring of odoo.addons.account.models.account_tax.AccountTax.tax_scope:1
msgid "Restrict the use of taxes to a type of product."
msgstr ""
#: ../../../odoo/addons/account/models/account_tax.py:docstring of odoo.addons.account.models.account_tax.AccountTax.amount_type:1
msgid "Tax Computation"
msgstr ""
#: ../../../odoo/addons/account/models/account_tax.py:docstring of odoo.addons.account.models.account_tax.AccountTax.amount_type:1
msgid "``group``: Group of Taxes ``fixed``: Fixed ``percent``: Percentage of Price ``division``: Percentage of Price Tax Included"
msgstr ""
#: ../../../odoo/addons/account/models/account_tax.py:docstring of odoo.addons.account.models.account_tax.AccountTax.amount_type:1
msgid "percent"
msgstr ""
#: ../../../odoo/addons/account/models/account_tax.py:docstring of odoo.addons.account.models.account_tax.AccountTax.amount_type:1
msgid "Group of Taxes: The tax is a set of sub taxes."
msgstr ""
#: ../../../odoo/addons/account/models/account_tax.py:docstring of odoo.addons.account.models.account_tax.AccountTax.amount_type:1
msgid "Fixed: The tax amount stays the same whatever the price."
msgstr ""
#: ../../../odoo/addons/account/models/account_tax.py:docstring of odoo.addons.account.models.account_tax.AccountTax.amount_type:1
msgid "Percentage of Price: The tax amount is a % of the price:"
msgstr ""
#: ../../../odoo/addons/account/models/account_tax.py:docstring of odoo.addons.account.models.account_tax.AccountTax.amount_type:1
msgid "e.g 100 * (1 + 10%) = 110 (not price included) e.g 110 / (1 + 10%) = 100 (price included)"
msgstr ""
#: ../../../odoo/addons/account/models/account_tax.py:docstring of odoo.addons.account.models.account_tax.AccountTax.amount_type:1
msgid "Percentage of Price Tax Included: The tax amount is a division of the price:"
msgstr ""
#: ../../../odoo/addons/account/models/account_tax.py:docstring of odoo.addons.account.models.account_tax.AccountTax.amount_type:1
msgid "e.g 180 / (1 - 10%) = 200 (not price included) e.g 200 * (1 - 10%) = 180 (price included)"
msgstr ""
#: ../../../odoo/addons/account/models/account_tax.py:docstring of odoo.addons.account.models.account_tax.AccountTax.active:1
msgid "Set active to false to hide the tax without removing it."
msgstr ""
#: ../../../odoo/addons/account/models/account_tax.py:docstring of odoo.addons.account.models.account_tax.AccountTax.children_tax_ids:1
msgid "Children Taxes"
msgstr ""
#: ../../content/developer/tutorials/define_module_data.rst:184
#: ../../../odoo/addons/account/models/account_tax.py:docstring of odoo.addons.account.models.account_tax.AccountTax.sequence:1
msgid "1"
msgstr ""
#: ../../../odoo/addons/account/models/account_tax.py:docstring of odoo.addons.account.models.account_tax.AccountTax.sequence:1
msgid "The sequence field is used to define order in which the tax lines are applied."
msgstr ""
#: ../../../odoo/addons/account/models/account_tax.py:docstring of odoo.addons.account.models.account_tax.AccountTax.amount:1
msgid "Amount"
msgstr ""
#: ../../../odoo/addons/account/models/account_tax.py:docstring of odoo.addons.account.models.account_tax.AccountTax.amount:1
msgid "0.0"
msgstr ""
#: ../../../odoo/addons/account/models/account_tax.py:docstring of odoo.addons.account.models.account_tax.AccountTax.price_include:1
msgid "Included in Price"
msgstr ""
#: ../../content/developer/tutorials/define_module_data.rst:187
#: ../../../odoo/addons/account/models/account_tax.py:docstring of odoo.addons.account.models.account_tax.AccountTax.include_base_amount:1
#: ../../../odoo/addons/account/models/account_tax.py:docstring of odoo.addons.account.models.account_tax.AccountTax.price_include:1
msgid "False"
msgstr ""
#: ../../../odoo/addons/account/models/account_tax.py:docstring of odoo.addons.account.models.account_tax.AccountTax.price_include:1
msgid "Check this if the price you use on the product and invoices includes this tax."
msgstr ""
#: ../../../odoo/addons/account/models/account_tax.py:docstring of odoo.addons.account.models.account_tax.AccountTax.include_base_amount:1
msgid "Affect Base of Subsequent Taxes"
msgstr ""
#: ../../../odoo/addons/account/models/account_tax.py:docstring of odoo.addons.account.models.account_tax.AccountTax.include_base_amount:1
msgid "If set, taxes with a higher sequence than this one will be affected by it, provided they accept it."
msgstr ""
#: ../../../odoo/addons/account/models/account_tax.py:docstring of odoo.addons.account.models.account_tax.AccountTax.is_base_affected:1
msgid "Base Affected by Previous Taxes"
msgstr ""
#: ../../../odoo/addons/account/models/account_tax.py:docstring of odoo.addons.account.models.account_tax.AccountTax.is_base_affected:1
msgid "If set, taxes with a lower sequence might affect this one, provided they try to do it."
msgstr ""
#: ../../../odoo/addons/account/models/account_tax.py:docstring of odoo.addons.account.models.account_tax.AccountTax.analytic:1
msgid "Include in Analytic Cost"
msgstr ""
#: ../../../odoo/addons/account/models/account_tax.py:docstring of odoo.addons.account.models.account_tax.AccountTax.analytic:1
msgid "If set, the amount computed by this tax will be assigned to the same analytic account as the invoice line (if any)"
msgstr ""
#: ../../../odoo/addons/account/models/account_tax.py:docstring of odoo.addons.account.models.account_tax.AccountTax.invoice_repartition_line_ids:1
msgid "Distribution for Invoices"
msgstr ""
#: ../../../odoo/addons/account/models/account_tax.py:docstring of odoo.addons.account.models.account_tax.AccountTax.invoice_repartition_line_ids:1
#: ../../../odoo/addons/account/models/account_tax.py:docstring of odoo.addons.account.models.account_tax.AccountTax.refund_repartition_line_ids:1
msgid ":ref:`account.tax.repartition.line <model-account-tax-repartition-line>`"
msgstr ""
#: ../../../odoo/addons/account/models/account_tax.py:docstring of odoo.addons.account.models.account_tax.AccountTax.invoice_repartition_line_ids:1
msgid "Distribution when the tax is used on an invoice"
msgstr ""
#: ../../../odoo/addons/account/models/account_tax.py:docstring of odoo.addons.account.models.account_tax.AccountTax.refund_repartition_line_ids:1
msgid "Distribution for Refund Invoices"
msgstr ""
#: ../../../odoo/addons/account/models/account_tax.py:docstring of odoo.addons.account.models.account_tax.AccountTax.refund_repartition_line_ids:1
msgid "Distribution when the tax is used on a refund"
msgstr ""
#: ../../../odoo/addons/account/models/account_tax.py:docstring of odoo.addons.account.models.account_tax.AccountTax.tax_group_id:1
msgid "Tax Group"
msgstr ""
#: ../../../odoo/addons/account/models/account_tax.py:docstring of odoo.addons.account.models.account_tax.AccountTax.tax_group_id:1
msgid ":ref:`account.tax.group <model-account-tax-group>`"
msgstr ""
#: ../../../odoo/addons/account/models/account_tax.py:docstring of odoo.addons.account.models.account_tax.AccountTax.tax_exigibility:1
msgid "Tax Exigibility"
msgstr ""
#: ../../../odoo/addons/account/models/account_tax.py:docstring of odoo.addons.account.models.account_tax.AccountTax.tax_exigibility:1
msgid "``on_invoice``: Based on Invoice ``on_payment``: Based on Payment"
msgstr ""
#: ../../../odoo/addons/account/models/account_tax.py:docstring of odoo.addons.account.models.account_tax.AccountTax.tax_exigibility:1
msgid "on_invoice"
msgstr ""
#: ../../../odoo/addons/account/models/account_tax.py:docstring of odoo.addons.account.models.account_tax.AccountTax.tax_exigibility:1
msgid "Based on Invoice: the tax is due as soon as the invoice is validated. Based on Payment: the tax is due as soon as the payment of the invoice is received."
msgstr ""
#: ../../../odoo/addons/account/models/account_tax.py:docstring of odoo.addons.account.models.account_tax.AccountTax.cash_basis_transition_account_id:1
msgid "Cash Basis Transition Account"
msgstr ""
#: ../../../odoo/addons/account/models/account_tax.py:docstring of odoo.addons.account.models.account_tax.AccountTax.cash_basis_transition_account_id:1
#: ../../../odoo/addons/account/models/account_tax.py:docstring of odoo.addons.account.models.account_tax.AccountTaxRepartitionLine.account_id:1
msgid ":ref:`account.account <model-account-account>`"
msgstr ""
#: ../../../odoo/addons/account/models/account_tax.py:docstring of odoo.addons.account.models.account_tax.AccountTax.cash_basis_transition_account_id:1
msgid "Account used to transition the tax amount for cash basis taxes. It will contain the tax amount as long as the original invoice has not been reconciled ; at reconciliation, this amount cancelled on this account and put on the regular tax account."
msgstr ""
#: ../../content/developer/reference/standard_modules/account/account_tax_repartition.rst:5
msgid "Tax Repartitions"
msgstr ""
#: ../../../odoo/addons/account/models/account_tax.py:docstring of odoo.addons.account.models.account_tax.AccountTaxRepartitionLine.factor_percent:1
msgid "%"
msgstr ""
#: ../../content/developer/tutorials/define_module_data.rst:185
#: ../../../odoo/addons/account/models/account_tax.py:docstring of odoo.addons.account.models.account_tax.AccountTaxRepartitionLine.factor_percent:1
msgid "100"
msgstr ""
#: ../../../odoo/addons/account/models/account_tax.py:docstring of odoo.addons.account.models.account_tax.AccountTaxRepartitionLine.factor_percent:1
msgid "Factor to apply on the account move lines generated from this distribution line, in percents"
msgstr ""
#: ../../../odoo/addons/account/models/account_tax.py:docstring of odoo.addons.account.models.account_tax.AccountTaxRepartitionLine.repartition_type:1
msgid "Based On"
msgstr ""
#: ../../../odoo/addons/account/models/account_tax.py:docstring of odoo.addons.account.models.account_tax.AccountTaxRepartitionLine.repartition_type:1
msgid "``base``: Base ``tax``: of tax"
msgstr ""
#: ../../../odoo/addons/account/models/account_tax.py:docstring of odoo.addons.account.models.account_tax.AccountTaxRepartitionLine.repartition_type:1
msgid "tax"
msgstr ""
#: ../../../odoo/addons/account/models/account_tax.py:docstring of odoo.addons.account.models.account_tax.AccountTaxRepartitionLine.repartition_type:1
msgid "Base on which the factor will be applied."
msgstr ""
#: ../../../odoo/addons/account/models/account_tax.py:docstring of odoo.addons.account.models.account_tax.AccountTaxRepartitionLine.document_type:1
msgid "Related to"
msgstr ""
#: ../../../odoo/addons/account/models/account_tax.py:docstring of odoo.addons.account.models.account_tax.AccountTaxRepartitionLine.document_type:1
msgid "``invoice``: Invoice ``refund``: Refund"
msgstr ""
#: ../../../odoo/addons/account/models/account_tax.py:docstring of odoo.addons.account.models.account_tax.AccountTaxRepartitionLine.account_id:1
msgid "Account on which to post the tax amount"
msgstr ""
#: ../../../odoo/addons/account/models/account_tax.py:docstring of odoo.addons.account.models.account_tax.AccountTaxRepartitionLine.tax_id:1
msgid "Tax"
msgstr ""
#: ../../../odoo/addons/account/models/account_tax.py:docstring of odoo.addons.account.models.account_tax.AccountTaxRepartitionLine.tag_ids:1
msgid "Tax Grids"
msgstr ""
#: ../../../odoo/addons/account/models/account_tax.py:docstring of odoo.addons.account.models.account_tax.AccountTaxRepartitionLine.use_in_tax_closing:1
msgid "Tax Closing Entry"
msgstr ""
#: ../../content/developer/reference/standard_modules/payment.rst:5
msgid "Payment"
msgstr ""
#: ../../content/developer/reference/standard_modules/payment/payment_method.rst:5
msgid "Payment Method"
msgstr ""
#: ../../../odoo/addons/payment/models/payment_method.py:docstring of odoo.addons.payment.models.payment_method.PaymentMethod._get_compatible_payment_methods:1
msgid "Search and return the payment methods matching the compatibility criteria."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_method.py:docstring of odoo.addons.payment.models.payment_method.PaymentMethod._get_compatible_payment_methods:3
msgid "The compatibility criteria are that payment methods must: be supported by at least one of the providers; support the country of the partner if it exists; be primary payment methods (not a brand). If provided, the optional keyword arguments further refine the criteria."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_method.py:docstring of odoo.addons.payment.models.payment_method.PaymentMethod._get_compatible_payment_methods:7
msgid "The list of providers by which the payment methods must be at least partially supported to be considered compatible, as a list of `payment.provider` ids."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_method.py:docstring of odoo.addons.payment.models.payment_method.PaymentMethod._get_compatible_payment_methods:10
#: ../../../odoo/addons/payment/models/payment_provider.py:docstring of odoo.addons.payment.models.payment_provider.PaymentProvider._get_compatible_providers:9
msgid "The partner making the payment, as a `res.partner` id."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_method.py:docstring of odoo.addons.payment.models.payment_method.PaymentMethod._get_compatible_payment_methods:11
#: ../../../odoo/addons/payment/models/payment_provider.py:docstring of odoo.addons.payment.models.payment_provider.PaymentProvider._get_compatible_providers:11
msgid "The payment currency, if known beforehand, as a `res.currency` id."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_method.py:docstring of odoo.addons.payment.models.payment_method.PaymentMethod._get_compatible_payment_methods:12
msgid "Whether only payment methods supporting tokenization can be matched."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_method.py:docstring of odoo.addons.payment.models.payment_method.PaymentMethod._get_compatible_payment_methods:14
#: ../../../odoo/addons/payment/models/payment_provider.py:docstring of odoo.addons.payment.models.payment_provider.PaymentProvider._get_compatible_providers:13
msgid "Whether the payment is made through express checkout."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_method.py:docstring of odoo.addons.payment.models.payment_method.PaymentMethod._get_compatible_payment_methods:15
#: ../../../odoo/addons/payment/models/payment_provider.py:docstring of odoo.addons.payment.models.payment_provider.PaymentProvider._get_compatible_providers:15
msgid "Optional data. This parameter is not used here."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_method.py:docstring of odoo.addons.payment.models.payment_method.PaymentMethod._get_compatible_payment_methods:16
msgid "The compatible payment methods."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_method.py:docstring of odoo.addons.payment.models.payment_method.PaymentMethod._get_from_code:1
msgid "Get the payment method corresponding to the given provider-specific code."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_method.py:docstring of odoo.addons.payment.models.payment_method.PaymentMethod._get_from_code:3
msgid "If a mapping is given, the search uses the generic payment method code that corresponds to the given provider-specific code."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_method.py:docstring of odoo.addons.payment.models.payment_method.PaymentMethod._get_from_code:6
msgid "The provider-specific code of the payment method to get."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_method.py:docstring of odoo.addons.payment.models.payment_method.PaymentMethod._get_from_code:7
msgid "A non-exhaustive mapping of generic payment method codes to provider-specific codes."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_method.py:docstring of odoo.addons.payment.models.payment_method.PaymentMethod._get_from_code:9
msgid "The corresponding payment method, if any."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_method.py:docstring of odoo.addons.payment.models.payment_method.PaymentMethod._get_from_code:10
msgid "payment.method"
msgstr ""
#: ../../content/developer/reference/standard_modules/payment/payment_provider.rst:5
msgid "Payment Provider"
msgstr ""
#: ../../../odoo/addons/payment/models/payment_provider.py:docstring of odoo.addons.payment.models.payment_provider.PaymentProvider._compute_feature_support_fields:1
msgid "Compute the feature support fields based on the provider."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_provider.py:docstring of odoo.addons.payment.models.payment_provider.PaymentProvider._compute_feature_support_fields:3
msgid "Feature support fields are used to specify which additional features are supported by a given provider. These fields are as follows:"
msgstr ""
#: ../../../odoo/addons/payment/models/payment_provider.py:docstring of odoo.addons.payment.models.payment_provider.PaymentProvider._compute_feature_support_fields:6
msgid "`support_express_checkout`: Whether the \"express checkout\" feature is supported. `False` by default."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_provider.py:docstring of odoo.addons.payment.models.payment_provider.PaymentProvider._compute_feature_support_fields:8
msgid "`support_manual_capture`: Whether the \"manual capture\" feature is supported. `False` by default."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_provider.py:docstring of odoo.addons.payment.models.payment_provider.PaymentProvider._compute_feature_support_fields:10
msgid "`support_refund`: Which type of the \"refunds\" feature is supported: `None`, `'full_only'`, or `'partial'`. `None` by default."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_provider.py:docstring of odoo.addons.payment.models.payment_provider.PaymentProvider._compute_feature_support_fields:12
msgid "`support_tokenization`: Whether the \"tokenization feature\" is supported. `False` by default."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_provider.py:docstring of odoo.addons.payment.models.payment_provider.PaymentProvider._compute_feature_support_fields:15
msgid "For a provider to specify that it supports additional features, it must override this method and set the related feature support fields to the desired value on the appropriate `payment.provider` records."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_provider.py:docstring of odoo.addons.payment.models.payment_provider.PaymentProvider._compute_feature_support_fields:19
#: ../../../odoo/addons/payment/models/payment_provider.py:docstring of odoo.addons.payment.models.payment_provider.PaymentProvider._compute_view_configuration_fields:21
#: ../../../odoo/addons/payment/models/payment_token.py:docstring of odoo.addons.payment.models.payment_token.PaymentToken._handle_archiving:6
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._process_notification_data:12
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._send_payment_request:11
msgid "None"
msgstr ""
#: ../../../odoo/addons/payment/models/payment_provider.py:docstring of odoo.addons.payment.models.payment_provider.PaymentProvider._compute_view_configuration_fields:1
msgid "Compute the view configuration fields based on the provider."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_provider.py:docstring of odoo.addons.payment.models.payment_provider.PaymentProvider._compute_view_configuration_fields:3
msgid "View configuration fields are used to hide specific elements (notebook pages, fields, etc.) from the form view of payment providers. These fields are set to `True` by default and are as follows:"
msgstr ""
#: ../../../odoo/addons/payment/models/payment_provider.py:docstring of odoo.addons.payment.models.payment_provider.PaymentProvider._compute_view_configuration_fields:7
msgid "`show_credentials_page`: Whether the \"Credentials\" notebook page should be shown."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_provider.py:docstring of odoo.addons.payment.models.payment_provider.PaymentProvider._compute_view_configuration_fields:8
msgid "`show_allow_tokenization`: Whether the `allow_tokenization` field should be shown."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_provider.py:docstring of odoo.addons.payment.models.payment_provider.PaymentProvider._compute_view_configuration_fields:9
msgid "`show_allow_express_checkout`: Whether the `allow_express_checkout` field should be shown."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_provider.py:docstring of odoo.addons.payment.models.payment_provider.PaymentProvider._compute_view_configuration_fields:10
msgid "`show_pre_msg`: Whether the `pre_msg` field should be shown."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_provider.py:docstring of odoo.addons.payment.models.payment_provider.PaymentProvider._compute_view_configuration_fields:11
msgid "`show_pending_msg`: Whether the `pending_msg` field should be shown."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_provider.py:docstring of odoo.addons.payment.models.payment_provider.PaymentProvider._compute_view_configuration_fields:12
msgid "`show_auth_msg`: Whether the `auth_msg` field should be shown."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_provider.py:docstring of odoo.addons.payment.models.payment_provider.PaymentProvider._compute_view_configuration_fields:13
msgid "`show_done_msg`: Whether the `done_msg` field should be shown."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_provider.py:docstring of odoo.addons.payment.models.payment_provider.PaymentProvider._compute_view_configuration_fields:14
msgid "`show_cancel_msg`: Whether the `cancel_msg` field should be shown."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_provider.py:docstring of odoo.addons.payment.models.payment_provider.PaymentProvider._compute_view_configuration_fields:15
msgid "`require_currency`: Whether the `available_currency_ids` field shoud be required."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_provider.py:docstring of odoo.addons.payment.models.payment_provider.PaymentProvider._compute_view_configuration_fields:17
msgid "For a provider to hide specific elements of the form view, it must override this method and set the related view configuration fields to `False` on the appropriate `payment.provider` records."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_provider.py:docstring of odoo.addons.payment.models.payment_provider.PaymentProvider._get_compatible_providers:1
msgid "Search and return the providers matching the compatibility criteria."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_provider.py:docstring of odoo.addons.payment.models.payment_provider.PaymentProvider._get_compatible_providers:3
msgid "The compatibility criteria are that providers must: not be disabled; be in the company that is provided; support the country of the partner if it exists; be compatible with the currency if provided. If provided, the optional keyword arguments further refine the criteria."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_provider.py:docstring of odoo.addons.payment.models.payment_provider.PaymentProvider._get_compatible_providers:8
msgid "The company to which providers must belong, as a `res.company` id."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_provider.py:docstring of odoo.addons.payment.models.payment_provider.PaymentProvider._get_compatible_providers:10
msgid "The amount to pay. `0` for validation transactions."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_provider.py:docstring of odoo.addons.payment.models.payment_provider.PaymentProvider._get_compatible_providers:12
msgid "Whether only providers allowing tokenization can be matched."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_provider.py:docstring of odoo.addons.payment.models.payment_provider.PaymentProvider._get_compatible_providers:14
#: ../../../odoo/addons/payment/models/payment_provider.py:docstring of odoo.addons.payment.models.payment_provider.PaymentProvider._get_redirect_form_view:8
#: ../../../odoo/addons/payment/models/payment_provider.py:docstring of odoo.addons.payment.models.payment_provider.PaymentProvider._should_build_inline_form:7
msgid "Whether the operation is a validation."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_provider.py:docstring of odoo.addons.payment.models.payment_provider.PaymentProvider._get_compatible_providers:16
msgid "The compatible providers."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_provider.py:docstring of odoo.addons.payment.models.payment_provider.PaymentProvider._get_redirect_form_view:1
msgid "Return the view of the template used to render the redirect form."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_provider.py:docstring of odoo.addons.payment.models.payment_provider.PaymentProvider._get_redirect_form_view:3
msgid "For a provider to return a different view depending on whether the operation is a validation, it must override this method and return the appropriate view."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_provider.py:docstring of odoo.addons.payment.models.payment_provider.PaymentProvider._get_redirect_form_view:6
#: ../../../odoo/addons/payment/models/payment_provider.py:docstring of odoo.addons.payment.models.payment_provider.PaymentProvider._get_validation_amount:6
#: ../../../odoo/addons/payment/models/payment_provider.py:docstring of odoo.addons.payment.models.payment_provider.PaymentProvider._get_validation_currency:7
#: ../../../odoo/addons/payment/models/payment_token.py:docstring of odoo.addons.payment.models.payment_token.PaymentToken._build_display_name:11
#: ../../../odoo/addons/payment/models/payment_token.py:docstring of odoo.addons.payment.models.payment_token.PaymentToken.get_linked_records_info:13
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._get_post_processing_values:22
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._process_notification_data:9
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._send_capture_request:8
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._send_payment_request:9
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._send_refund_request:6
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._send_void_request:8
msgid "Note: `self.ensure_one()`"
msgstr ""
#: ../../../odoo/addons/payment/models/payment_provider.py:docstring of odoo.addons.payment.models.payment_provider.PaymentProvider._get_redirect_form_view:9
msgid "The view of the redirect form template."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_provider.py:docstring of odoo.addons.payment.models.payment_provider.PaymentProvider._get_redirect_form_view:10
msgid "record of `ir.ui.view`"
msgstr ""
#: ../../../odoo/addons/payment/models/payment_provider.py:docstring of odoo.addons.payment.models.payment_provider.PaymentProvider._get_validation_amount:1
msgid "Return the amount to use for validation operations."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_provider.py:docstring of odoo.addons.payment.models.payment_provider.PaymentProvider._get_validation_amount:3
msgid "For a provider to support tokenization, it must override this method and return the validation amount. If it is `0`, it is not necessary to create the override."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_provider.py:docstring of odoo.addons.payment.models.payment_provider.PaymentProvider._get_validation_amount:8
msgid "The validation amount."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_provider.py:docstring of odoo.addons.payment.models.payment_provider.PaymentProvider._get_validation_currency:1
msgid "Return the currency to use for validation operations."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_provider.py:docstring of odoo.addons.payment.models.payment_provider.PaymentProvider._get_validation_currency:3
msgid "For a provider to support tokenization, it must override this method and return the validation currency. If the validation amount is `0`, it is not necessary to create the override."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_provider.py:docstring of odoo.addons.payment.models.payment_provider.PaymentProvider._get_validation_currency:9
msgid "The validation currency."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_provider.py:docstring of odoo.addons.payment.models.payment_provider.PaymentProvider._get_validation_currency:10
msgid "recordset of `res.currency`"
msgstr ""
#: ../../../odoo/addons/payment/models/payment_provider.py:docstring of odoo.addons.payment.models.payment_provider.PaymentProvider._is_tokenization_required:1
msgid "Return whether tokenizing the transaction is required given its context."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_provider.py:docstring of odoo.addons.payment.models.payment_provider.PaymentProvider._is_tokenization_required:3
msgid "For a module to make the tokenization required based on the payment context, it must override this method and return whether it is required."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_provider.py:docstring of odoo.addons.payment.models.payment_provider.PaymentProvider._is_tokenization_required:6
msgid "The payment context. This parameter is not used here."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_provider.py:docstring of odoo.addons.payment.models.payment_provider.PaymentProvider._is_tokenization_required:7
msgid "Whether tokenizing the transaction is required."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_provider.py:docstring of odoo.addons.payment.models.payment_provider.PaymentProvider._should_build_inline_form:1
msgid "Return whether the inline payment form should be instantiated."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_provider.py:docstring of odoo.addons.payment.models.payment_provider.PaymentProvider._should_build_inline_form:3
msgid "For a provider to handle both direct payments and payments with redirection, it must override this method and return whether the inline payment form should be instantiated (i.e. if the payment should be direct) based on the operation (online payment or validation)."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_provider.py:docstring of odoo.addons.payment.models.payment_provider.PaymentProvider._should_build_inline_form:8
msgid "Whether the inline form should be instantiated."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_provider.py:docstring of odoo.addons.payment.models.payment_provider.PaymentProvider._get_removal_values:1
msgid "Return the values to update a provider with when its module is uninstalled."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_provider.py:docstring of odoo.addons.payment.models.payment_provider.PaymentProvider._get_removal_values:3
msgid "For a module to specify additional removal values, it must override this method and complete the generic values with its specific values."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_provider.py:docstring of odoo.addons.payment.models.payment_provider.PaymentProvider._get_removal_values:6
msgid "The removal values to update the removed provider with."
msgstr ""
#: ../../content/developer/reference/standard_modules/payment/payment_token.rst:5
msgid "Payment Token"
msgstr ""
#: ../../../odoo/addons/payment/models/payment_token.py:docstring of odoo.addons.payment.models.payment_token.PaymentToken._get_available_tokens:1
msgid "Return the available tokens linked to the given providers and partner."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_token.py:docstring of odoo.addons.payment.models.payment_token.PaymentToken._get_available_tokens:3
msgid "For a module to retrieve the available tokens, it must override this method and add information in the kwargs to define the context of the request."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_token.py:docstring of odoo.addons.payment.models.payment_token.PaymentToken._get_available_tokens:6
msgid "The ids of the providers available for the transaction."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_token.py:docstring of odoo.addons.payment.models.payment_token.PaymentToken._get_available_tokens:7
msgid "The id of the partner."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_token.py:docstring of odoo.addons.payment.models.payment_token.PaymentToken._get_available_tokens:8
msgid "Whether the transaction is a validation operation."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_token.py:docstring of odoo.addons.payment.models.payment_token.PaymentToken._get_available_tokens:9
msgid "Locally unused keywords arguments."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_token.py:docstring of odoo.addons.payment.models.payment_token.PaymentToken._get_available_tokens:10
msgid "The available tokens."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_token.py:docstring of odoo.addons.payment.models.payment_token.PaymentToken._build_display_name:1
msgid "Build a token name of the desired maximum length with the format `•••• 1234`."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_token.py:docstring of odoo.addons.payment.models.payment_token.PaymentToken._build_display_name:3
msgid "The payment details are padded on the left with up to four padding characters. The padding is only added if there is enough room for it. If not, it is either reduced or not added at all. If there is not enough room for the payment details either, they are trimmed from the left."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_token.py:docstring of odoo.addons.payment.models.payment_token.PaymentToken._build_display_name:8
msgid "For a module to customize the display name of a token, it must override this method and return the customized display name."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_token.py:docstring of odoo.addons.payment.models.payment_token.PaymentToken._build_display_name:13
msgid "The arguments passed by QWeb when calling this method."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_token.py:docstring of odoo.addons.payment.models.payment_token.PaymentToken._build_display_name:14
msgid "The desired maximum length of the token name. The default is `34` to fit the largest IBANs."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_token.py:docstring of odoo.addons.payment.models.payment_token.PaymentToken._build_display_name:16
msgid "Whether the token should be padded."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_token.py:docstring of odoo.addons.payment.models.payment_token.PaymentToken._build_display_name:17
msgid "Optional data used in overrides of this method."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_token.py:docstring of odoo.addons.payment.models.payment_token.PaymentToken._build_display_name:18
msgid "The padded token name."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_token.py:docstring of odoo.addons.payment.models.payment_token.PaymentToken._get_specific_create_values:1
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._get_specific_create_values:1
msgid "Complete the values of the `create` method with provider-specific values."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_token.py:docstring of odoo.addons.payment.models.payment_token.PaymentToken._get_specific_create_values:3
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._get_specific_create_values:3
msgid "For a provider to add its own create values, it must overwrite this method and return a dict of values. Provider-specific values take precedence over those of the dict of generic create values."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_token.py:docstring of odoo.addons.payment.models.payment_token.PaymentToken._get_specific_create_values:7
msgid "The code of the provider managing the token."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_token.py:docstring of odoo.addons.payment.models.payment_token.PaymentToken._get_specific_create_values:8
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._get_specific_create_values:8
msgid "The original create values."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_token.py:docstring of odoo.addons.payment.models.payment_token.PaymentToken._get_specific_create_values:9
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._get_specific_create_values:9
msgid "The dict of provider-specific create values."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_token.py:docstring of odoo.addons.payment.models.payment_token.PaymentToken._handle_archiving:1
msgid "Handle the archiving of tokens."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_token.py:docstring of odoo.addons.payment.models.payment_token.PaymentToken._handle_archiving:3
msgid "For a module to perform additional operations when a token is archived, it must override this method."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_token.py:docstring of odoo.addons.payment.models.payment_token.PaymentToken.get_linked_records_info:1
msgid "Return a list of information about records linked to the current token."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_token.py:docstring of odoo.addons.payment.models.payment_token.PaymentToken.get_linked_records_info:3
msgid "For a module to implement payments and link documents to a token, it must override this method and add information about linked document records to the returned list."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_token.py:docstring of odoo.addons.payment.models.payment_token.PaymentToken.get_linked_records_info:6
msgid "The information must be structured as a dict with the following keys:"
msgstr ""
#: ../../../odoo/addons/payment/models/payment_token.py:docstring of odoo.addons.payment.models.payment_token.PaymentToken.get_linked_records_info:8
msgid "`description`: The description of the record's model (e.g. \"Subscription\")."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_token.py:docstring of odoo.addons.payment.models.payment_token.PaymentToken.get_linked_records_info:9
msgid "`id`: The id of the record."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_token.py:docstring of odoo.addons.payment.models.payment_token.PaymentToken.get_linked_records_info:10
msgid "`name`: The name of the record."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_token.py:docstring of odoo.addons.payment.models.payment_token.PaymentToken.get_linked_records_info:11
msgid "`url`: The url to access the record."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_token.py:docstring of odoo.addons.payment.models.payment_token.PaymentToken.get_linked_records_info:15
msgid "The list of information about the linked document records."
msgstr ""
#: ../../content/developer/reference/standard_modules/payment/payment_transaction.rst:5
msgid "Payment Transaction"
msgstr ""
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._compute_reference:1
msgid "Compute a unique reference for the transaction."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._compute_reference:3
msgid "The reference corresponds to the prefix if no other transaction with that prefix already exists. Otherwise, it follows the pattern `{computed_prefix}{separator}{sequence_number}` where:"
msgstr ""
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._compute_reference:7
msgid "`{computed_prefix}` is:"
msgstr ""
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._compute_reference:9
msgid "The provided custom prefix, if any."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._compute_reference:10
msgid "The computation result of :meth:`_compute_reference_prefix` if the custom prefix is not filled, but the kwargs are."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._compute_reference:12
msgid "`'tx-{datetime}'` if neither the custom prefix nor the kwargs are filled."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._compute_reference:14
msgid "`{separator}` is the string that separates the prefix from the sequence number."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._compute_reference:15
msgid "`{sequence_number}` is the next integer in the sequence of references sharing the same prefix. The sequence starts with `1` if there is only one matching reference."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._compute_reference:20
msgid "Given the custom prefix `'example'` which has no match with an existing reference, the full reference will be `'example'`."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._compute_reference:22
msgid "Given the custom prefix `'example'` which matches the existing reference `'example'`, and the custom separator `'-'`, the full reference will be `'example-1'`."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._compute_reference:24
msgid "Given the kwargs `{'invoice_ids': [1, 2]}`, the custom separator `'-'` and no custom prefix, the full reference will be `'INV1-INV2'` (or similar) if no existing reference has the same prefix, or `'INV1-INV2-n'` if `n` existing references have the same prefix."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._compute_reference:29
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._compute_reference_prefix:6
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._get_tx_from_notification_data:6
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._handle_notification_data:3
msgid "The code of the provider handling the transaction."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._compute_reference:30
msgid "The custom prefix used to compute the full reference."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._compute_reference:31
msgid "The custom separator used to separate the prefix from the suffix."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._compute_reference:32
msgid "Optional values passed to :meth:`_compute_reference_prefix` if no custom prefix is provided."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._compute_reference:34
msgid "The unique reference for the transaction."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._compute_reference_prefix:1
msgid "Compute the reference prefix from the transaction values."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._compute_reference_prefix:3
msgid "Note: This method should be called in sudo mode to give access to the documents (invoices, sales orders) referenced in the transaction values."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._compute_reference_prefix:7
msgid "The custom separator used to separate parts of the computed reference prefix."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._compute_reference_prefix:9
msgid "The transaction values used to compute the reference prefix."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._compute_reference_prefix:10
msgid "The computed reference prefix."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._get_post_processing_values:1
msgid "Return a dict of values used to display the status of the transaction."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._get_post_processing_values:3
msgid "For a provider to handle transaction status display, it must override this method and return a dict of values. Provider-specific values take precedence over those of the dict of generic post-processing values."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._get_post_processing_values:7
msgid "The returned dict contains the following entries:"
msgstr ""
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._get_post_processing_values:9
msgid "`provider_code`: The code of the provider."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._get_post_processing_values:10
msgid "`provider_name`: The name of the provider."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._get_post_processing_values:11
msgid "`reference`: The reference of the transaction."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._get_post_processing_values:12
msgid "`amount`: The rounded amount of the transaction."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._get_post_processing_values:13
msgid "`currency_id`: The currency of the transaction, as a `res.currency` id."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._get_post_processing_values:14
msgid "`state`: The transaction state: `draft`, `pending`, `authorized`, `done`, `cancel`, or `error`."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._get_post_processing_values:16
msgid "`state_message`: The information message about the state."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._get_post_processing_values:17
msgid "`operation`: The operation of the transaction."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._get_post_processing_values:18
msgid "`is_post_processed`: Whether the transaction has already been post-processed."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._get_post_processing_values:19
msgid "`landing_route`: The route the user is redirected to after the transaction."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._get_post_processing_values:20
msgid "Additional provider-specific entries."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._get_post_processing_values:24
msgid "The dict of processing values."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._get_specific_create_values:7
msgid "The code of the provider that handled the transaction."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._get_specific_processing_values:1
msgid "Return a dict of provider-specific values used to process the transaction."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._get_specific_processing_values:3
msgid "For a provider to add its own processing values, it must overwrite this method and return a dict of provider-specific values based on the generic values returned by this method. Provider-specific values take precedence over those of the dict of generic processing values."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._get_specific_processing_values:8
msgid "The generic processing values of the transaction."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._get_specific_processing_values:9
msgid "The dict of provider-specific processing values."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._get_specific_rendering_values:1
msgid "Return a dict of provider-specific values used to render the redirect form."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._get_specific_rendering_values:3
msgid "For a provider to add its own rendering values, it must overwrite this method and return a dict of provider-specific values based on the processing values (provider-specific processing values included)."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._get_specific_rendering_values:7
msgid "The processing values of the transaction."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._get_specific_rendering_values:8
msgid "The dict of provider-specific rendering values."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._get_tx_from_notification_data:1
msgid "Find the transaction based on the notification data."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._get_tx_from_notification_data:3
msgid "For a provider to handle transaction processing, it must overwrite this method and return the transaction matching the notification data."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._get_tx_from_notification_data:7
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._handle_notification_data:4
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._process_notification_data:11
msgid "The notification data sent by the provider."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._get_tx_from_notification_data:8
msgid "The transaction, if found."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._get_tx_from_notification_data:9
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._handle_notification_data:6
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._send_refund_request:10
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._set_authorized:7
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._set_canceled:7
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._set_done:7
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._set_error:7
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._set_pending:7
msgid "recordset of `payment.transaction`"
msgstr ""
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._handle_notification_data:1
msgid "Match the transaction with the notification data, update its state and return it."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._handle_notification_data:5
msgid "The transaction."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._process_notification_data:1
msgid "Update the transaction state and the provider reference based on the notification data."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._process_notification_data:3
msgid "This method should usually not be called directly. The correct method to call upon receiving notification data is :meth:`_handle_notification_data`."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._process_notification_data:6
msgid "For a provider to handle transaction processing, it must overwrite this method and process the notification data."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._send_capture_request:1
msgid "Request the provider handling the transaction to capture the payment."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._send_capture_request:3
msgid "For partial captures, create a child transaction linked to the source transaction."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._send_capture_request:5
msgid "For a provider to support authorization, it must override this method and make an API request to capture the payment."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._send_capture_request:10
msgid "The amount to capture."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._send_capture_request:11
msgid "The created capture child transaction, if any."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._send_capture_request:12
msgid "`payment.transaction`"
msgstr ""
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._send_payment_request:1
msgid "Request the provider handling the transaction to make the payment."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._send_payment_request:3
msgid "This method is exclusively used to make payments by token, which correspond to both the `online_token` and the `offline` transaction's `operation` field."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._send_payment_request:6
msgid "For a provider to support tokenization, it must override this method and make an API request to make a payment."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._send_refund_request:1
msgid "Request the provider handling the transaction to refund it."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._send_refund_request:3
msgid "For a provider to support refunds, it must override this method and make an API request to make a refund."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._send_refund_request:8
msgid "The amount to be refunded."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._send_refund_request:9
msgid "The refund transaction created to process the refund request."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._send_void_request:1
msgid "Request the provider handling the transaction to void the payment."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._send_void_request:3
msgid "For partial voids, create a child transaction linked to the source transaction."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._send_void_request:5
msgid "For a provider to support authorization, it must override this method and make an API request to void the payment."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._send_void_request:10
msgid "The amount to be voided."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._send_void_request:11
msgid "The created void child transaction, if any."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._set_authorized:1
msgid "Update the transactions' state to `authorized`."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._set_authorized:3
msgid "The reason for setting the transactions in the state `authorized`."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._set_authorized:4
msgid "The extra states that should be considered allowed target states for the source state 'authorized'."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._set_authorized:6
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._set_canceled:6
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._set_done:6
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._set_error:6
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._set_pending:6
msgid "The updated transactions."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._set_canceled:1
msgid "Update the transactions' state to `cancel`."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._set_canceled:3
msgid "The reason for setting the transactions in the state `cancel`."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._set_canceled:4
msgid "The extra states that should be considered allowed target states for the source state 'canceled'."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._set_done:1
msgid "Update the transactions' state to `done`."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._set_done:3
msgid "The reason for setting the transactions in the state `done`."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._set_done:4
msgid "The extra states that should be considered allowed target states for the source state 'done'."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._set_error:1
msgid "Update the transactions' state to `error`."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._set_error:3
msgid "The reason for setting the transactions in the state `error`."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._set_error:4
msgid "The extra states that should be considered allowed target states for the source state 'error'."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._set_pending:1
msgid "Update the transactions' state to `pending`."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._set_pending:3
msgid "The reason for setting the transactions in the state `pending`."
msgstr ""
#: ../../../odoo/addons/payment/models/payment_transaction.py:docstring of odoo.addons.payment.models.payment_transaction.PaymentTransaction._set_pending:4
msgid "The extra states that should be considered allowed target states for the source state 'pending'."
msgstr ""
#: ../../content/developer/reference/upgrade_scripts.rst:3
msgid "Upgrade scripts"
msgstr ""
#: ../../content/developer/reference/upgrade_scripts.rst:5
msgid "An upgrade script is a Python file containing a function called :meth:`migrate`, which the upgrade process invokes during the update of a module."
msgstr ""
#: ../../content/developer/reference/upgrade_scripts.rst:10
msgid "current database cursor"
msgstr ""
#: ../../content/developer/reference/upgrade_scripts.rst:12
msgid "installed version of the module"
msgstr ""
#: ../../content/developer/reference/upgrade_scripts.rst:14
msgid "Typically, this function executes one or multiple SQL queries and can also access Odoo's ORM, as well as the :doc:`./upgrade_utils`."
msgstr ""
#: ../../content/developer/reference/upgrade_scripts.rst:18
msgid "Writing upgrade scripts"
msgstr ""
#: ../../content/developer/reference/upgrade_scripts.rst:20
msgid "Upgrade scripts follow a specific tree structure with a naming convention which determines when they are executed."
msgstr ""
#: ../../content/developer/reference/upgrade_scripts.rst:23
msgid "The structure of an upgrade script path is :file:`$module/migrations/$version/{pre,post,end}-*.py`, where `$module` is the module for which the script will run, `$version` is the full version of the module (including Odoo's major version and the module's minor version) and `{pre|post|end}-*.py` is the file that needs to be executed. The file's name will determine the :ref:`phase <upgrade-scripts/phases>` and order in which it is executed for that module and version."
msgstr ""
#: ../../content/developer/reference/upgrade_scripts.rst:30
msgid "Upgrade scripts are only executed when the module is being updated. Therefore, the module's minor version set in the `$version` directory needs to be higher than the module's installed version and equal or lower to the updated version of the module."
msgstr ""
#: ../../content/developer/reference/upgrade_scripts.rst:36
msgid "Directory structure of an upgrade script for a custom module named `awesome_partner` upgraded to version `2.0` on Odoo 17."
msgstr ""
#: ../../content/developer/reference/upgrade_scripts.rst:46
msgid "Two upgrade scripts examples with the content of the :file:`pre-exclamation.py`, file adding \"!\" at the end of partners' names:"
msgstr ""
#: ../../content/developer/reference/upgrade_scripts.rst:77
msgid "Note that in the second example, the script takes advantage of the :doc:`./upgrade_utils` to access the ORM. Check the documentation to find out more about this library."
msgstr ""
#: ../../content/developer/reference/upgrade_scripts.rst:83
msgid "Phases of upgrade scripts"
msgstr ""
#: ../../content/developer/reference/upgrade_scripts.rst:85
msgid "The upgrade process consists of three phases for each version of each module:"
msgstr ""
#: ../../content/developer/reference/upgrade_scripts.rst:87
msgid "The pre-phase, before the module is loaded."
msgstr ""
#: ../../content/developer/reference/upgrade_scripts.rst:88
msgid "The post-phase, after the module and its dependencies are loaded and updated."
msgstr ""
#: ../../content/developer/reference/upgrade_scripts.rst:89
msgid "The end-phase, after all modules have been loaded and updated for that version."
msgstr ""
#: ../../content/developer/reference/upgrade_scripts.rst:91
msgid "Upgrade scripts are grouped according to the first part of their filenames into the corresponding phase. Within each phase, the files are executed according to their lexical order."
msgstr ""
#: ../../content/developer/reference/upgrade_scripts.rst:94
msgid "Execution order of example scripts for one module in one version"
msgstr ""
#: ../../content/developer/reference/upgrade_scripts.rst:96
msgid ":file:`pre-10-do_something.py`"
msgstr ""
#: ../../content/developer/reference/upgrade_scripts.rst:97
msgid ":file:`pre-20-something_else.py`"
msgstr ""
#: ../../content/developer/reference/upgrade_scripts.rst:98
msgid ":file:`post-do_something.py`"
msgstr ""
#: ../../content/developer/reference/upgrade_scripts.rst:99
msgid ":file:`post-something.py`"
msgstr ""
#: ../../content/developer/reference/upgrade_scripts.rst:100
msgid ":file:`end-01-migrate.py`"
msgstr ""
#: ../../content/developer/reference/upgrade_scripts.rst:101
msgid ":file:`end-migrate.py`"
msgstr ""
#: ../../content/developer/reference/upgrade_utils.rst:3
msgid "Upgrade utils"
msgstr ""
#: ../../content/developer/reference/upgrade_utils.rst:5
msgid "`Upgrade utils <https://github.com/odoo/upgrade-util/>`_ is a library that contains helper functions to facilitate the writing of upgrade scripts. This library, used by Odoo for the upgrade scripts of standard modules, provides reliability and helps speed up the upgrade process:"
msgstr ""
#: ../../content/developer/reference/upgrade_utils.rst:9
msgid "The helper functions help make sure the data is consistent in the database."
msgstr ""
#: ../../content/developer/reference/upgrade_utils.rst:10
msgid "It takes care of indirect references of the updated records."
msgstr ""
#: ../../content/developer/reference/upgrade_utils.rst:11
msgid "Allows calling functions and avoid writing code, saving time and reducing development risks."
msgstr ""
#: ../../content/developer/reference/upgrade_utils.rst:12
msgid "Helpers allow to focus on what is important for the upgrade and not think of details."
msgstr ""
#: ../../content/developer/reference/upgrade_utils.rst:15
msgid "Installation"
msgstr ""
#: ../../content/developer/reference/upgrade_utils.rst:17
msgid "Clone the `Upgrade utils repository <https://github.com/odoo/upgrade-util/>`_ locally and start ``odoo`` with the ``src`` directory prepended to the ``--upgrade-path`` option."
msgstr ""
#: ../../content/developer/reference/upgrade_utils.rst:24
msgid "On platforms where you do not manage Odoo yourself, you can install this library via `pip`:"
msgstr ""
#: ../../content/developer/reference/upgrade_utils.rst:30
msgid "On `Odoo.sh <https://www.odoo.sh/>`_ it is recommended to add it to the :file:`requirements.txt` of the custom repository. For this, add the following line inside the file::"
msgstr ""
#: ../../content/developer/reference/upgrade_utils.rst:36
msgid "Using Upgrade utils"
msgstr ""
#: ../../content/developer/reference/upgrade_utils.rst:38
msgid "Once installed, the following packages are available for the upgrade scripts:"
msgstr ""
#: ../../content/developer/reference/upgrade_utils.rst:40
msgid ":mod:`odoo.upgrade.util`: the helper itself."
msgstr ""
#: ../../content/developer/reference/upgrade_utils.rst:41
msgid ":mod:`odoo.upgrade.testing`: base TestCase classes."
msgstr ""
#: ../../content/developer/reference/upgrade_utils.rst:43
msgid "To use it in upgrade scripts, simply import it:"
msgstr ""
#: ../../content/developer/reference/upgrade_utils.rst:53
msgid "Now, the helper functions are available to be called through ``util``."
msgstr ""
#: ../../content/developer/reference/upgrade_utils.rst:56
msgid "Util functions"
msgstr ""
#: ../../content/developer/reference/upgrade_utils.rst:58
msgid "Upgrade utils provides many useful functions to ease the upgrade process. Here, we describe some of the most useful ones. Refer to the `util folder <https://github.com/odoo/upgrade-util/tree/master/src/util>`_ for the comprehensive declaration of helper functions."
msgstr ""
#: ../../content/developer/reference/upgrade_utils.rst:65
msgid "All util functions receive :attr:`cr` as a parameter. This refers to the database cursor. Pass the one received as a parameter in :meth:`migrate`."
msgstr ""
#: ../../content/developer/reference/upgrade_utils.rst:74
msgid "Remove a field and its references from the database."
msgstr ""
#: ../../content/developer/reference/upgrade_utils.rst:76
msgid "model name of the field to remove"
msgstr ""
#: ../../content/developer/reference/upgrade_utils.rst:77
msgid "name of the field to remove"
msgstr ""
#: ../../content/developer/reference/upgrade_utils.rst:78
msgid "whether the field's column and inheritance are removed in ``CASCADE``"
msgstr ""
#: ../../content/developer/reference/upgrade_utils.rst:79
msgid "whether the field's column is dropped"
msgstr ""
#: ../../content/developer/reference/upgrade_utils.rst:80
#: ../../content/developer/reference/upgrade_utils.rst:97
#: ../../content/developer/reference/upgrade_utils.rst:109
msgid "list of models whose field's inheritance is skipped. Use ``\"*\"`` to skip all inheritances"
msgstr ""
#: ../../content/developer/reference/upgrade_utils.rst:86
msgid "Rename a field and its references from ``old`` to ``new``."
msgstr ""
#: ../../content/developer/reference/upgrade_utils.rst:88
msgid "model name of the field to rename"
msgstr ""
#: ../../content/developer/reference/upgrade_utils.rst:89
msgid "current name od the field to rename"
msgstr ""
#: ../../content/developer/reference/upgrade_utils.rst:90
msgid "new name od the field to rename"
msgstr ""
#: ../../content/developer/reference/upgrade_utils.rst:91
msgid "whether all references of field ``old`` to ``new`` are replaced in: ``ir_filters``, ``ir_exports_line``, ``ir_act_server``, ``mail_alias``, ``ir_ui_view_custom (dashboard)``, ``domains (using \"domain_adapter\")``, ``related fields``"
msgstr ""
#: ../../content/developer/reference/upgrade_utils.rst:94
msgid "function that takes three arguments and returns a domain that substitutes the original leaf: ``(leaf: Tuple[str,str,Any], in_or: bool, negated: bool)`` -> ``List[Union[str,Tuple[str,str,Any]]]``"
msgstr ""
#: ../../content/developer/reference/upgrade_utils.rst:103
msgid "Move a field's reference in ``ir_model_data`` table from ``old_module`` to ``new_module``."
msgstr ""
#: ../../content/developer/reference/upgrade_utils.rst:105
msgid "model name of the field to move"
msgstr ""
#: ../../content/developer/reference/upgrade_utils.rst:106
msgid "name of the field to move"
msgstr ""
#: ../../content/developer/reference/upgrade_utils.rst:107
msgid "current module name of the field to move"
msgstr ""
#: ../../content/developer/reference/upgrade_utils.rst:108
msgid "new module name of the field to move"
msgstr ""
#: ../../content/developer/reference/upgrade_utils.rst:118
msgid "Remove a model and its references from the database."
msgstr ""
#: ../../content/developer/reference/upgrade_utils.rst:120
msgid "name of the model to remove"
msgstr ""
#: ../../content/developer/reference/upgrade_utils.rst:121
msgid "whether the model's table is dropped"
msgstr ""
#: ../../content/developer/reference/upgrade_utils.rst:122
msgid "list of m2m tables ignored to remove. Use ``\"*\"`` to ignore all m2m tables"
msgstr ""
#: ../../content/developer/reference/upgrade_utils.rst:128
msgid "Rename a model and its references from ``old`` to ``new``."
msgstr ""
#: ../../content/developer/reference/upgrade_utils.rst:130
msgid "current name of the model to rename"
msgstr ""
#: ../../content/developer/reference/upgrade_utils.rst:131
msgid "new name of the model to rename"
msgstr ""
#: ../../content/developer/reference/upgrade_utils.rst:132
msgid "whether the model's table is renamed"
msgstr ""
#: ../../content/developer/reference/upgrade_utils.rst:137
msgid "Merge the references from ``source`` model into ``target`` model and removes ``source`` model and its references. By default, only the fields with the same name in both models are mapped."
msgstr ""
#: ../../content/developer/reference/upgrade_utils.rst:141
msgid "This function does not move the records from ``source`` model to ``target`` model."
msgstr ""
#: ../../content/developer/reference/upgrade_utils.rst:143
msgid "name of the source model of the merge"
msgstr ""
#: ../../content/developer/reference/upgrade_utils.rst:144
msgid "name of the destination model of the merge"
msgstr ""
#: ../../content/developer/reference/upgrade_utils.rst:145
msgid "whether the source model's table is dropped"
msgstr ""
#: ../../content/developer/reference/upgrade_utils.rst:146
msgid "Dictionary ``{\"source_model_field_1\": \"target_model_field_1\", ...}`` mapping fields with different names on both models"
msgstr ""
#: ../../content/developer/reference/upgrade_utils.rst:148
msgid "list of m2m tables ignored to remove from source model."
msgstr ""
#: ../../content/developer/reference/upgrade_utils.rst:151
#: ../../content/developer/tutorials/unit_tests.rst:167
msgid "Modules"
msgstr ""
#: ../../content/developer/reference/upgrade_utils.rst:156
msgid "Uninstall and remove a module and its references from the database."
msgstr ""
#: ../../content/developer/reference/upgrade_utils.rst:158
msgid "name of the module to remove"
msgstr ""
#: ../../content/developer/reference/upgrade_utils.rst:163
msgid "Rename a module and its references from ``old`` to ``new``."
msgstr ""
#: ../../content/developer/reference/upgrade_utils.rst:165
msgid "current name of the module to rename"
msgstr ""
#: ../../content/developer/reference/upgrade_utils.rst:166
msgid "new name of the module to rename"
msgstr ""
#: ../../content/developer/reference/upgrade_utils.rst:171
msgid "Move all references of module ``old`` into module ``into``."
msgstr ""
#: ../../content/developer/reference/upgrade_utils.rst:173
msgid "name of the source module of the merge"
msgstr ""
#: ../../content/developer/reference/upgrade_utils.rst:174
msgid "ame of the destination module of the merge"
msgstr ""
#: ../../content/developer/reference/upgrade_utils.rst:175
msgid "whether the dependencies of modules that depends on ``old`` are updated"
msgstr ""
#: ../../content/developer/reference/upgrade_utils.rst:179
msgid "ORM"
msgstr ""
#: ../../content/developer/reference/upgrade_utils.rst:184
msgid "Create a new environment from the cursor."
msgstr ""
#: ../../content/developer/reference/upgrade_utils.rst:187
msgid "This function does NOT empty the cache maintained on the cursor for superuser with an empty environment. A call to `invalidate_cache` will most probably be necessary every time you directly modify something in database."
msgstr ""
#: ../../content/developer/reference/upgrade_utils.rst:191
msgid "The new environment"
msgstr ""
#: ../../content/developer/reference/upgrade_utils.rst:197
msgid "Recompute field values. Possible strategies to process the recomputation:"
msgstr ""
#: ../../content/developer/reference/upgrade_utils.rst:199
msgid "``flush``: Flush the recomputation when it's finished"
msgstr ""
#: ../../content/developer/reference/upgrade_utils.rst:200
msgid "``commit``: Commit the recomputation when it's finished"
msgstr ""
#: ../../content/developer/reference/upgrade_utils.rst:201
msgid "``auto``: The function chooses the best alternative based on the number of records to recompute and the fields traceability"
msgstr ""
#: ../../content/developer/reference/upgrade_utils.rst:204
msgid "model name of the field(s) to recompute"
msgstr ""
#: ../../content/developer/reference/upgrade_utils.rst:205
msgid "list of field names to recompute"
msgstr ""
#: ../../content/developer/reference/upgrade_utils.rst:206
msgid "list of record IDs to recompute"
msgstr ""
#: ../../content/developer/reference/upgrade_utils.rst:207
msgid "Logger used to print the progress of the function"
msgstr ""
#: ../../content/developer/reference/upgrade_utils.rst:209
msgid "size of the chunk used to split the records for better processing"
msgstr ""
#: ../../content/developer/reference/upgrade_utils.rst:210
msgid "strategy used to process the recomputation"
msgstr ""
#: ../../content/developer/reference/upgrade_utils.rst:213
msgid "Records"
msgstr ""
#: ../../content/developer/reference/upgrade_utils.rst:218
msgid "Return the id corresponding to the given :term:`xml_id <external identifier>`."
msgstr ""
#: ../../content/developer/reference/upgrade_utils.rst:220
msgid "Record xml_id, under the format ``<module.id>``"
msgstr ""
#: ../../content/developer/reference/upgrade_utils.rst:221
msgid "Found record id, if any"
msgstr ""
#: ../../content/developer/reference/upgrade_utils.rst:222
msgid "int or `None`"
msgstr ""
#: ../../content/developer/reference/upgrade_utils.rst:227
msgid "Remove a record and its references corresponding to the given :term:`xml_id <external identifier>`."
msgstr ""
#: ../../content/developer/reference/upgrade_utils.rst:235
msgid "Rename the :term:`external Identifier` of a record. Possible actions to take if the external Identifier already exists on the database:"
msgstr ""
#: ../../content/developer/reference/upgrade_utils.rst:238
msgid "``fail``: raise ``MigrationError`` and prevent renaming"
msgstr ""
#: ../../content/developer/reference/upgrade_utils.rst:239
msgid "``merge``: renames the external Identifier and removes the old one"
msgstr ""
#: ../../content/developer/reference/upgrade_utils.rst:241
msgid "current xml_id of the record, under the format ``<module.id>``"
msgstr ""
#: ../../content/developer/reference/upgrade_utils.rst:242
msgid "new xml_id of the record, under the format ``<module.id>``"
msgstr ""
#: ../../content/developer/reference/upgrade_utils.rst:243
msgid "value to set on the ir_model_data record ``noupdate`` field"
msgstr ""
#: ../../content/developer/reference/upgrade_utils.rst:244
msgid "action to take if the xml_id already exists"
msgstr ""
#: ../../content/developer/reference/upgrade_utils.rst:249
msgid "Match a record with an xmlid by creating or updating the external identifier."
msgstr ""
#: ../../content/developer/reference/upgrade_utils.rst:251
msgid "This function is useful when migrating in-database records into a custom module, to create the record's xmlid before the module is updated and avoid duplication."
msgstr ""
#: ../../content/developer/reference/upgrade_utils.rst:255
msgid "model name of the record"
msgstr ""
#: ../../content/developer/reference/upgrade_utils.rst:256
msgid "Dictionary ``{\"fieldname_1\": \"value_1\", ...}`` mapping fields and values to search for the record to update. For example: .. code-block:: python values = {\"id\": 123} values = {\"name\": \"INV/2024/0001\", company_id: 1}"
msgstr ""
#: ../../content/developer/reference/upgrade_utils.rst:256
msgid "Dictionary ``{\"fieldname_1\": \"value_1\", ...}`` mapping fields and values to search for the record to update. For example:"
msgstr ""
#: ../../content/developer/reference/upgrade_utils.rst:264
msgid "the :term:`xml_id <external identifier>` of the record."
msgstr ""
#: ../../content/developer/reference/upgrade_utils.rst:270
msgid "Update a record based on its definition in the :doc:`/developer/reference/backend/data`."
msgstr ""
#: ../../content/developer/reference/upgrade_utils.rst:272
msgid "Useful to update ``noupdate`` records, in order to reset them for the upgraded version."
msgstr ""
#: ../../content/developer/reference/upgrade_utils.rst:275
msgid "whether the metadata before the record update is kept"
msgstr ""
#: ../../content/developer/reference/upgrade_utils.rst:276
msgid "whether the record is created if it does not exist"
msgstr ""
#: ../../content/developer/reference/upgrade_utils.rst:277
msgid "name of the module from which to update the record. Useful when the record is rewritten in another module."
msgstr ""
#: ../../content/developer/reference/upgrade_utils.rst:279
msgid "set of field names whose translations get reset"
msgstr ""
#: ../../content/developer/reference/user_interface.rst:5
msgid "User interface"
msgstr ""
#: ../../content/developer/reference/user_interface/icons.rst:7
msgid "UI icons"
msgstr ""
#: ../../content/developer/reference/user_interface/icons.rst:9
msgid "Odoo's user interface mostly relies on `FontAwesome4 icons <https://fontawesome.com/v4/icons/>`_."
msgstr ""
#: ../../content/developer/reference/user_interface/icons.rst:11
msgid "To cover FontAwesome's lack of iconography for specific functionalities, we designed our own icon-font. These icons can be rendered using the main `oi` class in conjunction with the specific icon class."
msgstr ""
#: ../../content/developer/reference/user_interface/scss_inheritance.rst:3
msgid "SCSS inheritance"
msgstr ""
#: ../../content/developer/reference/user_interface/scss_inheritance.rst:8
msgid "Managing SCSS assets in Odoo is not as straightforward as it is in some other environments, but it's highly efficient."
msgstr ""
#: ../../content/developer/reference/user_interface/scss_inheritance.rst:11
msgid "Modularity is key. The inheritance scheme described further allows Odoo to:"
msgstr ""
#: ../../content/developer/reference/user_interface/scss_inheritance.rst:13
msgid "customize the Bootstrap CSS framework;"
msgstr ""
#: ../../content/developer/reference/user_interface/scss_inheritance.rst:14
msgid "handle two different webclient designs (Community and Enterprise);"
msgstr ""
#: ../../content/developer/reference/user_interface/scss_inheritance.rst:15
msgid "handle backend and frontend bundles separately (including the user's website design);"
msgstr ""
#: ../../content/developer/reference/user_interface/scss_inheritance.rst:16
msgid "contextually load only necessary assets;"
msgstr ""
#: ../../content/developer/reference/user_interface/scss_inheritance.rst:17
msgid "handle multiple color-schemes (e.g.: dark-mode);"
msgstr ""
#: ../../content/developer/reference/user_interface/scss_inheritance.rst:20
msgid "SCSS's `!default` directive"
msgstr ""
#: ../../content/developer/reference/user_interface/scss_inheritance.rst:22
msgid "\"Direct variables overrides\" are technically possible in SCSS but may lead to inconsistent results in complex environments like Odoo."
msgstr ""
#: ../../content/developer/reference/user_interface/scss_inheritance.rst:27
#: ../../content/developer/reference/user_interface/scss_inheritance.rst:57
msgid ":file:`library.scss`"
msgstr ""
#: ../../content/developer/reference/user_interface/scss_inheritance.rst:32
#: ../../content/developer/reference/user_interface/scss_inheritance.rst:52
msgid ":file:`customization_layer.scss`"
msgstr ""
#: ../../content/developer/reference/user_interface/scss_inheritance.rst:37
msgid "Indeed, since the compilation process acts across different interdependent bundles, re-assigning a variable in the \"wrong spot\" may lead to unexpected cascading results."
msgstr ""
#: ../../content/developer/reference/user_interface/scss_inheritance.rst:40
msgid "SCSS provides several techniques to overcome these issues (e.g.: `shadowing <https://sass-lang.com/documentation/variables#shadowing>`_), but the most critical procedure in Odoo is the use of the `!default` flag."
msgstr ""
#: ../../content/developer/reference/user_interface/scss_inheritance.rst:44
msgid "When using the `!default` flag, the compiler assigns a value **only** if that variable is not yet defined."
msgstr ""
#: ../../content/developer/reference/user_interface/scss_inheritance.rst:47
msgid "As a result of this technique, the priority in which variables are assigned matches the assets' loading order."
msgstr ""
#: ../../content/developer/reference/user_interface/scss_inheritance.rst:63
msgid ":file:`component.scss`"
msgstr ""
#: ../../content/developer/reference/user_interface/scss_inheritance.rst:72
msgid "`!default` flag on the `SASS Documentation <https://sass-lang.com/documentation/variables#default-values>`_"
msgstr ""
#: ../../content/developer/reference/user_interface/scss_inheritance.rst:76
msgid "Odoo's SCSS inheritance system"
msgstr ""
#: ../../content/developer/reference/user_interface/scss_inheritance.rst:78
msgid "The following diagram conceptually illustrates the compilation order in which the CSS and SCSS variables are defined."
msgstr ""
#: ../../content/developer/reference/user_interface/scss_inheritance.rst:105
msgid "This diagram is incomplete and does not match the current bundles' organization. Read more on :ref:`asset bundles <reference/assets_bundle>`."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:5
msgid "View architectures"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:8
msgid "Generic architecture"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:10
msgid "The architecture of a view is defined by XML data interpreted by the JavaScript framework."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:12
msgid "For most views, there is a :file:`\\*.rng` file defining the attributes and possible architectures. Some views are not ruled by such a file either because they accept HTML content, or for performance reasons."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:17
msgid "The current context and user access rights may impact the view abilities."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:20
msgid ":doc:`view_records`"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:25
msgid "Python expression"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:27
msgid "When evaluating node attributes, e.g. the `readonly` modifier, it is possible to provide a **Python expression** that will be executed in an environment that has access to the following variables:"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:30
msgid "The names of all fields present in the current view, containing the value of the current record, except for `column_invisible` in :ref:`list view <reference/view_architectures/list/field>`; relational fields are given as a list of IDs;"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:33
msgid "The ID of the current record;"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:34
msgid "`parent`: the record that refers to the container; only inside sub-views of :ref:`relational fields <studio/fields/relational-fields>`;"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:36
msgid "`context (dict)`: the current view's context;"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:37
msgid "`uid (int)`: the id of the current user;"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:38
msgid "`today (str)`: the current local date in the `YYYY-MM-DD` format;"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:39
msgid "`now (str)`: the current local datetime in the `YYYY-MM-DD hh:mm:ss` format."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:61
#: ../../content/developer/tutorials/getting_started/07_basicviews.rst:72
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:235
msgid "Form"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:63
msgid "Form views are used to display the data from a single record. They are composed of regular HTML_ with additional semantic and structural components."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:66
msgid "The root element of form views is `form`."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:77
#: ../../content/developer/reference/user_interface/view_architectures.rst:1165
#: ../../content/developer/reference/user_interface/view_architectures.rst:2273
msgid "Root attributes"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:79
msgid "Optional attributes can be added to the root element `form` to customize the view."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures/root_attribute_string.rst:4
#: ../../content/developer/reference/user_interface/view_architectures/root_attribute_string.rst:4
msgid "The view title. It is displayed only if you open an action that has no name and whose target is `new` (opening a dialog)."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:0
#: ../../content/developer/reference/user_interface/view_architectures/button_attribute_context.rst:0
#: ../../content/developer/reference/user_interface/view_architectures/button_attribute_help.rst:0
#: ../../content/developer/reference/user_interface/view_architectures/button_attribute_icon.rst:0
#: ../../content/developer/reference/user_interface/view_architectures/button_attribute_name.rst:0
#: ../../content/developer/reference/user_interface/view_architectures/button_attribute_string.rst:0
#: ../../content/developer/reference/user_interface/view_architectures/button_attribute_type.rst:0
#: ../../content/developer/reference/user_interface/view_architectures/field_attribute_name.rst:0
#: ../../content/developer/reference/user_interface/view_architectures/field_attribute_readonly.rst:0
#: ../../content/developer/reference/user_interface/view_architectures/field_attribute_required.rst:0
#: ../../content/developer/reference/user_interface/view_architectures/field_attribute_string.rst:0
#: ../../content/developer/reference/user_interface/view_architectures/field_attribute_widget.rst:0
#: ../../content/developer/reference/user_interface/view_architectures/generic_attribute_class.rst:0
#: ../../content/developer/reference/user_interface/view_architectures/generic_attribute_column_invisible.rst:0
#: ../../content/developer/reference/user_interface/view_architectures/generic_attribute_groups.rst:0
#: ../../content/developer/reference/user_interface/view_architectures/generic_attribute_invisible.rst:0
#: ../../content/developer/reference/user_interface/view_architectures/root_attribute_banner_route.rst:0
#: ../../content/developer/reference/user_interface/view_architectures/root_attribute_create.rst:0
#: ../../content/developer/reference/user_interface/view_architectures/root_attribute_default_group_by.rst:0
#: ../../content/developer/reference/user_interface/view_architectures/root_attribute_default_order.rst:0
#: ../../content/developer/reference/user_interface/view_architectures/root_attribute_delete.rst:0
#: ../../content/developer/reference/user_interface/view_architectures/root_attribute_edit.rst:0
#: ../../content/developer/reference/user_interface/view_architectures/root_attribute_sample.rst:0
#: ../../content/developer/reference/user_interface/view_architectures/root_attribute_string.rst:0
#: ../../content/developer/reference/user_interface/view_records.rst:0
#: ../../content/developer/reference/user_interface/view_architectures/button_attribute_context.rst:0
#: ../../content/developer/reference/user_interface/view_architectures/button_attribute_help.rst:0
#: ../../content/developer/reference/user_interface/view_architectures/button_attribute_icon.rst:0
#: ../../content/developer/reference/user_interface/view_architectures/button_attribute_name.rst:0
#: ../../content/developer/reference/user_interface/view_architectures/button_attribute_string.rst:0
#: ../../content/developer/reference/user_interface/view_architectures/button_attribute_type.rst:0
#: ../../content/developer/reference/user_interface/view_architectures/field_attribute_name.rst:0
#: ../../content/developer/reference/user_interface/view_architectures/field_attribute_readonly.rst:0
#: ../../content/developer/reference/user_interface/view_architectures/field_attribute_required.rst:0
#: ../../content/developer/reference/user_interface/view_architectures/field_attribute_string.rst:0
#: ../../content/developer/reference/user_interface/view_architectures/field_attribute_widget.rst:0
#: ../../content/developer/reference/user_interface/view_architectures/generic_attribute_class.rst:0
#: ../../content/developer/reference/user_interface/view_architectures/generic_attribute_column_invisible.rst:0
#: ../../content/developer/reference/user_interface/view_architectures/generic_attribute_groups.rst:0
#: ../../content/developer/reference/user_interface/view_architectures/generic_attribute_invisible.rst:0
#: ../../content/developer/reference/user_interface/view_architectures/root_attribute_banner_route.rst:0
#: ../../content/developer/reference/user_interface/view_architectures/root_attribute_create.rst:0
#: ../../content/developer/reference/user_interface/view_architectures/root_attribute_default_group_by.rst:0
#: ../../content/developer/reference/user_interface/view_architectures/root_attribute_default_order.rst:0
#: ../../content/developer/reference/user_interface/view_architectures/root_attribute_delete.rst:0
#: ../../content/developer/reference/user_interface/view_architectures/root_attribute_edit.rst:0
#: ../../content/developer/reference/user_interface/view_architectures/root_attribute_sample.rst:0
#: ../../content/developer/reference/user_interface/view_architectures/root_attribute_string.rst:0
msgid "requirement"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:92
#: ../../content/developer/reference/user_interface/view_architectures.rst:103
#: ../../content/developer/reference/user_interface/view_architectures.rst:112
#: ../../content/developer/reference/user_interface/view_architectures.rst:161
#: ../../content/developer/reference/user_interface/view_architectures.rst:172
#: ../../content/developer/reference/user_interface/view_architectures.rst:192
#: ../../content/developer/reference/user_interface/view_architectures.rst:215
#: ../../content/developer/reference/user_interface/view_architectures.rst:240
#: ../../content/developer/reference/user_interface/view_architectures.rst:250
#: ../../content/developer/reference/user_interface/view_architectures.rst:262
#: ../../content/developer/reference/user_interface/view_architectures.rst:272
#: ../../content/developer/reference/user_interface/view_architectures.rst:284
#: ../../content/developer/reference/user_interface/view_architectures.rst:294
#: ../../content/developer/reference/user_interface/view_architectures.rst:305
#: ../../content/developer/reference/user_interface/view_architectures.rst:315
#: ../../content/developer/reference/user_interface/view_architectures.rst:376
#: ../../content/developer/reference/user_interface/view_architectures.rst:436
#: ../../content/developer/reference/user_interface/view_architectures.rst:451
#: ../../content/developer/reference/user_interface/view_architectures.rst:468
#: ../../content/developer/reference/user_interface/view_architectures.rst:564
#: ../../content/developer/reference/user_interface/view_architectures.rst:573
#: ../../content/developer/reference/user_interface/view_architectures.rst:582
#: ../../content/developer/reference/user_interface/view_architectures.rst:666
#: ../../content/developer/reference/user_interface/view_architectures.rst:753
#: ../../content/developer/reference/user_interface/view_architectures.rst:986
#: ../../content/developer/reference/user_interface/view_architectures.rst:1023
#: ../../content/developer/reference/user_interface/view_architectures.rst:1032
#: ../../content/developer/reference/user_interface/view_architectures.rst:1083
#: ../../content/developer/reference/user_interface/view_architectures.rst:1092
#: ../../content/developer/reference/user_interface/view_architectures.rst:1101
#: ../../content/developer/reference/user_interface/view_architectures.rst:1111
#: ../../content/developer/reference/user_interface/view_architectures.rst:1122
#: ../../content/developer/reference/user_interface/view_architectures.rst:1133
#: ../../content/developer/reference/user_interface/view_architectures.rst:1182
#: ../../content/developer/reference/user_interface/view_architectures.rst:1191
#: ../../content/developer/reference/user_interface/view_architectures.rst:1218
#: ../../content/developer/reference/user_interface/view_architectures.rst:1230
#: ../../content/developer/reference/user_interface/view_architectures.rst:1241
#: ../../content/developer/reference/user_interface/view_architectures.rst:1265
#: ../../content/developer/reference/user_interface/view_architectures.rst:1274
#: ../../content/developer/reference/user_interface/view_architectures.rst:1284
#: ../../content/developer/reference/user_interface/view_architectures.rst:1296
#: ../../content/developer/reference/user_interface/view_architectures.rst:1364
#: ../../content/developer/reference/user_interface/view_architectures.rst:1392
#: ../../content/developer/reference/user_interface/view_architectures.rst:1411
#: ../../content/developer/reference/user_interface/view_architectures.rst:1424
#: ../../content/developer/reference/user_interface/view_architectures.rst:1435
#: ../../content/developer/reference/user_interface/view_architectures.rst:1617
#: ../../content/developer/reference/user_interface/view_architectures.rst:1677
#: ../../content/developer/reference/user_interface/view_architectures.rst:1790
#: ../../content/developer/reference/user_interface/view_architectures.rst:1807
#: ../../content/developer/reference/user_interface/view_architectures.rst:1819
#: ../../content/developer/reference/user_interface/view_architectures.rst:1831
#: ../../content/developer/reference/user_interface/view_architectures.rst:1897
#: ../../content/developer/reference/user_interface/view_architectures.rst:1906
#: ../../content/developer/reference/user_interface/view_architectures.rst:1924
#: ../../content/developer/reference/user_interface/view_architectures.rst:1943
#: ../../content/developer/reference/user_interface/view_architectures.rst:1976
#: ../../content/developer/reference/user_interface/view_architectures.rst:2102
#: ../../content/developer/reference/user_interface/view_architectures.rst:2113
#: ../../content/developer/reference/user_interface/view_architectures.rst:2122
#: ../../content/developer/reference/user_interface/view_architectures.rst:2135
#: ../../content/developer/reference/user_interface/view_architectures.rst:2153
#: ../../content/developer/reference/user_interface/view_architectures.rst:2162
#: ../../content/developer/reference/user_interface/view_architectures.rst:2173
#: ../../content/developer/reference/user_interface/view_architectures.rst:2190
#: ../../content/developer/reference/user_interface/view_architectures.rst:2199
#: ../../content/developer/reference/user_interface/view_architectures.rst:2294
#: ../../content/developer/reference/user_interface/view_architectures.rst:2308
#: ../../content/developer/reference/user_interface/view_architectures.rst:2317
#: ../../content/developer/reference/user_interface/view_architectures.rst:2326
#: ../../content/developer/reference/user_interface/view_architectures.rst:2335
#: ../../content/developer/reference/user_interface/view_architectures.rst:2344
#: ../../content/developer/reference/user_interface/view_architectures.rst:2353
#: ../../content/developer/reference/user_interface/view_architectures.rst:2363
#: ../../content/developer/reference/user_interface/view_architectures.rst:2372
#: ../../content/developer/reference/user_interface/view_architectures.rst:2383
#: ../../content/developer/reference/user_interface/view_architectures.rst:2395
#: ../../content/developer/reference/user_interface/view_architectures.rst:2507
#: ../../content/developer/reference/user_interface/view_architectures.rst:2552
#: ../../content/developer/reference/user_interface/view_architectures/button_attribute_context.rst:12
#: ../../content/developer/reference/user_interface/view_architectures/button_attribute_help.rst:11
#: ../../content/developer/reference/user_interface/view_architectures/button_attribute_icon.rst:12
#: ../../content/developer/reference/user_interface/view_architectures/button_attribute_name.rst:7
#: ../../content/developer/reference/user_interface/view_architectures/button_attribute_string.rst:11
#: ../../content/developer/reference/user_interface/view_architectures/field_attribute_readonly.rst:13
#: ../../content/developer/reference/user_interface/view_architectures/field_attribute_required.rst:13
#: ../../content/developer/reference/user_interface/view_architectures/field_attribute_string.rst:6
#: ../../content/developer/reference/user_interface/view_architectures/field_attribute_widget.rst:19
#: ../../content/developer/reference/user_interface/view_architectures/generic_attribute_class.rst:32
#: ../../content/developer/reference/user_interface/view_architectures/generic_attribute_column_invisible.rst:15
#: ../../content/developer/reference/user_interface/view_architectures/generic_attribute_groups.rst:14
#: ../../content/developer/reference/user_interface/view_architectures/generic_attribute_invisible.rst:26
#: ../../content/developer/reference/user_interface/view_architectures/root_attribute_banner_route.rst:40
#: ../../content/developer/reference/user_interface/view_architectures/root_attribute_create.rst:6
#: ../../content/developer/reference/user_interface/view_architectures/root_attribute_default_group_by.rst:7
#: ../../content/developer/reference/user_interface/view_architectures/root_attribute_default_order.rst:16
#: ../../content/developer/reference/user_interface/view_architectures/root_attribute_delete.rst:6
#: ../../content/developer/reference/user_interface/view_architectures/root_attribute_edit.rst:6
#: ../../content/developer/reference/user_interface/view_architectures/root_attribute_sample.rst:14
#: ../../content/developer/reference/user_interface/view_architectures/root_attribute_string.rst:7
#: ../../content/developer/reference/user_interface/view_records.rst:80
#: ../../content/developer/reference/user_interface/view_records.rst:94
#: ../../content/developer/reference/user_interface/view_records.rst:104
#: ../../content/developer/reference/user_interface/view_records.rst:116
#: ../../content/developer/reference/user_interface/view_records.rst:130
#: ../../content/developer/reference/user_interface/view_records.rst:159
#: ../../content/developer/reference/user_interface/view_architectures/button_attribute_context.rst:12
#: ../../content/developer/reference/user_interface/view_architectures/button_attribute_help.rst:11
#: ../../content/developer/reference/user_interface/view_architectures/button_attribute_icon.rst:12
#: ../../content/developer/reference/user_interface/view_architectures/button_attribute_name.rst:7
#: ../../content/developer/reference/user_interface/view_architectures/button_attribute_string.rst:11
#: ../../content/developer/reference/user_interface/view_architectures/field_attribute_readonly.rst:13
#: ../../content/developer/reference/user_interface/view_architectures/field_attribute_required.rst:13
#: ../../content/developer/reference/user_interface/view_architectures/field_attribute_string.rst:6
#: ../../content/developer/reference/user_interface/view_architectures/field_attribute_widget.rst:19
#: ../../content/developer/reference/user_interface/view_architectures/generic_attribute_class.rst:32
#: ../../content/developer/reference/user_interface/view_architectures/generic_attribute_column_invisible.rst:15
#: ../../content/developer/reference/user_interface/view_architectures/generic_attribute_groups.rst:14
#: ../../content/developer/reference/user_interface/view_architectures/generic_attribute_invisible.rst:26
#: ../../content/developer/reference/user_interface/view_architectures/root_attribute_banner_route.rst:40
#: ../../content/developer/reference/user_interface/view_architectures/root_attribute_create.rst:6
#: ../../content/developer/reference/user_interface/view_architectures/root_attribute_default_group_by.rst:7
#: ../../content/developer/reference/user_interface/view_architectures/root_attribute_default_order.rst:16
#: ../../content/developer/reference/user_interface/view_architectures/root_attribute_delete.rst:6
#: ../../content/developer/reference/user_interface/view_architectures/root_attribute_edit.rst:6
#: ../../content/developer/reference/user_interface/view_architectures/root_attribute_sample.rst:14
#: ../../content/developer/reference/user_interface/view_architectures/root_attribute_string.rst:7
msgid "Optional"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:104
#: ../../content/developer/reference/user_interface/view_architectures.rst:162
#: ../../content/developer/reference/user_interface/view_architectures.rst:173
#: ../../content/developer/reference/user_interface/view_architectures.rst:263
#: ../../content/developer/reference/user_interface/view_architectures.rst:273
#: ../../content/developer/reference/user_interface/view_architectures.rst:285
#: ../../content/developer/reference/user_interface/view_architectures.rst:306
#: ../../content/developer/reference/user_interface/view_architectures.rst:369
#: ../../content/developer/reference/user_interface/view_architectures.rst:377
#: ../../content/developer/reference/user_interface/view_architectures.rst:437
#: ../../content/developer/reference/user_interface/view_architectures.rst:452
#: ../../content/developer/reference/user_interface/view_architectures.rst:469
#: ../../content/developer/reference/user_interface/view_architectures.rst:565
#: ../../content/developer/reference/user_interface/view_architectures.rst:971
#: ../../content/developer/reference/user_interface/view_architectures.rst:979
#: ../../content/developer/reference/user_interface/view_architectures.rst:1024
#: ../../content/developer/reference/user_interface/view_architectures.rst:1033
#: ../../content/developer/reference/user_interface/view_architectures.rst:1084
#: ../../content/developer/reference/user_interface/view_architectures.rst:1093
#: ../../content/developer/reference/user_interface/view_architectures.rst:1102
#: ../../content/developer/reference/user_interface/view_architectures.rst:1112
#: ../../content/developer/reference/user_interface/view_architectures.rst:1123
#: ../../content/developer/reference/user_interface/view_architectures.rst:1219
#: ../../content/developer/reference/user_interface/view_architectures.rst:1231
#: ../../content/developer/reference/user_interface/view_architectures.rst:1365
#: ../../content/developer/reference/user_interface/view_architectures.rst:1412
#: ../../content/developer/reference/user_interface/view_architectures.rst:1425
#: ../../content/developer/reference/user_interface/view_architectures.rst:1436
#: ../../content/developer/reference/user_interface/view_architectures.rst:1549
#: ../../content/developer/reference/user_interface/view_architectures.rst:1618
#: ../../content/developer/reference/user_interface/view_architectures.rst:1669
#: ../../content/developer/reference/user_interface/view_architectures.rst:1775
#: ../../content/developer/reference/user_interface/view_architectures.rst:1791
#: ../../content/developer/reference/user_interface/view_architectures.rst:1882
#: ../../content/developer/reference/user_interface/view_architectures.rst:1890
#: ../../content/developer/reference/user_interface/view_architectures.rst:1898
#: ../../content/developer/reference/user_interface/view_architectures.rst:1925
#: ../../content/developer/reference/user_interface/view_architectures.rst:1944
#: ../../content/developer/reference/user_interface/view_architectures.rst:2082
#: ../../content/developer/reference/user_interface/view_architectures.rst:2103
#: ../../content/developer/reference/user_interface/view_architectures.rst:2114
#: ../../content/developer/reference/user_interface/view_architectures.rst:2123
#: ../../content/developer/reference/user_interface/view_architectures.rst:2200
#: ../../content/developer/reference/user_interface/view_architectures.rst:2295
#: ../../content/developer/reference/user_interface/view_architectures.rst:2309
#: ../../content/developer/reference/user_interface/view_architectures.rst:2384
#: ../../content/developer/reference/user_interface/view_architectures.rst:2396
#: ../../content/developer/reference/user_interface/view_architectures.rst:2508
#: ../../content/developer/reference/user_interface/view_architectures.rst:2534
#: ../../content/developer/reference/user_interface/view_architectures.rst:2553
#: ../../content/developer/reference/user_interface/view_architectures.rst:2614
#: ../../content/developer/reference/user_interface/view_architectures.rst:2625
#: ../../content/developer/reference/user_interface/view_architectures.rst:2633
#: ../../content/developer/reference/user_interface/view_architectures.rst:2638
#: ../../content/developer/reference/user_interface/view_architectures/button_attribute_help.rst:12
#: ../../content/developer/reference/user_interface/view_architectures/button_attribute_icon.rst:13
#: ../../content/developer/reference/user_interface/view_architectures/button_attribute_name.rst:8
#: ../../content/developer/reference/user_interface/view_architectures/button_attribute_string.rst:12
#: ../../content/developer/reference/user_interface/view_architectures/button_attribute_type.rst:26
#: ../../content/developer/reference/user_interface/view_architectures/field_attribute_name.rst:7
#: ../../content/developer/reference/user_interface/view_architectures/field_attribute_string.rst:7
#: ../../content/developer/reference/user_interface/view_architectures/field_attribute_widget.rst:20
#: ../../content/developer/reference/user_interface/view_architectures/generic_attribute_class.rst:33
#: ../../content/developer/reference/user_interface/view_architectures/generic_attribute_groups.rst:15
#: ../../content/developer/reference/user_interface/view_architectures/root_attribute_default_group_by.rst:8
#: ../../content/developer/reference/user_interface/view_architectures/root_attribute_default_order.rst:17
#: ../../content/developer/reference/user_interface/view_architectures/root_attribute_string.rst:8
#: ../../content/developer/reference/user_interface/view_architectures/button_attribute_help.rst:12
#: ../../content/developer/reference/user_interface/view_architectures/button_attribute_icon.rst:13
#: ../../content/developer/reference/user_interface/view_architectures/button_attribute_name.rst:8
#: ../../content/developer/reference/user_interface/view_architectures/button_attribute_string.rst:12
#: ../../content/developer/reference/user_interface/view_architectures/button_attribute_type.rst:26
#: ../../content/developer/reference/user_interface/view_architectures/field_attribute_name.rst:7
#: ../../content/developer/reference/user_interface/view_architectures/field_attribute_string.rst:7
#: ../../content/developer/reference/user_interface/view_architectures/field_attribute_widget.rst:20
#: ../../content/developer/reference/user_interface/view_architectures/generic_attribute_class.rst:33
#: ../../content/developer/reference/user_interface/view_architectures/generic_attribute_groups.rst:15
#: ../../content/developer/reference/user_interface/view_architectures/root_attribute_default_group_by.rst:8
#: ../../content/developer/reference/user_interface/view_architectures/root_attribute_default_order.rst:17
#: ../../content/developer/reference/user_interface/view_architectures/root_attribute_string.rst:8
msgid "str"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:105
#: ../../content/developer/reference/user_interface/view_architectures.rst:174
#: ../../content/developer/reference/user_interface/view_architectures.rst:264
#: ../../content/developer/reference/user_interface/view_architectures.rst:286
#: ../../content/developer/reference/user_interface/view_architectures.rst:307
#: ../../content/developer/reference/user_interface/view_architectures.rst:438
#: ../../content/developer/reference/user_interface/view_architectures.rst:453
#: ../../content/developer/reference/user_interface/view_architectures.rst:470
#: ../../content/developer/reference/user_interface/view_architectures.rst:566
#: ../../content/developer/reference/user_interface/view_architectures.rst:668
#: ../../content/developer/reference/user_interface/view_architectures.rst:755
#: ../../content/developer/reference/user_interface/view_architectures.rst:1025
#: ../../content/developer/reference/user_interface/view_architectures.rst:1034
#: ../../content/developer/reference/user_interface/view_architectures.rst:1085
#: ../../content/developer/reference/user_interface/view_architectures.rst:1103
#: ../../content/developer/reference/user_interface/view_architectures.rst:1113
#: ../../content/developer/reference/user_interface/view_architectures.rst:1124
#: ../../content/developer/reference/user_interface/view_architectures.rst:1135
#: ../../content/developer/reference/user_interface/view_architectures.rst:1220
#: ../../content/developer/reference/user_interface/view_architectures.rst:1232
#: ../../content/developer/reference/user_interface/view_architectures.rst:1413
#: ../../content/developer/reference/user_interface/view_architectures.rst:1426
#: ../../content/developer/reference/user_interface/view_architectures.rst:1437
#: ../../content/developer/reference/user_interface/view_architectures.rst:1619
#: ../../content/developer/reference/user_interface/view_architectures.rst:1899
#: ../../content/developer/reference/user_interface/view_architectures.rst:1926
#: ../../content/developer/reference/user_interface/view_architectures.rst:2115
#: ../../content/developer/reference/user_interface/view_architectures.rst:2124
#: ../../content/developer/reference/user_interface/view_architectures.rst:2201
#: ../../content/developer/reference/user_interface/view_architectures.rst:2296
#: ../../content/developer/reference/user_interface/view_architectures.rst:2310
#: ../../content/developer/reference/user_interface/view_architectures.rst:2385
#: ../../content/developer/reference/user_interface/view_architectures.rst:2397
#: ../../content/developer/reference/user_interface/view_architectures.rst:2554
#: ../../content/developer/reference/user_interface/view_architectures/button_attribute_help.rst:13
#: ../../content/developer/reference/user_interface/view_architectures/button_attribute_icon.rst:14
#: ../../content/developer/reference/user_interface/view_architectures/button_attribute_name.rst:9
#: ../../content/developer/reference/user_interface/view_architectures/button_attribute_string.rst:13
#: ../../content/developer/reference/user_interface/view_architectures/field_attribute_widget.rst:21
#: ../../content/developer/reference/user_interface/view_architectures/generic_attribute_class.rst:34
#: ../../content/developer/reference/user_interface/view_architectures/generic_attribute_groups.rst:16
#: ../../content/developer/reference/user_interface/view_architectures/root_attribute_banner_route.rst:42
#: ../../content/developer/reference/user_interface/view_architectures/root_attribute_default_group_by.rst:9
#: ../../content/developer/reference/user_interface/view_architectures/root_attribute_default_order.rst:18
#: ../../content/developer/reference/user_interface/view_architectures/root_attribute_string.rst:9
#: ../../content/developer/reference/user_interface/view_architectures/button_attribute_help.rst:13
#: ../../content/developer/reference/user_interface/view_architectures/button_attribute_icon.rst:14
#: ../../content/developer/reference/user_interface/view_architectures/button_attribute_name.rst:9
#: ../../content/developer/reference/user_interface/view_architectures/button_attribute_string.rst:13
#: ../../content/developer/reference/user_interface/view_architectures/field_attribute_widget.rst:21
#: ../../content/developer/reference/user_interface/view_architectures/generic_attribute_class.rst:34
#: ../../content/developer/reference/user_interface/view_architectures/generic_attribute_groups.rst:16
#: ../../content/developer/reference/user_interface/view_architectures/root_attribute_banner_route.rst:42
#: ../../content/developer/reference/user_interface/view_architectures/root_attribute_default_group_by.rst:9
#: ../../content/developer/reference/user_interface/view_architectures/root_attribute_default_order.rst:18
#: ../../content/developer/reference/user_interface/view_architectures/root_attribute_string.rst:9
msgid "`''`"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2914
#: ../../content/developer/reference/user_interface/view_architectures.rst:3431
#: ../../content/developer/reference/user_interface/view_architectures/root_attribute_create.rst:4
#: ../../content/developer/reference/user_interface/view_architectures/root_attribute_create.rst:4
msgid "Disable/enable record creation on the view."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:93
#: ../../content/developer/reference/user_interface/view_architectures.rst:113
#: ../../content/developer/reference/user_interface/view_architectures.rst:251
#: ../../content/developer/reference/user_interface/view_architectures.rst:295
#: ../../content/developer/reference/user_interface/view_architectures.rst:316
#: ../../content/developer/reference/user_interface/view_architectures.rst:1183
#: ../../content/developer/reference/user_interface/view_architectures.rst:1192
#: ../../content/developer/reference/user_interface/view_architectures.rst:1242
#: ../../content/developer/reference/user_interface/view_architectures.rst:1297
#: ../../content/developer/reference/user_interface/view_architectures.rst:2136
#: ../../content/developer/reference/user_interface/view_architectures.rst:2154
#: ../../content/developer/reference/user_interface/view_architectures.rst:2163
#: ../../content/developer/reference/user_interface/view_architectures.rst:2318
#: ../../content/developer/reference/user_interface/view_architectures.rst:2327
#: ../../content/developer/reference/user_interface/view_architectures.rst:2336
#: ../../content/developer/reference/user_interface/view_architectures.rst:2345
#: ../../content/developer/reference/user_interface/view_architectures.rst:2354
#: ../../content/developer/reference/user_interface/view_architectures.rst:2364
#: ../../content/developer/reference/user_interface/view_architectures.rst:2373
#: ../../content/developer/reference/user_interface/view_architectures.rst:2646
#: ../../content/developer/reference/user_interface/view_architectures/root_attribute_create.rst:7
#: ../../content/developer/reference/user_interface/view_architectures/root_attribute_delete.rst:7
#: ../../content/developer/reference/user_interface/view_architectures/root_attribute_edit.rst:7
#: ../../content/developer/reference/user_interface/view_architectures/root_attribute_sample.rst:15
#: ../../content/developer/reference/user_interface/view_architectures/root_attribute_create.rst:7
#: ../../content/developer/reference/user_interface/view_architectures/root_attribute_delete.rst:7
#: ../../content/developer/reference/user_interface/view_architectures/root_attribute_edit.rst:7
#: ../../content/developer/reference/user_interface/view_architectures/root_attribute_sample.rst:15
msgid "bool"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:94
#: ../../content/developer/reference/user_interface/view_architectures.rst:1184
#: ../../content/developer/reference/user_interface/view_architectures.rst:1193
#: ../../content/developer/reference/user_interface/view_architectures.rst:2137
#: ../../content/developer/reference/user_interface/view_architectures.rst:2319
#: ../../content/developer/reference/user_interface/view_architectures.rst:2328
#: ../../content/developer/reference/user_interface/view_architectures.rst:2337
#: ../../content/developer/reference/user_interface/view_architectures.rst:2346
#: ../../content/developer/reference/user_interface/view_architectures.rst:2355
#: ../../content/developer/reference/user_interface/view_architectures.rst:2365
#: ../../content/developer/reference/user_interface/view_architectures/root_attribute_create.rst:8
#: ../../content/developer/reference/user_interface/view_architectures/root_attribute_delete.rst:8
#: ../../content/developer/reference/user_interface/view_architectures/root_attribute_edit.rst:8
#: ../../content/developer/reference/user_interface/view_architectures/root_attribute_create.rst:8
#: ../../content/developer/reference/user_interface/view_architectures/root_attribute_delete.rst:8
#: ../../content/developer/reference/user_interface/view_architectures/root_attribute_edit.rst:8
msgid "`True`"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2919
#: ../../content/developer/reference/user_interface/view_architectures.rst:3436
#: ../../content/developer/reference/user_interface/view_architectures/root_attribute_edit.rst:4
#: ../../content/developer/reference/user_interface/view_architectures/root_attribute_edit.rst:4
msgid "Disable/enable record edition on the view."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:90
msgid "Disable/enable record duplication on the view through the **Action** dropdown."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures/root_attribute_delete.rst:4
#: ../../content/developer/reference/user_interface/view_architectures/root_attribute_delete.rst:4
msgid "Disable/enable record deletion on the view through the :guilabel:`Action` dropdown."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:101
msgid "The name of the JavaScript component the webclient will instantiate instead of the form view."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:110
msgid "Disable automatic focusing on the first field in the view."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:114
#: ../../content/developer/reference/user_interface/view_architectures.rst:252
#: ../../content/developer/reference/user_interface/view_architectures.rst:296
#: ../../content/developer/reference/user_interface/view_architectures.rst:317
#: ../../content/developer/reference/user_interface/view_architectures.rst:1243
#: ../../content/developer/reference/user_interface/view_architectures.rst:1267
#: ../../content/developer/reference/user_interface/view_architectures.rst:1298
#: ../../content/developer/reference/user_interface/view_architectures.rst:1394
#: ../../content/developer/reference/user_interface/view_architectures.rst:2155
#: ../../content/developer/reference/user_interface/view_architectures.rst:2164
#: ../../content/developer/reference/user_interface/view_architectures/field_attribute_readonly.rst:15
#: ../../content/developer/reference/user_interface/view_architectures/field_attribute_required.rst:15
#: ../../content/developer/reference/user_interface/view_architectures/generic_attribute_column_invisible.rst:17
#: ../../content/developer/reference/user_interface/view_architectures/generic_attribute_invisible.rst:28
#: ../../content/developer/reference/user_interface/view_architectures/root_attribute_sample.rst:16
#: ../../content/developer/reference/user_interface/view_architectures/field_attribute_readonly.rst:15
#: ../../content/developer/reference/user_interface/view_architectures/field_attribute_required.rst:15
#: ../../content/developer/reference/user_interface/view_architectures/generic_attribute_column_invisible.rst:17
#: ../../content/developer/reference/user_interface/view_architectures/generic_attribute_invisible.rst:28
#: ../../content/developer/reference/user_interface/view_architectures/root_attribute_sample.rst:16
msgid "`False`"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures/root_attribute_banner_route.rst:4
#: ../../content/developer/reference/user_interface/view_architectures/root_attribute_banner_route.rst:4
msgid "The route to fetch HTML from and prepend it to the view."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures/root_attribute_banner_route.rst:6
#: ../../content/developer/reference/user_interface/view_architectures/root_attribute_banner_route.rst:6
msgid "If this attribute is set, the URL of the :ref:`controller route <reference/controllers>` is fetched and the returned content is displayed above the view. The JSON response from the controller must contain an `html` key."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures/root_attribute_banner_route.rst:10
#: ../../content/developer/reference/user_interface/view_architectures/root_attribute_banner_route.rst:10
msgid "If the HTML contains a `<link>` tag for a stylesheet, it is removed from its original location and appended to the `<head>` section."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures/root_attribute_banner_route.rst:13
msgid "To interact with the backend, use `<a type=\"action\">` tags. For more details, refer to the documentation of the `_onActionClicked` method in `AbstractController <{GITHUB_PATH}/addons/web/static/src/js/views/abstract_controller.js>`_."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures/root_attribute_banner_route.rst:17
#: ../../content/developer/reference/user_interface/view_architectures/root_attribute_banner_route.rst:17
msgid "Only views extending `AbstractView` and `AbstractController`, such as :ref:`reference/view_architectures/form`, :ref:`reference/view_architectures/kanban`, and :ref:`reference/view_architectures/list`, can use this attribute."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:987
#: ../../content/developer/reference/user_interface/view_architectures/root_attribute_banner_route.rst:41
#: ../../content/developer/reference/user_interface/view_architectures/root_attribute_banner_route.rst:41
msgid "path_"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:121
msgid "Semantic components"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:123
msgid "Semantic components tie into the Odoo system and allow interaction with it."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:125
msgid "Form views accept the following children semantic components: :ref:`field <reference/view_architectures/form/field>`, :ref:`label <reference/view_architectures/form/label>`, :ref:`button <reference/view_architectures/form/button>`, :ref:`reference/view_architectures/form/chatter`, and :ref:`reference/view_architectures/form/attachment`."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:131
#: ../../content/developer/reference/user_interface/view_architectures.rst:534
#: ../../content/developer/reference/user_interface/view_architectures.rst:945
#: ../../content/developer/reference/user_interface/view_architectures.rst:1316
#: ../../content/developer/reference/user_interface/view_architectures.rst:1751
#: ../../content/developer/reference/user_interface/view_architectures.rst:2414
msgid "Placeholders are denoted in all caps."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:136
#: ../../content/developer/reference/user_interface/view_architectures.rst:1321
#: ../../content/developer/reference/user_interface/view_architectures.rst:2419
msgid "`field`: display field values"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:138
msgid "The `field` element renders (and allows editing of, possibly) a single field of the current record."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:140
msgid "Using the same field multiple times in a form view is supported, and the fields can receive different values for the `invisible` and `readonly` attributes. These fields may have the same values but can be displayed differently. However, the behavior is not guaranteed when several fields exist with different values for the `required` attribute."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:151
#: ../../content/developer/reference/user_interface/view_architectures.rst:1334
#: ../../content/developer/reference/user_interface/view_architectures.rst:1767
#: ../../content/developer/reference/user_interface/view_architectures.rst:2432
msgid "The `field` element can have the following attributes:"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures/field_attribute_name.rst:4
#: ../../content/developer/reference/user_interface/view_architectures/field_attribute_name.rst:4
msgid "The name of the field to render."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:368
#: ../../content/developer/reference/user_interface/view_architectures.rst:970
#: ../../content/developer/reference/user_interface/view_architectures.rst:978
#: ../../content/developer/reference/user_interface/view_architectures.rst:1548
#: ../../content/developer/reference/user_interface/view_architectures.rst:1668
#: ../../content/developer/reference/user_interface/view_architectures.rst:1774
#: ../../content/developer/reference/user_interface/view_architectures.rst:1881
#: ../../content/developer/reference/user_interface/view_architectures.rst:1889
#: ../../content/developer/reference/user_interface/view_architectures.rst:2081
#: ../../content/developer/reference/user_interface/view_architectures.rst:2533
#: ../../content/developer/reference/user_interface/view_architectures.rst:2542
#: ../../content/developer/reference/user_interface/view_architectures/field_attribute_name.rst:6
#: ../../content/developer/reference/user_interface/view_records.rst:87
#: ../../content/developer/reference/user_interface/view_architectures/field_attribute_name.rst:6
msgid "Mandatory"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:158
msgid "The node id. Useful when there are several occurrences of the same field in the view (see :ref:`reference/view_architectures/form/label`)."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:163
msgid "The field name"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures/field_attribute_string.rst:4
#: ../../content/developer/reference/user_interface/view_architectures/field_attribute_string.rst:4
msgid "The label of the field."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures/field_attribute_string.rst:8
#: ../../content/developer/reference/user_interface/view_architectures/field_attribute_string.rst:8
msgid "The `string` attribute of the model's field"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:170
msgid "The tooltip displayed when hovering the field or its label."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures/field_attribute_widget.rst:4
#: ../../content/developer/reference/user_interface/view_architectures/field_attribute_widget.rst:4
msgid "The rendering method and context to use in place of the default one assigned to the field's type (e.g., :class:`~odoo.fields.Char`, :class:`~odoo.fields.Many2one`). See :ref:`reference/js/widgets`."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:181
msgid "The configuration options for the field's widget (including default widgets), as a Python expression that evaluates to a dict."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:184
msgid "For relation fields, the following options are available: `no_create`, `no_quick_create`, `no_open`, and `no_create_edit`."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:193
#: ../../content/developer/reference/user_interface/view_architectures.rst:216
#: ../../content/developer/reference/user_interface/view_architectures.rst:241
#: ../../content/developer/reference/user_interface/view_architectures.rst:1266
#: ../../content/developer/reference/user_interface/view_architectures.rst:1393
#: ../../content/developer/reference/user_interface/view_architectures.rst:1678
#: ../../content/developer/reference/user_interface/view_architectures.rst:1808
#: ../../content/developer/reference/user_interface/view_architectures.rst:1820
#: ../../content/developer/reference/user_interface/view_architectures.rst:1832
#: ../../content/developer/reference/user_interface/view_architectures.rst:1907
#: ../../content/developer/reference/user_interface/view_architectures.rst:1977
#: ../../content/developer/reference/user_interface/view_architectures.rst:2191
#: ../../content/developer/reference/user_interface/view_architectures/button_attribute_context.rst:13
#: ../../content/developer/reference/user_interface/view_architectures/field_attribute_readonly.rst:14
#: ../../content/developer/reference/user_interface/view_architectures/field_attribute_required.rst:14
#: ../../content/developer/reference/user_interface/view_architectures/generic_attribute_column_invisible.rst:16
#: ../../content/developer/reference/user_interface/view_architectures/generic_attribute_invisible.rst:27
#: ../../content/developer/reference/user_interface/view_architectures/button_attribute_context.rst:13
#: ../../content/developer/reference/user_interface/view_architectures/field_attribute_readonly.rst:14
#: ../../content/developer/reference/user_interface/view_architectures/field_attribute_required.rst:14
#: ../../content/developer/reference/user_interface/view_architectures/generic_attribute_column_invisible.rst:16
#: ../../content/developer/reference/user_interface/view_architectures/generic_attribute_invisible.rst:27
msgid ":ref:`Python expression <reference/view_architectures/python_expression>`"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:194
#: ../../content/developer/reference/user_interface/view_architectures.rst:242
#: ../../content/developer/reference/user_interface/view_architectures.rst:1679
#: ../../content/developer/reference/user_interface/view_architectures.rst:1821
#: ../../content/developer/reference/user_interface/view_architectures.rst:1978
#: ../../content/developer/reference/user_interface/view_architectures/button_attribute_context.rst:14
#: ../../content/developer/reference/user_interface/view_architectures/button_attribute_context.rst:14
msgid "`{}`"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures/field_attribute_readonly.rst:4
#: ../../content/developer/reference/user_interface/view_architectures/field_attribute_readonly.rst:4
msgid "Whether the field can be modified by the user (`False`) or is read-only (`True`), as a Python expression that evaluates to a bool."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures/field_attribute_required.rst:4
#: ../../content/developer/reference/user_interface/view_architectures/field_attribute_required.rst:4
msgid "Whether the field can be left empty (`False`) or must be set (`True`), as a Python expression that evaluates to a bool."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures/generic_attribute_invisible.rst:4
#: ../../content/developer/reference/user_interface/view_architectures/generic_attribute_invisible.rst:4
msgid "Whether the element is visible (`False`) or hidden (`True`), as a Python expression that evaluates to a bool."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures/generic_attribute_invisible.rst:8
#: ../../content/developer/reference/user_interface/view_architectures/generic_attribute_invisible.rst:8
msgid "There are two uses for the `invisible` attribute:"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures/generic_attribute_invisible.rst:10
#: ../../content/developer/reference/user_interface/view_architectures/generic_attribute_invisible.rst:10
msgid "Usability: to avoid overloading the view and to make it easier for the user to read, depending on the content."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures/generic_attribute_invisible.rst:12
#: ../../content/developer/reference/user_interface/view_architectures/generic_attribute_invisible.rst:12
msgid "Technical: a field must be present (invisible is enough) in the view to be used in a Python expression."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures/generic_attribute_groups.rst:4
#: ../../content/developer/reference/user_interface/view_architectures/generic_attribute_groups.rst:4
msgid "The comma-separated list of user groups to whom the element is displayed. Users who do not belong to at least one of these groups are unable to see the element. Groups can be prefixed with the negative `!` operator to exclude them."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:207
msgid "The filters to apply when displaying existing records for selection, as a Python expression that evaluates to a :ref:`domain <reference/orm/domains>`."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:217
#: ../../content/developer/reference/user_interface/view_architectures.rst:1809
#: ../../content/developer/reference/user_interface/view_architectures.rst:1833
#: ../../content/developer/reference/user_interface/view_architectures.rst:1908
#: ../../content/developer/reference/user_interface/view_architectures.rst:2192
msgid "`[]`"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:0
msgid "scope"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:223
msgid "extensive documentation on all the magic context values (TYPE_view_ref, group_by, search_default_FIELD..."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:226
msgid "The context to use when fetching possible values and creating or searching records, as a Python expression that evaluates to a dict."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:248
msgid "Whether the field label should be hidden."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:253
msgid "Fields that are a direct child of a `group` element"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:258
msgid "The help message to display on *empty* fields. It can replace field labels in complex forms. However, it *should not* be an example of data, as users may confuse placeholder text with filled fields."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:269
msgid "The comma-separated list of display modes (view types) to use for the field's linked records. Allowed modes are: `tree`, `form`, `kanban`, and `graph`."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:274
msgid "`tree`"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:275
msgid ":class:`~odoo.fields.One2many` and :class:`~odoo.fields.Many2many` fields"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures/generic_attribute_class.rst:4
#: ../../content/developer/reference/user_interface/view_architectures/generic_attribute_class.rst:4
msgid "The `HTML class <https://en.wikipedia.org/wiki/HTML_attribute>`_ to set on the generated element."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures/generic_attribute_class.rst:6
#: ../../content/developer/reference/user_interface/view_architectures/generic_attribute_class.rst:6
msgid "The styling uses the `Bootstrap <https://getbootstrap.com>`_ framework and :ref:`UI icons <reference/user_interface/ui_icons>`. Common Odoo classes include:"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures/generic_attribute_class.rst:9
#: ../../content/developer/reference/user_interface/view_architectures/generic_attribute_class.rst:9
msgid "`oe_inline`: prevents the usual line break following fields, and limits their span;"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures/generic_attribute_class.rst:10
#: ../../content/developer/reference/user_interface/view_architectures/generic_attribute_class.rst:10
msgid "`oe_left`, `oe_right`: `floats <https://developer.mozilla.org/en-US/docs/Web/CSS/float>`_ the element to the corresponding direction;"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures/generic_attribute_class.rst:12
#: ../../content/developer/reference/user_interface/view_architectures/generic_attribute_class.rst:12
msgid "`oe_read_only`, `oe_edit_only`: only displays the element in the corresponding form mode;"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures/generic_attribute_class.rst:13
#: ../../content/developer/reference/user_interface/view_architectures/generic_attribute_class.rst:13
msgid "`oe_avatar`: for image fields, displays images as an \"avatar\" (max 90x90 square);"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures/generic_attribute_class.rst:14
#: ../../content/developer/reference/user_interface/view_architectures/generic_attribute_class.rst:14
msgid "`oe_stat_button`: defines a particular rendering to dynamically display information while being clickable to target an action."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:282
msgid "The name of the related field providing the name of the file."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:287
msgid ":class:`~odoo.fields.Binary` fields"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:292
msgid "Whether the field stores a password and thus its data should not be displayed."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:297
msgid ":class:`~odoo.fields.Char` fields"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:302
msgid "The XMLID of the specific Kanban :doc:`view record <view_records>` that should be used when selecting records in a mobile environment."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:313
msgid "Whether the field is focused when the view opens. It can be applied to only one field of a view."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:320
msgid ":ref:`Relational fields <studio/fields/relational-fields>` nodes can contain specific subviews."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:338
msgid "`label`: display field labels"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:340
msgid "When a :ref:`field <reference/view_architectures/form/field>` component is not placed directly inside a :ref:`group <reference/view_architectures/form/group>`, or when its `nolabel` attribute is set, the field's label is not automatically displayed alongside its value. The `label` component is the manual alternative of displaying the label of a field."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:356
msgid "The `label` element can have the following attributes:"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:361
msgid "The reference to the field associated with the label. It can be either the name of the field, or its id (the `id` attribute set on the :ref:`field <reference/view_architectures/form/field>`)."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:364
msgid "When there are several occurrences of the same field in the view, and there are several `label` components associated with these field nodes, these labels must have unique `for` attribute; in this case, referencing the `id` attribute of the corresponding field nodes."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:374
msgid "The label to display."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:378
msgid "The field's label coming from the field definition on the model"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:387
#: ../../content/developer/reference/user_interface/view_architectures.rst:1467
msgid "`button`: display action buttons"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:396
#: ../../content/developer/reference/user_interface/view_architectures.rst:1476
msgid "The `button` element can have the following attributes:"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures/button_attribute_type.rst:4
#: ../../content/developer/reference/user_interface/view_architectures/button_attribute_type.rst:4
msgid "The type of the button indicating how it behaves. It can have two different values:"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures/button_attribute_type.rst:9
#: ../../content/developer/reference/user_interface/view_architectures/button_attribute_type.rst:9
msgid "Call a method on the view's model. The button's `name` is the method that is called with the current record ID and the current `context`."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures/button_attribute_type.rst:15
#: ../../content/developer/reference/user_interface/view_architectures/button_attribute_type.rst:15
msgid "Load and execute an `ir.actions` action record. The button's `name` is the XMLID of the action to load. The `context` is extended with the view's model (as `active_model`) and with the current record (as `active_id`)."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures/button_attribute_type.rst:25
#: ../../content/developer/reference/user_interface/view_architectures/button_attribute_type.rst:25
msgid "Mandatory if the `special` attribute is not set"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures/button_attribute_name.rst:4
#: ../../content/developer/reference/user_interface/view_architectures/button_attribute_name.rst:4
msgid "The method to call if the `type` is `object`. The :term:`XMLID <external identifier>` of the action to load if the `type` is `action`, either in raw format or in `%(XMLID)d` format."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures/button_attribute_string.rst:4
#: ../../content/developer/reference/user_interface/view_architectures/button_attribute_string.rst:4
msgid "The button's text if there is no `icon`, the `alt` text for the icon otherwise."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures/button_attribute_icon.rst:4
#: ../../content/developer/reference/user_interface/view_architectures/button_attribute_icon.rst:4
msgid "The icon to use to display the button. See :ref:`icons <reference/user_interface/ui_icons>` for the reference list."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures/button_attribute_help.rst:4
#: ../../content/developer/reference/user_interface/view_architectures/button_attribute_help.rst:4
msgid "The tooltip message shown when hovering with the mouse cursor."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:1674
#: ../../content/developer/reference/user_interface/view_architectures/button_attribute_context.rst:4
#: ../../content/developer/reference/user_interface/view_architectures/button_attribute_context.rst:4
msgid "The context that is merged into the view's context when performing the button's call, as a Python expression that evaluates to a dict."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:419
msgid "The behavior of the button for form views opened in dialog. It can have two different values:"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:424
msgid "Save the record and close the dialog."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:429
msgid "Close the dialog without saving."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:443
msgid "The confirmation message to display (and for the user to accept) before performing the button's action."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:458
msgid "The hotkey (`keyboard_shortcut`_, similar to an accesskey_) that is bound to the button. It is enabled when the `alt` key is pressed together with the selected character, or together with the `shift` key and the selected character when `shift+` is prepended to the value."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:475
msgid "Chatter widget"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:477
msgid "The :ref:`chatter widget <reference/mixins/mail/chatter>` is the communication and log tool allowing to email colleagues and customers directly from a record (task, order, invoice, event, note...)."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:480
msgid "It is added with a `div` element with the class `oe_chatter` when the model inherits the `mail.thread` mixin."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:500
msgid "Attachments preview widget"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:502
msgid "The attachment preview widget is added with an *empty* `div` element with the class `o_attachment_preview`."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:518
#: ../../content/developer/reference/user_interface/view_architectures.rst:3655
msgid "Structural components"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:520
msgid "Structural components provide structure or \"visual\" features with little logic. They are used as elements or sets of elements in form views."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:523
msgid "Form views accept the following children structural components: :ref:`group <reference/view_architectures/form/group>`, :ref:`sheet <reference/view_architectures/form/sheet>`, :ref:`notebook <reference/view_architectures/form/notebook>`, :ref:`notebook <reference/view_architectures/form/notebook>`, :ref:`newline <reference/view_architectures/form/newline>`, :ref:`separator <reference/view_architectures/form/separator>`, :ref:`header <reference/view_architectures/form/header>`, :ref:`footer <reference/view_architectures/form/footer>`, :ref:`reference/view_architectures/form/button_container`, and :ref:`reference/view_architectures/form/title_container`."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:539
msgid "`group`: define columns layouts"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:541
msgid "The `group` element is used to define column layouts in forms. By default, groups define 2 columns, and most direct children of groups take a single column."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:544
msgid ":ref:`field <reference/view_architectures/form/field>` elements that are direct children of groups display a `label` by default, and the label and the field itself have a `colspan` of `1` each."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:547
msgid "Children are laid out horizontally (they try to fill the next column before changing row)."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:557
msgid "The `group` element can have the following attributes:"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:562
msgid "The title displayed for the group."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:571
msgid "The number of columns in a `group`."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:574
#: ../../content/developer/reference/user_interface/view_architectures.rst:583
#: ../../content/developer/reference/user_interface/view_architectures.rst:1275
#: ../../content/developer/reference/user_interface/view_architectures.rst:1285
#: ../../content/developer/reference/user_interface/view_architectures.rst:2174
msgid "int"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:580
msgid "The number of columns taken by a child element."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:588
#: ../../content/developer/reference/user_interface/view_architectures.rst:672
#: ../../content/developer/reference/user_interface/view_architectures.rst:712
#: ../../content/developer/reference/user_interface/view_architectures.rst:757
#: ../../content/developer/reference/user_interface/view_architectures.rst:862
#: ../../content/developer/reference/user_interface/view_architectures.rst:1148
#: ../../content/developer/reference/user_interface/view_architectures.rst:1446
#: ../../content/developer/reference/user_interface/view_architectures.rst:1498
#: ../../content/developer/reference/user_interface/view_architectures.rst:1551
#: ../../content/developer/reference/user_interface/view_architectures.rst:1621
#: ../../content/developer/reference/user_interface/view_architectures.rst:1681
#: ../../content/developer/reference/user_interface/view_architectures.rst:1725
#: ../../content/developer/reference/user_interface/view_architectures.rst:1839
#: ../../content/developer/reference/user_interface/view_architectures.rst:2001
#: ../../content/developer/reference/user_interface/view_architectures.rst:2252
#: ../../content/developer/reference/user_interface/view_architectures.rst:2436
#: ../../content/developer/reference/user_interface/view_architectures.rst:2556
msgid "Possible structure and representation of its rendering"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:625
msgid "`sheet`: make the layout responsive"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:627
msgid "The `sheet` element can be used as a direct child of the :ref:`form <reference/view_architectures/form>` root element for a narrower and more responsive form layout (centered page, margin...). It usually contains :ref:`group <reference/view_architectures/form/group>` elements."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:643
msgid "`notebook` & `page`: add tabbed sections"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:645
msgid "The `notebook` element defines a tabbed section. Each tab is defined through a `page` child element."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:647
msgid "The `notebook` element should not be placed within `group` elements."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:659
msgid "The `page` element can have the following attributes:"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:664
msgid "The title of the tab."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:667
#: ../../content/developer/reference/user_interface/view_architectures.rst:754
msgid "`str`"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:696
msgid "`newline`: start new group rows"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:698
msgid "The `newline` element is used within :ref:`group <reference/view_architectures/form/group>` elements to end the current row early and immediately switch to a new row, without filling any remaining column beforehand."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:734
msgid "`separator`: add horizontal spacing"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:736
msgid "The `separator` element adds vertical spacing between elements within a group."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:746
msgid "The `<separator>` element can have the following attributes:"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:751
msgid "The title as a section title."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:785
msgid "The `separator` element can be used to achieve visual separation between elements within the same inner `group` element while keeping them horizontally aligned."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:791
msgid "`header`: display workflow buttons and a status"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:793
msgid "The `header` element combined with the :ref:`sheet <reference/view_architectures/form/sheet>` element provides a full-width location above the sheet itself generally used to display workflow :ref:`button <reference/view_architectures/form/button>` elements and a :ref:`field <reference/view_architectures/form/field>` element rendered as status widget."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:821
msgid "`footer`: display dialog buttons"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:823
msgid "The `footer` element is used to display :ref:`buttons <reference/view_architectures/form/button>` elements at the end of dialogs."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:849
msgid "Buttons container"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:851
msgid "A :ref:`button <reference/view_architectures/form/button>` elements container can be created with a `div` element with the class `button_box`."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:884
msgid "Title container"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:886
msgid "A title :ref:`field <reference/view_architectures/form/field>` element container can be created with a `div` element with the class `oe_title`."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:902
msgid "Settings"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:904
msgid "Settings views are a customization of the :ref:`form <reference/view_architectures/form>` view. They are used to display settings in a centralized place. They differ from generic form views in that they have a search bar and a sidebar."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:937
msgid "Settings views accept the :ref:`field <reference/view_architectures/form/field>`, :ref:`label <reference/view_architectures/form/label>` and :ref:`button <reference/view_architectures/form/button>` elements of :ref:`form <reference/view_architectures/form>` views, as well as three additional children elements: :ref:`app <reference/view_architectures/settings/app>`, :ref:`block <reference/view_architectures/settings/block>`, and :ref:`setting <reference/view_architectures/settings/setting>`."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:950
msgid "`app`: declare the application"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:952
msgid "The `app` element is used to declare the application on the settings view. It creates an entry with the logo of the application on the sidebar of the view. It also acts as delimiter when searching."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:963
msgid "The `app` element can have the following attributes:"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:968
msgid "The name of the application."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:976
msgid "The technical name of the application (the name of the module)."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:984
msgid "The `relative path`_ to the logo."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:988
msgid "A path computed with the `name` attribute: :file:`/{name}/static/description/icon.png`"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:999
msgid "`block`: declare a group of settings"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:1001
msgid "The `block` element is used to declare a group of settings. This group can have a title and a description."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:1016
msgid "The `block` element can have the following attributes:"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:1021
msgid "The title of the block of settings. One can search on its value."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:1030
msgid "The description of the block of settings. One can search on its value."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:1043
msgid "`setting`: declare the setting"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:1045
msgid "The `setting` element is used to declare the setting itself."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:1047
msgid "The first :ref:`field <reference/view_architectures/form/field>` element in the setting is used as the main field. It is placed on the left panel if it is a boolean field, and on the top of the right panel otherwise. The field is also used to create the setting label if a `string` attribute is not defined."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:1052
msgid "The `setting` element can also contain additional elements (e.g., HTML). All of those elements are rendered in the right panel."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:1071
msgid "The `<setting>` element can have the following attributes:"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:1076
msgid "By default, a setting is visually separated on two panels (left and right), and is used to edit a given :ref:`field <reference/view_architectures/form/field>`. By defining `type=\"header\"`, a special kind of setting is rendered instead. This setting is used to modify the scope of the other settings. For example, on the Website application, this setting is used to indicate to which website the other settings apply. The header setting is visually represented as a banner on top of the screen."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:1090
msgid "The text used as the label of the setting."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:1094
msgid "The first field's label"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:1099
msgid "The text used as a tooltip."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:1108
msgid "The description of the setting. This text is displayed just below the setting label (with the class `text-muted`)."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:1118
msgid "Whether the setting is company-specific. If set, an icon is displayed next to the setting label."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:1120
#: ../../content/developer/reference/user_interface/view_architectures.rst:1228
msgid "It accepts only the value `'1'`."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:1129
msgid "The `path`_ to the documentation on the setting. If set, a clickable icon is displayed next to the setting label. The path can be both an absolute or a `relative path`_. In the latter case, it is relative to `https://www.odoo.com/documentation/<version>`."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:1134
msgid "`path_`"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:1144
#: ../../content/developer/tutorials/getting_started/07_basicviews.rst:23
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:318
msgid "List"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:1146
msgid "The root element of list views is `tree`\\ [#treehistory]_."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:1167
msgid "Optional attributes can be added to the root element `tree` to customize the view."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:1180
msgid "Disable/enable record import from data on the view."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:1189
msgid "Disable/enable record export to data on the view."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:1198
msgid "Make the view's records editable in-place, and allow creating new records from a row of the list. It can have two different values:"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:1204
msgid "New records are created from the top of the list."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:1209
msgid "New records are created from the bottom of the list."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:1211
msgid "The architecture for the inline :ref:`form <reference/view_architectures/form>` view is derived from the list view. Most attributes valid on a form view's fields and buttons are thus accepted by list views, although they may not have any meaning if the list view is non-editable."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:1216
msgid "This behavior is disabled if the `edit` attribute is set to `False`."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:1225
msgid "Activate the multi-editing feature that allows updating a field to the same value for multiple records at once."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:1237
msgid "Display a button at the end of each row to open the record in a form view."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:1239
msgid "It has no effect if the view is non-editable."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures/root_attribute_default_group_by.rst:4
#: ../../content/developer/reference/user_interface/view_architectures/root_attribute_default_group_by.rst:4
msgid "The name of the field on which the records should be grouped by default if no grouping is specified via the action or the current :ref:`search <reference/view_architectures/search>`."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures/root_attribute_default_order.rst:4
#: ../../content/developer/reference/user_interface/view_architectures/root_attribute_default_order.rst:4
msgid "A comma-separated list of fields names that overrides the ordering defined on the model through the :attr:`~odoo.models.BaseModel._order` attribute."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures/root_attribute_default_order.rst:7
#: ../../content/developer/reference/user_interface/view_architectures/root_attribute_default_order.rst:7
msgid "To inverse the sorting order of a field, postfix it with `desc`, separated by a space."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:1252
msgid "The style that should be applied to matching records' rows, as a Python expression that evaluates to a bool."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:1255
#: ../../content/developer/reference/user_interface/view_architectures.rst:1383
msgid "`<style>` must be replaced by one of `bf` (bold), `it` (italic), `info`, `warning`, `danger`, `muted`, `primary`, and `success`."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:1272
msgid "The default size of a page. It must be strictly positive."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:1276
#: ../../content/developer/reference/user_interface/view_architectures.rst:1286
msgid "`80` for list views, `40` for X2many lists in form views"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:1281
msgid "The default number of groups on a page when the list view is grouped. It must be strictly positive."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:1291
msgid "Whether the first level of groups should be opened by default when the list view is grouped."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:1294
msgid "It may be slow, depending on the number of groups."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures/root_attribute_sample.rst:4
#: ../../content/developer/reference/user_interface/view_architectures/root_attribute_sample.rst:4
msgid "Whether the view should be populated with a set of sample records if none are found for the current model."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures/root_attribute_sample.rst:7
#: ../../content/developer/reference/user_interface/view_architectures/root_attribute_sample.rst:7
msgid "These fake records have heuristics for certain field names/models. For example, a field `display_name` on the model `res.users` will be populated with sample people names, while an `email` field will be in the form `firstname.lastname@sample.demo`."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures/root_attribute_sample.rst:11
#: ../../content/developer/reference/user_interface/view_architectures/root_attribute_sample.rst:11
msgid "The user is unable to interact with these data, and they will be discarded as soon as an action is performed (record created, column added, etc.)."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:1309
msgid "List views accept the following children elements: :ref:`field <reference/view_architectures/list/field>`, :ref:`button <reference/view_architectures/list/button>`, :ref:`groupby <reference/view_architectures/list/groupby>`, :ref:`header <reference/view_architectures/list/header>`, :ref:`control, and create <reference/view_architectures/list/control>`."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:1323
msgid "The `field` element renders (and allows editing of, possibly) a single field of all current records as a column."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:1326
msgid "Using the same field multiple times in a list view is not supported"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:1343
msgid "Make the visibility of the field optional. The field's column can be hidden or shown through a button on the view's header."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:1346
msgid "It can have two different values:"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:1351
msgid "The field is shown by default."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:1356
msgid "The field is hidden by default."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures/generic_attribute_column_invisible.rst:4
#: ../../content/developer/reference/user_interface/view_architectures/generic_attribute_column_invisible.rst:4
msgid "Whether the column is visible (`False`) or hidden (`True`), as a Python expression that evaluates to a bool."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures/generic_attribute_column_invisible.rst:7
#: ../../content/developer/reference/user_interface/view_architectures/generic_attribute_column_invisible.rst:7
msgid "Unlike `invisible`, it affects the entire column, and is evaluated without the subtree values."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:1380
msgid "The style that should be applied to matching records' field, as a Python expression that evaluates to a bool."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:1401
msgid "The aggregate to display at the bottom of the column. The aggregation is computed on only records that are currently displayed. The aggregation operation must match the corresponding field's `group_operator`."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:1418
msgid "The width to apply to the field's column when there are no records in the list, as an absolute width (e.g., `100px`)."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:1422
msgid "The width is set by the webclient when there are records in the list."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:1431
msgid "Whether the field's column header should remain empty. If set, the column will not be sortable."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:1433
msgid "It accepts only the value `'1'`"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:1440
msgid "When a list view is grouped, numeric fields are aggregated and displayed for each group. Also, if there are too many records in a group, a pager appears on the right of the group row. For this reason, it is a bad practice to have a numeric field in the last column when the list view is in a situation where it can be grouped. However, it does not pose a problem for X2many fields in a form view, as they cannot be grouped."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:1520
msgid "`groupby`: define group headers"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:1522
msgid "The `groupby` element is used to define group headers with :ref:`button <reference/view_architectures/list/button>` elements when grouping records on :attr:`~odoo.fields.Many2one` fields. It also accepts :ref:`field <reference/view_architectures/list/field>` elements, which can be used for modifiers. These fields thus belong on the Many2one co-model. These extra fields are fetched in batch."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:1538
msgid "The `groupby` element can have the following attributes:"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:1543
msgid "The name of the a :attr:`~odoo.fields.Many2one` field to use as header."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:1545
msgid "A special :ref:`button <reference/view_architectures/list/button>` element with `type=\"edit\"` can be defined to open the Many2one field's form view."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:1575
msgid "Fields inside the `groupby` element are used only to fetch and store the value, but they are never displayed."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:1581
msgid "`header`: display workflow buttons"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:1592
msgid "The `header` element accepts the following children elements:"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:1597
msgid "The `button` element allows defining buttons in the control panel. It is the same element as the :ref:`button element in list views <reference/view_architectures/list/button>`, but it accepts one more attribute when placed inside a `header` element:"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:1604
msgid "Make the button available at all time, without having to select records."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:1606
msgid "It accepts only the value `always`."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:1644
msgid "`control` & `create`: add inline create buttons"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:1646
msgid "The `control` element defines a control row that accepts create buttons. Each create button is defined through a `create` element."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:1659
msgid "The `control` element takes no attributes."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:1661
msgid "The `create` element can have the following attributes:"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:1666
msgid "The button's text."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:1704
msgid "Using the `control` element makes sense only if the list view is inside a :class:`~odoo.fields.One2many` or :class:`~odoo.fields.Many2many` field. If any `create` element is defined, it overwrites the default :guilabel:`add a line` button."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:1708
msgid "For historical reasons, it has its origin in tree-type views later repurposed to a more table/list-type display"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:1714
#: ../../content/developer/tutorials/getting_started/07_basicviews.rst:134
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:386
msgid "Search"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:1716
msgid "Search views are different from other view types in that they are not used to display content. Although they apply to a specific model, they are used to filter another view's content (usually aggregated views; e.g., :ref:`reference/view_architectures/list` and :ref:`reference/view_architectures/graph`)."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:1721
msgid "The root element of search views is `search`."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:1723
msgid "It takes no attributes."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:1744
msgid "Search views accept the following children elements: :ref:`field <reference/view_architectures/search/field>`, :ref:`filter <reference/view_architectures/search/filter>`, :ref:`separator <reference/view_architectures/search/separator>`, :ref:`group <reference/view_architectures/search/group>`, and :ref:`searchpanel <reference/view_architectures/search/searchpanel>`."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:1756
msgid "`field`: filter based on field values"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:1758
msgid "The `field` element defines domains or contexts with user-provided values. When search domains are generated, field domains are joined with each other and with filters using the **AND** operator."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:1772
#: ../../content/developer/reference/user_interface/view_architectures.rst:2079
msgid "The name of the field to filter on."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:1782
msgid "By default, fields generate domains of the form :samp:`[(name, {operator}, value)]`, where `name` is the field's name and `value` is the value provided by the user, possibly filtered or transformed (e.g., a user is expected to provide the *label* of a selection field's value, not the value itself)."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:1787
msgid "The `operator` attribute allows overriding the default operator, which depends on the field's type (e.g., `=` for float fields, but `ilike` for char fields and `child_of` for many2one)."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:1792
msgid "`=`"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:1797
msgid "The domain to use as the field's search domain, as a Python expression that evaluates to a :ref:`domain <reference/orm/domains>`."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:1800
msgid "It can use the `self` variable to inject the provided value in the custom domain. It can be used to generate significantly more flexible domains than with the `operator` attribute alone (e.g., search on multiple fields at once)."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:1804
msgid "If both the `operator` and `filter_domain` attributes are provided, `filter_domain` takes precedence."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:1814
msgid "The context to merge into the context of the view that the search view is targeting, as a Python expression that evaluates to a dict."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:1817
#: ../../content/developer/reference/user_interface/view_architectures.rst:1829
msgid "It can contain user-provided values, which are available under the `self` variable."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:1826
msgid "The filters to apply to the completion results for fields that allow for auto-completion (e.g., :class:`~odoo.fields.Many2one`)."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:1860
msgid "`filter`: create pre-defined filters"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:1862
msgid "The `filter` element is used to create pre-defined filters that can be toggled in the search view. It allows adding data to the search context :dfn:`the context passed to the data view for searching/filtering`, or appending new sections to the search filter."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:1872
msgid "The `filter` element can have the following attributes:"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:1877
msgid "The technical name of the filter. It can be used to :ref:`enable it by default <reference/view_architectures/search/defaults>` or as an :ref:`inheritance hook <reference/view_records/inheritance>`."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:1887
msgid "The label of the filter."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:1895
msgid "The tooltip displayed when hovering the filter."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:1904
msgid "The domain to append to the action's domain as part of the search domain."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:1913
msgid "The name of the `date` or `datetime` field to filter on."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:1915
msgid "When used, this attribute creates a set of filters available in a sub-menu of the :guilabel:`Filters` menu. The available filters are time-dependent but not dynamic in the sense that their domains are evaluated at the time of the control panel instantiation."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:1931
msgid "The default period of the time-based filter (with a `date` attribute). It must be one of, or a comma-separated list of, `today`, `this_week`, `this_month`, `last_month`, `antepenultimate_month`, `fourth_quarter`, `third_quarter`, `second_quarter`, `first_quarter`, `this_year`, `last_year` or `antepenultimate_year`."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:1936
msgid "The filter must be in the default set of filters activated at the view initialization."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:1945
msgid "`this_month`"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:1946
msgid "Filters with a non-empty `date` attribute"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:1955
msgid "The context merged into the action's domain to generate the search domain"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:1957
msgid "The context key `group_by` set with a field as value can be used to define a group available in the :guilabel:`Group By` menu. When the field is of type `date` or `datetime`, the filter generates a submenu of the :guilabel:`Group By` menu with the following interval options available: :guilabel:`Year`, :guilabel:`Quarter`, :guilabel:`Month`, :guilabel:`Week`, and :guilabel:`Day`. When the filter is in the default set of filters activated at the view initialization, the records are grouped by month by default. This can be changed by using the syntax `date_field:interval`."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:1972
msgid "The results of `read_groups` grouped on a field may be influenced by its `group_expand` attribute, allowing to display empty groups when needed. For more information, please refer to :class:`~odoo.fields.Field`."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:1981
msgid "Sequences of filters (without non-filters elements separating them) are treated as inclusively composited: they will be composed with `OR` rather than the usual `AND`."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:1990
msgid "Records whose `state` field is `draft` or `done` are shown."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:1999
msgid "Records whose `state` field is `draft` **and** `delay` field is below 15."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2020
msgid "`separator`: separate groups of filters"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2022
msgid "The `separator` element is used to separates groups of :ref:`filters <reference/view_architectures/search/filter>` in simple search views. For more complex search views, the :ref:`group <reference/view_architectures/search/group>` element is recommended."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2034
msgid "The `separator` element takes no attributes."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2039
msgid "`group`: separate groups of filters"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2041
msgid "The `group` element is used to separate groups of :ref:`filters <reference/view_architectures/search/filter>` in cluttered search views. In simpler search views, it can be substituted for the :ref:`separator <reference/view_architectures/search/group>` element."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2053
msgid "The `group` element takes no attributes."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2058
msgid "`searchpanel`: display search panels"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2060
msgid "The `searchpanel` element displays a search panel to the left of multi-records views. It allows for quickly filtering data on the basis of given fields."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2071
msgid "The `searchpanel` element accepts only `field` children elements."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2073
msgid "The `field` element used as a child element of a `searchpanel` element can have the following attributes:"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2089
msgid "The behavior and display of the field. It can have two different values:"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2094
msgid "At most one value can be selected. Supported field types are `many2one` and `selection`."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2099
msgid "Several values can be selected. Supported field types are `many2one`, `many2many` and `selection`."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2104
msgid "`one`"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2111
msgid "The icon of the field."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2120
msgid "The color of the field."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2126
msgid "When the `field` element has the `select=one` attribute set, it can have the following additional attributes:"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2132
msgid "Whether child categories should appear under their parent category, or at the same hierarchy level."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2138
msgid ":class:`~odoo.fields.Many2one` fields"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2140
msgid "When the `field` element has the `select=multi` attribute set, it can have the following additional attributes:"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2146
msgid "Whether the record counters is computed and displayed if non-zero."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2149
msgid "This attribute exists to avoid impacting performance. Another way to address performance issues is to override the `search_panel_select_range` and `search_panel_select_multi_range` methods."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2160
msgid "Whether categories and filters with no records should be shown."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2169
msgid "The maximal number of values to fetch for the field. If the limit is reached, no values are displayed on the search panel, and an error message is shown instead. If set to 0, all values are fetched."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2175
msgid "`200`"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2180
msgid "The conditions that the records have to satisfy."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2197
msgid "The name of the field name on which values should be grouped."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2202
msgid ":class:`~odoo.fields.Many2one` and :class:`~odoo.fields.Many2many` fields"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2207
msgid "Search defaults"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2209
msgid "Search fields and filters can be configured through the action's `context` using :samp:`search_default_{name}` keys. For fields, the value must be the value to set to the field. For filters, it must be a boolean value or a number."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2214
msgid "With `foo`, a field, and `bar`, a filter, the following action context will search `foo` on `acro` and enable `bar` by default:"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2224
msgid "A numeric value (between 1 and 99) can be used to define the order of default *groupby* filters."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2227
msgid "With `foo` and `bar`, two *groupby* filters, the following action context will first enable `bar`, then `foo`."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2240
#: ../../content/developer/tutorials/backend.rst:1043
msgid "Kanban"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2242
msgid "Kanban views are a used as a `kanban board <https://en.wikipedia.org/wiki/Kanban_board>`_ visualisation: they display records as \"cards\", halfway between a :ref:`list <reference/view_architectures/list>` view and a non-editable :ref:`form <reference/view_architectures/form>` view."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2247
msgid "Records may be grouped in columns for use in workflow visualisation or manipulation (e.g., tasks or work-progress management), or ungrouped (used simply to visualize records)."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2250
msgid "The root element of Kanban views is `kanban`."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2267
msgid "Kanban views load and display a maximum of ten columns. Any column after that is closed but can still be opened by the user."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2275
msgid "Optional attributes can be added to the root element `kanban` to customize the view."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2292
msgid "Add HTML classes to the root HTML element of the view."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2301
msgid "The key in the `KanbanExamplesRegistry` of the examples than can be browsed when creating a new column in the grouped kanban view."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2305
msgid "`Use of the examples attribute in the utm module <https://github.com/odoo/odoo/blob/17.0/addons/utm/static/src/js/utm_campaign_kanban_examples.js>`_"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2315
msgid "Whether the :guilabel:`Add a new column` bar is visible."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2324
msgid "Whether columns can be deleted via the cog menu."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2333
msgid "Whether columns can be edited via the cog menu."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2342
msgid "Whether columns can be reordered."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2351
msgid "Whether records can be dragged when the kanban view is grouped."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2360
msgid "Whether records belonging to a column can be archived and unarchived when the `active` field is defined on the model."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2370
msgid "Whether it should be possible to create records without switching to the form view."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2374
msgid "`True` when the kanban view is grouped by many2one, selection, char, or boolean fields, otherwise `False`"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2380
msgid "The reference of the :ref:`form <reference/view_architectures/form>` view to open when using the quick creation of records."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2390
msgid "The custom action to call when clicking on :guilabel:`Create`."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2392
msgid "If set to `'quick_create'`, the quick creation of records is used instead. If the quick creation is disabled, the standard create action is called."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2408
msgid "Kanban views accept the following children elements: :ref:`field <reference/view_architectures/kanban/field>`, :ref:`header <reference/view_architectures/kanban/header>`, :ref:`progressbar <reference/view_architectures/kanban/progressbar>`, and :ref:`templates <reference/view_architectures/kanban/templates>`."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2421
msgid "The `field` element declares fields to use in the :ref:`templates <reference/view_architectures/kanban/templates>`. If the field is simply displayed, it does not need to be pre-declared."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2459
msgid "`header`: display buttons in the control panel"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2461
msgid "The `header` element is used to insert custom buttons in the control panel."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2472
msgid "The `header` element accepts only `button` children elements, similar to :ref:`list views' button <reference/view_architectures/list/button>` elements."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2475
msgid "The `button` element used as a child element of the `header` element can have the following additional attributes:"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2481
msgid "The display mode of the button. It can have two different values:"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2486
msgid "The button is displayed only when some records are selected; their action applies to the selected records."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2493
msgid "The button is displayed at all times, even if no records are selected."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2496
msgid "Only the `always` display mode is available because it is not yet possible to select records in a kanban view."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2509
msgid "`display`"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2514
msgid "`progressbar`: show progress bars on top of columns"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2516
msgid "The `progressbar` element is used to define a progress bar to display on top of kanban columns."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2525
msgid "The `progressbar` element can have the following attributes:"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2530
msgid "The name of the field on which the progress bar's sub-groups are based."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2539
msgid "The mapping of the progress bar's field values to the color values `muted`, `success`, `warning`, and `danger`."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2543
msgid "`JSON <https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON>`_"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2549
msgid "The name of the field to use in a sum displayed next to the progress bar. If not set, the total number of records is displayed instead."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2578
msgid "`templates`: define cards structure"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2580
msgid "The `templates` elements is used to define the :ref:`QWeb templates <reference/qweb>` that structure the kanban cards."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2583
msgid "Cards structure definition can be split into multiple templates for clarity, but at least one root template `kanban-box` must be defined."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2586
msgid "Two additional templates can be defined: `kanban-menu` and `kanban-tooltip`. If defined, the `kanban-menu` template is rendered inside a dropdown that can be toggled with a vertical ellipsis (:guilabel:`⋮`) on the top right of the card. The `kanban-tooltip` template is rendered inside a tooltip when hovering kanban cards."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2591
msgid "The templates are written in :ref:`JavaScript QWeb <reference/qweb/javascript>`"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2606
msgid "The following variables are available in the rendering context:"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2611
msgid "The current :js:class:`KanbanRecord`. It can be used to fetch some meta-information. The methods are also available directly in the template context and don't need to be accessed via `widget`."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2619
msgid "An object with all the requested fields as its attributes. Each field has two attributes: `value` and `raw_value`. The former is formatted according to current user parameters while the latter is the raw value from a :meth:`~odoo.models.Model.read` (except for the `date` and `datetime` fields that are `formatted according to the user locale <https://github.com/odoo/odoo/blob/a678bd4e /addons/web_kanban/static/src/js/kanban_record.js#L102>`_)."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2630
msgid "The current context propagated from either the action that opens the kanban view, or the one2many or many2many field that embeds the kanban view in a form view."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2643
msgid "Whether the kanban view is opened when selecting a many2one or many2many field in mobile environment."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2648
msgid "While most of the kanban templates are standard :ref:`QWeb templates <reference/qweb>`, the kanban view processes `field`, `button` and `a` elements is a special way:"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2651
msgid "By default, fields are replaced by their formatted value, unless the `widget` attribute is specified, in which case their rendering and behavior depends on the corresponding widget. The `widget` attribute can have different values including:"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2658
msgid "Allow reordering records with a drag and drop when their are sorted based on `sequence` (or `integer`) fields."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2661
msgid "list all widgets and move the attribute definition in the <field> section"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2663
msgid "Buttons and links with a `type` attribute perform different operations than their standard HTML function. The `type` attribute can have the values `action` and `object` of :ref:`regular buttons <reference/view_architectures/list/button>`, or the following values:"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2670
msgid "Clicking the element opens the card's record in form view in read-only mode."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2675
msgid "Clicking the element opens the card's record in form view in editable mode."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2680
msgid "Clicking the element deletes the card's record and removes the card."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2683
msgid "kanban-specific CSS"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2684
msgid "kanban structures/widgets (vignette, details, ...)"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2693
msgid "QWeb views are standard :ref:`reference/qweb` templates inside a view's ``arch``. They don't have a specific root element. Because QWeb views don't have a specific root element, their type must be specified explicitly (it can not be inferred from the root element of the ``arch`` field)."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2698
msgid "QWeb views have two use cases:"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2700
msgid "they can be used as frontend templates, in which case :ref:`reference/data/template` should be used as a shortcut."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2702
msgid "they can be used as actual qweb views (opened inside an action), in which case they should be defined as regular view with an explicit ``type`` (it can not be inferred) and a model."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2706
msgid "The main additions of qweb-as-view to the basic qweb-as-template are:"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2708
msgid "qweb-as-view has a special case for a ``<nav>`` element bearing the CSS class ``o_qweb_cp_buttons``: its contents should be buttons and will be extracted and moved to the control panel's button area, the ``<nav>`` itself will be removed, this is a work-around to control panel views not existing yet"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2713
msgid "qweb-as-view rendering adds several items to the standard qweb rendering context:"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2719
msgid "the model to which the qweb view is bound"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2720
#: ../../content/developer/reference/user_interface/view_architectures.rst:3316
#: ../../content/developer/reference/user_interface/view_architectures.rst:3365
#: ../../content/developer/reference/user_interface/view_architectures.rst:3378
#: ../../content/developer/tutorials/backend.rst:932
msgid "``domain``"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2721
msgid "the domain provided by the search view"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2723
msgid "the context provided by the search view"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2726
msgid "``records``"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2725
msgid "a lazy proxy to ``model.search(domain)``, this can be used if you just want to iterate the records and not perform more complex operations (e.g. grouping)"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2728
msgid "qweb-as-view also provides additional rendering hooks:"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2730
msgid "``_qweb_prepare_context(view_id, domain)`` prepares the rendering context specific to qweb-as-view"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2732
msgid "``qweb_render_view(view_id, domain)`` is the method called by the client and will call the context-preparation methods and ultimately ``env['ir.qweb'].render()``."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2739
msgid "Graph"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2741
msgid "The graph view is used to visualize aggregations over a number of records or record groups. Its root element is ``<graph>`` which can take the following attributes:"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2748
#: ../../content/developer/reference/user_interface/view_architectures.rst:2784
#: ../../content/developer/reference/user_interface/view_architectures.rst:2858
msgid "``type`` (optional)"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2748
msgid "one of ``bar`` (default), ``pie`` and ``line``, the type of graph to use"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2752
msgid "``stacked`` (optional)"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2751
msgid "only used for ``bar`` charts. Set to ``0`` to prevent the bars within a group to be stacked initially."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2755
#: ../../content/developer/reference/user_interface/view_architectures.rst:2816
#: ../../content/developer/reference/user_interface/view_architectures.rst:3107
msgid "``disable_linking`` (optional)"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2755
msgid "set to ``1`` to prevent from redirecting clicks on graph to list view"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2760
msgid "``order`` (optional)"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2758
msgid "if set, x-axis values will be sorted by default according their measure with respect to the given order (``asc`` or ``desc``). Only used for ``bar`` and ``pie`` charts."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2763
#: ../../content/developer/reference/user_interface/view_architectures.rst:2795
#: ../../content/developer/reference/user_interface/view_architectures.rst:2841
#: ../../content/developer/reference/user_interface/view_architectures.rst:3137
msgid "``string`` (optional)"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2763
msgid "string displayed in the breadcrumbs when redirecting to list view."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2767
msgid "The only allowed element within a graph view is ``field`` which can have the following attributes:"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2773
#: ../../content/developer/reference/user_interface/view_architectures.rst:2836
msgid "the name of a field to use in the view. If used for grouping (rather than aggregating)"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2778
#: ../../content/developer/reference/user_interface/view_architectures.rst:2863
#: ../../content/developer/reference/user_interface/view_architectures.rst:3144
msgid "``invisible`` (optional)"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2777
msgid "if true, the field will not appear either in the active measures nor in the selectable measures."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2781
msgid "if set to ``measure``, the field will be used as an aggregated value within a group instead of a grouping criteria. It only works for the last field with that attribute but it is useful for other fields with string attribute (see below)."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2790
#: ../../content/developer/reference/user_interface/view_architectures.rst:3122
msgid "``interval`` (optional)"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2787
msgid "on date and datetime fields, groups by the specified interval (``day``, ``week``, ``month``, ``quarter`` or ``year``) instead of grouping on the specific datetime (fixed second resolution) or date (fixed day resolution). Default is ``month``."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2793
msgid "only used for field with ``type=\"measure\"``. The name that will be used to display the field in the graph view, overrides the default python String attribute of the field."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2797
#: ../../content/developer/reference/user_interface/view_architectures.rst:2867
msgid "The measures are automatically generated from the model fields; only the aggregatable fields are used. Those measures are also alphabetically sorted on the string of the field."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2803
msgid "graph view aggregations are performed on database content, non-stored function fields can not be used in graph views"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2809
msgid "Pivot"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2811
msgid "The pivot view is used to visualize aggregations as a `pivot table`_. Its root element is ``<pivot>`` which can take the following attributes:"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2817
msgid "Set to ``1`` to remove table cell's links to list view."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2818
msgid "``display_quantity`` (optional)"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2819
msgid "Set to ``1`` to display the Quantity column by default."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2828
msgid "``default_order`` (optional)"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2821
msgid "The name of the measure and the order (asc or desc) to use as default order in the view."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2830
msgid "The only allowed element within a pivot view is ``field`` which can have the following attributes:"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2840
msgid "the name that will be used to display the field in the pivot view, overrides the default python String attribute of the field."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2844
msgid "indicates whether the field should be used as a grouping criteria or as an aggregated value within a group. Possible values are:"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2849
#: ../../content/developer/tutorials/backend.rst:1021
msgid "``row`` (default)"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2850
msgid "groups by the specified field, each group gets its own row."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2851
msgid "``col``"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2852
msgid "creates column-wise groups"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2853
#: ../../content/developer/tutorials/backend.rst:1024
msgid "``measure``"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2854
msgid "field to aggregate within a group"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2858
msgid "``interval``"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2856
msgid "on date and datetime fields, groups by the specified interval (``day``, ``week``, ``month``, ``quarter`` or ``year``) instead of grouping on the specific datetime (fixed second resolution) or date (fixed day resolution)."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2861
msgid "if true, the field will not appear either in the active measures nor in the selectable measures (useful for fields that do not make sense aggregated, such as fields in different units, e.g. € and $)."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2873
msgid "like the graph view, the pivot aggregates data on database content which means that non-stored function fields can not be used in pivot views"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2877
msgid "In Pivot view a ``field`` can have a ``widget`` attribute to dictate its format. The widget should be a field formatter, of which the most interesting are ``date``, ``datetime``, ``float_time``, and ``monetary``."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2881
msgid "For instance a timesheet pivot view could be defined as::"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2892
msgid "Calendar"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2894
msgid "Calendar views display records as events in a daily, weekly, monthly or yearly calendar."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2897
msgid "By default the calendar view will be centered around the current date (today). You can pass a specific initial date to the context of the action in order to set the initial focus of the calendar on the period (see `mode`) around this date (the context key to use being `initial_date`)"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2902
msgid "Their root element is ``<calendar>``. Available attributes on the calendar view are:"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2906
#: ../../content/developer/reference/user_interface/view_architectures.rst:3423
msgid "string (default: ``''``)"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2908
#: ../../content/developer/reference/user_interface/view_architectures.rst:3425
msgid "This view title is displayed only if you open an action that has no name and whose target is 'new' (opening a dialog)"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:0
#: ../../content/developer/tutorials/restrict_data_access.rst:158
msgid "create"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2912
#: ../../content/developer/reference/user_interface/view_architectures.rst:2917
#: ../../content/developer/reference/user_interface/view_architectures.rst:2922
#: ../../content/developer/reference/user_interface/view_architectures.rst:3429
#: ../../content/developer/reference/user_interface/view_architectures.rst:3434
#: ../../content/developer/reference/user_interface/view_architectures.rst:3439
msgid "bool (default: ``True``)"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:0
msgid "edit"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:0
#: ../../content/developer/tutorials/restrict_data_access.rst:158
msgid "delete"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2924
#: ../../content/developer/reference/user_interface/view_architectures.rst:3441
msgid "Disable/enable record deletion on the view through the **Action** dropdown."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2928
#: ../../content/developer/reference/user_interface/view_architectures.rst:3446
msgid "``date_start`` (required)"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2929
msgid "name of the record's field holding the start date for the event"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2932
msgid "``date_stop``"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2931
msgid "name of the record's field holding the end date for the event, if ``date_stop`` is provided records become movable (via drag and drop) directly in the calendar"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2935
msgid "``date_delay``"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2935
msgid "alternative to ``date_stop``, provides the duration of the event instead of its end date (unit: day)"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2940
#: ../../content/developer/reference/user_interface/view_architectures.rst:3460
#: ../../content/developer/tutorials/backend.rst:901
msgid "``color``"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2938
msgid "name of a record field to use for *color segmentation*. Records in the same color segment are allocated the same highlight color in the calendar, colors are allocated semi-randomly. Displayed the display_name/avatar of the visible record in the sidebar"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2944
#: ../../content/developer/reference/user_interface/view_architectures.rst:3601
msgid "``form_view_id``"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2943
msgid "view to open when the user create or edit an event. Note that if this attribute is not set, the calendar view will fall back to the id of the form view in the current action, if any."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2948
msgid "``event_open_popup``"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2947
msgid "If the option 'event_open_popup' is set to true, then the calendar view will open events (or records) in a FormViewDialog. Otherwise, it will open events in a new form view (with a do_action)"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2953
msgid "``quick_create``"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2951
msgid "enables quick-event creation on click: only asks the user for a ``name`` (the field to which this values is saved can be controlled through ``rec_name``) and tries to create a new event with just that and the clicked event time. Falls back to a full form dialog if the quick creation fails"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2956
msgid "``quick_create_view_id``"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2956
msgid "View to open when the attribute ``quick_create`` is set and the user creates an event instead of the default dialog."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2959
msgid "``create_name_field``"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2959
msgid "name of the record's field holding the textual representation of the record, this is used when creating records through the 'quick create' mechanism"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2962
msgid "``all_day``"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2962
msgid "name of a boolean field on the record indicating whether the corresponding event is flagged as day-long (and duration is irrelevant)"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2965
msgid "``mode``"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2965
msgid "Default display mode when loading the calendar. Possible attributes are: ``day``, ``week``, ``month``, ``year``"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2968
#: ../../content/developer/reference/user_interface/view_architectures.rst:3578
msgid "``scales``"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2968
msgid "Comma-separated list of scales to provide. By default, all scales are available. See mode for possible scale values."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2971
msgid "``create``, ``delete``"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2971
msgid "allows disabling the corresponding action in the view by setting the corresponding attribute to ``false``"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2993
msgid "``<field>``"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2974
msgid "declares fields to aggregate or to use in kanban *logic*. If the field is simply displayed in the calendar cards."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2977
msgid "Fields can have additional attributes:"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2981
msgid "``invisible``"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2982
msgid "use \"True\" to hide the value in the cards"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2984
msgid "``avatar_field``"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2984
msgid "only for x2many field, to display the avatar instead of the display_name in the cards"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2988
msgid "``write_model`` and ``write_field`` and ``filter_field``"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2987
msgid "you can add a filter and save the result in the defined model, the filter is added in the sidebar. The ``filter_field`` is optional and allows you to specify the field that will hold the status of the filter."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2993
msgid "``filters`` and ``color``"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2991
msgid "use \"True\" to add this field in filter in the sidebar. You can specify a ``color`` field used to colorize the checkbox."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:2996
msgid "Model Commons"
msgstr ""
#: ../../docstring of odoo.addons.base.models.ir_ui_view.Model._date_name:1
msgid "field to use for default calendar view"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3005
msgid "Activity"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3007
msgid "The Activity view is used to display the activities linked to the records. The data are displayed in a chart with the records forming the rows and the activity types the columns. The first cell of each row displays a (customizable, see ``templates``, quite similarly to :ref:`reference/view_architectures/kanban`) card representing the corresponding record. When clicking on others cells, a detailed description of all activities of the same type for the record is displayed."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3016
msgid "The Activity view is only available when the ``mail`` module is installed, and for the models that inherit from the ``mail.activity.mixin``."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3019
msgid "The root element of the Activity view is ``<activity>``, it accepts the following attributes:"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3025
#: ../../content/developer/reference/user_interface/view_architectures.rst:3096
msgid "``string`` (mandatory)"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3025
#: ../../content/developer/reference/user_interface/view_architectures.rst:3096
msgid "A title, which should describe the view"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3027
msgid "Possible children of the view element are:"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3032
msgid "declares fields to use in activity *logic*. If the field is simply displayed in the activity view, it does not need to be pre-declared."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3035
msgid "Possible attributes are:"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3040
msgid "``name`` (required)"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3040
msgid "the name of the field to fetch"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3060
#: ../../content/developer/reference/user_interface/view_architectures.rst:3596
msgid "``templates``"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3043
msgid "defines the :ref:`reference/qweb` templates. Cards definition may be split into multiple templates for clarity, but activity views *must* define at least one root template ``activity-box``, which will be rendered once for each record."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3048
msgid "The activity view uses mostly-standard :ref:`javascript qweb <reference/qweb/javascript>` and provides the following context variables (see :ref:`reference/view_architectures/kanban` for more details):"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3056
#: ../../content/developer/reference/user_interface/view_architectures.rst:3592
msgid "``widget``"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3055
msgid "the current :js:class:`ActivityRecord`, can be used to fetch some meta-information. These methods are also available directly in the template context and don't need to be accessed via ``widget``"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3059
msgid "an object with all the requested fields as its attributes. Each field has two attributes ``value`` and ``raw_value``"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3065
msgid "Cohort"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3071
msgid "The cohort view is used to display and understand the way some data changes over a period of time. For example, imagine that for a given business, clients can subscribe to some service. The cohort view can then display the total number of subscriptions each month, and study the rate at which client leave the service (churn). When clicking on a cell, the cohort view will redirect you to a new action in which you will only see the records contained in the cell's time interval; this action contains a list view and a form view."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3079
msgid "By default the cohort view will use the same list and form views as those defined on the action. You can pass a list view and a form view to the context of the action in order to set/override the views that will be used (the context keys to use being `form_view_id` and `list_view_id`)"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3084
msgid "For example, here is a very simple cohort view:"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3090
msgid "The root element of the Cohort view is <cohort>, it accepts the following attributes:"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3100
msgid "``date_start`` (mandatory)"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3099
msgid "A valid date or datetime field. This field is understood by the view as the beginning date of a record"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3104
msgid "``date_stop`` (mandatory)"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3103
msgid "A valid date or datetime field. This field is understood by the view as the end date of a record. This is the field that will determine the churn."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3107
msgid "Set to ``1`` to prevent from redirecting clicks on cohort cells to list view."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3112
msgid "``mode`` (optional)"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3110
msgid "A string to describe the mode. It should be either 'churn' or 'retention' (default). Churn mode will start at 0% and accumulate over time whereas retention will start at 100% and decrease over time."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3118
msgid "``timeline`` (optional)"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3115
msgid "A string to describe the timeline. It should be either 'backward' or 'forward' (default). Forward timeline will display data from date_start to date_stop, whereas backward timeline will display data from date_stop to date_start (when the date_start is in future / greater than date_stop)."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3121
msgid "A string to describe a time interval. It should be 'day', 'week', 'month'' (default) or 'year'."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3126
msgid "``measure`` (optional)"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3125
msgid "A field that can be aggregated. This field will be used to compute the values for each cell. If not set, the cohort view will count the number of occurrences."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3144
msgid "``<field>`` (optional)"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3129
msgid "allows to specify a particular field in order to manage it from the available measures, it's main use is for hiding a field from the selectable measures:"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3135
msgid "the name of the field to use in the view."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3137
msgid "the name that would be used to display the field in the cohort view, overrides the default python String attribute of the field."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3140
msgid "if true, the field will not appear either in the active measures nor in the selectable measures (useful for fields that do not make sense aggregated, such as fields in different units, e.g. € and $). If the value is a domain, the domain is evaluated in the context of the current row's record, if ``True`` the corresponding attribute is set on the cell."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3151
msgid "Grid"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3160
msgid "This view is a work in progress and may have to be expanded or altered."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3162
msgid "only ``date`` column fields have been tested, ``selection`` and ``many2one`` are nominally implemented and supported but have not been tested, ``datetime`` is not implemented at all."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3165
msgid "column cells are hardly configurable and must be numerical"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3166
msgid "cell adjustment is disabled by default and must be configured to be enabled"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3167
msgid "``create``, ``edit`` and ``delete`` ACL metadata doesn't get automatically set on the view root due to limitations in ``fields_view_get`` post-processing (there's a fixed explicit list of the view types getting those attributes)"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3173
msgid "Schema"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3175
msgid "The grid view has its own schema and additional validation in this module. The view architecture is:"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3232
msgid "``<grid>`` (1)"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3179
msgid "architecture root element"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3181
msgid "mandatory ``string`` attribute"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3182
msgid "optional ``create``, ``edit`` and ``delete`` attributes"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3183
msgid "optional ``adjustment`` and ``adjust_name`` attributes"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3185
msgid "``adjustment`` can be either ``object`` or ``action`` to indicate whether a cell's adjustment should be performed through a method call or an action execution. ``adjust_name`` provides respectively the method name and the action id."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3190
msgid "In both cases, the adjustment parameters are provided as a ``grid_adjust`` context member, in the ``object`` case, the parameters are also provided as positional function parameters (next to an empty list of ids):"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3195
msgid "``row_domain``"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3196
msgid "the domain matching the entire row of the adjusted cell"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3197
msgid "``column_field``"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3198
msgid "the name of the column for the adjusted cell"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3199
msgid "``column_value``"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3200
msgid "the value of the column for the adjusted cell"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3201
msgid "``cell_field``"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3202
msgid "the measure field of the adjusted cell"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3205
msgid "``change``"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3204
msgid "the difference between the old value of the cell and the adjusted one, may be positive or negative"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3207
msgid "optional ``hide_line_total`` and ``hide_column_total`` attributes"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3209
msgid "``hide_line_total``"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3210
msgid "set to true to hide total line (default false)"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3212
msgid "``hide_column_total``"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3212
msgid "set to true to hide total column (default false)"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3214
msgid "optional ``barchart_total`` attribute"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3218
msgid "``barchart_total``"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3217
msgid "set to ``true`` in order to display a bar chart at the bottom of the grid, based on the totals of the columns (default false)."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3220
msgid "optional ``create_inline`` and ``display_empty`` attributes"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3226
msgid "``create_inline``"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3223
msgid "set to ``true`` in order to display an additional row at bottom of the grid with an ``Add a line`` button (default false). When this option is set to ``true``, the ``Add a line`` button from the control panel is hidden. When no data is available and when ``display_empty`` is not set (so when the help content is displayed), the the ``Add a line`` button from the control panel is shown in order to let the user create a first record."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3232
msgid "``display_empty``"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3229
msgid "set to ``true`` in order to keep displaying the grid when there is no data (default false). This can be useful when you want the user to be able to keep track of the current period (as dates are displayed in the columns headers). As a reminder, when no data are present and when this attribute is no set, the help content is displayed instead of the grid."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3248
msgid "``<button>`` (0+)"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3235
msgid "Regular Odoo action buttons, displayed in the view header"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3237
msgid "mandatory ``string`` attribute (the button label)"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3238
msgid "mandatory ``type`` attribute, either ``object`` or ``action``"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3240
msgid "workflow buttons are not supported"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3242
msgid "mandatory ``name`` attribute, either the name of the method to call, or the ID of the action to execute"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3244
msgid "optional ``context``"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3246
msgid "The server callback is provided with all the record ids displayed in the view, either as the ids passed to the method (``object`` button) or as the context's ``active_ids`` (``action`` buttons)"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3256
msgid "``<field type=\"row\">`` (1+)"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3251
msgid "Row grouping fields, will be replaced by the search view's groupby filter if any."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3254
msgid "The order of ``row`` fields in the view provides their grouping depth: if the first field is ``school`` and the second is ``age`` the records will be grouped by ``school`` first and by ``age`` within each school."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3277
msgid "``<field type=\"col\">`` (1)"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3259
msgid "Column grouping field."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3261
msgid "The col field can contain 0+ ``<range>`` elements which specify customisable column ranges. ``range`` elements have the following mandatory attributes"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3266
msgid "can be used to override the default range (the first one by default) through the ``grid_range`` context value"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3269
msgid "the range button's label (user-visible)"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3273
msgid "``span``"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3271
msgid "symbolic name of the span of all columns to display at once in the view, may trigger pagination."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3274
msgid "For ``date`` fields, valid spans are currently ``week`` and ``month``."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3277
msgid "``step``"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3276
msgid "symbolic name of the step between one column and the previous/next"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3278
msgid "For ``date`` fields, the only valid span is currently ``day``."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3283
msgid "``<field type=\"measure\">`` (1)"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3280
msgid "Cell field, automatically accumulated (by ``read_group``)."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3282
msgid "The measure field can take a ``widget`` attribute to customise its display."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3286
msgid "Server interactions"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3288
msgid "Aside from optional buttons, the grid view currently calls two methods:"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3290
msgid "``read_grid`` (provided on all models by the module) returns almost the entirety of the grid's content as a dict:"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3293
msgid "the row titles is a list of dictionaries with the following keys:"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3296
#: ../../content/developer/reference/user_interface/view_architectures.rst:3304
msgid "``values`` (required)"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3296
msgid "this maps to a dictionary with a key per ``row`` field, the values are *always* of the form ``[value, label]``."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3300
#: ../../content/developer/reference/user_interface/view_architectures.rst:3306
msgid "``domain`` (required)"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3299
msgid "the domain of any record at the source of this row, in case it's necessary to copy a record during cell adjustment"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3302
msgid "the column titles is a list of dictionaries with at least one key:"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3305
msgid "see row title values"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3307
msgid "see column domain value"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3309
msgid "``current`` (optional)"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3309
msgid "boolean, marks/highlights a column"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3311
msgid "the grid data as a list (of rows) of list (of cells) of cell dicts each with the following keys:"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3315
msgid "the numeric value associated with the cell"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3317
msgid "the domain matching the cell's records (should be assumed opaque)"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3318
msgid "``size``"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3319
msgid "the number of records grouped in the cell"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3321
msgid "``readonly`` (optional)"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3321
msgid "a boolean indicating that this specific cell should not be client-editable"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3328
msgid "``classes`` (optional)"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3324
msgid "a list of classes (as strings) to add on the cell's container (between the cell's TD and the cell's potentially-editable element)."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3327
msgid "In case of conflicts between this list and the base classes (prefixed with ``o_grid_cell_``), the classes in this list are ignored."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3330
msgid "Note that the grid data is *dense*, if querying the database yields no group matching a cell a cell will generate an \"empty\" cell with default values for required keys."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3333
msgid "``prev`` and ``next`` which can be either falsy (no pagination) or a context item to merge into the view's own context to ``read_grid`` the previous or next page, it should be assumed to be opaque"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3337
msgid "``read_grid_domain(field, range)`` (provided on al models by the module) returns the domain matching the current configured \"span\" of the grid. This is also done internally by ``read_grid``, but can be useful or necessary to call independently to use with separate e.g. ``search_count`` or ``read_group``."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3343
msgid "``adjust_grid``, for which there currently isn't a blanket implementation and whose semantics are likely to evolve with time and use cases"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3347
msgid "Server Hooks"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3349
msgid "``read_grid`` calls a number of hooks allowing the customisation of its operations from within without having to override the entire method:"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3353
msgid "``_grid_format_cell(group, cell_field)``"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3353
msgid "converts the output of a read_group (group-by-group) into cells in the format described above (as part of \"the grid data\")"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3355
msgid "``_grid_make_empty_cell(row_domain, column_domain, view_domain)``"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3356
msgid "generates an empty version of a cell (if there is no corresponding group)"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3386
msgid "``_grid_column_info(name, range)``"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3358
msgid "generates a ColumnMetadata object based on the column type, storing values either returned directly (as part of ``read_grid``) or used query and reformat ``read_group`` into ``read_grid``:"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3362
msgid "``grouping``"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3363
msgid "the actual grouping field/query for the columns"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3365
msgid "domain to apply to ``read_group`` in case the column field is paginated, can be an empty list"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3369
msgid "``prev`` and ``next``"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3368
msgid "context segments which will be sent to ``read_grid`` for pages before and after the current one. If ``False``, disables pagination in that direction"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3376
#: ../../content/developer/reference/user_interface/view_architectures.rst:3386
msgid "``values``"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3372
msgid "column values to display on the \"current page\", each value is a dictionary with the following keys:"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3376
msgid "dictionary mapping field names to values for the entire column, usually just ``name`` -> a value"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3379
msgid "domain matching this specific column"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3381
msgid "``is_current``"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3381
msgid "``True`` if the current column should be specifically outlined in the grid, ``False`` otherwise"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3384
msgid "how to format the values of that column/type from ``read_group`` formatting to ``read_grid`` formatting (matching ``values`` in ColumnInfo)"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3389
msgid "ACL"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3391
msgid "if the view is not editable, individual cells won't be editable"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3392
msgid "if the view is not creatable, the ``Add a Line`` button will not be displayed (it currently creates a new empty record)"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3396
msgid "Context Keys"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3399
msgid "``grid_range``"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3399
msgid "selects which range should be used by default if the view has multiple ranges"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3406
msgid "``grid_anchor``"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3402
msgid "if applicable, used as the default anchor of column ranges instead of whatever ``read_grid`` defines as its default."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3405
msgid "For date fields, the reference date around which the initial span will be computed. The default date anchor is \"today\" (in the user's timezone)"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3411
#: ../../content/developer/tutorials/backend.rst:971
msgid "Gantt"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3417
msgid "Gantt views appropriately display Gantt charts (for scheduling)."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3419
msgid "The root element of gantt views is ``<gantt/>``, it has no children but can take the following attributes:"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3446
msgid "name of the field providing the start datetime of the event for each record."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3449
msgid "``date_stop`` (required)"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3449
msgid "name of the field providing the end duration of the event for each record."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3454
msgid "``dependency_field``"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3452
msgid "name of the ``many2many`` field that provides the dependency relation between two records. If B depends on A, ``dependency_field`` is the field that allows getting A from B. Both this field and ``dependency_inverted_field`` field are used to draw dependency arrows between pills and reschedule them."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3458
msgid "``dependency_inverted_field`` (required if ``dependency_field`` is provided)"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3457
msgid "name of the ``many2many`` field that provides the invert dependency relation than ``dependency_field``. If B depends on A, ``dependency_inverted_field`` is the field that allows getting B from A."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3461
msgid "name of the field used to color the pills according to its value"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3489
#: ../../content/developer/tutorials/backend.rst:879
msgid "``decoration-{$name}``"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3463
msgid "`python expression`_ that evaluates to a bool"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3465
msgid "allow changing the style of a cell's text based on the corresponding record's attributes."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3468
msgid "``{$name}`` can be one of the following `bootstrap contextual color`_ (``danger``, ``info``, ``secondary``, ``success`` or ``warning``)."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3471
msgid "Define a conditional display of a record in the style of a row's text based on the corresponding record's attributes."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3474
#: ../../content/developer/tutorials/backend.rst:858
msgid "Values are Python expressions. For each record, the expression is evaluated with the record's attributes as context values and if ``true``, the corresponding style is applied to the row. Here are some of the other values available in the context:"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3479
#: ../../content/developer/tutorials/backend.rst:863
msgid "``uid``: the id of the current user,"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3480
#: ../../content/developer/tutorials/backend.rst:864
msgid "``today``: the current local date as a string of the form ``YYYY-MM-DD``,"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3481
#: ../../content/developer/tutorials/backend.rst:865
msgid "``now``: same as ``today`` with the addition of the current time. This value is formatted as ``YYYY-MM-DD hh:mm:ss``."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3491
msgid "``default_group_by``"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3492
msgid "name of a field to group tasks by"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3493
msgid "``disable_drag_drop``"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3494
msgid "if set to true, the gantt view will not have any drag&drop support"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3495
msgid "``consolidation``"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3496
msgid "field name to display consolidation value in record cell"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3499
msgid "``consolidation_max``"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3498
msgid "dictionary with the \"group by\" field as key and the maximum consolidation value that can be reached before displaying the cell in red (e.g. ``{\"user_id\": 100}``)"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3503
msgid "``consolidation_exclude``"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3502
msgid "name of the field that describes if the task has to be excluded from the consolidation if set to true it displays a striped zone in the consolidation line"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3520
msgid "``create``, ``cell_create``, ``edit``, ``delete``, ``plan``"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3506
msgid "allows *dis*\\ abling the corresponding action in the view by setting the corresponding attribute to ``false`` (default: ``true``)."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3509
msgid "``create``: If enabled, an ``Add`` button will be available in the control panel to create records."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3511
msgid "``cell_create``: If enabled and ``create`` enabled, a \"**+**\" button will be displayed while hovering on a time slot cell to create a new record on that slot."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3513
msgid "``edit``: If enabled, the opened records will be in edit mode (thus editable)."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3514
msgid "``plan``: If enabled and ``edit`` enabled, a \"magnifying glass\" button will be displayed on time slots to plan unassigned records into that time slot."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3519
msgid "When you do not want to create records on the gantt view and the beginning and end dates are required on the model, the planning feature should be disabled because no record will ever be found."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3525
msgid "``offset``"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3523
msgid "Depending on the scale, the number of units to add to today to compute the default period. Examples: An offset of +1 in default_scale week will open the gantt view for next week, and an offset of -2 in default_scale month will open the gantt view of 2 months ago."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3528
msgid "``progress``"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3528
msgid "name of a field providing the completion percentage for the record's event, between 0 and 100"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3531
msgid "title of the gantt view"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3556
msgid "``precision``"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3533
msgid "JSON object specifying snapping precisions for the pills in each scale."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3535
msgid "Possible values for scale ``day`` are (default: ``hour``):"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3537
msgid "``hour``: records times snap to full hours (ex: 7:12 becomes 8:00)"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3539
msgid "``hour:half``: records times snap to half hours (ex: 7:12 becomes 7:30)"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3541
msgid "``hour:quarter``: records times snap to half hours (ex: 7:12 becomes 7:15)"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3543
msgid "Possible values for scale ``week`` are (default: ``day:half``):"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3545
#: ../../content/developer/reference/user_interface/view_architectures.rst:3551
msgid "``day``: records times snap to full days (ex: 7:28 AM becomes 11:59:59 PM of the previous day, 10:32 PM becomes 12:00 PM of the current day)"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3547
#: ../../content/developer/reference/user_interface/view_architectures.rst:3553
msgid "``day:half``: records times snap to half hours (ex: 7:28 AM becomes 12:00 PM)"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3549
msgid "Possible values for scale ``month`` are (default: ``day:half``):"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3555
msgid "Scale ``year`` always snap to full day."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3557
msgid "Example of precision attribute: ``{\"day\": \"hour:quarter\", \"week\": \"day:half\", \"month\": \"day\"}``"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3559
msgid "``total_row``"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3559
msgid "boolean to control whether the row containing the total count of records should be displayed. (default: ``false``)"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3562
msgid "``collapse_first_level``"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3562
msgid "boolean to control whether it is possible to collapse each row if grouped by one field. (default: ``false``, the collapse starts when grouping by two fields)"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3566
msgid "``display_unavailability``"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3565
msgid "boolean to mark the dates returned by the ``gantt_unavailability`` function of the model as available inside the gantt view. Records can still be scheduled in them, but their unavailability is visually displayed. (default: ``false``)"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3574
msgid "``default_scale``"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3569
msgid "default scale when rendering the view. Possible values are (default: ``month``):"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3571
msgid "``day``"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3572
msgid "``week``"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3573
msgid "``month``"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3574
msgid "``year``"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3577
msgid "comma-separated list of allowed scales for this view. By default, all scales are allowed. For possible scale values to use in this list, see ``default_scale``."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3581
msgid "defines the :ref:`reference/qweb` template ``gantt-popover`` which is used when the user hovers over one of the records in the gantt view."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3584
msgid "The gantt view uses mostly-standard :ref:`javascript qweb <reference/qweb/javascript>` and provides the following context variables:"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3590
msgid "the current :js:class:`GanttRow`, can be used to fetch some meta-information. The ``getColor`` method to convert in a color integer is also available directly in the template context without using ``widget``."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3596
msgid "``on_create``"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3595
msgid "If specified when clicking the add button on the view, instead of opening a generic dialog, launch a client action. this should hold the xmlid of the action (eg: ``on_create=\"%(my_module.my_wizard)d\"``"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3599
msgid "view to open when the user create or edit a record. Note that if this attribute is not set, the gantt view will fall back to the id of the form view in the current action, if any."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3605
msgid "``dynamic_range``"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3604
msgid "if set to true, the gantt view will start at the first record, instead of starting at the beginning of the year/month/day."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3609
msgid "``pill_label``"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3608
msgid "If set to true, the time appears in the pill label when the scale is set on week or month. (e.g. `7:00 AM - 11:00 AM (4h) - DST Task 1`)"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3628
msgid "``thumbnails``"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3612
msgid "This allows to display a thumbnail next to groups name if the group is a relationnal field. This expects a python dict which keys are the name of the field on the active model. Values are the names of the field holding the thumbnail on the related model."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3616
msgid "Example: tasks have a field user_id that reference res.users. The res.users model has a field image that holds the avatar, then:"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3628
msgid "will display the users avatars next to their names when grouped by user_id."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3641
msgid "This view is able to display records on a map and the routes between them. The records are represented by pins. It also allows the visualization of fields from the model in a popup tied to the record's pin."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3645
msgid "The model on which the view is applied should contain a `res.partner` many2one since the view relies on the `res.partner`'s address and coordinates fields to localize the records."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3650
msgid "The view uses location data platforms' API to fetch the tiles (the map's background), do the geoforwarding (converting addresses to a set of coordinates) and fetch the routes. The view implements two API, OpenStreetMap and MapBox. OpenStreetMap is used by default and is able to fetch `tiles`_ and do `geoforwarding`_. This API does not require a token. As soon as a valid `MapBox`_ token is provided in the general settings the view switches to the MapBox API. This API is faster and allows the computation of routes. A token can be obtained by `signing up`_ to MapBox."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3657
msgid "The view's root element is ``<map>``. It can have the following attributes:"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3662
msgid "``res_partner``"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3663
msgid "Contains the `res.partner` many2one. If not provided the view resorts to create an empty map."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3664
msgid "``default_order``"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3665
msgid "If a field is provided the view overrides the model's default order. The field must be part of the model on which the view is applied, not from `res.partner`."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3666
msgid "``routing``"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3667
msgid "if ``1`` display the routes between the records. The view needs a valid MapBox token and at least two located records (i.e the records have a `res.partner` many2one and the partner has an address or valid coordinates)."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3668
msgid "``hide_name``"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3669
msgid "if ``1`` hide the name from the pin's popup (default: ``0``)."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3670
msgid "``hide_address``"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3671
msgid "if ``1`` hide the address from the pin's popup (default: ``0``)."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3672
msgid "``hide_title``"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3673
msgid "if ``1`` hide the title from the pin list (default: ``0``)."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3674
msgid "``panel_title``"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3675
msgid "String to display as title of the pin list. If not provided, the title is the action's name or \"Items\" if the view is not in an action."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3677
msgid "``limit``"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3677
msgid "Maximum number of records to fetch (default: ``80``). It must be a positive integer."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3679
msgid "The ``<map>`` element can contain multiple ``<field>`` elements. Each ``<field>`` element is interpreted as a line in the pin's popup. The field's attributes are the following:"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3684
msgid "The field to display."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3686
msgid "String to display before the field's content. It can be used as a description."
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures.rst:3693
msgid "For example here is a map:"
msgstr ""
#: ../../content/developer/reference/user_interface/view_architectures/root_attribute_banner_route.rst:13
msgid "To interact with the backend, use `<a type=\"action\">` tags. For more details, refer to the documentation of the `_onActionClicked` method in `AbstractController <https://github.com/odoo/odoo/blob/17.0/addons/web/static/src/js/views/abstract_controller.js>`_."
msgstr ""
#: ../../content/developer/reference/user_interface/view_records.rst:3
msgid "View records"
msgstr ""
#: ../../content/developer/reference/user_interface/view_records.rst:5
msgid "Views are what define how records should be displayed to end-users. They are specified in XML and stored as records themselves, meaning they can be edited independently from the models that they represent. They are flexible and allow a high level of customization of the screens that they control. There exist various :ref:`types of views <reference/view_records/types>`. Each represents a visualization mode: *form*, *list*, *kanban*, etc."
msgstr ""
#: ../../content/developer/reference/user_interface/view_records.rst:14
msgid "Generic structure"
msgstr ""
#: ../../content/developer/reference/user_interface/view_records.rst:16
msgid "Basic views generally share the common minimal structure defined below. Placeholders are denoted in all caps."
msgstr ""
#: ../../content/developer/reference/user_interface/view_records.rst:34
msgid "View types"
msgstr ""
#: ../../content/developer/reference/user_interface/view_records.rst:36
msgid ":ref:`Form <reference/view_architectures/form>`"
msgstr ""
#: ../../content/developer/reference/user_interface/view_records.rst:37
msgid "Display and edit the data from a single record."
msgstr ""
#: ../../content/developer/reference/user_interface/view_records.rst:38
msgid ":ref:`List <reference/view_architectures/list>`"
msgstr ""
#: ../../content/developer/reference/user_interface/view_records.rst:39
msgid "View and edit multiple records."
msgstr ""
#: ../../content/developer/reference/user_interface/view_records.rst:40
msgid ":ref:`Search <reference/view_architectures/search>`"
msgstr ""
#: ../../content/developer/reference/user_interface/view_records.rst:41
msgid "Apply filters and perform searches. The results are displayed in the current list, kanban... view."
msgstr ""
#: ../../content/developer/reference/user_interface/view_records.rst:42
msgid ":ref:`Kanban <reference/view_architectures/kanban>`"
msgstr ""
#: ../../content/developer/reference/user_interface/view_records.rst:43
msgid "Display records as \"cards\", configurable as a small template."
msgstr ""
#: ../../content/developer/reference/user_interface/view_records.rst:44
msgid ":ref:`Qweb <reference/view_architectures/qweb>`"
msgstr ""
#: ../../content/developer/reference/user_interface/view_records.rst:45
msgid "Templating of reporting, website..."
msgstr ""
#: ../../content/developer/reference/user_interface/view_records.rst:46
msgid ":ref:`Graph <reference/view_architectures/graph>`"
msgstr ""
#: ../../content/developer/reference/user_interface/view_records.rst:47
msgid "Visualize aggregations over a number of records or record groups."
msgstr ""
#: ../../content/developer/reference/user_interface/view_records.rst:48
msgid ":ref:`Pivot <reference/view_architectures/pivot>`"
msgstr ""
#: ../../content/developer/reference/user_interface/view_records.rst:49
msgid "Display aggregations as a `pivot table <https://en.wikipedia.org/wiki/Pivot_table>`_."
msgstr ""
#: ../../content/developer/reference/user_interface/view_records.rst:50
msgid ":ref:`Calendar <reference/view_architectures/calendar>`"
msgstr ""
#: ../../content/developer/reference/user_interface/view_records.rst:51
msgid "Display records as events in a daily, weekly, monthly, or yearly calendar."
msgstr ""
#: ../../content/developer/reference/user_interface/view_records.rst:52
msgid ":ref:`Cohort <reference/view_architectures/cohort>` |enterprise|"
msgstr ""
#: ../../content/developer/reference/user_interface/view_records.rst:53
msgid "Display and understand the way some data changes over a period of time."
msgstr ""
#: ../../content/developer/reference/user_interface/view_records.rst:54
msgid ":ref:`Gantt <reference/view_architectures/gantt>` |enterprise|"
msgstr ""
#: ../../content/developer/reference/user_interface/view_records.rst:55
msgid "Display records as a Gantt chart."
msgstr ""
#: ../../content/developer/reference/user_interface/view_records.rst:56
msgid ":ref:`Grid <reference/view_architectures/grid>` |enterprise|"
msgstr ""
#: ../../content/developer/reference/user_interface/view_records.rst:57
msgid "Display computed information in numerical cells; are hardly configurable."
msgstr ""
#: ../../content/developer/reference/user_interface/view_records.rst:59
msgid ":ref:`Map <reference/view_architectures/map>` |enterprise|"
msgstr ""
#: ../../content/developer/reference/user_interface/view_records.rst:59
msgid "Display records on a map, and the routes between them."
msgstr ""
#: ../../content/developer/reference/user_interface/view_records.rst:70
msgid "View records expose a number of fields."
msgstr ""
#: ../../content/developer/reference/user_interface/view_records.rst:76
msgid "Only useful as a mnemonic/description of the view when looking for one in a list of some sort. Most Odoo view names start with the name of the addon and end with the type of view being discussed."
msgstr ""
#: ../../content/developer/reference/user_interface/view_records.rst:85
msgid "The model linked to the view, if applicable."
msgstr ""
#: ../../content/developer/reference/user_interface/view_records.rst:92
msgid "The description of the view layout depending on the :doc:`view type <view_architectures>`."
msgstr ""
#: ../../content/developer/reference/user_interface/view_records.rst:95
msgid ":class:`~odoo.fields.Text`"
msgstr ""
#: ../../content/developer/reference/user_interface/view_records.rst:99
msgid "The groups allowed to use/access the current view."
msgstr ""
#: ../../content/developer/reference/user_interface/view_records.rst:101
msgid "If the view extends an existing view, the extension will be applied only for a given user, if that user has access to the provided `groups_id`."
msgstr ""
#: ../../content/developer/reference/user_interface/view_records.rst:105
msgid ":class:`~odoo.fields.Many2many` -> :class:`~odoo.addons.base.models.res_users.Groups`"
msgstr ""
#: ../../content/developer/reference/user_interface/view_records.rst:109
msgid "When requesting a view by specifying the `model` and `type`, the matching view with the lowest priority is returned (it is the default view)."
msgstr ""
#: ../../content/developer/reference/user_interface/view_records.rst:112
msgid "It also defines the order of views application during :ref:`view resolution <reference/view_records/inheritance/resolution>`. When a view is requested by `id` and its mode is not `primary`, its *closest* parent with `mode` = `primary` is matched."
msgstr ""
#: ../../content/developer/reference/user_interface/view_records.rst:117
msgid ":class:`~odoo.fields.Integer`"
msgstr ""
#: ../../content/developer/reference/user_interface/view_records.rst:121
msgid "Reference to the parent view on which the :ref:`inheritance <reference/view_records/inheritance>` will be applied. Its value is used by default. Specify the parent using the `ref` attribute with :code:`ref=\"ADDON.MODEL_parent_view_TYPE\"`."
msgstr ""
#: ../../content/developer/reference/user_interface/view_records.rst:125
msgid "The addon name (before the dot) is not necessary if the inheritance is done on a record of the same module."
msgstr ""
#: ../../content/developer/reference/user_interface/view_records.rst:128
#: ../../content/developer/reference/user_interface/view_records.rst:157
msgid "See :ref:`reference/view_records/inheritance` for more information."
msgstr ""
#: ../../content/developer/reference/user_interface/view_records.rst:135
msgid "Only applies if this view inherits from an other one (`inherit_id` is set)."
msgstr ""
#: ../../content/developer/reference/user_interface/view_records.rst:139
msgid "If the view is requested, the closest primary view is looked up (via `inherit_id`). Then, all views inheriting from it with this view's model are applied."
msgstr ""
#: ../../content/developer/reference/user_interface/view_records.rst:144
msgid "The closest primary view is fully resolved (even if it uses a different model than the current one). Then, the view's :ref:`inheritance specs <reference/view_records/inheritance/specs>` are applied, and the result is used as if it were this view's actual arch."
msgstr ""
#: ../../content/developer/reference/user_interface/view_records.rst:149
msgid "A case in which one would want to override `mode` while using `inherit_id` is delegation inheritance. In that case, your derived model is separated from its parent, and views matching with one won't match with the other. Assuming one inherits from a view associated with the parent model and wants to customize the derived view to show data from the derived model, the `mode` of the derived view needs to be set to `primary` because it is the base (and maybe only) view for that derived model. Otherwise, the :ref:`view matching <reference/view_records/inheritance/resolution>` rules won't apply."
msgstr ""
#: ../../content/developer/reference/user_interface/view_records.rst:160
msgid ":class:`~odoo.fields.Selection`: `extension` / `primary`"
msgstr ""
#: ../../content/developer/reference/user_interface/view_records.rst:161
msgid "`extension`"
msgstr ""
#: ../../content/developer/reference/user_interface/view_records.rst:164
msgid "The current context and user access rights may also impact the view abilities."
msgstr ""
#: ../../content/developer/reference/user_interface/view_records.rst:171
msgid "Inheritance allows for customizing delivered views. It makes it possible, for example, to add content as modules are installed, or to deliver different displays according to the action."
msgstr ""
#: ../../content/developer/reference/user_interface/view_records.rst:174
msgid "Inherit views generally share the common structure defined below. Placeholders are denoted in all caps. This synthetic view will update a node targeted by an XPath, and another targeted by its name and attributes."
msgstr ""
#: ../../content/developer/reference/user_interface/view_records.rst:194
msgid "The `inherit_id` and `mode` fields determine the :ref:`view resolution <reference/view_records/inheritance/resolution>`. The `xpath` or `NODE` elements indicate the :ref:`inheritance specs <reference/view_records/inheritance/specs>`. The `expr` and `position` attributes specify the :ref:`inheritance position <reference/view_records/inheritance/position>`."
msgstr ""
#: ../../content/developer/reference/user_interface/view_records.rst:202
msgid "View resolution"
msgstr ""
#: ../../content/developer/reference/user_interface/view_records.rst:204
msgid "Resolution generates the final `arch` for a requested/matched `primary` view as follow:"
msgstr ""
#: ../../content/developer/reference/user_interface/view_records.rst:206
msgid "if the view has a parent, the parent is fully resolved, then the current view's inheritance specs are applied;"
msgstr ""
#: ../../content/developer/reference/user_interface/view_records.rst:208
msgid "if the view has no parent, its `arch` is used as-is;"
msgstr ""
#: ../../content/developer/reference/user_interface/view_records.rst:209
msgid "the current view's children with mode `extension` are looked up, and their inheritance specs are applied depth-first (a child view is applied, then its children, then its siblings)."
msgstr ""
#: ../../content/developer/reference/user_interface/view_records.rst:212
msgid "The inheritance is applied according to the `inherit_id` field. If several view records inherit the same view, the order is determined by the `priority`."
msgstr ""
#: ../../content/developer/reference/user_interface/view_records.rst:215
msgid "The result of applying children views yields the final `arch`."
msgstr ""
#: ../../content/developer/reference/user_interface/view_records.rst:217
msgid "NOTE on fields_view_get and link to ORM ?"
msgstr ""
#: ../../content/developer/reference/user_interface/view_records.rst:222
msgid "Inheritance specs"
msgstr ""
#: ../../content/developer/reference/user_interface/view_records.rst:224
msgid "Inheritance specs are applied sequentially and are comprised of:"
msgstr ""
#: ../../content/developer/reference/user_interface/view_records.rst:226
msgid "an element locator to match the inherited element in the parent view;"
msgstr ""
#: ../../content/developer/reference/user_interface/view_records.rst:227
msgid "children element to modify the inherited element."
msgstr ""
#: ../../content/developer/reference/user_interface/view_records.rst:229
msgid "There are three types of element locators:"
msgstr ""
#: ../../content/developer/reference/user_interface/view_records.rst:231
msgid "An `xpath` element with an `expr` attribute. `expr` is an `XPath <https://en.wikipedia.org/wiki/XPath>`_ expression\\ [#hasclass]_ applied to the current `arch`, matching the first node it finds;"
msgstr ""
#: ../../content/developer/reference/user_interface/view_records.rst:234
msgid "A `field` element with a `name` attribute, matching the first field with the same `name`."
msgstr ""
#: ../../content/developer/reference/user_interface/view_records.rst:237
msgid "All other attributes are ignored."
msgstr ""
#: ../../content/developer/reference/user_interface/view_records.rst:239
msgid "Any other element, matching the first element with the same `name` and identical attributes."
msgstr ""
#: ../../content/developer/reference/user_interface/view_records.rst:242
msgid "The attributes `position` and `version` are ignored."
msgstr ""
#: ../../content/developer/reference/user_interface/view_records.rst:244
msgid "An extension function is added for simpler matching in QWeb views: `hasclass(*classes)` matches if the context node has all the specified classes."
msgstr ""
#: ../../content/developer/reference/user_interface/view_records.rst:261
msgid "Inheritance position"
msgstr ""
#: ../../content/developer/reference/user_interface/view_records.rst:263
msgid "The inheritance specs accept an optional `position` attribute, defaulting to `inside`, that specifies how the matched node should be modified."
msgstr ""
#: ../../content/developer/reference/user_interface/view_records.rst:268
msgid "The content of the inheritance spec is appended to the matched node."
msgstr ""
#: ../../content/developer/reference/user_interface/view_records.rst:282
msgid "The content of the inheritance spec is appended to the matched node's parent after the matched node."
msgstr ""
#: ../../content/developer/reference/user_interface/view_records.rst:295
msgid "The content of the inheritance spec is appended to the matched node's parent before the matched node."
msgstr ""
#: ../../content/developer/reference/user_interface/view_records.rst:308
msgid "The content of the inheritance spec replaces the matched node. Any text node containing only `$0` within the contents of the spec is replaced by a copy of the matched node, effectively wrapping the matched node."
msgstr ""
#: ../../content/developer/reference/user_interface/view_records.rst:324
msgid "The content of the inheritance spec should be made of only `attribute` elements, each with a `name` attribute and an optional body."
msgstr ""
#: ../../content/developer/reference/user_interface/view_records.rst:327
msgid "If the `attribute` element has a body, a new attributed named after its `name` is added to the matched node with the `attribute` element's text as value."
msgstr ""
#: ../../content/developer/reference/user_interface/view_records.rst:329
msgid "If the `attribute` element has no body, the attribute named after its `name` is removed from the matched node."
msgstr ""
#: ../../content/developer/reference/user_interface/view_records.rst:331
msgid "If the `attribute` element has an `add` attribute, a `remove` attribute, or both, the value of the matched node's attribute named after `name` is recomputed to account for the value(s) of `add`, `remove`, and an optional `separator` attribute defaulting to `,`. `add` includes its value(s), separated by `separator`. `remove` removes its value(s), separated by `separator`."
msgstr ""
#: ../../content/developer/reference/user_interface/view_records.rst:346
msgid "The attribute `position=\"move\"` is set on the content of the inheritance spec to specify how nodes are moved relatively to the inheritance spec's element locator, on which the attribute `position` must also be set, with values `inside`, `replace`, `after`, or `before`."
msgstr ""
#: ../../content/developer/reference/user_interface/view_records.rst:364
msgid "Model commons"
msgstr ""
#: ../../../odoo/odoo/addons/base/models/ir_ui_view.py:docstring of odoo.addons.base.models.ir_ui_view.Model.get_views:1
msgid "Returns the fields_views of given views, along with the fields of the current model, and optionally its filters for the given action."
msgstr ""
#: ../../../odoo/odoo/addons/base/models/ir_ui_view.py:docstring of odoo.addons.base.models.ir_ui_view.Model.get_view:3
#: ../../../odoo/odoo/addons/base/models/ir_ui_view.py:docstring of odoo.addons.base.models.ir_ui_view.Model.get_views:4
msgid "The return of the method can only depend on the requested view types, access rights (views or other records), view access rules, options, context lang and TYPE_view_ref (other context values cannot be used)."
msgstr ""
#: ../../../odoo/odoo/addons/base/models/ir_ui_view.py:docstring of odoo.addons.base.models.ir_ui_view.Model.get_views:8
msgid "Python expressions contained in views or representing domains (on python fields) will be evaluated by the client with all the context values as well as the record values it has."
msgstr ""
#: ../../../odoo/odoo/addons/base/models/ir_ui_view.py:docstring of odoo.addons.base.models.ir_ui_view.Model.get_views:12
msgid "list of [view_id, view_type]"
msgstr ""
#: ../../../odoo/odoo/addons/base/models/ir_ui_view.py:docstring of odoo.addons.base.models.ir_ui_view.Model.get_views:13
msgid "a dict optional boolean flags, set to enable: ``toolbar`` includes contextual actions when loading fields_views ``load_filters`` returns the model's filters ``action_id`` id of the action to get the filters, otherwise loads the global filters or the model"
msgstr ""
#: ../../../odoo/odoo/addons/base/models/ir_ui_view.py:docstring of odoo.addons.base.models.ir_ui_view.Model.get_views:13
msgid "a dict optional boolean flags, set to enable:"
msgstr ""
#: ../../../odoo/odoo/addons/base/models/ir_ui_view.py:docstring of odoo.addons.base.models.ir_ui_view.Model.get_views:15
msgid "``toolbar``"
msgstr ""
#: ../../../odoo/odoo/addons/base/models/ir_ui_view.py:docstring of odoo.addons.base.models.ir_ui_view.Model.get_views:16
msgid "includes contextual actions when loading fields_views"
msgstr ""
#: ../../../odoo/odoo/addons/base/models/ir_ui_view.py:docstring of odoo.addons.base.models.ir_ui_view.Model.get_views:17
msgid "``load_filters``"
msgstr ""
#: ../../../odoo/odoo/addons/base/models/ir_ui_view.py:docstring of odoo.addons.base.models.ir_ui_view.Model.get_views:18
msgid "returns the model's filters"
msgstr ""
#: ../../../odoo/odoo/addons/base/models/ir_ui_view.py:docstring of odoo.addons.base.models.ir_ui_view.Model.get_views:21
msgid "``action_id``"
msgstr ""
#: ../../../odoo/odoo/addons/base/models/ir_ui_view.py:docstring of odoo.addons.base.models.ir_ui_view.Model.get_views:20
msgid "id of the action to get the filters, otherwise loads the global filters or the model"
msgstr ""
#: ../../../odoo/odoo/addons/base/models/ir_ui_view.py:docstring of odoo.addons.base.models.ir_ui_view.Model.get_views:23
msgid "dictionary with fields_views, fields and optionally filters"
msgstr ""
#: ../../../odoo/odoo/addons/base/models/ir_ui_view.py:docstring of odoo.addons.base.models.ir_ui_view.Model.get_view:1
msgid "Get the detailed composition of the requested view like model, view architecture."
msgstr ""
#: ../../../odoo/odoo/addons/base/models/ir_ui_view.py:docstring of odoo.addons.base.models.ir_ui_view.Model.get_view:7
msgid "id of the view or None"
msgstr ""
#: ../../../odoo/odoo/addons/base/models/ir_ui_view.py:docstring of odoo.addons.base.models.ir_ui_view.Model.get_view:8
msgid "type of the view to return if view_id is None ('form', 'tree', ...)"
msgstr ""
#: ../../../odoo/odoo/addons/base/models/ir_ui_view.py:docstring of odoo.addons.base.models.ir_ui_view.Model.get_view:9
msgid "boolean options to return additional features: - bool mobile: true if the web client is currently using the responsive mobile view (to use kanban views instead of list views for x2many fields)"
msgstr ""
#: ../../../odoo/odoo/addons/base/models/ir_ui_view.py:docstring of odoo.addons.base.models.ir_ui_view.Model.get_view:12
msgid "composition of the requested view (including inherited views and extensions)"
msgstr ""
#: ../../../odoo/odoo/addons/base/models/ir_ui_view.py:docstring of odoo.addons.base.models.ir_ui_view.Model.get_view:14
msgid "* if the inherited view has unknown position to work with other than 'before', 'after', 'inside', 'replace' * if some tag other than 'position' is found in parent view"
msgstr ""
#: ../../../odoo/odoo/addons/base/models/ir_ui_view.py:docstring of odoo.addons.base.models.ir_ui_view.Model.get_view:16
msgid "if the inherited view has unknown position to work with other than 'before', 'after', 'inside', 'replace'"
msgstr ""
#: ../../../odoo/odoo/addons/base/models/ir_ui_view.py:docstring of odoo.addons.base.models.ir_ui_view.Model.get_view:17
msgid "if some tag other than 'position' is found in parent view"
msgstr ""
#: ../../../odoo/odoo/addons/base/models/ir_ui_view.py:docstring of odoo.addons.base.models.ir_ui_view.Model.get_view:19
msgid "if there is view type other than form, tree, calendar, search etc... defined on the structure"
msgstr ""
#: ../../content/developer/tutorials.rst:6
msgid "Tutorials"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:8
msgid "Building a Module"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:11
#: ../../content/developer/tutorials/website.rst:8
msgid "This tutorial is outdated. We recommend reading :doc:`getting_started` instead."
msgstr ""
#: ../../content/developer/tutorials/backend.rst:14
msgid "This tutorial requires :doc:`having installed Odoo <../../administration/install>`"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:17
msgid "Start/Stop the Odoo server"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:19
msgid "Odoo uses a client/server architecture in which clients are web browsers accessing the Odoo server via RPC."
msgstr ""
#: ../../content/developer/tutorials/backend.rst:22
msgid "Business logic and extension is generally performed on the server side, although supporting client features (e.g. new data representation such as interactive maps) can be added to the client."
msgstr ""
#: ../../content/developer/tutorials/backend.rst:26
msgid "In order to start the server, simply invoke the command :ref:`odoo-bin <reference/cmdline>` in the shell, adding the full path to the file if necessary:"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:34
msgid "The server is stopped by hitting ``Ctrl-C`` twice from the terminal, or by killing the corresponding OS process."
msgstr ""
#: ../../content/developer/tutorials/backend.rst:38
msgid "Build an Odoo module"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:40
msgid "Both server and client extensions are packaged as *modules* which are optionally loaded in a *database*."
msgstr ""
#: ../../content/developer/tutorials/backend.rst:43
msgid "Odoo modules can either add brand new business logic to an Odoo system, or alter and extend existing business logic: a module can be created to add your country's accounting rules to Odoo's generic accounting support, while the next module adds support for real-time visualisation of a bus fleet."
msgstr ""
#: ../../content/developer/tutorials/backend.rst:48
msgid "Everything in Odoo thus starts and ends with modules."
msgstr ""
#: ../../content/developer/tutorials/backend.rst:51
#: ../../content/developer/tutorials/getting_started/01_architecture.rst:58
msgid "Composition of a module"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:53
msgid "An Odoo module can contain a number of elements:"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:57
msgid "Business objects"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:56
msgid "Declared as Python classes, these resources are automatically persisted by Odoo based on their configuration"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:60
msgid ":doc:`Object views <../reference/user_interface/view_architectures>`"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:60
msgid "Definition of business objects UI display"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:69
#: ../../content/developer/tutorials/getting_started/01_architecture.rst:77
msgid ":ref:`Data files <reference/data>`"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:63
msgid "XML or CSV files declaring the model metadata :"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:65
msgid ":doc:`views <../reference/user_interface/view_architectures>` or :ref:`reports <reference/reports>`,"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:67
#: ../../content/developer/tutorials/getting_started/01_architecture.rst:75
msgid "configuration data (modules parametrization, :ref:`security rules <reference/security>`),"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:68
#: ../../content/developer/tutorials/getting_started/01_architecture.rst:76
msgid "demonstration data"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:69
#: ../../content/developer/tutorials/getting_started/01_architecture.rst:77
msgid "and more"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:72
#: ../../content/developer/tutorials/getting_started/01_architecture.rst:80
msgid ":ref:`Web controllers <reference/controllers>`"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:72
#: ../../content/developer/tutorials/getting_started/01_architecture.rst:80
msgid "Handle requests from web browsers"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:75
#: ../../content/developer/tutorials/getting_started/01_architecture.rst:83
msgid "Static web data"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:75
msgid "Images, CSS or javascript files used by the web interface or website"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:78
#: ../../content/developer/tutorials/getting_started/01_architecture.rst:90
msgid "Module structure"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:80
#: ../../content/developer/tutorials/getting_started/01_architecture.rst:92
msgid "Each module is a directory within a *module directory*. Module directories are specified by using the :option:`--addons-path <odoo-bin --addons-path>` option."
msgstr ""
#: ../../content/developer/tutorials/backend.rst:87
msgid "most command-line options can also be set using :ref:`a configuration file <reference/cmdline/config>`"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:90
#: ../../content/developer/tutorials/getting_started/01_architecture.rst:96
msgid "An Odoo module is declared by its :ref:`manifest <reference/module/manifest>`."
msgstr ""
#: ../../content/developer/tutorials/backend.rst:92
msgid "A module is also a `Python package <http://docs.python.org/2/tutorial/modules.html#packages>`_ with a ``__init__.py`` file, containing import instructions for various Python files in the module."
msgstr ""
#: ../../content/developer/tutorials/backend.rst:97
msgid "For instance, if the module has a single ``mymodule.py`` file ``__init__.py`` might contain::"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:102
msgid "Odoo provides a mechanism to help set up a new module, :ref:`odoo-bin <reference/cmdline/server>` has a subcommand :ref:`scaffold <reference/cmdline/scaffold>` to create an empty module:"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:110
msgid "The command creates a subdirectory for your module, and automatically creates a bunch of standard files for a module. Most of them simply contain commented code or XML. The usage of most of those files will be explained along this tutorial."
msgstr ""
#: ../../content/developer/tutorials/backend.rst:114
msgid "Module creation"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:116
msgid "Use the command line above to create an empty module Open Academy, and install it in Odoo."
msgstr ""
#: ../../content/developer/tutorials/backend.rst:119
#: ../../content/developer/tutorials/getting_started/04_basicmodel.rst:25
msgid "Object-Relational Mapping"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:121
msgid "A key component of Odoo is the :abbr:`ORM (Object-Relational Mapping)` layer. This layer avoids having to write most :abbr:`SQL (Structured Query Language)` by hand and provides extensibility and security services\\ [#rawsql]_."
msgstr ""
#: ../../content/developer/tutorials/backend.rst:125
msgid "Business objects are declared as Python classes extending :class:`~odoo.models.Model` which integrates them into the automated persistence system."
msgstr ""
#: ../../content/developer/tutorials/backend.rst:129
msgid "Models can be configured by setting a number of attributes at their definition. The most important attribute is :attr:`~odoo.models.Model._name` which is required and defines the name for the model in the Odoo system. Here is a minimally complete definition of a model::"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:140
#: ../../content/developer/tutorials/getting_started/04_basicmodel.rst:114
msgid "Model fields"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:142
msgid "Fields are used to define what the model can store and where. Fields are defined as attributes on the model class::"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:153
#: ../../content/developer/tutorials/getting_started/04_basicmodel.rst:219
msgid "Common Attributes"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:155
msgid "Much like the model itself, its fields can be configured, by passing configuration attributes as parameters::"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:160
#: ../../content/developer/tutorials/getting_started/04_basicmodel.rst:243
msgid "Some attributes are available on all fields, here are the most common ones:"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:162
msgid ":attr:`~odoo.fields.Field.string` (``unicode``, default: field's name)"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:163
#: ../../content/developer/tutorials/getting_started/04_basicmodel.rst:246
msgid "The label of the field in UI (visible by users)."
msgstr ""
#: ../../content/developer/tutorials/backend.rst:165
#: ../../content/developer/tutorials/getting_started/04_basicmodel.rst:248
msgid ":attr:`~odoo.fields.Field.required` (``bool``, default: ``False``)"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:165
msgid "If ``True``, the field can not be empty, it must either have a default value or always be given a value when creating a record."
msgstr ""
#: ../../content/developer/tutorials/backend.rst:167
msgid ":attr:`~odoo.fields.Field.help` (``unicode``, default: ``''``)"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:168
msgid "Long-form, provides a help tooltip to users in the UI."
msgstr ""
#: ../../content/developer/tutorials/backend.rst:170
#: ../../content/developer/tutorials/getting_started/04_basicmodel.rst:253
msgid ":attr:`~odoo.fields.Field.index` (``bool``, default: ``False``)"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:170
#: ../../content/developer/tutorials/getting_started/04_basicmodel.rst:253
msgid "Requests that Odoo create a `database index`_ on the column."
msgstr ""
#: ../../content/developer/tutorials/backend.rst:173
msgid "Simple fields"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:175
msgid "There are two broad categories of fields: \"simple\" fields which are atomic values stored directly in the model's table and \"relational\" fields linking records (of the same model or of different models)."
msgstr ""
#: ../../content/developer/tutorials/backend.rst:179
msgid "Example of simple fields are :class:`~odoo.fields.Boolean`, :class:`~odoo.fields.Date`, :class:`~odoo.fields.Char`."
msgstr ""
#: ../../content/developer/tutorials/backend.rst:183
msgid "Reserved fields"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:185
msgid "Odoo creates a few fields in all models\\ [#autofields]_. These fields are managed by the system and shouldn't be written to. They can be read if useful or necessary:"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:189
#: ../../content/developer/tutorials/getting_started/04_basicmodel.rst:279
msgid ":attr:`~odoo.fields.Model.id` (:class:`~odoo.fields.Id`)"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:190
msgid "The unique identifier for a record in its model."
msgstr ""
#: ../../content/developer/tutorials/backend.rst:191
#: ../../content/developer/tutorials/getting_started/04_basicmodel.rst:281
msgid ":attr:`~odoo.fields.Model.create_date` (:class:`~odoo.fields.Datetime`)"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:192
#: ../../content/developer/tutorials/getting_started/04_basicmodel.rst:282
msgid "Creation date of the record."
msgstr ""
#: ../../content/developer/tutorials/backend.rst:193
#: ../../content/developer/tutorials/getting_started/04_basicmodel.rst:283
msgid ":attr:`~odoo.fields.Model.create_uid` (:class:`~odoo.fields.Many2one`)"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:194
#: ../../content/developer/tutorials/getting_started/04_basicmodel.rst:284
msgid "User who created the record."
msgstr ""
#: ../../content/developer/tutorials/backend.rst:195
#: ../../content/developer/tutorials/getting_started/04_basicmodel.rst:285
msgid ":attr:`~odoo.fields.Model.write_date` (:class:`~odoo.fields.Datetime`)"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:196
#: ../../content/developer/tutorials/getting_started/04_basicmodel.rst:286
msgid "Last modification date of the record."
msgstr ""
#: ../../content/developer/tutorials/backend.rst:198
#: ../../content/developer/tutorials/getting_started/04_basicmodel.rst:289
msgid ":attr:`~odoo.fields.Model.write_uid` (:class:`~odoo.fields.Many2one`)"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:198
msgid "user who last modified the record."
msgstr ""
#: ../../content/developer/tutorials/backend.rst:201
msgid "Special fields"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:203
msgid "By default, Odoo also requires a ``name`` field on all models for various display and search behaviors. The field used for these purposes can be overridden by setting :attr:`~odoo.models.Model._rec_name`."
msgstr ""
#: ../../content/developer/tutorials/backend.rst:207
msgid "Define a model"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:209
msgid "Define a new data model *Course* in the *openacademy* module. A course has a title and a description. Courses must have a title."
msgstr ""
#: ../../content/developer/tutorials/backend.rst:213
msgid "Data files"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:215
msgid "Odoo is a highly data driven system. Although behavior is customized using Python_ code part of a module's value is in the data it sets up when loaded."
msgstr ""
#: ../../content/developer/tutorials/backend.rst:218
msgid "some modules exist solely to add data into Odoo"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:221
msgid "Module data is declared via :ref:`data files <reference/data>`, XML files with ``<record>`` elements. Each ``<record>`` element creates or updates a database record."
msgstr ""
#: ../../content/developer/tutorials/backend.rst:235
msgid "``model`` is the name of the Odoo model for the record."
msgstr ""
#: ../../content/developer/tutorials/backend.rst:236
msgid "``id`` is an :term:`external identifier`, it allows referring to the record (without having to know its in-database identifier)."
msgstr ""
#: ../../content/developer/tutorials/backend.rst:238
msgid "``<field>`` elements have a ``name`` which is the name of the field in the model (e.g. ``description``). Their body is the field's value."
msgstr ""
#: ../../content/developer/tutorials/backend.rst:241
msgid "Data files have to be declared in the manifest file to be loaded, they can be declared in the ``'data'`` list (always loaded) or in the ``'demo'`` list (only loaded in demonstration mode)."
msgstr ""
#: ../../content/developer/tutorials/backend.rst:245
msgid "Define demonstration data"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:247
msgid "Create demonstration data filling the *Courses* model with a few demonstration courses."
msgstr ""
#: ../../content/developer/tutorials/backend.rst:250
msgid "The content of the data files is only loaded when a module is installed or updated."
msgstr ""
#: ../../content/developer/tutorials/backend.rst:252
msgid "After making some changes, do not forget to use :ref:`odoo-bin -u openacademy <reference/cmdline>` to save the changes to your database."
msgstr ""
#: ../../content/developer/tutorials/backend.rst:258
msgid "Actions and Menus"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:260
msgid "Actions and menus are regular records in database, usually declared through data files. Actions can be triggered in three ways:"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:263
#: ../../content/developer/tutorials/getting_started/06_firstui.rst:63
msgid "by clicking on menu items (linked to specific actions)"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:264
#: ../../content/developer/tutorials/getting_started/06_firstui.rst:64
msgid "by clicking on buttons in views (if these are connected to actions)"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:265
#: ../../content/developer/tutorials/getting_started/06_firstui.rst:65
msgid "as contextual actions on object"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:267
msgid "Because menus are somewhat complex to declare there is a ``<menuitem>`` shortcut to declare an ``ir.ui.menu`` and connect it to the corresponding action more easily."
msgstr ""
#: ../../content/developer/tutorials/backend.rst:284
msgid "The action must be declared before its corresponding menu in the XML file."
msgstr ""
#: ../../content/developer/tutorials/backend.rst:286
msgid "Data files are executed sequentially, the action's ``id`` must be present in the database before the menu can be created."
msgstr ""
#: ../../content/developer/tutorials/backend.rst:289
msgid "Define new menu entries"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:291
msgid "Define new menu entries to access courses under the OpenAcademy menu entry. A user should be able to:"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:294
msgid "display a list of all the courses"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:295
msgid "create/modify courses"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:298
msgid "Basic views"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:300
msgid "Views define the way the records of a model are displayed. Each type of view represents a mode of visualization (a list of records, a graph of their aggregation, …). Views can either be requested generically via their type (e.g. *a list of partners*) or specifically via their id. For generic requests, the view with the correct type and the lowest priority will be used (so the lowest-priority view of each type is the default view for that type)."
msgstr ""
#: ../../content/developer/tutorials/backend.rst:308
msgid ":ref:`View inheritance <reference/view_records/inheritance>` allows altering views declared elsewhere (adding or removing content)."
msgstr ""
#: ../../content/developer/tutorials/backend.rst:312
msgid "Generic view declaration"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:314
msgid "A view is declared as a record of the model ``ir.ui.view``. The view type is implied by the root element of the ``arch`` field:"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:328
msgid "The view's content is XML."
msgstr ""
#: ../../content/developer/tutorials/backend.rst:331
msgid "The ``arch`` field must thus be declared as ``type=\"xml\"`` to be parsed correctly."
msgstr ""
#: ../../content/developer/tutorials/backend.rst:334
#: ../../content/developer/tutorials/backend.rst:849
msgid "Tree views"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:336
msgid "Tree views, also called list views, display records in a tabular form."
msgstr ""
#: ../../content/developer/tutorials/backend.rst:338
msgid "Their root element is ``<tree>``. The simplest form of the tree view simply lists all the fields to display in the table (each field as a column):"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:351
msgid "Form views"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:353
#: ../../content/developer/tutorials/getting_started/07_basicviews.rst:85
msgid "Forms are used to create and edit single records."
msgstr ""
#: ../../content/developer/tutorials/backend.rst:356
msgid "Their root element is ``<form>``. They are composed of high-level structure elements (groups, notebooks) and interactive elements (buttons and fields):"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:385
msgid "Customise form view using XML"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:387
msgid "Create your own form view for the Course object. Data displayed should be: the name and the description of the course."
msgstr ""
#: ../../content/developer/tutorials/backend.rst:390
msgid "Notebooks"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:392
msgid "In the Course form view, put the description field under a tab, such that it will be easier to add other tabs later, containing additional information."
msgstr ""
#: ../../content/developer/tutorials/backend.rst:395
msgid "Form views can also use plain HTML for more flexible layouts:"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:422
#: ../../content/developer/tutorials/backend.rst:922
#: ../../content/developer/tutorials/backend.rst:964
msgid "Search views"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:424
msgid "Search views customize the search field associated with the list view (and other aggregated views). Their root element is ``<search>`` and they're composed of fields defining which fields can be searched on:"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:435
msgid "If no search view exists for the model, Odoo generates one which only allows searching on the ``name`` field."
msgstr ""
#: ../../content/developer/tutorials/backend.rst:438
msgid "Search courses"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:440
msgid "Allow searching for courses based on their title or their description."
msgstr ""
#: ../../content/developer/tutorials/backend.rst:443
#: ../../content/developer/tutorials/website.rst:649
msgid "Relations between models"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:445
msgid "A record from a model may be related to a record from another model. For instance, a sale order record is related to a client record that contains the client data; it is also related to its sale order line records."
msgstr ""
#: ../../content/developer/tutorials/backend.rst:449
msgid "Create a session model"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:451
msgid "For the module Open Academy, we consider a model for *sessions*: a session is an occurrence of a course taught at a given time for a given audience."
msgstr ""
#: ../../content/developer/tutorials/backend.rst:454
msgid "Create a model for *sessions*. A session has a name, a start date, a duration and a number of seats. Add an action and a menu item to display them. Make the new model visible via a menu item."
msgstr ""
#: ../../content/developer/tutorials/backend.rst:461
msgid "Relational fields link records, either of the same model (hierarchies) or between different models."
msgstr ""
#: ../../content/developer/tutorials/backend.rst:464
msgid "Relational field types are:"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:471
msgid ":class:`Many2one(other_model, ondelete='set null') <odoo.fields.Many2one>`"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:467
msgid "A simple link to an other object::"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:471
msgid "`foreign keys <http://www.postgresql.org/docs/12/static/tutorial-fk.html>`_"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:485
msgid ":class:`One2many(other_model, related_field) <odoo.fields.One2many>`"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:474
msgid "A virtual relationship, inverse of a :class:`~odoo.fields.Many2one`. A :class:`~odoo.fields.One2many` behaves as a container of records, accessing it results in a (possibly empty) set of records::"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:483
msgid "Because a :class:`~odoo.fields.One2many` is a virtual relationship, there *must* be a :class:`~odoo.fields.Many2one` field in the :samp:`{other_model}`, and its name *must* be :samp:`{related_field}`"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:493
msgid ":class:`Many2many(other_model) <odoo.fields.Many2many>`"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:488
msgid "Bidirectional multiple relationship, any record on one side can be related to any number of records on the other side. Behaves as a container of records, accessing it also results in a possibly empty set of records::"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:495
msgid "Many2one relations"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:497
msgid "Using a many2one, modify the *Course* and *Session* models to reflect their relation with other models:"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:500
msgid "A course has a *responsible* user; the value of that field is a record of the built-in model ``res.users``."
msgstr ""
#: ../../content/developer/tutorials/backend.rst:502
msgid "A session has an *instructor*; the value of that field is a record of the built-in model ``res.partner``."
msgstr ""
#: ../../content/developer/tutorials/backend.rst:504
msgid "A session is related to a *course*; the value of that field is a record of the model ``openacademy.course`` and is required."
msgstr ""
#: ../../content/developer/tutorials/backend.rst:506
msgid "Adapt the views."
msgstr ""
#: ../../content/developer/tutorials/backend.rst:508
msgid "Inverse one2many relations"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:510
msgid "Using the inverse relational field one2many, modify the models to reflect the relation between courses and sessions."
msgstr ""
#: ../../content/developer/tutorials/backend.rst:513
msgid "Multiple many2many relations"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:515
msgid "Using the relational field many2many, modify the *Session* model to relate every session to a set of *attendees*. Attendees will be represented by partner records, so we will relate to the built-in model ``res.partner``. Adapt the views accordingly."
msgstr ""
#: ../../content/developer/tutorials/backend.rst:524
msgid "Model inheritance"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:526
#: ../../content/developer/tutorials/getting_started/13_inheritance.rst:114
msgid "Odoo provides two *inheritance* mechanisms to extend an existing model in a modular way."
msgstr ""
#: ../../content/developer/tutorials/backend.rst:529
msgid "The first inheritance mechanism allows a module to modify the behavior of a model defined in another module:"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:532
msgid "add fields to a model,"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:533
msgid "override the definition of fields on a model,"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:534
msgid "add constraints to a model,"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:535
msgid "add methods to a model,"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:536
msgid "override existing methods on a model."
msgstr ""
#: ../../content/developer/tutorials/backend.rst:538
msgid "The second inheritance mechanism (delegation) allows to link every record of a model to a record in a parent model, and provides transparent access to the fields of the parent record."
msgstr ""
#: ../../content/developer/tutorials/backend.rst:546
msgid ":attr:`~odoo.models.Model._inherit`"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:547
msgid ":attr:`~odoo.models.Model._inherits`"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:550
msgid "View inheritance"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:552
msgid "Instead of modifying existing views in place (by overwriting them), Odoo provides view inheritance where children \"extension\" views are applied on top of root views, and can add or remove content from their parent."
msgstr ""
#: ../../content/developer/tutorials/backend.rst:556
msgid "An extension view references its parent using the ``inherit_id`` field, and instead of a single view its ``arch`` field is composed of any number of ``xpath`` elements selecting and altering the content of their parent view:"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:577
#: ../../content/developer/tutorials/getting_started/13_inheritance.rst:204
msgid "``expr``"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:577
#: ../../content/developer/tutorials/getting_started/13_inheritance.rst:204
msgid "An XPath_ expression selecting a single element in the parent view. Raises an error if it matches no element or more than one"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:593
#: ../../content/developer/tutorials/getting_started/13_inheritance.rst:220
msgid "``position``"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:580
#: ../../content/developer/tutorials/getting_started/13_inheritance.rst:207
msgid "Operation to apply to the matched element:"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:582
#: ../../content/developer/tutorials/getting_started/13_inheritance.rst:209
msgid "``inside``"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:583
msgid "appends ``xpath``'s body at the end of the matched element"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:585
#: ../../content/developer/tutorials/getting_started/13_inheritance.rst:212
msgid "replaces the matched element with the ``xpath``'s body, replacing any ``$0`` node occurrence in the new body with the original element"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:588
#: ../../content/developer/tutorials/getting_started/13_inheritance.rst:215
msgid "inserts the ``xpath``'s body as a sibling before the matched element"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:590
#: ../../content/developer/tutorials/getting_started/13_inheritance.rst:217
msgid "inserts the ``xpaths``'s body as a sibling after the matched element"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:592
msgid "alters the attributes of the matched element using special ``attribute`` elements in the ``xpath``'s body"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:596
msgid "When matching a single element, the ``position`` attribute can be set directly on the element to be found. Both inheritances below will give the same result."
msgstr ""
#: ../../content/developer/tutorials/backend.rst:610
msgid "Alter existing content"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:612
msgid "Using model inheritance, modify the existing *Partner* model to add an ``instructor`` boolean field, and a many2many field that corresponds to the session-partner relation"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:615
msgid "Using view inheritance, display this fields in the partner form view"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:620
msgid "In Odoo, :ref:`reference/orm/domains` are values that encode conditions on records. A domain is a list of criteria used to select a subset of a model's records. Each criteria is a triple with a field name, an operator and a value."
msgstr ""
#: ../../content/developer/tutorials/backend.rst:624
msgid "For instance, when used on the *Product* model the following domain selects all *services* with a unit price over *1000*::"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:629
msgid "By default criteria are combined with an implicit AND. The logical operators ``&`` (AND), ``|`` (OR) and ``!`` (NOT) can be used to explicitly combine criteria. They are used in prefix position (the operator is inserted before its arguments rather than between). For instance to select products \"which are services *OR* have a unit price which is *NOT* between 1000 and 2000\"::"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:641
msgid "A ``domain`` parameter can be added to relational fields to limit valid records for the relation when trying to select records in the client interface."
msgstr ""
#: ../../content/developer/tutorials/backend.rst:644
msgid "Domains on relational fields"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:646
msgid "When selecting the instructor for a *Session*, only instructors (partners with ``instructor`` set to ``True``) should be visible."
msgstr ""
#: ../../content/developer/tutorials/backend.rst:649
msgid "More complex domains"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:651
msgid "Create new partner categories *Teacher / Level 1* and *Teacher / Level 2*. The instructor for a session can be either an instructor or a teacher (of any level)."
msgstr ""
#: ../../content/developer/tutorials/backend.rst:656
msgid "Computed fields and default values"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:658
msgid "So far fields have been stored directly in and retrieved directly from the database. Fields can also be *computed*. In that case, the field's value is not retrieved from the database but computed on-the-fly by calling a method of the model."
msgstr ""
#: ../../content/developer/tutorials/backend.rst:663
msgid "To create a computed field, create a field and set its attribute :attr:`~odoo.fields.Field.compute` to the name of a method. The computation method should simply set the value of the field to compute on every record in ``self``."
msgstr ""
#: ../../content/developer/tutorials/backend.rst:668
msgid "``self`` is a collection"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:671
msgid "The object ``self`` is a *recordset*, i.e., an ordered collection of records. It supports the standard Python operations on collections, like ``len(self)`` and ``iter(self)``, plus extra set operations like ``recs1 + recs2``."
msgstr ""
#: ../../content/developer/tutorials/backend.rst:675
msgid "Iterating over ``self`` gives the records one by one, where each record is itself a collection of size 1. You can access/assign fields on single records by using the dot notation, like ``record.name``."
msgstr ""
#: ../../content/developer/tutorials/backend.rst:695
#: ../../content/developer/tutorials/getting_started/09_compute_onchange.rst:59
msgid "Dependencies"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:697
msgid "The value of a computed field usually depends on the values of other fields on the computed record. The ORM expects the developer to specify those dependencies on the compute method with the decorator :func:`~odoo.api.depends`. The given dependencies are used by the ORM to trigger the recomputation of the field whenever some of its dependencies have been modified::"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:718
msgid "Add the percentage of taken seats to the *Session* model"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:719
msgid "Display that field in the tree and form views"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:720
msgid "Display the field as a progress bar"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:723
msgid "Default values"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:725
msgid "Any field can be given a default value. In the field definition, add the option ``default=X`` where ``X`` is either a Python literal value (boolean, integer, float, string), or a function taking a recordset and returning a value::"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:733
#: ../../content/developer/tutorials/getting_started/08_relations.rst:115
msgid "The object ``self.env`` gives access to request parameters and other useful things:"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:735
#: ../../content/developer/tutorials/getting_started/08_relations.rst:118
msgid "``self.env.cr`` or ``self._cr`` is the database *cursor* object; it is used for querying the database"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:737
#: ../../content/developer/tutorials/getting_started/08_relations.rst:120
msgid "``self.env.uid`` or ``self._uid`` is the current user's database id"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:738
#: ../../content/developer/tutorials/getting_started/08_relations.rst:121
msgid "``self.env.user`` is the current user's record"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:739
#: ../../content/developer/tutorials/getting_started/08_relations.rst:122
msgid "``self.env.context`` or ``self._context`` is the context dictionary"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:740
#: ../../content/developer/tutorials/getting_started/08_relations.rst:123
msgid "``self.env.ref(xml_id)`` returns the record corresponding to an XML id"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:741
#: ../../content/developer/tutorials/getting_started/08_relations.rst:124
msgid "``self.env[model_name]`` returns an instance of the given model"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:743
msgid "Active objects Default values"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:745
msgid "Define the start_date default value as today (see :class:`~odoo.fields.Date`)."
msgstr ""
#: ../../content/developer/tutorials/backend.rst:747
msgid "Add a field ``active`` in the class Session, and set sessions as active by default."
msgstr ""
#: ../../content/developer/tutorials/backend.rst:751
#: ../../content/developer/tutorials/getting_started/09_compute_onchange.rst:0
msgid "Onchange"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:753
msgid "The \"onchange\" mechanism provides a way for the client interface to update a form whenever the user has filled in a value in a field, without saving anything to the database."
msgstr ""
#: ../../content/developer/tutorials/backend.rst:757
msgid "For instance, suppose a model has three fields ``amount``, ``unit_price`` and ``price``, and you want to update the price on the form when any of the other fields is modified. To achieve this, define a method where ``self`` represents the record in the form view, and decorate it with :func:`~odoo.api.onchange` to specify on which field it has to be triggered. Any change you make on ``self`` will be reflected on the form."
msgstr ""
#: ../../content/developer/tutorials/backend.rst:786
msgid "For computed fields, valued ``onchange`` behavior is built-in as can be seen by playing with the *Session* form: change the number of seats or participants, and the ``taken_seats`` progressbar is automatically updated."
msgstr ""
#: ../../content/developer/tutorials/backend.rst:790
msgid "Warning"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:792
msgid "Add an explicit onchange to warn about invalid values, like a negative number of seats, or more participants than seats."
msgstr ""
#: ../../content/developer/tutorials/backend.rst:796
msgid "Model constraints"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:798
#: ../../content/developer/tutorials/getting_started/11_constraints.rst:12
msgid "Odoo provides two ways to set up automatically verified invariants: :func:`Python constraints <odoo.api.constrains>` and :attr:`SQL constraints <odoo.models.Model._sql_constraints>`."
msgstr ""
#: ../../content/developer/tutorials/backend.rst:802
msgid "A Python constraint is defined as a method decorated with :func:`~odoo.api.constrains`, and invoked on a recordset. The decorator specifies which fields are involved in the constraint, so that the constraint is automatically evaluated when one of them is modified. The method is expected to raise an exception if its invariant is not satisfied::"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:817
msgid "Add Python constraints"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:819
msgid "Add a constraint that checks that the instructor is not present in the attendees of his/her own session."
msgstr ""
#: ../../content/developer/tutorials/backend.rst:822
msgid "SQL constraints are defined through the model attribute :attr:`~odoo.models.Model._sql_constraints`. The latter is assigned to a list of triples of strings ``(name, sql_definition, message)``, where ``name`` is a valid SQL constraint name, ``sql_definition`` is a table_constraint_ expression, and ``message`` is the error message."
msgstr ""
#: ../../content/developer/tutorials/backend.rst:828
msgid "Add SQL constraints"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:830
msgid "With the help of `PostgreSQL's documentation`_ , add the following constraints:"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:833
msgid "CHECK that the course description and the course title are different"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:834
msgid "Make the Course's name UNIQUE"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:836
msgid "Exercise 6 - Add a duplicate option"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:838
msgid "Since we added a constraint for the Course name uniqueness, it is not possible to use the \"duplicate\" function anymore (:menuselection:`Form --> Duplicate`)."
msgstr ""
#: ../../content/developer/tutorials/backend.rst:842
msgid "Re-implement your own \"copy\" method which allows to duplicate the Course object, changing the original name into \"Copy of [original name]\"."
msgstr ""
#: ../../content/developer/tutorials/backend.rst:846
msgid "Advanced Views"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:851
msgid "Tree views can take supplementary attributes to further customize their behavior:"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:855
msgid "allow changing the style of a row's text based on the corresponding record's attributes."
msgstr ""
#: ../../content/developer/tutorials/backend.rst:868
msgid "``{$name}`` can be ``bf`` (``font-weight: bold``), ``it`` (``font-style: italic``), or any `bootstrap contextual color <https://getbootstrap.com/docs/3.3/components/#available-variations>`_ (``danger``, ``info``, ``muted``, ``primary``, ``success`` or ``warning``)."
msgstr ""
#: ../../content/developer/tutorials/backend.rst:884
msgid "``editable``"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:882
msgid "Either ``\"top\"`` or ``\"bottom\"``. Makes the tree view editable in-place (rather than having to go through the form view), the value is the position where new rows appear."
msgstr ""
#: ../../content/developer/tutorials/backend.rst:886
msgid "List coloring"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:888
msgid "Modify the Session tree view in such a way that sessions lasting less than 5 days are colored blue, and the ones lasting more than 15 days are colored red."
msgstr ""
#: ../../content/developer/tutorials/backend.rst:893
msgid "Calendars"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:895
msgid "Displays records as calendar events. Their root element is ``<calendar>`` and their most common attributes are:"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:899
msgid "The name of the field used for *color segmentation*. Colors are automatically distributed to events, but events in the same color segment (records which have the same value for their ``@color`` field) will be given the same color."
msgstr ""
#: ../../content/developer/tutorials/backend.rst:903
msgid "``date_start``"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:904
msgid "record's field holding the start date/time for the event"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:905
msgid "``date_stop`` (optional)"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:906
msgid "record's field holding the end date/time for the event"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:908
msgid "record's field to define the label for each calendar event"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:916
msgid "Calendar view"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:918
msgid "Add a Calendar view to the *Session* model enabling the user to view the events associated to the Open Academy."
msgstr ""
#: ../../content/developer/tutorials/backend.rst:924
msgid "Search view ``<field>`` elements can have a ``@filter_domain`` that overrides the domain generated for searching on the given field. In the given domain, ``self`` represents the value entered by the user. In the example below, it is used to search on both fields ``name`` and ``description``."
msgstr ""
#: ../../content/developer/tutorials/backend.rst:929
#: ../../content/developer/tutorials/getting_started/07_basicviews.rst:181
msgid "Search views can also contain ``<filter>`` elements, which act as toggles for predefined searches. Filters must have one of the following attributes:"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:933
msgid "add the given domain to the current search"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:935
msgid "add some context to the current search; use the key ``group_by`` to group results on the given field name"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:955
msgid "To use a non-default search view in an action, it should be linked using the ``search_view_id`` field of the action record."
msgstr ""
#: ../../content/developer/tutorials/backend.rst:958
msgid "The action can also set default values for search fields through its ``context`` field: context keys of the form :samp:`search_default_{field_name}` will initialize *field_name* with the provided value. Search filters must have an optional ``@name`` to have a default and behave as booleans (they can only be enabled by default)."
msgstr ""
#: ../../content/developer/tutorials/backend.rst:966
msgid "Add a button to filter the courses for which the current user is the responsible in the course search view. Make it selected by default."
msgstr ""
#: ../../content/developer/tutorials/backend.rst:968
msgid "Add a button to group courses by responsible user."
msgstr ""
#: ../../content/developer/tutorials/backend.rst:974
msgid "The gantt view requires the web_gantt module which is present in the :ref:`enterprise edition <install/editions>` version."
msgstr ""
#: ../../content/developer/tutorials/backend.rst:977
msgid "Horizontal bar charts typically used to show project planning and advancement, their root element is ``<gantt>``."
msgstr ""
#: ../../content/developer/tutorials/backend.rst:988
msgid "Gantt charts"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:990
msgid "Add a Gantt Chart enabling the user to view the sessions scheduling linked to the Open Academy module. The sessions should be grouped by instructor."
msgstr ""
#: ../../content/developer/tutorials/backend.rst:994
msgid "Graph views"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:996
msgid "Graph views allow aggregated overview and analysis of models, their root element is ``<graph>``."
msgstr ""
#: ../../content/developer/tutorials/backend.rst:1000
msgid "Pivot views (element ``<pivot>``) a multidimensional table, allows the selection of filers and dimensions to get the right aggregated dataset before moving to a more graphical overview. The pivot view shares the same content definition as graph views."
msgstr ""
#: ../../content/developer/tutorials/backend.rst:1004
msgid "Graph views have 4 display modes, the default mode is selected using the ``@type`` attribute."
msgstr ""
#: ../../content/developer/tutorials/backend.rst:1011
msgid "Bar (default)"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:1008
msgid "a bar chart, the first dimension is used to define groups on the horizontal axis, other dimensions define aggregated bars within each group."
msgstr ""
#: ../../content/developer/tutorials/backend.rst:1011
msgid "By default bars are side-by-side, they can be stacked by using ``@stacked=\"True\"`` on the ``<graph>``"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:1013
msgid "Line"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:1014
msgid "2-dimensional line chart"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:1016
msgid "Pie"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:1016
msgid "2-dimensional pie"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:1018
msgid "Graph views contain ``<field>`` with a mandatory ``@type`` attribute taking the values:"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:1022
msgid "the field should be aggregated by default"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:1024
msgid "the field should be aggregated rather than grouped on"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:1034
msgid "Graph views perform aggregations on database values, they do not work with non-stored computed fields."
msgstr ""
#: ../../content/developer/tutorials/backend.rst:1037
msgid "Graph view"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:1039
msgid "Add a Graph view in the Session object that displays, for each course, the number of attendees under the form of a bar chart."
msgstr ""
#: ../../content/developer/tutorials/backend.rst:1045
msgid "Used to organize tasks, production processes, etc… their root element is ``<kanban>``."
msgstr ""
#: ../../content/developer/tutorials/backend.rst:1048
msgid "A kanban view shows a set of cards possibly grouped in columns. Each card represents a record, and each column the values of an aggregation field."
msgstr ""
#: ../../content/developer/tutorials/backend.rst:1051
msgid "For instance, project tasks may be organized by stage (each column is a stage), or by responsible (each column is a user), and so on."
msgstr ""
#: ../../content/developer/tutorials/backend.rst:1054
msgid "Kanban views define the structure of each card as a mix of form elements (including basic HTML) and :ref:`reference/qweb`."
msgstr ""
#: ../../content/developer/tutorials/backend.rst:1057
#: ../../content/developer/tutorials/getting_started/15_qwebintro.rst:0
msgid "Kanban view"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:1059
msgid "Add a Kanban view that displays sessions grouped by course (columns are thus courses)."
msgstr ""
#: ../../content/developer/tutorials/backend.rst:1063
msgid "Security"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:1065
msgid "Access control mechanisms must be configured to achieve a coherent security policy."
msgstr ""
#: ../../content/developer/tutorials/backend.rst:1069
msgid "Group-based access control mechanisms"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:1071
msgid "Groups are created as normal records on the model ``res.groups``, and granted menu access via menu definitions. However even without a menu, objects may still be accessible indirectly, so actual object-level permissions (read, write, create, unlink) must be defined for groups. They are usually inserted via CSV files inside modules. It is also possible to restrict access to specific fields on a view or object using the field's groups attribute."
msgstr ""
#: ../../content/developer/tutorials/backend.rst:1079
msgid "Access rights"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:1081
msgid "Access rights are defined as records of the model ``ir.model.access``. Each access right is associated to a model, a group (or no group for global access), and a set of permissions: read, write, create, unlink. Such access rights are usually created by a CSV file named after its model: ``ir.model.access.csv``."
msgstr ""
#: ../../content/developer/tutorials/backend.rst:1093
msgid "Add access control through the Odoo interface"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:1095
msgid "Create a new user \"John Smith\". Then create a group \"OpenAcademy / Session Read\" with read access to the *Session* model."
msgstr ""
#: ../../content/developer/tutorials/backend.rst:1098
msgid "Add access control through data files in your module"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:1100
msgid "Using data files,"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:1102
msgid "Create a group *OpenAcademy / Manager* with full access to all OpenAcademy models"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:1104
msgid "Make *Session* and *Course* readable by all users"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:1107
msgid "Record rules"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:1109
msgid "A record rule restricts the access rights to a subset of records of the given model. A rule is a record of the model ``ir.rule``, and is associated to a model, a number of groups (many2many field), permissions to which the restriction applies, and a domain. The domain specifies to which records the access rights are limited."
msgstr ""
#: ../../content/developer/tutorials/backend.rst:1115
msgid "Here is an example of a rule that prevents the deletion of leads that are not in state ``cancel``. Notice that the value of the field ``groups`` must follow the same convention as the method :meth:`~odoo.models.Model.write` of the ORM."
msgstr ""
#: ../../content/developer/tutorials/backend.rst:1132
msgid "Record rule"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:1134
msgid "Add a record rule for the model Course and the group \"OpenAcademy / Manager\", that restricts ``write`` and ``unlink`` accesses to the responsible of a course. If a course has no responsible, all users of the group must be able to modify it."
msgstr ""
#: ../../content/developer/tutorials/backend.rst:1142
msgid "Wizards"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:1144
msgid "Wizards describe interactive sessions with the user (or dialog boxes) through dynamic forms. A wizard is simply a model that extends the class :class:`~odoo.models.TransientModel` instead of :class:`~odoo.models.Model`. The class :class:`~odoo.models.TransientModel` extends :class:`~odoo.models.Model` and reuse all its existing mechanisms, with the following particularities:"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:1151
msgid "Wizard records are not meant to be persistent; they are automatically deleted from the database after a certain time. This is why they are called *transient*."
msgstr ""
#: ../../content/developer/tutorials/backend.rst:1154
msgid "Wizard records may refer to regular records or wizard records through relational fields(many2one or many2many), but regular records *cannot* refer to wizard records through a many2one field."
msgstr ""
#: ../../content/developer/tutorials/backend.rst:1158
msgid "We want to create a wizard that allow users to create attendees for a particular session, or for a list of sessions at once."
msgstr ""
#: ../../content/developer/tutorials/backend.rst:1161
msgid "Define the wizard"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:1163
msgid "Create a wizard model with a many2one relationship with the *Session* model and a many2many relationship with the *Partner* model."
msgstr ""
#: ../../content/developer/tutorials/backend.rst:1167
msgid "Launching wizards"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:1169
msgid "Wizards are simply :ref:`window actions <howtos/module/actions>` with a ``target`` field set to the value ``new``, which opens the view (usually :ref:`a form <howtos/module/views/form>`) in a separate dialog. The action may be triggered via a menu item, but is more generally triggered by a button."
msgstr ""
#: ../../content/developer/tutorials/backend.rst:1175
msgid "An other way to launch wizards is through the :menuselection:`Action` menu of a tree or form view. This is done through the ``binding_model_id`` field of the action. Setting this field will make the action appear on the views of the model the action is \"bound\" to."
msgstr ""
#: ../../content/developer/tutorials/backend.rst:1191
msgid "While wizards use regular views and buttons, normally clicking any button in a form would first save the form then close the dialog. Because this is often undesirable in wizards, a special attribute ``special=\"cancel\"`` is available which immediately closes the wizard without saving the form."
msgstr ""
#: ../../content/developer/tutorials/backend.rst:1196
msgid "Launch the wizard"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:1198
msgid "Define a form view for the wizard."
msgstr ""
#: ../../content/developer/tutorials/backend.rst:1199
msgid "Add the action to launch it in the context of the *Session* model."
msgstr ""
#: ../../content/developer/tutorials/backend.rst:1200
msgid "Define a default value for the session field in the wizard; use the context parameter ``self._context`` to retrieve the current session."
msgstr ""
#: ../../content/developer/tutorials/backend.rst:1203
msgid "Register attendees"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:1205
msgid "Add buttons to the wizard, and implement the corresponding method for adding the attendees to the given session."
msgstr ""
#: ../../content/developer/tutorials/backend.rst:1208
msgid "Register attendees to multiple sessions"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:1210
msgid "Modify the wizard model so that attendees can be registered to multiple sessions."
msgstr ""
#: ../../content/developer/tutorials/backend.rst:1214
msgid "Internationalization"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:1216
msgid "Each module can provide its own translations within the i18n directory, by having files named LANG.po where LANG is the locale code for the language, or the language and country combination when they differ (e.g. pt.po or pt_BR.po). Translations will be loaded automatically by Odoo for all enabled languages. Developers always use English when creating a module, then export the module terms using Odoo's gettext POT export feature (:menuselection:`Settings --> Translations --> Import/Export --> Export Translation` without specifying a language), to create the module template POT file, and then derive the translated PO files. Many IDE's have plugins or modes for editing and merging PO/POT files."
msgstr ""
#: ../../content/developer/tutorials/backend.rst:1228
msgid "The Portable Object files generated by Odoo are published on `Transifex <https://www.transifex.com/odoo/public/>`_, making it easy to translate the software."
msgstr ""
#: ../../content/developer/tutorials/backend.rst:1241
msgid "By default Odoo's POT export only extracts labels inside XML files or inside field definitions in Python code, but any Python string can be translated this way by surrounding it with the function :func:`odoo._` (e.g. ``_(\"Label\")``)"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:1246
msgid "Translate a module"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:1248
msgid "Choose a second language for your Odoo installation. Translate your module using the facilities provided by Odoo."
msgstr ""
#: ../../content/developer/tutorials/backend.rst:1252
msgid "Reporting"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:1255
msgid "Printed reports"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:1257
msgid "Odoo uses a report engine based on :ref:`reference/qweb`, `Twitter Bootstrap`_ and Wkhtmltopdf_."
msgstr ""
#: ../../content/developer/tutorials/backend.rst:1260
msgid "A report is a combination two elements:"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:1262
msgid "an ``ir.actions.report`` which configures various basic parameters for the report (default type, whether the report should be saved to the database after generation,…)"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:1283
msgid "Because it largerly a standard action, as with :ref:`howto/module/wizard` it is generally useful to add the report as a *contextual item* on the tree and / or form views of the model being reported on via the ``binding_model_id`` field."
msgstr ""
#: ../../content/developer/tutorials/backend.rst:1288
msgid "Here we are also using ``binding_type`` in order for the report to be in the *report* contextual menu rather than the *action* one. There is no technical difference but putting elements in the right place helps users."
msgstr ""
#: ../../content/developer/tutorials/backend.rst:1292
msgid "A standard :ref:`QWeb view <reference/view_architectures/qweb>` for the actual report:"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:1306
msgid "the standard rendering context provides a number of elements, the most important being:"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:1310
msgid "the records for which the report is printed"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:1312
msgid "the user printing the report"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:1314
msgid "Because reports are standard web pages, they are available through a URL and output parameters can be manipulated through this URL, for instance the HTML version of the *Invoice* report is available through http://localhost:8069/report/html/account.report_invoice/1 (if ``account`` is installed) and the PDF version through http://localhost:8069/report/pdf/account.report_invoice/1."
msgstr ""
#: ../../content/developer/tutorials/backend.rst:1325
msgid "If it appears that your PDF report is missing the styles (i.e. the text appears but the style/layout is different from the html version), probably your wkhtmltopdf_ process cannot reach your web server to download them."
msgstr ""
#: ../../content/developer/tutorials/backend.rst:1329
msgid "If you check your server logs and see that the CSS styles are not being downloaded when generating a PDF report, most surely this is the problem."
msgstr ""
#: ../../content/developer/tutorials/backend.rst:1332
msgid "The wkhtmltopdf_ process will use the ``web.base.url`` system parameter as the *root path* to all linked files, but this parameter is automatically updated each time the Administrator is logged in. If your server resides behind some kind of proxy, that could not be reachable. You can fix this by adding one of these system parameters:"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:1338
msgid "``report.url``, pointing to an URL reachable from your server (probably ``http://localhost:8069`` or something similar). It will be used for this particular purpose only."
msgstr ""
#: ../../content/developer/tutorials/backend.rst:1342
msgid "``web.base.url.freeze``, when set to ``True``, will stop the automatic updates to ``web.base.url``."
msgstr ""
#: ../../content/developer/tutorials/backend.rst:1345
msgid "Create a report for the Session model"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:1347
msgid "For each session, it should display session's name, its start and end, and list the session's attendees."
msgstr ""
#: ../../content/developer/tutorials/backend.rst:1351
msgid "Dashboards"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:1353
msgid "Define a Dashboard"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:1355
msgid "Define a dashboard containing the graph view you created, the sessions calendar view and a list view of the courses (switchable to a form view). This dashboard should be available through a menuitem in the menu, and automatically displayed in the web client when the OpenAcademy main menu is selected."
msgstr ""
#: ../../content/developer/tutorials/backend.rst:1361
#: ../../content/developer/tutorials/getting_started/04_basicmodel.rst:295
msgid "it is possible to :ref:`disable the automatic creation of some fields <reference/fields/automatic/log_access>`"
msgstr ""
#: ../../content/developer/tutorials/backend.rst:1363
msgid "writing raw SQL queries is possible, but requires care as it bypasses all Odoo authentication and security mechanisms."
msgstr ""
#: ../../content/developer/tutorials/define_module_data.rst:3
msgid "Define module data"
msgstr ""
#: ../../content/developer/tutorials/define_module_data.rst:6
#: ../../content/developer/tutorials/pdf_reports.rst:6
#: ../../content/developer/tutorials/restrict_data_access.rst:6
#: ../../content/developer/tutorials/unit_tests.rst:6
msgid "This tutorial is an extension of the :doc:`getting_started` tutorial. Make sure you have completed it and use the `estate` module you have built as a base for the exercises in this tutorial. Fetch the branch `17.0-core` from the `technical-training-solutions <https://github.com/odoo/technical-training-solutions/tree/17.0-core>`_ repository if you want to start from a clean base."
msgstr ""
#: ../../content/developer/tutorials/define_module_data.rst:13
msgid "Data Types"
msgstr ""
#: ../../content/developer/tutorials/define_module_data.rst:16
msgid "Master Data"
msgstr ""
#: ../../content/developer/tutorials/define_module_data.rst:18
msgid "Master data is usually part of the technical or business requirements for the module. In other words, such data is often necessary for the module to work properly. This data will always be installed when installing the module."
msgstr ""
#: ../../content/developer/tutorials/define_module_data.rst:22
msgid "We already met technical data previously since we have defined :doc:`views <../reference/user_interface/view_records>` and :doc:`actions <../reference/backend/actions>`. Those are one kind of master data."
msgstr ""
#: ../../content/developer/tutorials/define_module_data.rst:26
msgid "On top of technical data, business data can be defined, e.g. countries, currencies, units of measure, as well as complete country localization (legal reports, tax definitions, chart of account), and much more..."
msgstr ""
#: ../../content/developer/tutorials/define_module_data.rst:31
msgid "Demo Data"
msgstr ""
#: ../../content/developer/tutorials/define_module_data.rst:33
msgid "In additional to master data, which are requirements for a module to work properly, we also like having data for demonstration purposes:"
msgstr ""
#: ../../content/developer/tutorials/define_module_data.rst:36
msgid "Help the sales representatives make their demos quickly."
msgstr ""
#: ../../content/developer/tutorials/define_module_data.rst:37
msgid "Have a set of working data for developers to test new features and see how these new features look with data they might not have added themselves."
msgstr ""
#: ../../content/developer/tutorials/define_module_data.rst:39
msgid "Test that the data is loaded correctly, without raising an error."
msgstr ""
#: ../../content/developer/tutorials/define_module_data.rst:40
msgid "Setup most of the features to be used quickly when creating a new database."
msgstr ""
#: ../../content/developer/tutorials/define_module_data.rst:42
msgid "Demo data is automatically loaded when you start the server if you don't explicitly say you don't want it. This can be done in the database manager or with the command line."
msgstr ""
#: ../../content/developer/tutorials/define_module_data.rst:65
msgid "Data Declaration"
msgstr ""
#: ../../content/developer/tutorials/define_module_data.rst:70
msgid "**Reference**: the documentation related to this topic can be found in :ref:`Module Manifests<reference/module/manifest>`."
msgstr ""
#: ../../content/developer/tutorials/define_module_data.rst:73
msgid "Data is declared either in CSV or in XML. Each file containing data must be added in the manifest for them to be loaded."
msgstr ""
#: ../../content/developer/tutorials/define_module_data.rst:76
msgid "The keys to use in the manifest to add new data are ``data`` for the master data and ``demo`` for the demo data. Both values should be a list of strings representing the relative paths to the files declaring the data."
msgstr ""
#: ../../content/developer/tutorials/define_module_data.rst:80
msgid "Usually, demo data is in a ``demo`` folder, views and actions are in a ``views`` folder, security related data is in a ``security`` folder, and other data is in a ``data`` folder."
msgstr ""
#: ../../content/developer/tutorials/define_module_data.rst:84
msgid "If your work tree looks like this:"
msgstr ""
#: ../../content/developer/tutorials/define_module_data.rst:103
msgid "Your manifest should look like this:"
msgstr ""
#: ../../content/developer/tutorials/define_module_data.rst:126
msgid "CSV"
msgstr ""
#: ../../content/developer/tutorials/define_module_data.rst:128
msgid "**Reference**: the documentation related to this topic can be found in :ref:`CSV data files<reference/data/csvdatafiles>`."
msgstr ""
#: ../../content/developer/tutorials/define_module_data.rst:131
msgid "The easiest way to declare simple data is by using the CSV format. This is however limited in terms of features: use it for long lists of simple models, but prefer XML otherwise."
msgstr ""
#: ../../content/developer/tutorials/define_module_data.rst:140
msgid "Your IDE has probably an extension to have a syntax highlighting of the CSV files"
msgstr ""
#: ../../content/developer/tutorials/define_module_data.rst:142
msgid "`Atom <https://atom.io/packages/rainbow-csv>`__."
msgstr ""
#: ../../content/developer/tutorials/define_module_data.rst:143
msgid "`PyCharm/IntelliJ <https://plugins.jetbrains.com/plugin/10037-csv-plugin>`__."
msgstr ""
#: ../../content/developer/tutorials/define_module_data.rst:144
msgid "`Vim <https://github.com/mechatroner/rainbow_csv>`__."
msgstr ""
#: ../../content/developer/tutorials/define_module_data.rst:145
msgid "`Visual Studio <https://marketplace.visualstudio.com/items?itemName=mechatroner.rainbow-csv>`__."
msgstr ""
#: ../../content/developer/tutorials/define_module_data.rst:147
msgid "Add some standard Real Estate Property Types for the `estate` module: Residential, Commercial, Industrial and Land. These should always be installed."
msgstr ""
#: ../../content/developer/tutorials/define_module_data.rst:151
msgid "XML"
msgstr ""
#: ../../content/developer/tutorials/define_module_data.rst:153
msgid "**Reference**: the documentation related to this topic can be found in :ref:`Data Files<reference/data>`."
msgstr ""
#: ../../content/developer/tutorials/define_module_data.rst:156
msgid "When the data to create is more complex it can be useful, or even necessary, to do it in XML."
msgstr ""
#: ../../content/developer/tutorials/define_module_data.rst:172
msgid "Create some demo data for the `estate` module."
msgstr ""
#: ../../content/developer/tutorials/define_module_data.rst:175
#: ../../content/developer/tutorials/getting_started/08_relations.rst:241
msgid "Values"
msgstr ""
#: ../../content/developer/tutorials/define_module_data.rst:177
#: ../../content/developer/tutorials/define_module_data.rst:241
#: ../../content/developer/tutorials/define_module_data.rst:242
#: ../../content/developer/tutorials/define_module_data.rst:243
msgid "Big Villa"
msgstr ""
#: ../../content/developer/tutorials/define_module_data.rst:177
msgid "Trailer home"
msgstr ""
#: ../../content/developer/tutorials/define_module_data.rst:178
msgid "state"
msgstr ""
#: ../../content/developer/tutorials/define_module_data.rst:178
msgid "New"
msgstr ""
#: ../../content/developer/tutorials/define_module_data.rst:178
msgid "Canceled"
msgstr ""
#: ../../content/developer/tutorials/define_module_data.rst:179
msgid "A nice and big villa"
msgstr ""
#: ../../content/developer/tutorials/define_module_data.rst:179
msgid "Home in a trailer park"
msgstr ""
#: ../../content/developer/tutorials/define_module_data.rst:180
#: ../../content/developer/tutorials/getting_started/04_basicmodel.rst:191
msgid "postcode"
msgstr ""
#: ../../content/developer/tutorials/define_module_data.rst:180
msgid "12345"
msgstr ""
#: ../../content/developer/tutorials/define_module_data.rst:180
msgid "54321"
msgstr ""
#: ../../content/developer/tutorials/define_module_data.rst:181
#: ../../content/developer/tutorials/getting_started/04_basicmodel.rst:192
msgid "date_availability"
msgstr ""
#: ../../content/developer/tutorials/define_module_data.rst:181
msgid "2020-02-02"
msgstr ""
#: ../../content/developer/tutorials/define_module_data.rst:181
msgid "1970-01-01"
msgstr ""
#: ../../content/developer/tutorials/define_module_data.rst:182
#: ../../content/developer/tutorials/getting_started/04_basicmodel.rst:193
#: ../../content/developer/tutorials/getting_started/04_basicmodel.rst:263
msgid "expected_price"
msgstr ""
#: ../../content/developer/tutorials/define_module_data.rst:182
msgid "1,600,000"
msgstr ""
#: ../../content/developer/tutorials/define_module_data.rst:182
msgid "100,000"
msgstr ""
#: ../../content/developer/tutorials/define_module_data.rst:183
#: ../../content/developer/tutorials/getting_started/04_basicmodel.rst:194
msgid "selling_price"
msgstr ""
#: ../../content/developer/tutorials/define_module_data.rst:183
msgid "120,000"
msgstr ""
#: ../../content/developer/tutorials/define_module_data.rst:184
#: ../../content/developer/tutorials/getting_started/04_basicmodel.rst:195
msgid "bedrooms"
msgstr ""
#: ../../content/developer/tutorials/define_module_data.rst:184
msgid "6"
msgstr ""
#: ../../content/developer/tutorials/define_module_data.rst:185
#: ../../content/developer/tutorials/getting_started/04_basicmodel.rst:196
msgid "living_area"
msgstr ""
#: ../../content/developer/tutorials/define_module_data.rst:185
msgid "10"
msgstr ""
#: ../../content/developer/tutorials/define_module_data.rst:186
#: ../../content/developer/tutorials/getting_started/04_basicmodel.rst:197
msgid "facades"
msgstr ""
#: ../../content/developer/tutorials/define_module_data.rst:186
msgid "4"
msgstr ""
#: ../../content/developer/tutorials/define_module_data.rst:187
#: ../../content/developer/tutorials/getting_started/04_basicmodel.rst:198
msgid "garage"
msgstr ""
#: ../../content/developer/tutorials/define_module_data.rst:188
#: ../../content/developer/tutorials/getting_started/04_basicmodel.rst:199
msgid "garden"
msgstr ""
#: ../../content/developer/tutorials/define_module_data.rst:189
#: ../../content/developer/tutorials/getting_started/04_basicmodel.rst:200
msgid "garden_area"
msgstr ""
#: ../../content/developer/tutorials/define_module_data.rst:189
msgid "100000"
msgstr ""
#: ../../content/developer/tutorials/define_module_data.rst:190
#: ../../content/developer/tutorials/getting_started/04_basicmodel.rst:201
msgid "garden_orientation"
msgstr ""
#: ../../content/developer/tutorials/define_module_data.rst:190
msgid "South"
msgstr ""
#: ../../content/developer/tutorials/define_module_data.rst:194
msgid "Data Extension"
msgstr ""
#: ../../content/developer/tutorials/define_module_data.rst:196
msgid "During the Core Training, we saw in the :ref:`tutorials/getting_started/13_inheritance` chapter we could inherit (extend) an existing view. This was a special case of data extension: any data can be extended in a module."
msgstr ""
#: ../../content/developer/tutorials/define_module_data.rst:200
msgid "When you are adding new fields to an existing model in a new module, you might want to populate those fields on the records created in the modules you are depending on. This is done by giving the `xml_id` of the record you want to extend. It won't replace it, in this case we will set the ``field_c`` to the given value for both records."
msgstr ""
#: ../../content/developer/tutorials/define_module_data.rst:221
msgid "Related fields can be set using the ``ref`` key. The value of that key is the ``xml_id`` of the record you want to link. Remember the ``xml_id`` is composed of the name of the module where the data is first declared, followed by a dot, followed by the ``id`` of the record (just the ``id`` works too if you are in the module declaring it)."
msgstr ""
#: ../../content/developer/tutorials/define_module_data.rst:234
msgid "Create some demo data offers for the properties you created."
msgstr ""
#: ../../content/developer/tutorials/define_module_data.rst:236
msgid "Create offers using the partners defined in ``base``"
msgstr ""
#: ../../content/developer/tutorials/define_module_data.rst:239
msgid "Partner"
msgstr ""
#: ../../content/developer/tutorials/define_module_data.rst:239
msgid "Estate"
msgstr ""
#: ../../content/developer/tutorials/define_module_data.rst:239
msgid "Price"
msgstr ""
#: ../../content/developer/tutorials/define_module_data.rst:239
msgid "Validity"
msgstr ""
#: ../../content/developer/tutorials/define_module_data.rst:241
#: ../../content/developer/tutorials/define_module_data.rst:242
msgid "Azure Interior"
msgstr ""
#: ../../content/developer/tutorials/define_module_data.rst:241
msgid "10000"
msgstr ""
#: ../../content/developer/tutorials/define_module_data.rst:241
#: ../../content/developer/tutorials/define_module_data.rst:242
#: ../../content/developer/tutorials/define_module_data.rst:243
msgid "14"
msgstr ""
#: ../../content/developer/tutorials/define_module_data.rst:242
msgid "1500000"
msgstr ""
#: ../../content/developer/tutorials/define_module_data.rst:243
msgid "Deco Addict"
msgstr ""
#: ../../content/developer/tutorials/define_module_data.rst:243
msgid "1500001"
msgstr ""
#: ../../content/developer/tutorials/define_module_data.rst:246
msgid "Ensure both of your demo properties are created with their Property Type set to Residential."
msgstr ""
#: ../../content/developer/tutorials/define_module_data.rst:251
msgid "The value to assign to a field is not always a simple string and you might need to compute it. It can also be used to optimize the insertion of related values, or because a constraint forces you to add the related values in batch. See ::ref:`Add X2many fields <tutorials/getting_started/C_data/x2m>`."
msgstr ""
#: ../../content/developer/tutorials/define_module_data.rst:264
msgid "The offers you added should always be in a date relative to the installation of the module."
msgstr ""
#: ../../content/developer/tutorials/define_module_data.rst:270
msgid "Sometimes, you need to call the ORM to do a ``search``. This is not feasible with the CSV format."
msgstr ""
#: ../../content/developer/tutorials/define_module_data.rst:283
msgid "In this code snippet, it is needed because the master data depends on the localization installed."
msgstr ""
#: ../../content/developer/tutorials/define_module_data.rst:289
msgid "You might also need to execute python code when loading data."
msgstr ""
#: ../../content/developer/tutorials/define_module_data.rst:297
msgid "Validate one of the demo data offers by using the \"Accept Offer\" button. Refuse the others."
msgstr ""
#: ../../content/developer/tutorials/define_module_data.rst:304
msgid "Add X2many fields"
msgstr ""
#: ../../content/developer/tutorials/define_module_data.rst:306
msgid "**Reference**: the documentation related to this topic can be found in :class:`~odoo.fields.Command`."
msgstr ""
#: ../../content/developer/tutorials/define_module_data.rst:309
msgid "If you need to add related data in a One2many or a Many2many field, you can do so by using the :class:`~odoo.fields.Command` methods."
msgstr ""
#: ../../content/developer/tutorials/define_module_data.rst:328
msgid "Create one new Property, but this time with some offers created directly inside the One2many field linked to the Offers."
msgstr ""
#: ../../content/developer/tutorials/define_module_data.rst:332
#: ../../content/developer/tutorials/website.rst:239
msgid "Accessing the data"
msgstr ""
#: ../../content/developer/tutorials/define_module_data.rst:334
msgid "You should never access demo data outside of the demo data declaration, not even in tests."
msgstr ""
#: ../../content/developer/tutorials/define_module_data.rst:337
msgid "There are multiple ways to access the master/demo data."
msgstr ""
#: ../../content/developer/tutorials/define_module_data.rst:339
msgid "In python code, you can use the ``env.ref(self, xml_id, raise_if_not_found=True)`` method. It returns the recordset linked to the ``xml_id`` you specify."
msgstr ""
#: ../../content/developer/tutorials/define_module_data.rst:342
msgid "In XML, you can use the `ref` key like this"
msgstr ""
#: ../../content/developer/tutorials/define_module_data.rst:352
msgid "It will call the ref method, and store the id of the record returned on the field ``related_id`` of the record of type ``tutorial.example`` with id ``id1``."
msgstr ""
#: ../../content/developer/tutorials/define_module_data.rst:355
msgid "In CSV, the title of the column must be suffixed with ``:id`` or ``/id``."
msgstr ""
#: ../../content/developer/tutorials/define_module_data.rst:364
msgid "In SQL, it is more complicated, see :ref:`the advanced section <tutorials/getting_started/C_data/xml_id>`."
msgstr ""
#: ../../content/developer/tutorials/define_module_data.rst:367
msgid "Data can always be deleted by the user. Always code defensively, taking this into account."
msgstr ""
#: ../../content/developer/tutorials/define_module_data.rst:374
msgid "Advanced"
msgstr ""
#: ../../content/developer/tutorials/define_module_data.rst:379
msgid "What is the XML id?"
msgstr ""
#: ../../content/developer/tutorials/define_module_data.rst:381
msgid "Because we don't want a column ``xml_id`` in every single SQL table of the database, we need a mechanism to store it. This is done with the ``ir.model.data`` model."
msgstr ""
#: ../../content/developer/tutorials/define_module_data.rst:384
msgid "It contains the name of the record (the ``xml_id``) along with the module in which it is defined, the model defining it, and the id of it."
msgstr ""
#: ../../content/developer/tutorials/define_module_data.rst:388
msgid "No update"
msgstr ""
#: ../../content/developer/tutorials/define_module_data.rst:390
msgid "The records created with the ``noupdate`` flag won't be updated when upgrading the module that created them, but it will be created if it didn't exist yet."
msgstr ""
#: ../../content/developer/tutorials/define_module_data.rst:393
msgid "``odoo-bin -i module`` will bypass this setting and always load the data. But normally one shouldn't do this on a production database."
msgstr ""
#: ../../content/developer/tutorials/define_module_data.rst:406
msgid "Import as SQL"
msgstr ""
#: ../../content/developer/tutorials/define_module_data.rst:408
msgid "In some cases, it makes sense to do the import directly in SQL. This is however discouraged as it bypasses all the features of the ORM, computed fields (including metadata) and python constraints."
msgstr ""
#: ../../content/developer/tutorials/define_module_data.rst:411
msgid "Generally using raw SQL also bypasses ACLs and increases the risks of injections."
msgstr ""
#: ../../content/developer/tutorials/define_module_data.rst:413
msgid "**Reference**: :ref:`Security in Odoo<reference/security>`"
msgstr ""
#: ../../content/developer/tutorials/define_module_data.rst:415
msgid "It can help to speed the import time by a lot `with huge files <https://github.com/odoo/enterprise/blob/d46cceef8c594b9056d0115edb7169e207a5986f/product_unspsc/hooks.py#L19>`__."
msgstr ""
#: ../../content/developer/tutorials/define_module_data.rst:417
msgid "For more complex imports like for the `translations <https://github.com/odoo/odoo/blob/e1f8d549895cd9c459e6350430f30d541d02838a/odoo/addons/base/models/ir_translation.py#L24>`__."
msgstr ""
#: ../../content/developer/tutorials/define_module_data.rst:419
msgid "It can be necessary to `initialize the database <https://github.com/odoo/odoo/blob/e1f8d549895cd9c459e6350430f30d541d02838a/odoo/addons/base/data/base_data.sql>`__."
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework.rst:5
msgid "Discover the JS framework"
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework.rst:13
msgid "This two parts tutorial is designed to introduce you to the basics of the Odoo Javascript framework. Whether you are new to the framework or have some prior experience, this tutorial will provide you with a solid foundation for using the Odoo JavaScript framework in your projects."
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework.rst:17
msgid "The first part covers the basics of Owl components, which are a key part of the Odoo JS framework. Owl components are reusable UI components that can be used to build complex web interfaces quickly and efficiently. We will explore how to create and use Owl components in Odoo. Then, in the second part of this tutorial, we focus on creating a dashboard using various features of Odoo. Dashboards are an essential part of any web application, and provide a nice starting point to use and interact with the Odoo codebase."
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework.rst:24
msgid "This tutorial assumes that you have some basic knowledge of development with Odoo in general (models, controllers, QWeb, ...). If you are new to Odoo, we recommend that you start with the :doc:`Getting started </developer/tutorials/getting_started>` tutorial before proceeding with this one."
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework.rst:31
msgid "Each chapter of this tutorial is an independant project. If you feel comfortable with Owl, you can start directly with chapter 2."
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework.rst:39
#: ../../content/developer/tutorials/master_odoo_web_framework.rst:48
msgid "Clone the `official Odoo tutorials repository <https://github.com/odoo/tutorials>`_ and switch to the branch `17.0`."
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework.rst:41
#: ../../content/developer/tutorials/master_odoo_web_framework.rst:50
msgid "Add the cloned repository to your :option:`--addons-path <odoo-bin --addons-path>`."
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework.rst:42
msgid "Start a new Odoo database and install the modules `awesome_owl` (for chapter 1) and `awesome_dashboard` (for chapter 2)."
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework.rst:48
msgid ":doc:`discover_js_framework/01_owl_components`"
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework.rst:49
msgid ":doc:`discover_js_framework/02_build_a_dashboard`"
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/01_owl_components.rst:3
msgid "Chapter 1: Owl components"
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/01_owl_components.rst:5
msgid "This chapter introduces the `Owl framework <https://github.com/odoo/owl>`_, a tailor-made component system for Odoo. The main building blocks of OWL are `components <https://github.com/odoo/owl/blob/master/doc/reference/component.md>`_ and `templates <https://github.com/odoo/owl/blob/master/doc/reference/templates.md>`_."
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/01_owl_components.rst:9
msgid "In Owl, every part of user interface is managed by a component: they hold the logic and define the templates that are used to render the user interface. In practice, a component is represented by a small JavaScript class subclassing the `Component` class."
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/01_owl_components.rst:13
msgid "To get started, you need a running Odoo server and a development environment setup. Before getting into the exercises, make sure you have followed all the steps described in this :ref:`tutorial introduction <tutorials/discover_js_framework/setup>`."
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/01_owl_components.rst:18
msgid "If you use Chrome as your web browser, you can install the `Owl Devtools` extension. This extension provides many features to help you understand and profile any Owl application."
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/01_owl_components.rst:21
msgid "`Video: How to use the DevTools <https://www.youtube.com/watch?v=IUyQjwnrpzM>`_"
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/01_owl_components.rst:23
msgid "In this chapter, we use the `awesome_owl` addon, which provides a simplified environment that only contains Owl and a few other files. The goal is to learn Owl itself, without relying on Odoo web client code. To get started, open the `/awesome_owl` route with your browser: it should display an Owl component with the text *hello world*."
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/01_owl_components.rst:30
msgid "The solutions for each exercise of the chapter are hosted on the `official Odoo tutorials repository <https://github.com/odoo/tutorials/commits/17.0-discover-js-framework-solutions/awesome_owl>`_. It is recommended to try to solve them first without looking at the solution!"
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/01_owl_components.rst:36
msgid "Example: a `Counter` component"
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/01_owl_components.rst:38
msgid "First, let us have a look at a simple example. The `Counter` component shown below is a component that maintains an internal number value, displays it, and updates it whenever the user clicks on the button."
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/01_owl_components.rst:58
msgid "The `Counter` component specifies the name of a template that represents its html. It is written in XML using the QWeb language:"
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/01_owl_components.rst:72
msgid "1. Displaying a counter"
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/01_owl_components.rst:77
msgid "As a first exercise, let us modify the `Playground` component located in :file:`awesome_owl/static/src/` to turn it into a counter. To see the result, you can go to the `/awesome_owl` route with your browser."
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/01_owl_components.rst:82
msgid "Modify :file:`playground.js` so that it acts as a counter like in the example above. You will need to use the `useState hook <https://github.com/odoo/owl/blob/master/doc/reference/hooks.md#usestate>`_ so that the component is re-rendered whenever any part of the state object that has been read by this component is modified."
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/01_owl_components.rst:86
msgid "In the same component, create an `increment` method."
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/01_owl_components.rst:87
msgid "Modify the template in :file:`playground.xml` so that it displays your counter variable. Use `t-esc <https://github.com/odoo/owl/blob/master/doc/reference/templates.md#outputting-data>`_ to output the data."
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/01_owl_components.rst:89
msgid "Add a button in the template and specify a `t-on-click <https://github.com/odoo/owl/blob/master/doc/reference/event_handling.md#event-handling>`_ attribute in the button to trigger the `increment` method whenever the button is clicked."
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/01_owl_components.rst:94
msgid "The Odoo JavaScript files downloaded by the browser are minified. For debugging purpose, it's easier when the files are not minified. Switch to :ref:`debug mode with assets <developer-mode/url>` so that the files are not minified."
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/01_owl_components.rst:98
msgid "This exercise showcases an important feature of Owl: the `reactivity system <https://github.com/odoo/owl/blob/master/doc/reference/reactivity.md>`_. The `useState` function wraps a value in a proxy so Owl can keep track of which component needs which part of the state, so it can be updated whenever a value has been changed. Try removing the `useState` function and see what happens."
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/01_owl_components.rst:104
msgid "2. Extract `Counter` in a sub component"
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/01_owl_components.rst:106
msgid "For now we have the logic of a counter in the `Playground` component, but it is not reusable. Let us see how to create a `sub-component <https://github.com/odoo/owl/blob/master/doc/reference/component.md#sub-components>`_ from it:"
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/01_owl_components.rst:109
msgid "Extract the counter code from the `Playground` component into a new `Counter` component."
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/01_owl_components.rst:110
msgid "You can do it in the same file first, but once it's done, update your code to move the `Counter` in its own folder and file. Import it relatively from `./counter/counter`. Make sure the template is in its own file, with the same name."
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/01_owl_components.rst:113
msgid "Add two counters in your playground."
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/01_owl_components.rst:119
msgid "By convention, most components code, template and css should have the same snake-cased name as the component. For example, if we have a `TodoList` component, its code should be in `todo_list.js`, `todo_list.xml` and if necessary, `todo_list.scss`"
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/01_owl_components.rst:124
msgid "Don't forget :code:`/** @odoo-module **/` in your JavaScript files. More information on this can be found :ref:`here <frontend/modules/native_js>`."
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/01_owl_components.rst:130
msgid "3. A simple `Card` component"
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/01_owl_components.rst:132
msgid "Components are really the most natural way to divide a complicated user interface into multiple reusable pieces. But to make them truly useful, it is necessary to be able to communicate some information between them. Let us see how a parent component can provide information to a sub component by using attributes (most commonly known as `props <https://github.com/odoo/owl/blob/master/doc/reference/props.md>`_)."
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/01_owl_components.rst:137
msgid "The goal of this exercise is to create a `Card` component, that takes two props: `title` and `content`. For example, here is how it could be used:"
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/01_owl_components.rst:144
msgid "The above example should produce some html using bootstrap that look like this:"
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/01_owl_components.rst:157
msgid "Create a `Card` component"
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/01_owl_components.rst:158
msgid "Import it in `Playground` and display a few cards in its template"
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/01_owl_components.rst:164
msgid "4. Using `markup` to display html"
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/01_owl_components.rst:166
msgid "If you used `t-esc` in the previous exercise, then you may have noticed that Owl will automatically escape its content. For example, if you try to display some html like this: `<Card title=\"'my title'\" content=\"this.html\"/>` with `this.html = \"<div>some content</div>\"\"`, the resulting output will simply display the html as a string."
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/01_owl_components.rst:171
msgid "In this case, since the `Card` component may be used to display any kind of content, it makes sense to allow the user to display some html. This is done with the `t-out directive <https://github.com/odoo/owl/blob/master/doc/reference/templates.md#outputting-data>`_."
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/01_owl_components.rst:175
msgid "However, displaying arbitrary content as html is dangerous, it could be used to inject malicious code, so by default, Owl will always escape a string unless it has been explicitely marked as safe with the `markup` function."
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/01_owl_components.rst:179
msgid "Update `Card` to use `t-out`"
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/01_owl_components.rst:180
msgid "Update `Playground` to import `markup`, and use it on some html values"
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/01_owl_components.rst:181
msgid "Make sure that you see that normal strings are always escaped, unlike markuped strings."
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/01_owl_components.rst:185
msgid "The `t-esc` directive can still be used in Owl templates. It is slightly faster than `t-out`."
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/01_owl_components.rst:191
msgid "5. Props validation"
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/01_owl_components.rst:193
msgid "The `Card` component has an implicit API. It expects to receive two strings in its props: the `title` and the `content`. Let us make that API more explicit. We can add a props definition that will let Owl perform a validation step in `dev mode <https://github.com/odoo/owl/blob/master/doc/reference/app.md#dev-mode>`_. You can activate the dev mode in the `App configuration <https://github.com/odoo/owl/blob/master/doc/reference/app.md#configuration>`_ (but it is activated by default on the `awesome_owl` playground)."
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/01_owl_components.rst:200
msgid "It is a good practice to do props validation for every component."
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/01_owl_components.rst:202
msgid "Add `props validation <https://github.com/odoo/owl/blob/master/doc/reference/props.md#props-validation>`_ to the `Card` component."
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/01_owl_components.rst:204
msgid "Rename the `title` props into something else in the playground template, then check in the :guilabel:`Console` tab of your browser's dev tools that you can see an error."
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/01_owl_components.rst:208
msgid "6. The sum of two `Counter`"
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/01_owl_components.rst:210
msgid "We saw in a previous exercise that `props` can be used to provide information from a parent to a child component. Now, let us see how we can communicate information in the opposite direction: in this exercise, we want to display two `Counter` components, and below them, the sum of their values. So, the parent component (`Playground`) need to be informed whenever one of the `Counter` value is changed."
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/01_owl_components.rst:216
msgid "This can be done by using a `callback prop <https://github.com/odoo/owl/blob/master/doc/reference/props.md#binding-function-props>`_: a prop that is a function meant to be called back. The child component can choose to call that function with any argument. In our case, we will simply add an optional `onChange` prop that will be called whenever the `Counter` component is incremented."
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/01_owl_components.rst:221
msgid "Add prop validation to the `Counter` component: it should accept an optional `onChange` function prop."
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/01_owl_components.rst:223
msgid "Update the `Counter` component to call the `onChange` prop (if it exists) whenever it is incremented."
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/01_owl_components.rst:225
msgid "Modify the `Playground` component to maintain a local state value (`sum`), initially set to 2, and display it in its template"
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/01_owl_components.rst:227
msgid "Implement an `incrementSum` method in `Playground`"
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/01_owl_components.rst:228
msgid "Give that method as a prop to two (or more!) sub `Counter` components."
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/01_owl_components.rst:235
msgid "There is a subtlety with callback props: they usually should be defined with the `.bind` suffix. See the `documentation <https://github.com/odoo/owl/blob/master/doc/reference/props.md#binding-function-props>`_"
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/01_owl_components.rst:239
msgid "7. A todo list"
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/01_owl_components.rst:241
msgid "Let us now discover various features of Owl by creating a todo list. We need two components: a `TodoList` component that will display a list of `TodoItem` components. The list of todos is a state that should be maintained by the `TodoList`."
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/01_owl_components.rst:245
msgid "For this tutorial, a `todo` is an object that contains three values: an `id` (number), a `description` (string) and a flag `isCompleted` (boolean):"
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/01_owl_components.rst:252
msgid "Create a `TodoList` and a `TodoItem` components"
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/01_owl_components.rst:253
msgid "The `TodoItem` component should receive a `todo` as a prop, and display its `id` and `description` in a `div`."
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/01_owl_components.rst:254
msgid "For now, hardcode the list of todos:"
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/01_owl_components.rst:261
msgid "Use `t-foreach <https://github.com/odoo/owl/blob/master/doc/reference/templates.md#loops>`_ to display each todo in a `TodoItem`"
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/01_owl_components.rst:262
msgid "Display a `TodoList` in the playground"
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/01_owl_components.rst:263
msgid "Add props validation to `TodoItem`"
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/01_owl_components.rst:268
msgid "Note that the `t-foreach` directive is not exactly the same in Owl as the QWeb python implementation: it requires a `t-key` unique value, so Owl can properly reconciliate each element."
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/01_owl_components.rst:273
msgid "Since the `TodoList` and `TodoItem` components are so tightly coupled, it makes sense to put them in the same folder"
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/01_owl_components.rst:277
msgid "8. Use dynamic attributes"
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/01_owl_components.rst:279
msgid "For now, the `TodoItem` component does not visually show if the `todo` is completed. Let us do that by using a `dynamic attributes <https://github.com/odoo/owl/blob/master/doc/reference/templates.md#dynamic-attributes>`_."
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/01_owl_components.rst:282
msgid "Add the Bootstrap classes `text-muted` and `text-decoration-line-through` on the `TodoItem` root element if it is completed."
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/01_owl_components.rst:284
msgid "Change the hardcoded `todo` value to check that it is properly displayed."
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/01_owl_components.rst:286
msgid "Even though the directive is named `t-att` (for attribute), it can be used to set a `class` value (and html properties such as the `value` of an input)."
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/01_owl_components.rst:294
msgid "Owl let you combine static class values with dynamic values. The following example will work as expected:"
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/01_owl_components.rst:300
msgid "See also: `Owl: Dynamic class attributes <https://github.com/odoo/owl/blob/master/doc/reference/templates.md#dynamic-class-attribute>`_"
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/01_owl_components.rst:303
msgid "9. Adding a todo"
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/01_owl_components.rst:305
msgid "So far, the todos in our list are hard-coded. Let us make it more useful by allowing the user to add a todo to the list."
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/01_owl_components.rst:308
msgid "Remove the hardcoded values in the `TodoList` component"
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/01_owl_components.rst:314
msgid "Add an input above the task list with placeholder *Enter a new task*."
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/01_owl_components.rst:315
msgid "Add an `event handler <https://github.com/odoo/owl/blob/master/doc/reference/event_handling.md>`_ on the `keyup` event named `addTodo`."
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/01_owl_components.rst:317
msgid "Implement `addTodo` to check if enter was pressed (:code:`ev.keyCode === 13`), and in that case, create a new todo with the current content of the input as the description and clear the input of all content."
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/01_owl_components.rst:320
msgid "Make sure the todo has a unique id. It can be just a counter that increments at each todo."
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/01_owl_components.rst:321
msgid "Bonus point: don't do anything if the input is empty."
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/01_owl_components.rst:328
msgid "`Owl: Reactivity <https://github.com/odoo/owl/blob/master/doc/reference/reactivity.md>`_"
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/01_owl_components.rst:331
msgid "Theory: Component lifecycle and hooks"
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/01_owl_components.rst:333
msgid "So far, we have seen one example of a hook function: `useState`. A `hook <https://github.com/odoo/owl/blob/master/doc/reference/hooks.md>`_ is a special function that *hook into* the internals of the component. In the case of `useState`, it generates a proxy object linked to the current component. This is why hook functions have to be called in the `setup` method, and no later!"
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/01_owl_components.rst:383
msgid "An Owl component goes through a lot of phases: it can be instantiated, rendered, mounted, updated, detached, destroyed, ... This is the `component lifecycle <https://github.com/odoo/owl/blob/master/doc/reference/component.md#lifecycle>`_. The figure above show the most important events in the life of a component (hooks are shown in purple). Roughly speaking, a component is created, then updated (potentially many times), then is destroyed."
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/01_owl_components.rst:388
msgid "Owl provides a variety of built-in `hooks functions <https://github.com/odoo/owl/blob/master/doc/reference/hooks.md>`_. All of them have to be called in the `setup` function. For example, if you want to execute some code when your component is mounted, you can use the `onMounted` hook:"
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/01_owl_components.rst:402
msgid "All hook functions start with `use` or `on`. For example: `useState` or `onMounted`."
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/01_owl_components.rst:406
msgid "10. Focusing the input"
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/01_owl_components.rst:408
msgid "Let's see how we can access the DOM with `t-ref <https://github.com/odoo/owl/blob/master/doc/reference/refs.md>`_ and `useRef <https://github.com/odoo/owl/blob/master/doc/reference/hooks.md#useref>`_. The main idea is that you need to mark the target element in the component template with a `t-ref`:"
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/01_owl_components.rst:416
msgid "Then you can access it in the JS with the `useRef hook <https://github.com/odoo/owl/blob/master/doc/reference/hooks.md#useref>`_. However, there is a problem if you think about it: the actual html element for a component does not exist when the component is created. It only exists when the component is mounted. But hooks have to be called in the `setup` method. So, `useRef` return an object that contains a `el` (for element) key that is only defined when the component is mounted."
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/01_owl_components.rst:433
msgid "Focus the `input` from the previous exercise. This this should be done from the `TodoList` component (note that there is a `focus` method on the input html element)."
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/01_owl_components.rst:435
msgid "Bonus point: extract the code into a specialized `hook <https://github.com/odoo/owl/blob/master/doc/reference/hooks.md>`_ `useAutofocus` in a new :file:`awesome_owl/utils.js` file."
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/01_owl_components.rst:443
msgid "Refs are usually suffixed by `Ref` to make it obvious that they are special objects:"
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/01_owl_components.rst:450
msgid "11. Toggling todos"
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/01_owl_components.rst:452
msgid "Now, let's add a new feature: mark a todo as completed. This is actually trickier than one might think. The owner of the state is not the same as the component that displays it. So, the `TodoItem` component needs to communicate to its parent that the todo state needs to be toggled. One classic way to do this is by using a `callback prop <https://github.com/odoo/owl/blob/master/doc/reference/props.md#binding-function-props>`_ `toggleState`."
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/01_owl_components.rst:458
msgid "Add an input with the attribute :code:`type=\"checkbox\"` before the id of the task, which must be checked if the state `isCompleted` is true."
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/01_owl_components.rst:462
msgid "Owl does not create attributes computed with the `t-att` directive if it evaluates to a falsy value."
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/01_owl_components.rst:465
msgid "Add a callback props `toggleState` to `TodoItem`."
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/01_owl_components.rst:466
msgid "Add a `click` event handler on the input in the `TodoItem` component and make sure it calls the `toggleState` function with the todo id."
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/01_owl_components.rst:468
#: ../../content/developer/tutorials/discover_js_framework/01_owl_components.rst:481
#: ../../content/developer/tutorials/discover_js_framework/02_build_a_dashboard.rst:279
msgid "Make it work!"
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/01_owl_components.rst:474
msgid "12. Deleting todos"
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/01_owl_components.rst:476
msgid "The final touch is to let the user delete a todo."
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/01_owl_components.rst:478
msgid "Add a new callback prop `removeTodo` in `TodoItem`."
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/01_owl_components.rst:479
msgid "Insert :code:`<span class=\"fa fa-remove\"/>` in the template of the `TodoItem` component."
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/01_owl_components.rst:480
msgid "Whenever the user clicks on it, it should call the `removeTodo` method."
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/01_owl_components.rst:484
msgid "If you're using an array to store your todo list, you can use the JavaScript `splice` function to remove a todo from it."
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/01_owl_components.rst:502
msgid "13. Generic `Card` with slots"
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/01_owl_components.rst:504
msgid "In a :ref:`previous exercise <tutorials/discover_js_framework/simple_card>`, we built a simple `Card` component. But it is honestly quite limited. What if we want to display some arbitrary content inside a card, such as a sub component? Well, it does not work, since the content of the card is described by a string. It would however be very convenient if we could describe the content as a piece of template."
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/01_owl_components.rst:510
msgid "This is exactly what Owl `slot <https://github.com/odoo/owl/blob/master/doc/reference/slots.md>`_ system is designed for: allowing to write generic components."
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/01_owl_components.rst:513
msgid "Let us modify the `Card` component to use slots:"
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/01_owl_components.rst:515
msgid "Remove the `content` prop"
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/01_owl_components.rst:516
msgid "Use the default slot to define the body"
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/01_owl_components.rst:517
msgid "Insert a few cards with arbitrary content, such as a `Counter` component"
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/01_owl_components.rst:518
msgid "(bonus) Add prop validation"
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/01_owl_components.rst:524
msgid "`Bootstrap: documentation on cards <https://getbootstrap.com/docs/5.2/components/card/>`_"
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/01_owl_components.rst:527
msgid "14. Minimizing card content"
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/01_owl_components.rst:529
msgid "Finally, let's add a feature to the `Card` component, to make it more interesting: we want a button to toggle its content (show it or hide it)"
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/01_owl_components.rst:532
msgid "Add a state to the `Card` component to track if it is open (the default) or not"
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/01_owl_components.rst:533
msgid "Add a `t-if` in the template to conditionally render the content"
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/01_owl_components.rst:534
msgid "Add a button in the header, and modify the code to flip the state when the button is clicked"
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/02_build_a_dashboard.rst:3
msgid "Chapter 2: Build a dashboard"
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/02_build_a_dashboard.rst:5
msgid "The first part of this tutorial introduced you to most of Owl ideas. It is now time to learn about the Odoo JavaScript framework in its entirety, as used by the web client."
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/02_build_a_dashboard.rst:23
msgid "To get started, you need a running Odoo server and a development environment setup. Before getting into the exercises, make sure you have followed all the steps described in this :ref:`tutorial introduction <tutorials/discover_js_framework/setup>`. For this chapter, we will start from the empty dashboard provided by the `awesome_dashboard` addon. We will progressively add features to it, using the Odoo JavaScript framework."
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/02_build_a_dashboard.rst:29
#: ../../content/developer/tutorials/master_odoo_web_framework/01_build_clicker_game.rst:14
#: ../../content/developer/tutorials/master_odoo_web_framework/02_create_gallery_view.rst:25
#: ../../content/developer/tutorials/master_odoo_web_framework/03_customize_kanban_view.rst:15
msgid "Goal"
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/02_build_a_dashboard.rst:36
msgid "The solutions for each exercise of the chapter are hosted on the `official Odoo tutorials repository <https://github.com/odoo/tutorials/commits/17.0-discover-js-framework-solutions/awesome_dashboard>`_."
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/02_build_a_dashboard.rst:41
msgid "1. A new Layout"
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/02_build_a_dashboard.rst:43
msgid "Most screens in the Odoo web client uses a common layout: a control panel on top, with some buttons, and a main content zone just below. This is done using the `Layout component <https://github.com/odoo/odoo/blob/17.0/addons/web/static/src/search/layout.js>`_, available in `@web/search/layout`."
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/02_build_a_dashboard.rst:47
msgid "Update the `AwesomeDashboard` component located in :file:`awesome_dashboard/static/src/` to use the `Layout` component. You can use :code:`{controlPanel: {} }` for the `display` props of the `Layout` component."
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/02_build_a_dashboard.rst:51
msgid "Add a `className` prop to `Layout`: `className=\"'o_dashboard h-100'\"`"
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/02_build_a_dashboard.rst:52
msgid "Add a `dashboard.scss` file in which you set the background-color of `.o_dashboard` to gray (or your favorite color)"
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/02_build_a_dashboard.rst:55
msgid "Open http://localhost:8069/web, then open the :guilabel:`Awesome Dashboard` app, and see the result."
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/02_build_a_dashboard.rst:63
msgid "`Example: use of Layout in client action <https://github.com/odoo/odoo/blob/17.0/addons/web/static/src/webclient/actions/reports/report_action.js>`_ and `template <https://github.com/odoo/odoo/blob/17.0/addons/web/static/src/webclient/actions/reports/report_action.xml>`_"
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/02_build_a_dashboard.rst:66
msgid "`Example: use of Layout in kanban view <https://github.com/odoo/odoo/blob/17.0/addons/web/static/src/views/kanban/kanban_controller.xml>`_"
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/02_build_a_dashboard.rst:72
msgid "Theory: Services"
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/02_build_a_dashboard.rst:74
msgid "In practice, every component (except the root component) may be destroyed at any time and replaced (or not) with another component. This means that each component internal state is not persistent. This is fine in many cases, but there certainly are situations where we want to keep some data around. For example, all discuss messages should not be reloaded every time we display a channel."
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/02_build_a_dashboard.rst:79
msgid "Also, it may happen that we need to write some code that is not a component. Maybe something that process all barcodes, or that manages the user configuration (context, ...)."
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/02_build_a_dashboard.rst:82
msgid "The Odoo framework defines the idea of a :ref:`service <frontend/services>`, which is a persistent piece of code that exports state and/or functions. Each service can depend on other services, and components can import a service."
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/02_build_a_dashboard.rst:104
msgid "Services can be accessed by any component. Imagine that we have a service to maintain some shared state:"
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/02_build_a_dashboard.rst:129
msgid "Then, any component can do this:"
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/02_build_a_dashboard.rst:142
msgid "2. Add some buttons for quick navigation"
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/02_build_a_dashboard.rst:144
msgid "One important service provided by Odoo is the `action` service: it can execute all kind of standard actions defined by Odoo. For example, here is how one component could execute an action by its xml id:"
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/02_build_a_dashboard.rst:160
msgid "Let us now add two buttons to our control panel:"
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/02_build_a_dashboard.rst:162
msgid "A button `Customers`, which opens a kanban view with all customers (this action already exists, so you should use `its xml id <https://github.com/odoo/odoo/blob/1f4e583ba20a01f4c44b0a4ada42c4d3bb074273/odoo/addons/base/views/res_partner_views.xml#L510>`_)."
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/02_build_a_dashboard.rst:166
msgid "A button `Leads`, which opens a dynamic action on the `crm.lead` model with a list and a form view."
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/02_build_a_dashboard.rst:172
msgid "`Example: doAction use <https://github.com/odoo/odoo/blob/17.0/addons/account/static/src/components/journal_dashboard_activity /journal_dashboard_activity.js#L35>`_"
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/02_build_a_dashboard.rst:175
msgid "`Code: action service <https://github.com/odoo/odoo/blob/17.0/addons/web/static/src/webclient/actions/action_service.js>`_"
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/02_build_a_dashboard.rst:179
msgid "3. Add a DashboardItem"
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/02_build_a_dashboard.rst:181
msgid "Let us now improve our content."
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/02_build_a_dashboard.rst:183
msgid "Create a generic `DashboardItem` component that display its default slot in a nice card layout It should take an optional `size` number props, that default to `1` The width should be hardcoded to `(18*size)rem`."
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/02_build_a_dashboard.rst:186
msgid "Add a few cards in the dashboard, with no size and a size of 2."
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/02_build_a_dashboard.rst:192
msgid "`Owl slot system <https://github.com/odoo/owl/blob/master/doc/reference/slots.md>`_"
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/02_build_a_dashboard.rst:195
msgid "4. Call the server, add some statistics"
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/02_build_a_dashboard.rst:197
msgid "Let's improve the dashboard by adding a few dashboard items to display *real* business data. The *awesome_dashboard* addon provides a `/awesome_dashboard/statistics` route that is meant to return some interesting information."
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/02_build_a_dashboard.rst:201
msgid "To call a specific controller, we need to use the :ref:`rpc service <frontend/services/rpc>`. It only exports a single function that perform the request: :code:`rpc(route, params, settings)`. A basic request could look like this:"
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/02_build_a_dashboard.rst:215
msgid "Update `Dashboard` so that it uses the `rpc` service."
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/02_build_a_dashboard.rst:216
msgid "Call the statistics route `/awesome_dashboard/statistics` in the `onWillStart` hook."
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/02_build_a_dashboard.rst:217
msgid "Display a few cards in the dashboard containing:"
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/02_build_a_dashboard.rst:219
msgid "Number of new orders this month"
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/02_build_a_dashboard.rst:220
msgid "Total amount of new orders this month"
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/02_build_a_dashboard.rst:221
msgid "Average amount of t-shirt by order this month"
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/02_build_a_dashboard.rst:222
msgid "Number of cancelled orders this month"
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/02_build_a_dashboard.rst:223
msgid "Average time for an order to go from 'new' to 'sent' or 'cancelled'"
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/02_build_a_dashboard.rst:230
msgid "`Code: rpc service <https://github.com/odoo/odoo/blob/17.0/addons/web/static/src/core/network/rpc_service.js>`_"
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/02_build_a_dashboard.rst:231
msgid "`Example: calling a route in onWillStart <https://github.com/odoo/odoo/blob/1f4e583ba20a01f4c44b0a4ada42c4d3bb074273/ addons/lunch/static/src/views/search_model.js#L21>`_"
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/02_build_a_dashboard.rst:236
msgid "5. Cache network calls, create a service"
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/02_build_a_dashboard.rst:238
msgid "If you open the :guilabel:`Network` tab of your browser's dev tools, you will see that the call to `/awesome_dashboard/statistics` is done every time the client action is displayed. This is because the `onWillStart` hook is called each time the `Dashboard` component is mounted. But in this case, we would prefer to do it only the first time, so we actually need to maintain some state outside of the `Dashboard` component. This is a nice use case for a service!"
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/02_build_a_dashboard.rst:244
msgid "Register and import a new `awesome_dashboard.statistics` service."
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/02_build_a_dashboard.rst:245
msgid "It should provide a function `loadStatistics` that, once called, performs the actual rpc, and always return the same information."
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/02_build_a_dashboard.rst:247
msgid "Use the `memoize <https://github.com/odoo/odoo/blob/1f4e583ba20a01f4c44b0a4ada42c4d3bb074273/ addons/web/static/src/core/utils/functions.js#L11>`_ utility function from `@web/core/utils/functions` that will allow caching the statistics."
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/02_build_a_dashboard.rst:250
msgid "Use this service in the `Dashboard` component."
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/02_build_a_dashboard.rst:251
msgid "Check that it works as expected"
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/02_build_a_dashboard.rst:254
msgid "`Example: simple service <https://github.com/odoo/odoo/blob/17.0/addons/web/static/src/core/network/http_service.js>`_"
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/02_build_a_dashboard.rst:255
msgid "`Example: service with a dependency <https://github.com/odoo/odoo/blob/17.0/addons/web/static/src/core/user_service.js>`_"
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/02_build_a_dashboard.rst:259
msgid "6. Display a pie chart"
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/02_build_a_dashboard.rst:261
msgid "Everyone likes charts (!), so let us add a pie chart in our dashboard. It will display the proportions of t-shirts sold for each size: S/M/L/XL/XXL."
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/02_build_a_dashboard.rst:264
msgid "For this exercise, we will use `Chart.js <https://www.chartjs.org/>`_. It is the chart library used by the graph view. However, it is not loaded by default, so we will need to either add it to our assets bundle, or lazy load it. Lazy loading is usually better since our users will not have to load the chartjs code every time if they don't need it."
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/02_build_a_dashboard.rst:269
msgid "Create a `PieChart` component"
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/02_build_a_dashboard.rst:270
msgid "In its `onWillStart` method, load chartjs, you can use the `loadJs <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`."
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/02_build_a_dashboard.rst:274
msgid "Use the `PieChart` component in a `DashboardItem` to display a `pie chart <https://www.chartjs.org/docs/2.8.0/charts/doughnut.html>`_ that shows the correct quantity for each sold t-shirts in each size (that information is available in the statistics route). Note that you can use the `size` property to make it look larger"
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/02_build_a_dashboard.rst:278
msgid "The `PieChart` component will need to render a canvas, and draw on it using `chart.js`."
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/02_build_a_dashboard.rst:286
msgid "`Example: lazy loading a js file <https://github.com/odoo/odoo/blob/1f4e583ba20a01f4c44b0a4ada42c4d3bb074273/ addons/web/static/src/views/graph/graph_renderer.js#L57>`_"
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/02_build_a_dashboard.rst:289
msgid "`Example: rendering a chart in a component <https://github.com/odoo/odoo/blob/1f4e583ba20a01f4c44b0a4ada42c4d3bb074273/ addons/web/static/src/views/graph/graph_renderer.js#L618>`_"
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/02_build_a_dashboard.rst:294
msgid "7. Real life update"
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/02_build_a_dashboard.rst:296
msgid "Since we moved the data loading in a cache, it does not ever updates. But let us say that we are looking at fast moving data, so we want to periodically (for example, every 10min) reload fresh data."
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/02_build_a_dashboard.rst:300
msgid "This is quite simple to implement, with a `setTimeout` or `setInterval` in the dashboard service. However, here is the tricky part: if the dashboard is currently being displayed, it should be updated immediately."
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/02_build_a_dashboard.rst:304
msgid "To do that, one can use a `reactive` object: it is just like the proxy returned by `useState`, but not linked to any component. A component can then do a `useState` on it to subscribe to its changes."
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/02_build_a_dashboard.rst:309
msgid "Update the dashboard service to reload data every 10 minutes (to test it, use 10s instead!)"
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/02_build_a_dashboard.rst:310
msgid "Modify it to return a `reactive <https://github.com/odoo/owl/blob/master/doc/reference/reactivity.md#reactive>`_ object. Reloading data should update the reactive object in place."
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/02_build_a_dashboard.rst:312
msgid "The `Dashboard` component can now use it with a `useState`"
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/02_build_a_dashboard.rst:315
msgid "`Documentation on reactivity <https://github.com/odoo/owl/blob/master/doc/reference/reactivity.md>`_"
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/02_build_a_dashboard.rst:316
msgid "`Example: Use of reactive in a service <https://github.com/odoo/odoo/blob/1f4e583ba20a01f4c44b0a4ada42c4d3bb074273/ addons/web/static/src/core/debug/profiling/profiling_service.js#L30>`_"
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/02_build_a_dashboard.rst:321
msgid "8. Lazy loading the dashboard"
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/02_build_a_dashboard.rst:323
msgid "Let us imagine that our dashboard is getting quite big, and is only of interest to some of our users. In that case, it could make sense to lazy load our dashboard, and all related assets, so we only pay the cost of loading the code when we actually want to look at it."
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/02_build_a_dashboard.rst:328
msgid "To do that, we will need to create a new bundle containing all our dashboard assets, then use the `LazyComponent` (located in `@web/core/assets`)."
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/02_build_a_dashboard.rst:331
msgid "Move all dashboard assets into a sub folder `/dashboard` to make it easier to add to a bundle."
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/02_build_a_dashboard.rst:333
msgid "Create a `awesome_dashboard.dashboard` assets bundle containing all content of the `/dashboard` folder"
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/02_build_a_dashboard.rst:335
msgid "Modify `dashboard.js` to register itself in the `lazy_components` registry, and not in the `action` registry."
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/02_build_a_dashboard.rst:337
msgid "Add in `src/` a file `dashboard_action` that import `LazyComponent` and register it to the `action` registry"
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/02_build_a_dashboard.rst:341
msgid "9. Making our dashboard generic"
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/02_build_a_dashboard.rst:343
msgid "So far, we have a nice working dashboard. But it is currently hardcoded in the dashboard template. What if we want to customize our dashboard? Maybe some users have different needs, and want to see some other data."
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/02_build_a_dashboard.rst:347
msgid "So, the next step is then to make our dashboard generic: instead of hardcoding its content in the template, it can just iterate over a list of dashboard items. But then, many questions comes up: how to represent a dashboard item, how to register it, what data should it receive, and so on. There are many different ways to design such a system, with different trade offs."
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/02_build_a_dashboard.rst:353
msgid "For this tutorial, we will say that a dashboard item is an object with the folowing structure:"
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/02_build_a_dashboard.rst:369
msgid "The `description` value will be useful in a later exercise to show the name of items that the user can choose to add to his dashboard. The `size` number is optional, and simply describes the size of the dashboard item that will be displayed. Finally, the `props` function is optional. If not given, we will simply give the `statistics` object as data. But if it is defined, it will be used to compute specific props for the component."
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/02_build_a_dashboard.rst:375
msgid "The goal is to replace the content of the dashboard with the following snippet:"
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/02_build_a_dashboard.rst:386
msgid "Note that the above example features two advanced features of Owl: dynamic components, and dynamic props."
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/02_build_a_dashboard.rst:388
msgid "We currently have two kinds of item components: number cards, with a title and a number, and pie cards, with some label and a pie chart."
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/02_build_a_dashboard.rst:391
msgid "create and implement two components: `NumberCard` and `PieChartCard`, with the corresponding props"
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/02_build_a_dashboard.rst:392
msgid "create a file `dashboard_items.js` in which you define and export a list of items, using `NumberCard` and `PieChartCard` to recreate our current dashboard"
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/02_build_a_dashboard.rst:394
msgid "import that list of items in our `Dashboard` component, add it to the component, and update the template to use a `t-foreach` like shown above"
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/02_build_a_dashboard.rst:403
msgid "And now, our dashboard template is generic!"
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/02_build_a_dashboard.rst:406
msgid "10. Making our dashboard extensible"
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/02_build_a_dashboard.rst:408
msgid "However, the content of our item list is still hardcoded. Let us fix that by using a registry:"
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/02_build_a_dashboard.rst:410
msgid "Instead of exporting a list, register all dashboard items in a `awesome_dashboard` registry"
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/02_build_a_dashboard.rst:411
msgid "Import all the items of the `awesome_dashboard` registry in the `Dashboard` component"
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/02_build_a_dashboard.rst:413
msgid "The dashboard is now easily extensible. Any other odoo addon that want to register a new item to the dashboard can just add it to the registry."
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/02_build_a_dashboard.rst:417
msgid "11. Add and remove dashboard items"
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/02_build_a_dashboard.rst:419
msgid "Let us see how we can make our dashboard customizable. To make it simple, we will save the user dashboard configuration in the local storage, so it is persistent, but we don't have to deal with the server for now."
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/02_build_a_dashboard.rst:423
msgid "The dashboard configuration will be saved as a list of removed item ids."
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/02_build_a_dashboard.rst:425
msgid "Add a button in the control panel with a gear icon, to indicate that it is a settings button"
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/02_build_a_dashboard.rst:426
msgid "Clicking on that button should open a dialog"
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/02_build_a_dashboard.rst:427
msgid "In that dialog, we want to see a list of all existing dashboard items, each with a checkbox"
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/02_build_a_dashboard.rst:428
msgid "There should be a `Apply` button in the footer. Clicking on it will build a list of all item ids that are unchecked"
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/02_build_a_dashboard.rst:430
msgid "We want to store that value in the local storage"
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/02_build_a_dashboard.rst:431
msgid "And modify the `Dashboard` component to filter the current items by removing the ids of items from the configuration"
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/02_build_a_dashboard.rst:440
msgid "12. Going further"
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/02_build_a_dashboard.rst:442
msgid "Here is a list of some small improvements you could try to do if you have the time:"
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/02_build_a_dashboard.rst:444
msgid "Make sure your application can be :ref:`translated <reference/translations>` (with `env._t`)."
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/02_build_a_dashboard.rst:446
msgid "Clicking on a section of the pie chart should open a list view of all orders which have the corresponding size."
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/02_build_a_dashboard.rst:448
msgid "Save the content of the dashboard in a user settings on the server!"
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/02_build_a_dashboard.rst:449
msgid "Make it responsive: in mobile mode, each card should take 100% of the width"
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/02_build_a_dashboard.rst:452
msgid "`Example: use of env._t function <https://github.com/odoo/odoo/blob/1f4e583ba20a01f4c44b0a4ada42c4d3bb074273/ addons/account/static/src/components/bills_upload/bills_upload.js#L64>`_"
msgstr ""
#: ../../content/developer/tutorials/discover_js_framework/02_build_a_dashboard.rst:455
msgid "`Code: translation code in web/ <https://github.com/odoo/odoo/blob/1f4e583ba20a01f4c44b0a4ada42c4d3bb074273/ addons/web/static/src/core/l10n/translation.js#L16>`_"
msgstr ""
#: ../../content/developer/tutorials/getting_started.rst:15
msgid "Welcome to the Getting Started Odoo tutorial! If you reached this page that means you are interested in the development of your own Odoo module. It might also mean that you recently joined the Odoo company for a rather technical position. In any case, your journey to the technical side of Odoo starts here."
msgstr ""
#: ../../content/developer/tutorials/getting_started.rst:20
msgid "The goal of this tutorial is for you to get an insight of the most important parts of the Odoo development framework while developing your own Odoo module to manage real estate assets. The chapters should be followed in their given order since they cover the development of a new Odoo application from scratch in an incremental way. In other words, each chapter depends on the previous one."
msgstr ""
#: ../../content/developer/tutorials/getting_started.rst:27
msgid "Are you following this tutorial as part of your technical onboarding as an Odoo employee? Then, we ask you to complete all the chapters before joining your new team."
msgstr ""
#: ../../content/developer/tutorials/getting_started.rst:30
msgid "Ready? Let's get started!"
msgstr ""
#: ../../content/developer/tutorials/getting_started.rst:32
msgid ":doc:`getting_started/01_architecture`"
msgstr ""
#: ../../content/developer/tutorials/getting_started.rst:33
msgid ":doc:`getting_started/02_setup`"
msgstr ""
#: ../../content/developer/tutorials/getting_started.rst:34
msgid ":doc:`getting_started/03_newapp`"
msgstr ""
#: ../../content/developer/tutorials/getting_started.rst:35
msgid ":doc:`getting_started/04_basicmodel`"
msgstr ""
#: ../../content/developer/tutorials/getting_started.rst:36
msgid ":doc:`getting_started/05_securityintro`"
msgstr ""
#: ../../content/developer/tutorials/getting_started.rst:37
msgid ":doc:`getting_started/06_firstui`"
msgstr ""
#: ../../content/developer/tutorials/getting_started.rst:38
msgid ":doc:`getting_started/07_basicviews`"
msgstr ""
#: ../../content/developer/tutorials/getting_started.rst:39
msgid ":doc:`getting_started/08_relations`"
msgstr ""
#: ../../content/developer/tutorials/getting_started.rst:40
msgid ":doc:`getting_started/09_compute_onchange`"
msgstr ""
#: ../../content/developer/tutorials/getting_started.rst:41
msgid ":doc:`getting_started/10_actions`"
msgstr ""
#: ../../content/developer/tutorials/getting_started.rst:42
msgid ":doc:`getting_started/11_constraints`"
msgstr ""
#: ../../content/developer/tutorials/getting_started.rst:43
msgid ":doc:`getting_started/12_sprinkles`"
msgstr ""
#: ../../content/developer/tutorials/getting_started.rst:44
msgid ":doc:`getting_started/13_inheritance`"
msgstr ""
#: ../../content/developer/tutorials/getting_started.rst:45
msgid ":doc:`getting_started/14_other_module`"
msgstr ""
#: ../../content/developer/tutorials/getting_started.rst:46
msgid ":doc:`getting_started/15_qwebintro`"
msgstr ""
#: ../../content/developer/tutorials/getting_started.rst:47
msgid ":doc:`getting_started/16_final_word`"
msgstr ""
#: ../../content/developer/tutorials/getting_started/01_architecture.rst:5
msgid "Chapter 1: Architecture Overview"
msgstr ""
#: ../../content/developer/tutorials/getting_started/01_architecture.rst:8
msgid "Multitier application"
msgstr ""
#: ../../content/developer/tutorials/getting_started/01_architecture.rst:10
msgid "Odoo follows a `multitier architecture`_, meaning that the presentation, the business logic and the data storage are separated. More specifically, it uses a three-tier architecture (image from Wikipedia):"
msgstr ""
#: ../../content/developer/tutorials/getting_started/01_architecture.rst:-1
msgid "Three-tier architecture"
msgstr ""
#: ../../content/developer/tutorials/getting_started/01_architecture.rst:18
msgid "The presentation tier is a combination of HTML5, JavaScript and CSS. The logic tier is exclusively written in Python, while the data tier only supports PostgreSQL as an RDBMS."
msgstr ""
#: ../../content/developer/tutorials/getting_started/01_architecture.rst:21
msgid "Depending on the scope of your module, Odoo development can be done in any of these tiers. Therefore, before going any further, it may be a good idea to refresh your memory if you don't have an intermediate level in these topics."
msgstr ""
#: ../../content/developer/tutorials/getting_started/01_architecture.rst:25
msgid "In order to go through this tutorial, you will need a very basic knowledge of HTML and an intermediate level of Python. Advanced topics will require more knowledge in the other subjects. There are plenty of tutorials freely accessible, so we cannot recommend one over another since it depends on your background."
msgstr ""
#: ../../content/developer/tutorials/getting_started/01_architecture.rst:30
msgid "For reference this is the official `Python tutorial`_."
msgstr ""
#: ../../content/developer/tutorials/getting_started/01_architecture.rst:33
msgid "Since version 15.0, Odoo is actively transitioning to using its own in-house developed `OWL framework <https://odoo.github.io/owl/>`_ as part of its presentation tier. The legacy JavaScript framework is still supported but will be deprecated over time. This will be discussed further in advanced topics."
msgstr ""
#: ../../content/developer/tutorials/getting_started/01_architecture.rst:39
msgid "Odoo modules"
msgstr ""
#: ../../content/developer/tutorials/getting_started/01_architecture.rst:41
msgid "Both server and client extensions are packaged as *modules* which are optionally loaded in a *database*. A module is a collection of functions and data that target a single purpose."
msgstr ""
#: ../../content/developer/tutorials/getting_started/01_architecture.rst:45
msgid "Odoo modules can either add brand new business logic to an Odoo system or alter and extend existing business logic. One module can be created to add your country's accounting rules to Odoo's generic accounting support, while a different module can add support for real-time visualisation of a bus fleet."
msgstr ""
#: ../../content/developer/tutorials/getting_started/01_architecture.rst:50
msgid "Everything in Odoo starts and ends with modules."
msgstr ""
#: ../../content/developer/tutorials/getting_started/01_architecture.rst:52
msgid "Terminology: developers group their business features in Odoo *modules*. The main user-facing modules are flagged and exposed as *Apps*, but a majority of the modules aren't Apps. *Modules* may also be referred to as *addons* and the directories where the Odoo server finds them form the ``addons_path``."
msgstr ""
#: ../../content/developer/tutorials/getting_started/01_architecture.rst:60
msgid "An Odoo module **can** contain a number of elements:"
msgstr ""
#: ../../content/developer/tutorials/getting_started/01_architecture.rst:65
msgid ":ref:`Business objects <reference/orm>`"
msgstr ""
#: ../../content/developer/tutorials/getting_started/01_architecture.rst:63
msgid "A business object (e.g. an invoice) is declared as a Python class. The fields defined in these classes are automatically mapped to database columns thanks to the :abbr:`ORM (Object-Relational Mapping)` layer."
msgstr ""
#: ../../content/developer/tutorials/getting_started/01_architecture.rst:68
msgid ":doc:`Object views <../../reference/user_interface/view_architectures>`"
msgstr ""
#: ../../content/developer/tutorials/getting_started/01_architecture.rst:68
msgid "Define UI display"
msgstr ""
#: ../../content/developer/tutorials/getting_started/01_architecture.rst:71
msgid "XML or CSV files declaring the model data:"
msgstr ""
#: ../../content/developer/tutorials/getting_started/01_architecture.rst:73
msgid ":doc:`views <../../reference/user_interface/view_architectures>` or :ref:`reports <reference/reports>`,"
msgstr ""
#: ../../content/developer/tutorials/getting_started/01_architecture.rst:83
msgid "Images, CSS or JavaScript files used by the web interface or website"
msgstr ""
#: ../../content/developer/tutorials/getting_started/01_architecture.rst:85
msgid "None of these elements are mandatory. Some modules may only add data files (e.g. country-specific accounting configuration), while others may only add business objects. During this training, we will create business objects, object views and data files."
msgstr ""
#: ../../content/developer/tutorials/getting_started/01_architecture.rst:98
msgid "When an Odoo module includes business objects (i.e. Python files), they are organized as a `Python package <https://docs.python.org/3/tutorial/modules.html#packages>`_ with a ``__init__.py`` file. This file contains import instructions for various Python files in the module."
msgstr ""
#: ../../content/developer/tutorials/getting_started/01_architecture.rst:103
msgid "Here is a simplified module directory:"
msgstr ""
#: ../../content/developer/tutorials/getting_started/01_architecture.rst:117
msgid "Odoo Editions"
msgstr ""
#: ../../content/developer/tutorials/getting_started/01_architecture.rst:119
msgid "Odoo is available in `two versions`_: Odoo Enterprise (licensed & shared sources) and Odoo Community (open-source). In addition to services such as support or upgrades, the Enterprise version provides extra functionalities to Odoo. From a technical point-of-view, these functionalities are simply new modules installed on top of the modules provided by the Community version."
msgstr ""
#: ../../content/developer/tutorials/getting_started/01_architecture.rst:124
msgid "Ready to start? Before writing actual code, let's go to the :doc:`next chapter <02_setup>` to review the Odoo installation process. Even if Odoo is already running on your system, we strongly suggest you go through this chapter to make sure we start on the same page during the development of our new application."
msgstr ""
#: ../../content/developer/tutorials/getting_started/02_setup.rst:3
msgid "Chapter 2: Development environment setup"
msgstr ""
#: ../../content/developer/tutorials/getting_started/02_setup.rst:5
msgid "Depending on the intended use case, there are multiple ways to install Odoo. For developers of the Odoo community and Odoo employees alike, the preferred way is to perform a source install (:dfn:`running Odoo from the source code`)."
msgstr ""
#: ../../content/developer/tutorials/getting_started/02_setup.rst:10
msgid "Prepare the environment"
msgstr ""
#: ../../content/developer/tutorials/getting_started/02_setup.rst:12
msgid "First, follow the :ref:`contributing/development/setup` section of the contributing guide to prepare your environment."
msgstr ""
#: ../../content/developer/tutorials/getting_started/02_setup.rst:15
msgid "By now, you should have downloaded the source code into two local repositories, one for `odoo/odoo` and one for `odoo/enterprise`. These repositories are set up to push changes to pre-defined forks on GitHub. This will prove to be convenient when you start contributing to the codebase, but for the scope of this tutorial, we want to avoid polluting them with training material. Let's then develop your own module in a third repository `odoo/tutorials`. Like the first two repositories, it will be part of the `addons-path` that references all directories containing Odoo modules. In this repository, we will create our first module!"
msgstr ""
#: ../../content/developer/tutorials/getting_started/02_setup.rst:25
msgid "This repository also already contains some bare modules that will be used in other tutorials."
msgstr ""
#: ../../content/developer/tutorials/getting_started/02_setup.rst:27
msgid "Following the same process as with the `odoo/odoo` and `odoo/enterprise` repositories, clone the `odoo/tutorials` repository on your machine with:"
msgstr ""
#: ../../content/developer/tutorials/getting_started/02_setup.rst:34
msgid "Configure your fork and Git to push changes to your fork rather than to the main codebase. If you work at Odoo, configure Git to push changes to the shared fork created on the account **odoo-dev**."
msgstr ""
#: ../../content/developer/tutorials/getting_started/02_setup.rst:39
msgid "Link Git with your fork"
msgstr ""
#: ../../content/developer/tutorials/getting_started/02_setup.rst:41
msgid "Visit `github.com/odoo/tutorials <https://github.com/odoo/tutorials>`_ and click the :guilabel:`Fork` button to create a fork of the repository on your account."
msgstr ""
#: ../../content/developer/tutorials/getting_started/02_setup.rst:44
msgid "In the command below, replace `<your_github_account>` with the name of the GitHub account on which you created the fork."
msgstr ""
#: ../../content/developer/tutorials/getting_started/02_setup.rst:52
msgid "Link Git with odoo-dev"
msgstr ""
#: ../../content/developer/tutorials/getting_started/02_setup.rst:60
msgid "That's it! Your environment is now prepared to run Odoo from the sources, and you have successfully created a repository to serve as an addons directory. This will allow you to push your work to GitHub."
msgstr ""
#: ../../content/developer/tutorials/getting_started/02_setup.rst:65
msgid "**For Odoo employees only:**"
msgstr ""
#: ../../content/developer/tutorials/getting_started/02_setup.rst:67
msgid "Make sure to read very carefully :ref:`contributing/development/first-contribution`. In particular, your branch name must follow our conventions."
msgstr ""
#: ../../content/developer/tutorials/getting_started/02_setup.rst:70
msgid "Once you have pushed your first change to the shared fork on **odoo-dev**, create a :abbr:`PR (Pull Request)`. Please put your quadrigram in the PR title (e.g., \"abcd - Technical Training\")."
msgstr ""
#: ../../content/developer/tutorials/getting_started/02_setup.rst:74
msgid "This will enable you to share your upcoming work and receive feedback from your coaches. To ensure a continuous feedback loop, we recommend pushing a new commit as soon as you complete a chapter of the tutorial. Note that the PR is automatically updated with commits you push to **odoo-dev**, you don't need to open multiple PRs."
msgstr ""
#: ../../content/developer/tutorials/getting_started/02_setup.rst:79
msgid "At Odoo we use `Runbot <https://runbot.odoo.com>`_ extensively for our :abbr:`CI (Continuous Integration)` tests. When you push your changes to **odoo-dev**, Runbot creates a new build and test your code. Once logged in, you will be able to see your branches `Tutorials project <https://runbot.odoo.com/runbot/tutorials-12>`_."
msgstr ""
#: ../../content/developer/tutorials/getting_started/02_setup.rst:86
msgid "The specific location of the repositories on your file system is not crucial. However, for the sake of simplicity, we will assume that you have cloned all the repositories under the same directory. If this is not the case, make sure to adjust the following commands accordingly, providing the appropriate relative path from the `odoo/odoo` repository to the `odoo/tutorials` repository."
msgstr ""
#: ../../content/developer/tutorials/getting_started/02_setup.rst:93
msgid "Run the server"
msgstr ""
#: ../../content/developer/tutorials/getting_started/02_setup.rst:96
msgid "Launch with `odoo-bin`"
msgstr ""
#: ../../content/developer/tutorials/getting_started/02_setup.rst:98
msgid "Once all dependencies are set up, Odoo can be launched by running `odoo-bin`, the command-line interface of the server."
msgstr ""
#: ../../content/developer/tutorials/getting_started/02_setup.rst:106
msgid "There are multiple :ref:`command-line arguments <reference/cmdline/server>` that you can use to run the server. In this training you will only need some of them."
msgstr ""
#: ../../content/developer/tutorials/getting_started/02_setup.rst:111
msgid "The database that is going to be used."
msgstr ""
#: ../../content/developer/tutorials/getting_started/02_setup.rst:115
msgid "A comma-separated list of directories in which modules are stored. These directories are scanned for modules."
msgstr ""
#: ../../content/developer/tutorials/getting_started/02_setup.rst:120
msgid "Prevent the worker from using more than <limit> CPU seconds for each request."
msgstr ""
#: ../../content/developer/tutorials/getting_started/02_setup.rst:124
msgid "Prevent the worker from taking longer than <limit> seconds to process a request."
msgstr ""
#: ../../content/developer/tutorials/getting_started/02_setup.rst:127
msgid "The :option:`--limit-time-cpu` and :option:`--limit-time-real` arguments can be used to prevent the worker from being killed when debugging the source code."
msgstr ""
#: ../../content/developer/tutorials/getting_started/02_setup.rst:0
msgid "You may face an error similar to `AttributeError: module '<MODULE_NAME>' has no attribute '<$ATTRIBUTE'>`. In this case, you may need to re-install the module with :command:`$ pip install --upgrade --force-reinstall <MODULE_NAME>`."
msgstr ""
#: ../../content/developer/tutorials/getting_started/02_setup.rst:0
msgid "If this error occurs with more than one module, you may need to re-install all the requirements with :command:`$ pip install --upgrade --force-reinstall -r requirements.txt`."
msgstr ""
#: ../../content/developer/tutorials/getting_started/02_setup.rst:0
msgid "You can also clear the python cache to solve the issue:"
msgstr ""
#: ../../content/developer/tutorials/getting_started/02_setup.rst:141
msgid "Other commonly used arguments are:"
msgstr ""
#: ../../content/developer/tutorials/getting_started/02_setup.rst:143
msgid ":option:`-i <odoo-bin --init>`: Install some modules before running the server (comma-separated list). This is equivalent to going to :guilabel:`Apps` in the user interface, and installing the module from there."
msgstr ""
#: ../../content/developer/tutorials/getting_started/02_setup.rst:146
msgid ":option:`-u <odoo-bin --update>`: Update some modules before running the server (comma-separated list). This is equivalent to going to :guilabel:`Apps` in the user interface, selecting a module, and upgrading it from there."
msgstr ""
#: ../../content/developer/tutorials/getting_started/02_setup.rst:151
msgid "For now you cannot add `../technical-training-sandbox` to your `addons-path` as it is empty and will result into an invalid addons-path folder error, but you will have to add it back later on !"
msgstr ""
#: ../../content/developer/tutorials/getting_started/02_setup.rst:155
msgid "Log in to Odoo"
msgstr ""
#: ../../content/developer/tutorials/getting_started/02_setup.rst:157
msgid "Open http://localhost:8069/ on your browser. We recommend using `Chrome <https://www.google.com/intl/en/chrome/>`_, `Firefox <https://www.mozilla.org/firefox/new/>`_, or any other browser with development tools."
msgstr ""
#: ../../content/developer/tutorials/getting_started/02_setup.rst:161
msgid "To log in as the administrator user, use the following credentials:"
msgstr ""
#: ../../content/developer/tutorials/getting_started/02_setup.rst:163
msgid "email: `admin`"
msgstr ""
#: ../../content/developer/tutorials/getting_started/02_setup.rst:164
msgid "password: `admin`"
msgstr ""
#: ../../content/developer/tutorials/getting_started/02_setup.rst:167
msgid "Enable the developer mode"
msgstr ""
#: ../../content/developer/tutorials/getting_started/02_setup.rst:169
msgid "The developer or debug mode is useful for training as it gives access to additional (advanced) tools. In the next chapters, **we will always assume that you have enabled the developer mode**."
msgstr ""
#: ../../content/developer/tutorials/getting_started/02_setup.rst:172
msgid ":ref:`Enable the developer mode <developer-mode>` now. Choose the method that you prefer; they are all equivalent."
msgstr ""
#: ../../content/developer/tutorials/getting_started/02_setup.rst:176
msgid "The main page of the Settings screen is only accessible if at least one application is installed. You will be led into installing your own application in the next chapter."
msgstr ""
#: ../../content/developer/tutorials/getting_started/02_setup.rst:180
msgid "Extra tools"
msgstr ""
#: ../../content/developer/tutorials/getting_started/02_setup.rst:183
msgid "Useful Git commands"
msgstr ""
#: ../../content/developer/tutorials/getting_started/02_setup.rst:185
msgid "Here are some useful Git commands for your day-to-day work."
msgstr ""
#: ../../content/developer/tutorials/getting_started/02_setup.rst:0
msgid "Switch branches:"
msgstr ""
#: ../../content/developer/tutorials/getting_started/02_setup.rst:0
msgid "When you switch branches, both repositories (odoo and enterprise) must be synchronized, i.e. both need to be in the same branch."
msgstr ""
#: ../../content/developer/tutorials/getting_started/02_setup.rst:199
msgid "Fetch and rebase:"
msgstr ""
#: ../../content/developer/tutorials/getting_started/02_setup.rst:212
msgid "Code Editor"
msgstr ""
#: ../../content/developer/tutorials/getting_started/02_setup.rst:214
msgid "If you are working at Odoo, many of your colleagues are using `VSCode <https://code.visualstudio.com>`_, `VSCodium <https://vscodium.com>`_ (the open source equivalent), `PyCharm <https://www.jetbrains.com/pycharm/download/#section=linux>`_, or `Sublime Text <https://www.sublimetext.com>`_. However, you are free to choose your preferred editor."
msgstr ""
#: ../../content/developer/tutorials/getting_started/02_setup.rst:219
msgid "It is important to configure your linters correctly. Using a linter helps you by showing syntax and semantic warnings or errors. Odoo source code tries to respect Python's and JavaScript's standards, but some of them can be ignored."
msgstr ""
#: ../../content/developer/tutorials/getting_started/02_setup.rst:223
msgid "For Python, we use PEP8 with these options ignored:"
msgstr ""
#: ../../content/developer/tutorials/getting_started/02_setup.rst:225
msgid "`E501`: line too long"
msgstr ""
#: ../../content/developer/tutorials/getting_started/02_setup.rst:226
msgid "`E301`: expected 1 blank line, found 0"
msgstr ""
#: ../../content/developer/tutorials/getting_started/02_setup.rst:227
msgid "`E302`: expected 2 blank lines, found 1"
msgstr ""
#: ../../content/developer/tutorials/getting_started/02_setup.rst:229
msgid "For JavaScript, we use ESLint and you can find a `configuration file example here <https://github.com/odoo/odoo/wiki/Javascript-coding-guidelines#use-a-linter>`_."
msgstr ""
#: ../../content/developer/tutorials/getting_started/02_setup.rst:233
msgid "Administrator tools for PostgreSQL"
msgstr ""
#: ../../content/developer/tutorials/getting_started/02_setup.rst:235
msgid "You can manage your PostgreSQL databases using the command line as demonstrated earlier or using a GUI application such as `pgAdmin <https://www.pgadmin.org/download/pgadmin-4-apt/>`_ or `DBeaver <https://dbeaver.io/>`_."
msgstr ""
#: ../../content/developer/tutorials/getting_started/02_setup.rst:239
msgid "To connect the GUI application to your database we recommend you connect using the Unix socket."
msgstr ""
#: ../../content/developer/tutorials/getting_started/02_setup.rst:241
msgid "Host name/address: `/var/run/postgresql`"
msgstr ""
#: ../../content/developer/tutorials/getting_started/02_setup.rst:242
msgid "Port: `5432`"
msgstr ""
#: ../../content/developer/tutorials/getting_started/02_setup.rst:243
msgid "Username: `$USER`"
msgstr ""
#: ../../content/developer/tutorials/getting_started/02_setup.rst:246
msgid "Python Debugging"
msgstr ""
#: ../../content/developer/tutorials/getting_started/02_setup.rst:248
msgid "When facing a bug or trying to understand how the code works, simply printing things out can go a long way, but a proper debugger can save a lot of time."
msgstr ""
#: ../../content/developer/tutorials/getting_started/02_setup.rst:251
msgid "You can use a classic Python library debugger (`pdb <https://docs.python.org/3/library/pdb.html>`_, `pudb <https://pypi.org/project/pudb/>`_ or `ipdb <https://pypi.org/project/ipdb/>`_), or you can use your editor's debugger."
msgstr ""
#: ../../content/developer/tutorials/getting_started/02_setup.rst:255
msgid "In the following example we use ipdb, but the process is similar with other libraries."
msgstr ""
#: ../../content/developer/tutorials/getting_started/02_setup.rst:257
msgid "Install the library:"
msgstr ""
#: ../../content/developer/tutorials/getting_started/02_setup.rst:263
msgid "Place a trigger (breakpoint):"
msgstr ""
#: ../../content/developer/tutorials/getting_started/02_setup.rst:282
msgid "Here is a list of commands:"
msgstr ""
#: ../../content/developer/tutorials/getting_started/02_setup.rst:286
msgid "Print the list of available commands if not argument is supplied. With a command as an argument, print the help about that command."
msgstr ""
#: ../../content/developer/tutorials/getting_started/02_setup.rst:291
msgid "The value of the `expression` is pretty-printed using the `pprint` module."
msgstr ""
#: ../../content/developer/tutorials/getting_started/02_setup.rst:295
msgid "Print a stack trace with the most recent frame at the bottom."
msgstr ""
#: ../../content/developer/tutorials/getting_started/02_setup.rst:299
msgid "Move the current frame one level down in the stack trace (to a newer frame)."
msgstr ""
#: ../../content/developer/tutorials/getting_started/02_setup.rst:303
msgid "Move the current frame one level up in the stack trace (to an older frame)."
msgstr ""
#: ../../content/developer/tutorials/getting_started/02_setup.rst:307
msgid "Continue the execution until the next line in the current function is reached or it returns."
msgstr ""
#: ../../content/developer/tutorials/getting_started/02_setup.rst:311
msgid "Continue the execution and only stop when a breakpoint is encountered."
msgstr ""
#: ../../content/developer/tutorials/getting_started/02_setup.rst:315
msgid "Execute the current line. Stop at the first possible occasion (either in a function that is called or on the next line in the current function)."
msgstr ""
#: ../../content/developer/tutorials/getting_started/02_setup.rst:320
msgid "Quit the debugger. The program being executed is aborted."
msgstr ""
#: ../../content/developer/tutorials/getting_started/02_setup.rst:322
msgid "Now that your server is running, it's time to start :ref:`writing your own application <tutorials/getting_started/03_newapp>`!"
msgstr ""
#: ../../content/developer/tutorials/getting_started/03_newapp.rst:5
msgid "Chapter 3: A New Application"
msgstr ""
#: ../../content/developer/tutorials/getting_started/03_newapp.rst:7
msgid "The purpose of this chapter is to lay the foundation for the creation of a completely new Odoo module. We will start from scratch with the minimum needed to have our module recognized by Odoo. In the upcoming chapters, we will progressively add features to build a realistic business case."
msgstr ""
#: ../../content/developer/tutorials/getting_started/03_newapp.rst:12
msgid "The Real Estate Advertisement module"
msgstr ""
#: ../../content/developer/tutorials/getting_started/03_newapp.rst:14
msgid "Our new module will cover a business area which is very specific and therefore not included in the standard set of modules: real estate. It is worth noting that before developing a new module, it is good practice to verify that Odoo doesn't already provide a way to answer the specific business case."
msgstr ""
#: ../../content/developer/tutorials/getting_started/03_newapp.rst:19
msgid "Here is an overview of the main list view containing some advertisements:"
msgstr ""
#: ../../content/developer/tutorials/getting_started/03_newapp.rst:-1
msgid "List view 01"
msgstr ""
#: ../../content/developer/tutorials/getting_started/03_newapp.rst:25
msgid "The top area of the form view summarizes important information for the property, such as the name, the property type, the postcode and so on. The first tab contains information describing the property: bedrooms, living area, garage, garden..."
msgstr ""
#: ../../content/developer/tutorials/getting_started/03_newapp.rst:-1
msgid "Form view 01"
msgstr ""
#: ../../content/developer/tutorials/getting_started/03_newapp.rst:33
msgid "The second tab lists the offers for the property. We can see here that potential buyers can make offers above or below the expected selling price. It is up to the seller to accept an offer."
msgstr ""
#: ../../content/developer/tutorials/getting_started/03_newapp.rst:-1
msgid "Form view 02"
msgstr ""
#: ../../content/developer/tutorials/getting_started/03_newapp.rst:40
msgid "Here is a quick video showing the workflow of the module."
msgstr ""
#: ../../content/developer/tutorials/getting_started/03_newapp.rst:42
msgid "Hopefully, this video will be recorded soon :-)"
msgstr ""
#: ../../content/developer/tutorials/getting_started/03_newapp.rst:45
msgid "Prepare the addon directory"
msgstr ""
#: ../../content/developer/tutorials/getting_started/03_newapp.rst:47
msgid "**Reference**: the documentation related to this topic can be found in :ref:`manifest <reference/module/manifest>`."
msgstr ""
#: ../../content/developer/tutorials/getting_started/03_newapp.rst:52
msgid "**Goal**: the goal of this section is to have Odoo recognize our new module, which will be an empty shell for now. It will be listed in the Apps:"
msgstr ""
#: ../../content/developer/tutorials/getting_started/03_newapp.rst:0
msgid "The new module appears in the list"
msgstr ""
#: ../../content/developer/tutorials/getting_started/03_newapp.rst:59
msgid "The first step of module creation is to create its directory. In the `tutorials` directory, add a new directory :file:`estate`."
msgstr ""
#: ../../content/developer/tutorials/getting_started/03_newapp.rst:62
msgid "A module must contain at least 2 files: the ``__manifest__.py`` file and a ``__init__.py`` file. The ``__init__.py`` file can remain empty for now and we'll come back to it in the next chapter. On the other hand, the ``__manifest__.py`` file must describe our module and cannot remain empty. Its only required field is the ``name``, but it usually contains much more information."
msgstr ""
#: ../../content/developer/tutorials/getting_started/03_newapp.rst:67
msgid "Take a look at the `CRM file <https://github.com/odoo/odoo/blob/fc92728fb2aa306bf0e01a7f9ae1cfa3c1df0e10/addons/crm/__manifest__.py#L1-L67>`__ as an example. In addition to providing the description of the module (``name``, ``category``, ``summary``, ``website``...), it lists its dependencies (``depends``). A dependency means that the Odoo framework will ensure that these modules are installed before our module is installed. Moreover, if one of these dependencies is uninstalled, then our module and **any other that depends on it will also be uninstalled**. Think about your favorite Linux distribution package manager (``apt``, ``dnf``, ``pacman``...): Odoo works in the same way."
msgstr ""
#: ../../content/developer/tutorials/getting_started/03_newapp.rst:76
msgid "Create the required addon files."
msgstr ""
#: ../../content/developer/tutorials/getting_started/03_newapp.rst:78
msgid "Create the following folders and files:"
msgstr ""
#: ../../content/developer/tutorials/getting_started/03_newapp.rst:80
msgid "``/home/$USER/src/tutorials/estate/__init__.py``"
msgstr ""
#: ../../content/developer/tutorials/getting_started/03_newapp.rst:81
msgid "``/home/$USER/src/tutorials/estate/__manifest__.py``"
msgstr ""
#: ../../content/developer/tutorials/getting_started/03_newapp.rst:83
msgid "The ``__manifest__.py`` file should only define the name and the dependencies of our modules. The only necessary framework module for now is ``base``."
msgstr ""
#: ../../content/developer/tutorials/getting_started/03_newapp.rst:87
msgid "Restart the Odoo server and go to Apps. Click on Update Apps List, search for ``estate`` and... tadaaa, your module appears! Did it not appear? Maybe try removing the default 'Apps' filter ;-)"
msgstr ""
#: ../../content/developer/tutorials/getting_started/03_newapp.rst:91
msgid "Remember to enable the :ref:`developer mode <developer-mode>` as explained in the previous chapter. You won't see the :guilabel:`Update Apps List` button otherwise."
msgstr ""
#: ../../content/developer/tutorials/getting_started/03_newapp.rst:94
msgid "Make your module an 'App'."
msgstr ""
#: ../../content/developer/tutorials/getting_started/03_newapp.rst:96
msgid "Add the appropriate key to your ``__manifest__.py`` so that the module appears when the 'Apps' filter is on."
msgstr ""
#: ../../content/developer/tutorials/getting_started/03_newapp.rst:99
msgid "You can even install the module! But obviously it's an empty shell, so no menu will appear."
msgstr ""
#: ../../content/developer/tutorials/getting_started/03_newapp.rst:101
msgid "All good? If yes, then let's :ref:`create our first model <tutorials/getting_started/04_basicmodel>`!"
msgstr ""
#: ../../content/developer/tutorials/getting_started/04_basicmodel.rst:5
msgid "Chapter 4: Models And Basic Fields"
msgstr ""
#: ../../content/developer/tutorials/getting_started/04_basicmodel.rst:7
msgid "At the end of the :ref:`previous chapter <tutorials/getting_started/03_newapp>`, we were able to create an Odoo module. However, at this point it is still an empty shell which doesn't allow us to store any data. In our real estate module, we want to store the information related to the properties (name, description, price, living area...) in a database. The Odoo framework provides tools to facilitate database interactions."
msgstr ""
#: ../../content/developer/tutorials/getting_started/04_basicmodel.rst:13
msgid "Before moving forward in the exercise, make sure the ``estate`` module is installed, i.e. it must appear as 'Installed' in the Apps list."
msgstr ""
#: ../../content/developer/tutorials/getting_started/04_basicmodel.rst:18
msgid "Do not use mutable global variables."
msgstr ""
#: ../../content/developer/tutorials/getting_started/04_basicmodel.rst:20
msgid "A single Odoo instance can run several databases in parallel within the same python process. Distinct modules might be installed on each of these databases, therefore we cannot rely on global variables that would be updated depending on installed modules."
msgstr ""
#: ../../content/developer/tutorials/getting_started/04_basicmodel.rst:27
msgid "**Reference**: the documentation related to this topic can be found in the :ref:`reference/orm/model` API."
msgstr ""
#: ../../content/developer/tutorials/getting_started/04_basicmodel.rst:32
msgid "**Goal**: at the end of this section, the table ``estate_property`` should be created:"
msgstr ""
#: ../../content/developer/tutorials/getting_started/04_basicmodel.rst:43
msgid "A key component of Odoo is the `ORM`_ layer. This layer avoids having to manually write most `SQL`_ and provides extensibility and security services\\ [#rawsql]_."
msgstr ""
#: ../../content/developer/tutorials/getting_started/04_basicmodel.rst:47
msgid "Business objects are declared as Python classes extending :class:`~odoo.models.Model`, which integrates them into the automated persistence system."
msgstr ""
#: ../../content/developer/tutorials/getting_started/04_basicmodel.rst:51
msgid "Models can be configured by setting attributes in their definition. The most important attribute is :attr:`~odoo.models.Model._name`, which is required and defines the name for the model in the Odoo system. Here is a minimum definition of a model::"
msgstr ""
#: ../../content/developer/tutorials/getting_started/04_basicmodel.rst:62
msgid "This definition is enough for the ORM to generate a database table named `test_model`. By convention all models are located in a `models` directory and each model is defined in its own Python file."
msgstr ""
#: ../../content/developer/tutorials/getting_started/04_basicmodel.rst:66
msgid "Take a look at how the ``crm_recurring_plan`` table is defined and how the corresponding Python file is imported:"
msgstr ""
#: ../../content/developer/tutorials/getting_started/04_basicmodel.rst:69
msgid "The model is defined in the file ``crm/models/crm_recurring_plan.py`` (see `here <https://github.com/odoo/odoo/blob/e80911aaead031e7523173789e946ac1fd27c7dc/addons/crm/models/crm_recurring_plan.py#L1-L9>`__)"
msgstr ""
#: ../../content/developer/tutorials/getting_started/04_basicmodel.rst:71
msgid "The file ``crm_recurring_plan.py`` is imported in ``crm/models/__init__.py`` (see `here <https://github.com/odoo/odoo/blob/e80911aaead031e7523173789e946ac1fd27c7dc/addons/crm/models/__init__.py#L15>`__)"
msgstr ""
#: ../../content/developer/tutorials/getting_started/04_basicmodel.rst:73
msgid "The folder ``models`` is imported in ``crm/__init__.py`` (see `here <https://github.com/odoo/odoo/blob/e80911aaead031e7523173789e946ac1fd27c7dc/addons/crm/__init__.py#L5>`__)"
msgstr ""
#: ../../content/developer/tutorials/getting_started/04_basicmodel.rst:76
msgid "Define the real estate properties model."
msgstr ""
#: ../../content/developer/tutorials/getting_started/04_basicmodel.rst:78
msgid "Based on example given in the CRM module, create the appropriate files and folder for the ``estate_property`` table."
msgstr ""
#: ../../content/developer/tutorials/getting_started/04_basicmodel.rst:81
msgid "When the files are created, add a minimum definition for the ``estate.property`` model."
msgstr ""
#: ../../content/developer/tutorials/getting_started/04_basicmodel.rst:84
msgid "Any modification of the Python files requires a restart of the Odoo server. When we restart the server, we will add the parameters ``-d`` and ``-u``:"
msgstr ""
#: ../../content/developer/tutorials/getting_started/04_basicmodel.rst:91
msgid "``-u estate`` means we want to upgrade the ``estate`` module, i.e. the ORM will apply database schema changes. In this case it creates a new table. ``-d rd-demo`` means that the upgrade should be performed on the ``rd-demo`` database. ``-u`` should always be used in combination with ``-d``."
msgstr ""
#: ../../content/developer/tutorials/getting_started/04_basicmodel.rst:96
msgid "During the startup you should see the following warnings:"
msgstr ""
#: ../../content/developer/tutorials/getting_started/04_basicmodel.rst:106
msgid "If this is the case, then you should be good! To be sure, double check with ``psql`` as demonstrated in the **Goal**."
msgstr ""
#: ../../content/developer/tutorials/getting_started/04_basicmodel.rst:109
msgid "Add a description."
msgstr ""
#: ../../content/developer/tutorials/getting_started/04_basicmodel.rst:111
msgid "Add a ``_description`` to your model to get rid of one of the warnings."
msgstr ""
#: ../../content/developer/tutorials/getting_started/04_basicmodel.rst:116
msgid "**Reference**: the documentation related to this topic can be found in the :ref:`reference/orm/fields` API."
msgstr ""
#: ../../content/developer/tutorials/getting_started/04_basicmodel.rst:119
msgid "Fields are used to define what the model can store and where they are stored. Fields are defined as attributes in the model class::"
msgstr ""
#: ../../content/developer/tutorials/getting_started/04_basicmodel.rst:130
msgid "The ``name`` field is a :class:`~odoo.fields.Char` which will be represented as a Python unicode ``str`` and a SQL ``VARCHAR``."
msgstr ""
#: ../../content/developer/tutorials/getting_started/04_basicmodel.rst:134
msgid "Types"
msgstr ""
#: ../../content/developer/tutorials/getting_started/04_basicmodel.rst:138
msgid "**Goal**: at the end of this section, several basic fields should have been added to the table ``estate_property``:"
msgstr ""
#: ../../content/developer/tutorials/getting_started/04_basicmodel.rst:174
msgid "There are two broad categories of fields: 'simple' fields, which are atomic values stored directly in the model's table, and 'relational' fields, which link records (of the same or different models)."
msgstr ""
#: ../../content/developer/tutorials/getting_started/04_basicmodel.rst:178
msgid "Simple field examples are :class:`~odoo.fields.Boolean`, :class:`~odoo.fields.Float`, :class:`~odoo.fields.Char`, :class:`~odoo.fields.Text`, :class:`~odoo.fields.Date` and :class:`~odoo.fields.Selection`."
msgstr ""
#: ../../content/developer/tutorials/getting_started/04_basicmodel.rst:182
msgid "Add basic fields to the Real Estate Property table."
msgstr ""
#: ../../content/developer/tutorials/getting_started/04_basicmodel.rst:184
msgid "Add the following basic fields to the table:"
msgstr ""
#: ../../content/developer/tutorials/getting_started/04_basicmodel.rst:190
msgid "Text"
msgstr ""
#: ../../content/developer/tutorials/getting_started/04_basicmodel.rst:193
#: ../../content/developer/tutorials/getting_started/04_basicmodel.rst:194
#: ../../content/developer/tutorials/getting_started/08_relations.rst:243
msgid "Float"
msgstr ""
#: ../../content/developer/tutorials/getting_started/04_basicmodel.rst:195
#: ../../content/developer/tutorials/getting_started/04_basicmodel.rst:196
#: ../../content/developer/tutorials/getting_started/04_basicmodel.rst:197
#: ../../content/developer/tutorials/getting_started/04_basicmodel.rst:200
#: ../../content/developer/tutorials/getting_started/09_compute_onchange.rst:175
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:218
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:265
msgid "Integer"
msgstr ""
#: ../../content/developer/tutorials/getting_started/04_basicmodel.rst:198
#: ../../content/developer/tutorials/getting_started/04_basicmodel.rst:199
msgid "Boolean"
msgstr ""
#: ../../content/developer/tutorials/getting_started/04_basicmodel.rst:204
msgid "The ``garden_orientation`` field must have 4 possible values: 'North', 'South', 'East' and 'West'. The selection list is defined as a list of tuples, see `here <https://github.com/odoo/odoo/blob/b0e0035b585f976e912e97e7f95f66b525bc8e43/addons/crm/report/crm_activity_report.py#L31-L34>`__ for an example."
msgstr ""
#: ../../content/developer/tutorials/getting_started/04_basicmodel.rst:209
msgid "When the fields are added to the model, restart the server with ``-u estate``"
msgstr ""
#: ../../content/developer/tutorials/getting_started/04_basicmodel.rst:215
msgid "Connect to ``psql`` and check the structure of the table ``estate_property``. You'll notice that a couple of extra fields were also added to the table. We will revisit them later."
msgstr ""
#: ../../content/developer/tutorials/getting_started/04_basicmodel.rst:223
msgid "**Goal**: at the end of this section, the columns ``name`` and ``expected_price`` should be not nullable in the table ``estate_property``:"
msgstr ""
#: ../../content/developer/tutorials/getting_started/04_basicmodel.rst:238
msgid "Much like the model itself, fields can be configured by passing configuration attributes as parameters::"
msgstr ""
#: ../../content/developer/tutorials/getting_started/04_basicmodel.rst:245
msgid ":attr:`~odoo.fields.Field.string` (``str``, default: field's name)"
msgstr ""
#: ../../content/developer/tutorials/getting_started/04_basicmodel.rst:248
msgid "If ``True``, the field can not be empty. It must either have a default value or always be given a value when creating a record."
msgstr ""
#: ../../content/developer/tutorials/getting_started/04_basicmodel.rst:250
msgid ":attr:`~odoo.fields.Field.help` (``str``, default: ``''``)"
msgstr ""
#: ../../content/developer/tutorials/getting_started/04_basicmodel.rst:251
msgid "Provides long-form help tooltip for users in the UI."
msgstr ""
#: ../../content/developer/tutorials/getting_started/04_basicmodel.rst:255
msgid "Set attributes for existing fields."
msgstr ""
#: ../../content/developer/tutorials/getting_started/04_basicmodel.rst:257
msgid "Add the following attributes:"
msgstr ""
#: ../../content/developer/tutorials/getting_started/04_basicmodel.rst:266
msgid "After restarting the server, both fields should be not nullable."
msgstr ""
#: ../../content/developer/tutorials/getting_started/04_basicmodel.rst:269
msgid "Automatic Fields"
msgstr ""
#: ../../content/developer/tutorials/getting_started/04_basicmodel.rst:271
msgid "**Reference**: the documentation related to this topic can be found in :ref:`reference/fields/automatic`."
msgstr ""
#: ../../content/developer/tutorials/getting_started/04_basicmodel.rst:274
msgid "You may have noticed your model has a few fields you never defined. Odoo creates a few fields in all models\\ [#autofields]_. These fields are managed by the system and can't be written to, but they can be read if useful or necessary:"
msgstr ""
#: ../../content/developer/tutorials/getting_started/04_basicmodel.rst:280
msgid "The unique identifier for a record of the model."
msgstr ""
#: ../../content/developer/tutorials/getting_started/04_basicmodel.rst:288
msgid "User who last modified the record."
msgstr ""
#: ../../content/developer/tutorials/getting_started/04_basicmodel.rst:291
msgid "Now that we have created our first model, let's :ref:`add some security <tutorials/getting_started/05_securityintro>`!"
msgstr ""
#: ../../content/developer/tutorials/getting_started/04_basicmodel.rst:297
msgid "writing raw SQL queries is possible, but requires caution as this bypasses all Odoo authentication and security mechanisms."
msgstr ""
#: ../../content/developer/tutorials/getting_started/05_securityintro.rst:5
msgid "Chapter 5: Security - A Brief Introduction"
msgstr ""
#: ../../content/developer/tutorials/getting_started/05_securityintro.rst:7
msgid "In the :ref:`previous chapter <tutorials/getting_started/04_basicmodel>`, we created our first table intended to store business data. In a business application such as Odoo, one of the first questions to consider is who\\ [#who]_ can access the data. Odoo provides a security mechanism to allow access to the data for specific groups of users."
msgstr ""
#: ../../content/developer/tutorials/getting_started/05_securityintro.rst:12
msgid "The topic of security is covered in more detail in :doc:`../restrict_data_access`. This chapter aims to cover the minimum required for our new module."
msgstr ""
#: ../../content/developer/tutorials/getting_started/05_securityintro.rst:16
msgid "Data Files (CSV)"
msgstr ""
#: ../../content/developer/tutorials/getting_started/05_securityintro.rst:18
msgid "Odoo is a highly data driven system. Although behavior is customized using Python code, part of a module's value is in the data it sets up when loaded. One way to load data is through a CSV file. One example is the `list of country states <https://github.com/odoo/odoo/blob/17.0/odoo/addons/base/data/res.country.state.csv>`_ which is loaded at installation of the `base` module."
msgstr ""
#: ../../content/developer/tutorials/getting_started/05_securityintro.rst:33
#: ../../content/developer/tutorials/getting_started/06_firstui.rst:83
msgid "``id`` is an :term:`external identifier`. It can be used to refer to the record (without knowing its in-database identifier)."
msgstr ""
#: ../../content/developer/tutorials/getting_started/05_securityintro.rst:35
msgid "``country_id:id`` refers to the country by using its :term:`external identifier`."
msgstr ""
#: ../../content/developer/tutorials/getting_started/05_securityintro.rst:36
msgid "``name`` is the name of the state."
msgstr ""
#: ../../content/developer/tutorials/getting_started/05_securityintro.rst:37
msgid "``code`` is the code of the state."
msgstr ""
#: ../../content/developer/tutorials/getting_started/05_securityintro.rst:39
msgid "These three fields are `defined <https://github.com/odoo/odoo/blob/2ad2f3d6567b6266fc42c6d2999d11f3066b282c/odoo/addons/base/models/res_country.py#L108-L111>`__ in the ``res.country.state`` model."
msgstr ""
#: ../../content/developer/tutorials/getting_started/05_securityintro.rst:43
msgid "By convention, a file importing data is located in the ``data`` folder of a module. When the data is related to security, it is located in the ``security`` folder. When the data is related to views and actions (we will cover this later), it is located in the ``views`` folder. Additionally, all of these files must be declared in the ``data`` list within the ``__manifest__.py`` file. Our example file is defined `in the manifest of the base module <https://github.com/odoo/odoo/blob/e8697f609372cd61b045c4ee2c7f0fcfb496f58a/odoo/addons/base/__manifest__.py#L29>`__."
msgstr ""
#: ../../content/developer/tutorials/getting_started/05_securityintro.rst:50
msgid "Also note that the content of the data files is only loaded when a module is installed or updated."
msgstr ""
#: ../../content/developer/tutorials/getting_started/05_securityintro.rst:55
msgid "The data files are sequentially loaded following their order in the ``__manifest__.py`` file. This means that if data ``A`` refers to data ``B``, you must make sure that ``B`` is loaded before ``A``."
msgstr ""
#: ../../content/developer/tutorials/getting_started/05_securityintro.rst:59
msgid "In the case of the country states, you will note that the `list of countries <https://github.com/odoo/odoo/blob/e8697f609372cd61b045c4ee2c7f0fcfb496f58a/odoo/addons/base/__manifest__.py#L22>`__ is loaded **before** the `list of country states <https://github.com/odoo/odoo/blob/e8697f609372cd61b045c4ee2c7f0fcfb496f58a/odoo/addons/base/__manifest__.py#L29>`__. This is because the states refer to the countries."
msgstr ""
#: ../../content/developer/tutorials/getting_started/05_securityintro.rst:65
msgid "Why is all this important for security? Because all the security configuration of a model is loaded through data files, as we'll see in the next section."
msgstr ""
#: ../../content/developer/tutorials/getting_started/05_securityintro.rst:71
msgid "**Reference**: the documentation related to this topic can be found in :ref:`reference/security/acl`."
msgstr ""
#: ../../content/developer/tutorials/getting_started/05_securityintro.rst:76
msgid "**Goal**: at the end of this section, the following warning should not appear anymore:"
msgstr ""
#: ../../content/developer/tutorials/getting_started/05_securityintro.rst:82
msgid "When no access rights are defined on a model, Odoo determines that no users can access the data. It is even notified in the log:"
msgstr ""
#: ../../content/developer/tutorials/getting_started/05_securityintro.rst:90
msgid "Access rights are defined as records of the model ``ir.model.access``. Each access right is associated with a model, a group (or no group for global access) and a set of permissions: create, read, write and unlink\\ [#unlink]_. Such access rights are usually defined in a CSV file named ``ir.model.access.csv``."
msgstr ""
#: ../../content/developer/tutorials/getting_started/05_securityintro.rst:96
msgid "Here is an example for our previous `test_model`:"
msgstr ""
#: ../../content/developer/tutorials/getting_started/05_securityintro.rst:103
msgid "``id`` is an :term:`external identifier`."
msgstr ""
#: ../../content/developer/tutorials/getting_started/05_securityintro.rst:104
msgid "``name`` is the name of the ``ir.model.access``."
msgstr ""
#: ../../content/developer/tutorials/getting_started/05_securityintro.rst:105
msgid "``model_id/id`` refers to the model which the access right applies to. The standard way to refer to the model is ``model_<model_name>``, where ``<model_name>`` is the ``_name`` of the model with the ``.`` replaced by ``_``. Seems cumbersome? Indeed it is..."
msgstr ""
#: ../../content/developer/tutorials/getting_started/05_securityintro.rst:108
msgid "``group_id/id`` refers to the group which the access right applies to."
msgstr ""
#: ../../content/developer/tutorials/getting_started/05_securityintro.rst:109
msgid "``perm_read,perm_write,perm_create,perm_unlink``: read, write, create and unlink permissions"
msgstr ""
#: ../../content/developer/tutorials/getting_started/05_securityintro.rst:111
msgid "Add access rights."
msgstr ""
#: ../../content/developer/tutorials/getting_started/05_securityintro.rst:113
msgid "Create the ``ir.model.access.csv`` file in the appropriate folder and define it in the ``__manifest__.py`` file."
msgstr ""
#: ../../content/developer/tutorials/getting_started/05_securityintro.rst:116
msgid "Give the read, write, create and unlink permissions to the group ``base.group_user``."
msgstr ""
#: ../../content/developer/tutorials/getting_started/05_securityintro.rst:118
msgid "Tip: the warning message in the log gives you most of the solution ;-)"
msgstr ""
#: ../../content/developer/tutorials/getting_started/05_securityintro.rst:120
msgid "Restart the server and the warning message should have disappeared!"
msgstr ""
#: ../../content/developer/tutorials/getting_started/05_securityintro.rst:122
msgid "It's now time to finally :ref:`interact with the UI <tutorials/getting_started/06_firstui>`!"
msgstr ""
#: ../../content/developer/tutorials/getting_started/05_securityintro.rst:124
msgid "meaning which Odoo user (or group of users)"
msgstr ""
#: ../../content/developer/tutorials/getting_started/05_securityintro.rst:126
msgid "'unlink' is the equivalent of 'delete'"
msgstr ""
#: ../../content/developer/tutorials/getting_started/06_firstui.rst:5
msgid "Chapter 6: Finally, Some UI To Play With"
msgstr ""
#: ../../content/developer/tutorials/getting_started/06_firstui.rst:7
msgid "Now that we've created our new :ref:`model <tutorials/getting_started/04_basicmodel>` and its corresponding :ref:`access rights <tutorials/getting_started/05_securityintro>`, it is time to interact with the user interface."
msgstr ""
#: ../../content/developer/tutorials/getting_started/06_firstui.rst:11
msgid "At the end of this chapter, we will have created a couple of menus in order to access a default list and form view."
msgstr ""
#: ../../content/developer/tutorials/getting_started/06_firstui.rst:15
msgid "Data Files (XML)"
msgstr ""
#: ../../content/developer/tutorials/getting_started/06_firstui.rst:17
msgid "**Reference**: the documentation related to this topic can be found in :ref:`reference/data`."
msgstr ""
#: ../../content/developer/tutorials/getting_started/06_firstui.rst:20
msgid "In :ref:`tutorials/getting_started/05_securityintro`, we added data through a CSV file. The CSV format is convenient when the data to load has a simple format. When the format is more complex (e.g. load the structure of a view or an email template), we use the XML format. For example, this `help field <https://github.com/odoo/odoo/blob/09c59012bf80d2ccbafe21c39e604d6cfda72924/addons/crm/views/crm_lost_reason_views.xml#L61-L69>`__ contains HTML tags. While it would be possible to load such data through a CSV file, it is more convenient to use an XML file."
msgstr ""
#: ../../content/developer/tutorials/getting_started/06_firstui.rst:28
msgid "The XML files must be added to the same folders as the CSV files and defined similarly in the ``__manifest__.py``. The content of the data files is also sequentially loaded when a module is installed or updated, therefore all remarks made for CSV files hold true for XML files. When the data is linked to views, we add them to the ``views`` folder."
msgstr ""
#: ../../content/developer/tutorials/getting_started/06_firstui.rst:33
msgid "In this chapter we will load our first action and menus though an XML file. Actions and menus are standard records in the database."
msgstr ""
#: ../../content/developer/tutorials/getting_started/06_firstui.rst:38
msgid "When performance is important, the CSV format is preferred over the XML format. This is the case in Odoo where loading a CSV file is faster than loading an XML file."
msgstr ""
#: ../../content/developer/tutorials/getting_started/06_firstui.rst:41
msgid "In Odoo, the user interface (actions, menus and views) is largely defined by creating and composing records defined in an XML file. A common pattern is Menu > Action > View. To access records the user navigates through several menu levels; the deepest level is an action which triggers the opening of a list of the records."
msgstr ""
#: ../../content/developer/tutorials/getting_started/06_firstui.rst:49
msgid "**Reference**: the documentation related to this topic can be found in :doc:`../../reference/backend/actions`."
msgstr ""
#: ../../content/developer/tutorials/getting_started/06_firstui.rst:54
msgid "**Goal**: at the end of this section, an action should be loaded in the system. We won't see anything yet in the UI, but the file should be loaded in the log:"
msgstr ""
#: ../../content/developer/tutorials/getting_started/06_firstui.rst:61
msgid "Actions can be triggered in three ways:"
msgstr ""
#: ../../content/developer/tutorials/getting_started/06_firstui.rst:67
msgid "We will only cover the first case in this chapter. The second case will be covered in a :ref:`later chapter <tutorials/getting_started/10_actions>` while the last is the focus of an advanced topic. In our Real Estate example, we would like to link a menu to the ``estate.property`` model, so we are able to create a new record. The action can be viewed as the link between the menu and the model."
msgstr ""
#: ../../content/developer/tutorials/getting_started/06_firstui.rst:73
msgid "A basic action for our `test_model` is:"
msgstr ""
#: ../../content/developer/tutorials/getting_started/06_firstui.rst:85
msgid "``model`` has a fixed value of ``ir.actions.act_window`` (:ref:`reference/actions/window`)."
msgstr ""
#: ../../content/developer/tutorials/getting_started/06_firstui.rst:86
msgid "``name`` is the name of the action."
msgstr ""
#: ../../content/developer/tutorials/getting_started/06_firstui.rst:87
msgid "``res_model`` is the model which the action applies to."
msgstr ""
#: ../../content/developer/tutorials/getting_started/06_firstui.rst:88
msgid "``view_mode`` are the views that will be available; in this case they are the list (tree) and form views. We'll see :ref:`later <tutorials/getting_started/15_qwebintro>` that there can be other view modes."
msgstr ""
#: ../../content/developer/tutorials/getting_started/06_firstui.rst:91
msgid "Examples can be found everywhere in Odoo, but `this <https://github.com/odoo/odoo/blob/09c59012bf80d2ccbafe21c39e604d6cfda72924/addons/crm/views/crm_lost_reason_views.xml#L57-L70>`__ is a good example of a simple action. Pay attention to the structure of the XML data file since you will need it in the following exercise."
msgstr ""
#: ../../content/developer/tutorials/getting_started/06_firstui.rst:96
msgid "Add an action."
msgstr ""
#: ../../content/developer/tutorials/getting_started/06_firstui.rst:98
msgid "Create the ``estate_property_views.xml`` file in the appropriate folder and define it in the ``__manifest__.py`` file."
msgstr ""
#: ../../content/developer/tutorials/getting_started/06_firstui.rst:101
msgid "Create an action for the model ``estate.property``."
msgstr ""
#: ../../content/developer/tutorials/getting_started/06_firstui.rst:103
msgid "Restart the server and you should see the file loaded in the log."
msgstr ""
#: ../../content/developer/tutorials/getting_started/06_firstui.rst:106
msgid "Menus"
msgstr ""
#: ../../content/developer/tutorials/getting_started/06_firstui.rst:108
msgid "**Reference**: the documentation related to this topic can be found in :ref:`reference/data/shortcuts`."
msgstr ""
#: ../../content/developer/tutorials/getting_started/06_firstui.rst:113
msgid "**Goal**: at the end of this section, three menus should be created and the default view is displayed:"
msgstr ""
#: ../../content/developer/tutorials/getting_started/06_firstui.rst:0
msgid "Root menus"
msgstr ""
#: ../../content/developer/tutorials/getting_started/06_firstui.rst:0
msgid "First level and action menus"
msgstr ""
#: ../../content/developer/tutorials/getting_started/06_firstui.rst:0
msgid "Default form view"
msgstr ""
#: ../../content/developer/tutorials/getting_started/06_firstui.rst:128
msgid "To reduce the complexity in declaring a menu (``ir.ui.menu``) and connecting it to the corresponding action, we can use the ``<menuitem>`` shortcut ."
msgstr ""
#: ../../content/developer/tutorials/getting_started/06_firstui.rst:131
msgid "A basic menu for our ``test_model_action`` is:"
msgstr ""
#: ../../content/developer/tutorials/getting_started/06_firstui.rst:137
msgid "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 between the menu and the model."
msgstr ""
#: ../../content/developer/tutorials/getting_started/06_firstui.rst:141
msgid "However, menus always follow an architecture, and in practice there are three levels of menus:"
msgstr ""
#: ../../content/developer/tutorials/getting_started/06_firstui.rst:143
msgid "The root menu, which is displayed in the App switcher (the Odoo Community App switcher is a dropdown menu)"
msgstr ""
#: ../../content/developer/tutorials/getting_started/06_firstui.rst:145
msgid "The first level menu, displayed in the top bar"
msgstr ""
#: ../../content/developer/tutorials/getting_started/06_firstui.rst:146
msgid "The action menus"
msgstr ""
#: ../../content/developer/tutorials/getting_started/06_firstui.rst:156
msgid "The easiest way to define the structure is to create it in the XML file. A basic structure for our ``test_model_action`` is:"
msgstr ""
#: ../../content/developer/tutorials/getting_started/06_firstui.rst:167
msgid "The name for the third menu is taken from the name of the ``action``."
msgstr ""
#: ../../content/developer/tutorials/getting_started/06_firstui.rst:169
msgid "Add menus."
msgstr ""
#: ../../content/developer/tutorials/getting_started/06_firstui.rst:171
msgid "Create the ``estate_menus.xml`` file in the appropriate folder and define it in the ``__manifest__.py`` file. Remember the sequential loading of the data files ;-)"
msgstr ""
#: ../../content/developer/tutorials/getting_started/06_firstui.rst:174
msgid "Create the three levels of menus for the ``estate.property`` action created in the previous exercise. Refer to the **Goal** of this section for the expected result."
msgstr ""
#: ../../content/developer/tutorials/getting_started/06_firstui.rst:177
msgid "Restart the server and **refresh the browser**\\ [#refresh]_. You should now see the menus, and you'll even be able to create your first real estate property advertisement!"
msgstr ""
#: ../../content/developer/tutorials/getting_started/06_firstui.rst:181
msgid "Fields, Attributes And View"
msgstr ""
#: ../../content/developer/tutorials/getting_started/06_firstui.rst:185
msgid "**Goal**: at the end of this section, the selling price should be read-only and the number of bedrooms and the availability date should have default values. Additionally the selling price and availability date values won't be copied when the record is duplicated."
msgstr ""
#: ../../content/developer/tutorials/getting_started/06_firstui.rst:-1
msgid "Interaction between model and view"
msgstr ""
#: ../../content/developer/tutorials/getting_started/06_firstui.rst:193
msgid "The reserved fields ``active`` and ``state`` are added to the ``estate.property`` model."
msgstr ""
#: ../../content/developer/tutorials/getting_started/06_firstui.rst:195
msgid "So far we have only used the generic view for our real estate property advertisements, but in most cases we want to fine tune the view. There are many fine-tunings possible in Odoo, but usually the first step is to make sure that:"
msgstr ""
#: ../../content/developer/tutorials/getting_started/06_firstui.rst:199
msgid "some fields have a default value"
msgstr ""
#: ../../content/developer/tutorials/getting_started/06_firstui.rst:200
msgid "some fields are read-only"
msgstr ""
#: ../../content/developer/tutorials/getting_started/06_firstui.rst:201
msgid "some fields are not copied when duplicating the record"
msgstr ""
#: ../../content/developer/tutorials/getting_started/06_firstui.rst:203
msgid "In our real estate business case, we would like the following:"
msgstr ""
#: ../../content/developer/tutorials/getting_started/06_firstui.rst:205
msgid "The selling price should be read-only (it will be automatically filled in later)"
msgstr ""
#: ../../content/developer/tutorials/getting_started/06_firstui.rst:206
msgid "The availability date and the selling price should not be copied when duplicating a record"
msgstr ""
#: ../../content/developer/tutorials/getting_started/06_firstui.rst:207
msgid "The default number of bedrooms should be 2"
msgstr ""
#: ../../content/developer/tutorials/getting_started/06_firstui.rst:208
msgid "The default availability date should be in 3 months"
msgstr ""
#: ../../content/developer/tutorials/getting_started/06_firstui.rst:211
msgid "Some New Attributes"
msgstr ""
#: ../../content/developer/tutorials/getting_started/06_firstui.rst:213
msgid "Before moving further with the view design, let's step back to our model definition. We saw that some attributes, such as ``required=True``, impact the table schema in the database. Other attributes will impact the view or provide default values."
msgstr ""
#: ../../content/developer/tutorials/getting_started/06_firstui.rst:217
msgid "Add new attributes to the fields."
msgstr ""
#: ../../content/developer/tutorials/getting_started/06_firstui.rst:219
msgid "Find the appropriate attributes (see :class:`~odoo.fields.Field`) to:"
msgstr ""
#: ../../content/developer/tutorials/getting_started/06_firstui.rst:221
msgid "set the selling price as read-only"
msgstr ""
#: ../../content/developer/tutorials/getting_started/06_firstui.rst:222
msgid "prevent copying of the availability date and the selling price values"
msgstr ""
#: ../../content/developer/tutorials/getting_started/06_firstui.rst:224
msgid "Restart the server and refresh the browser. You should not be able to set any selling prices. When duplicating a record, the availability date should be empty."
msgstr ""
#: ../../content/developer/tutorials/getting_started/06_firstui.rst:228
msgid "Default Values"
msgstr ""
#: ../../content/developer/tutorials/getting_started/06_firstui.rst:230
msgid "Any field can be given a default value. In the field definition, add the option ``default=X`` where ``X`` is either a Python literal value (boolean, integer, float, string) or a function taking a model and returning a value::"
msgstr ""
#: ../../content/developer/tutorials/getting_started/06_firstui.rst:237
msgid "The ``name`` field will have the value 'Unknown' by default while the ``last_seen`` field will be set as the current time."
msgstr ""
#: ../../content/developer/tutorials/getting_started/06_firstui.rst:240
msgid "Set default values."
msgstr ""
#: ../../content/developer/tutorials/getting_started/06_firstui.rst:242
msgid "Add the appropriate default attributes so that:"
msgstr ""
#: ../../content/developer/tutorials/getting_started/06_firstui.rst:244
msgid "the default number of bedrooms is 2"
msgstr ""
#: ../../content/developer/tutorials/getting_started/06_firstui.rst:245
msgid "the default availability date is in 3 months"
msgstr ""
#: ../../content/developer/tutorials/getting_started/06_firstui.rst:247
msgid "Tip: this might help you: :meth:`~odoo.fields.Date.today`"
msgstr ""
#: ../../content/developer/tutorials/getting_started/06_firstui.rst:249
msgid "Check that the default values are set as expected."
msgstr ""
#: ../../content/developer/tutorials/getting_started/06_firstui.rst:252
msgid "Reserved Fields"
msgstr ""
#: ../../content/developer/tutorials/getting_started/06_firstui.rst:254
msgid "**Reference**: the documentation related to this topic can be found in :ref:`reference/orm/fields/reserved`."
msgstr ""
#: ../../content/developer/tutorials/getting_started/06_firstui.rst:257
msgid "A few field names are reserved for pre-defined behaviors. They should be defined on a model when the related behavior is desired."
msgstr ""
#: ../../content/developer/tutorials/getting_started/06_firstui.rst:260
msgid "Add active field."
msgstr ""
#: ../../content/developer/tutorials/getting_started/06_firstui.rst:262
msgid "Add the ``active`` field to the ``estate.property`` model."
msgstr ""
#: ../../content/developer/tutorials/getting_started/06_firstui.rst:264
msgid "Restart the server, create a new property, then come back to the list view... The property will not be listed! ``active`` is an example of a reserved field with a specific behavior: when a record has ``active=False``, it is automatically removed from any search. To display the created property, you will need to specifically search for inactive records."
msgstr ""
#: ../../content/developer/tutorials/getting_started/06_firstui.rst:-1
msgid "Inactive records"
msgstr ""
#: ../../content/developer/tutorials/getting_started/06_firstui.rst:273
msgid "Set a default value for active field."
msgstr ""
#: ../../content/developer/tutorials/getting_started/06_firstui.rst:275
msgid "Set the appropriate default value for the ``active`` field so it doesn't disappear anymore."
msgstr ""
#: ../../content/developer/tutorials/getting_started/06_firstui.rst:277
msgid "Note that the default ``active=False`` value was assigned to all existing records."
msgstr ""
#: ../../content/developer/tutorials/getting_started/06_firstui.rst:279
msgid "Add state field."
msgstr ""
#: ../../content/developer/tutorials/getting_started/06_firstui.rst:281
msgid "Add a ``state`` field to the ``estate.property`` model. Five values are possible: New, Offer Received, Offer Accepted, Sold and Canceled. It must be required, should not be copied and should have its default value set to 'New'."
msgstr ""
#: ../../content/developer/tutorials/getting_started/06_firstui.rst:285
msgid "Make sure to use the correct type!"
msgstr ""
#: ../../content/developer/tutorials/getting_started/06_firstui.rst:287
msgid "The ``state`` will be used later on for several UI enhancements."
msgstr ""
#: ../../content/developer/tutorials/getting_started/06_firstui.rst:289
msgid "Now that we are able to interact with the UI thanks to the default views, the next step is obvious: we want to define :ref:`our own views <tutorials/getting_started/07_basicviews>`."
msgstr ""
#: ../../content/developer/tutorials/getting_started/06_firstui.rst:292
msgid "A refresh is needed since the web client keeps a cache of the various menus and views for performance reasons."
msgstr ""
#: ../../content/developer/tutorials/getting_started/07_basicviews.rst:5
msgid "Chapter 7: Basic Views"
msgstr ""
#: ../../content/developer/tutorials/getting_started/07_basicviews.rst:7
msgid "We have seen in the :ref:`previous chapter <tutorials/getting_started/06_firstui>` that Odoo is able to generate default views for a given model. In practice, the default view is **never** acceptable for a business application. Instead, we should at least organize the various fields in a logical manner."
msgstr ""
#: ../../content/developer/tutorials/getting_started/07_basicviews.rst:12
msgid "Views are defined in XML files with actions and menus. They are instances of the ``ir.ui.view`` model."
msgstr ""
#: ../../content/developer/tutorials/getting_started/07_basicviews.rst:15
msgid "In our real estate module, we need to organize the fields in a logical way:"
msgstr ""
#: ../../content/developer/tutorials/getting_started/07_basicviews.rst:17
msgid "in the list (tree) view, we want to display more than just the name."
msgstr ""
#: ../../content/developer/tutorials/getting_started/07_basicviews.rst:18
msgid "in the form view, the fields should be grouped."
msgstr ""
#: ../../content/developer/tutorials/getting_started/07_basicviews.rst:19
msgid "in the search view, we must be able to search on more than just the name. Specifically, we want a filter for the 'Available' properties and a shortcut to group by postcode."
msgstr ""
#: ../../content/developer/tutorials/getting_started/07_basicviews.rst:25
msgid "**Reference**: the documentation related to this topic can be found in :ref:`reference/view_architectures/list`."
msgstr ""
#: ../../content/developer/tutorials/getting_started/07_basicviews.rst:30
msgid "**Goal**: at the end of this section, the list view should look like this:"
msgstr ""
#: ../../content/developer/tutorials/getting_started/07_basicviews.rst:0
msgid "List view"
msgstr ""
#: ../../content/developer/tutorials/getting_started/07_basicviews.rst:36
msgid "List views, also called tree views, display records in a tabular form."
msgstr ""
#: ../../content/developer/tutorials/getting_started/07_basicviews.rst:38
msgid "Their root element is ``<tree>``. The most basic version of this view simply lists all the fields to display in the table (where each field is a column):"
msgstr ""
#: ../../content/developer/tutorials/getting_started/07_basicviews.rst:48
msgid "A simple example can be found `here <https://github.com/odoo/odoo/blob/6da14a3aadeb3efc40f145f6c11fc33314b2f15e/addons/crm/views/crm_lost_reason_views.xml#L46-L54>`__."
msgstr ""
#: ../../content/developer/tutorials/getting_started/07_basicviews.rst:51
msgid "Add a custom list view."
msgstr ""
#: ../../content/developer/tutorials/getting_started/07_basicviews.rst:53
msgid "Define a list view for the ``estate.property`` model in the appropriate XML file. Check the **Goal** of this section for the fields to display."
msgstr ""
#: ../../content/developer/tutorials/getting_started/07_basicviews.rst:56
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:379
#: ../../content/developer/tutorials/getting_started/14_other_module.rst:117
msgid "Tips:"
msgstr ""
#: ../../content/developer/tutorials/getting_started/07_basicviews.rst:58
msgid "do not add the ``editable=\"bottom\"`` attribute that you can find in the example above. We'll come back to it later."
msgstr ""
#: ../../content/developer/tutorials/getting_started/07_basicviews.rst:60
msgid "some field labels may need to be adapted to match the reference."
msgstr ""
#: ../../content/developer/tutorials/getting_started/07_basicviews.rst:63
msgid "As always, you need to restart the server (do not forget the ``-u`` option) and refresh the browser to see the result."
msgstr ""
#: ../../content/developer/tutorials/getting_started/07_basicviews.rst:68
msgid "You will probably use some copy-paste in this chapter, therefore always make sure that the ``id`` remains unique for each view!"
msgstr ""
#: ../../content/developer/tutorials/getting_started/07_basicviews.rst:74
msgid "**Reference**: the documentation related to this topic can be found in :ref:`reference/view_architectures/form`."
msgstr ""
#: ../../content/developer/tutorials/getting_started/07_basicviews.rst:79
msgid "**Goal**: at the end of this section, the form view should look like this:"
msgstr ""
#: ../../content/developer/tutorials/getting_started/07_basicviews.rst:0
msgid "Form view"
msgstr ""
#: ../../content/developer/tutorials/getting_started/07_basicviews.rst:87
msgid "Their root element is ``<form>``. They are composed of high-level structure elements (groups and notebooks) and interactive elements (buttons and fields):"
msgstr ""
#: ../../content/developer/tutorials/getting_started/07_basicviews.rst:110
msgid "It is possible to use regular HTML tags such as ``div`` and ``h1`` as well as the the ``class`` attribute (Odoo provides some built-in classes) to fine-tune the look."
msgstr ""
#: ../../content/developer/tutorials/getting_started/07_basicviews.rst:113
msgid "A simple example can be found `here <https://github.com/odoo/odoo/blob/6da14a3aadeb3efc40f145f6c11fc33314b2f15e/addons/crm/views/crm_lost_reason_views.xml#L16-L44>`__."
msgstr ""
#: ../../content/developer/tutorials/getting_started/07_basicviews.rst:116
msgid "Add a custom form view."
msgstr ""
#: ../../content/developer/tutorials/getting_started/07_basicviews.rst:118
msgid "Define a form view for the ``estate.property`` model in the appropriate XML file. Check the **Goal** of this section for the expected final design of the page."
msgstr ""
#: ../../content/developer/tutorials/getting_started/07_basicviews.rst:121
msgid "This might require some trial and error before you get to the expected result ;-) It is advised that you add the fields and the tags one at a time to help understand how it works."
msgstr ""
#: ../../content/developer/tutorials/getting_started/07_basicviews.rst:124
msgid "In order to avoid relaunching the server every time you do a modification to the view, it can be convenient to use the ``--dev xml`` parameter when launching the server:"
msgstr ""
#: ../../content/developer/tutorials/getting_started/07_basicviews.rst:131
msgid "This parameter allows you to just refresh the page to view your view modifications."
msgstr ""
#: ../../content/developer/tutorials/getting_started/07_basicviews.rst:136
msgid "**Reference**: the documentation related to this topic can be found in :ref:`reference/view_architectures/search`."
msgstr ""
#: ../../content/developer/tutorials/getting_started/07_basicviews.rst:141
msgid "**Goal**: at the end of this section, the search view should look like this:"
msgstr ""
#: ../../content/developer/tutorials/getting_started/07_basicviews.rst:0
msgid "Search fields"
msgstr ""
#: ../../content/developer/tutorials/getting_started/07_basicviews.rst:0
msgid "Group By"
msgstr ""
#: ../../content/developer/tutorials/getting_started/07_basicviews.rst:155
msgid "Search views are slightly different from the list and form views since they don't display *content*. Although they apply to a specific model, they are used to filter other views' content (generally aggregated views such as :ref:`reference/view_architectures/list`). Beyond the difference in use case, they are defined the same way."
msgstr ""
#: ../../content/developer/tutorials/getting_started/07_basicviews.rst:161
msgid "Their root element is ``<search>``. The most basic version of this view simply lists all the fields for which a shortcut is desired:"
msgstr ""
#: ../../content/developer/tutorials/getting_started/07_basicviews.rst:171
msgid "The default search view generated by Odoo provides a shortcut to filter by ``name``. It is very common to add the fields which the user is likely to filter on in a customized search view."
msgstr ""
#: ../../content/developer/tutorials/getting_started/07_basicviews.rst:174
msgid "Add a custom search view."
msgstr ""
#: ../../content/developer/tutorials/getting_started/07_basicviews.rst:176
msgid "Define a search view for the ``estate.property`` model in the appropriate XML file. Check the first image of this section's **Goal** for the list of fields."
msgstr ""
#: ../../content/developer/tutorials/getting_started/07_basicviews.rst:179
msgid "After restarting the server, it should be possible to filter on the given fields."
msgstr ""
#: ../../content/developer/tutorials/getting_started/07_basicviews.rst:184
msgid "``domain``: adds the given domain to the current search"
msgstr ""
#: ../../content/developer/tutorials/getting_started/07_basicviews.rst:185
msgid "``context``: adds some context to the current search; uses the key ``group_by`` to group results on the given field name"
msgstr ""
#: ../../content/developer/tutorials/getting_started/07_basicviews.rst:188
msgid "A simple example can be found `here <https://github.com/odoo/odoo/blob/715a24333bf000d5d98b9ede5155d3af32de067c/addons/delivery/views/delivery_view.xml#L30-L44>`__."
msgstr ""
#: ../../content/developer/tutorials/getting_started/07_basicviews.rst:191
msgid "Before going further in the exercise, it is necessary to introduce the 'domain' concept."
msgstr ""
#: ../../content/developer/tutorials/getting_started/07_basicviews.rst:196
msgid "**Reference**: the documentation related to this topic can be found in :ref:`reference/orm/domains`."
msgstr ""
#: ../../content/developer/tutorials/getting_started/07_basicviews.rst:199
msgid "In Odoo, a domain encodes conditions on records: a domain is a list of criteria used to select a subset of a model's records. Each criterion is a triplet with a *field name*, an *operator* and a *value*. A record satisfies a criterion if the specified field meets the condition of the operator applied to the value."
msgstr ""
#: ../../content/developer/tutorials/getting_started/07_basicviews.rst:204
msgid "For instance, when used on the *Product* model the following domain selects all *services* with a unit price greater than *1000*::"
msgstr ""
#: ../../content/developer/tutorials/getting_started/07_basicviews.rst:209
msgid "By default criteria are combined with an implicit AND, meaning *every* criterion needs to be satisfied for a record to match a domain. The logical operators ``&`` (AND), ``|`` (OR) and ``!`` (NOT) can be used to explicitly combine criteria. They are used in prefix position (the operator is inserted before its arguments rather than between). For instance, to select products 'which are services *OR* have a unit price which is *NOT* between 1000 and 2000'::"
msgstr ""
#: ../../content/developer/tutorials/getting_started/07_basicviews.rst:222
msgid "XML does not allow ``<`` and ``&`` to be used inside XML elements. To avoid parsing errors, entity references should be used: ``&lt;`` for ``<`` and ``&amp;`` for ``&``. Other entity references (``&gt;``, ``&apos;`` & ``&quot;``) are optional."
msgstr ""
#: ../../content/developer/tutorials/getting_started/07_basicviews.rst:232
msgid "Add filter and Group By."
msgstr ""
#: ../../content/developer/tutorials/getting_started/07_basicviews.rst:234
msgid "The following should be added to the previously created search view:"
msgstr ""
#: ../../content/developer/tutorials/getting_started/07_basicviews.rst:236
msgid "a filter which displays available properties, i.e. the state should be 'New' or 'Offer Received'."
msgstr ""
#: ../../content/developer/tutorials/getting_started/07_basicviews.rst:238
msgid "the ability to group results by postcode."
msgstr ""
#: ../../content/developer/tutorials/getting_started/07_basicviews.rst:240
msgid "Looking good? At this point we are already able to create models and design a user interface which makes sense business-wise. However, a key component is still missing: the :ref:`link between models <tutorials/getting_started/08_relations>`."
msgstr ""
#: ../../content/developer/tutorials/getting_started/08_relations.rst:5
msgid "Chapter 8: Relations Between Models"
msgstr ""
#: ../../content/developer/tutorials/getting_started/08_relations.rst:7
msgid "The :ref:`previous chapter <tutorials/getting_started/07_basicviews>` covered the creation of custom views for a model containing basic fields. However, in any real business scenario we need more than one model. Moreover, links between models are necessary. One can easily imagine one model containing the customers and another one containing the list of users. You might need to refer to a customer or a user on any existing business model."
msgstr ""
#: ../../content/developer/tutorials/getting_started/08_relations.rst:13
msgid "In our real estate module, we want the following information for a property:"
msgstr ""
#: ../../content/developer/tutorials/getting_started/08_relations.rst:15
msgid "the customer who bought the property"
msgstr ""
#: ../../content/developer/tutorials/getting_started/08_relations.rst:16
msgid "the real estate agent who sold the property"
msgstr ""
#: ../../content/developer/tutorials/getting_started/08_relations.rst:17
msgid "the property type: house, apartment, penthouse, castle..."
msgstr ""
#: ../../content/developer/tutorials/getting_started/08_relations.rst:18
msgid "a list of tags characterizing the property: cozy, renovated..."
msgstr ""
#: ../../content/developer/tutorials/getting_started/08_relations.rst:19
msgid "a list of the offers received"
msgstr ""
#: ../../content/developer/tutorials/getting_started/08_relations.rst:22
msgid "Many2one"
msgstr ""
#: ../../content/developer/tutorials/getting_started/08_relations.rst:24
msgid "**Reference**: the documentation related to this topic can be found in :class:`~odoo.fields.Many2one`."
msgstr ""
#: ../../content/developer/tutorials/getting_started/08_relations.rst:29
#: ../../content/developer/tutorials/getting_started/08_relations.rst:136
#: ../../content/developer/tutorials/getting_started/08_relations.rst:199
#: ../../content/developer/tutorials/getting_started/09_compute_onchange.rst:25
#: ../../content/developer/tutorials/getting_started/10_actions.rst:27
#: ../../content/developer/tutorials/getting_started/11_constraints.rst:24
#: ../../content/developer/tutorials/getting_started/13_inheritance.rst:20
#: ../../content/developer/tutorials/getting_started/14_other_module.rst:18
msgid "**Goal**: at the end of this section:"
msgstr ""
#: ../../content/developer/tutorials/getting_started/08_relations.rst:31
msgid "a new ``estate.property.type`` model should be created with the corresponding menu, action and views."
msgstr ""
#: ../../content/developer/tutorials/getting_started/08_relations.rst:0
msgid "Property type"
msgstr ""
#: ../../content/developer/tutorials/getting_started/08_relations.rst:37
msgid "three Many2one fields should be added to the ``estate.property`` model: property type, buyer and seller."
msgstr ""
#: ../../content/developer/tutorials/getting_started/08_relations.rst:0
msgid "Property"
msgstr ""
#: ../../content/developer/tutorials/getting_started/08_relations.rst:43
msgid "In our real estate module, we want to define the concept of property type. A property type is, for example, a house or an apartment. It is a standard business need to categorize properties according to their type, especially to refine filtering."
msgstr ""
#: ../../content/developer/tutorials/getting_started/08_relations.rst:47
msgid "A property can have **one** type, but the same type can be assigned to **many** properties. This is supported by the **many2one** concept."
msgstr ""
#: ../../content/developer/tutorials/getting_started/08_relations.rst:50
msgid "A many2one is a simple link to another object. For example, in order to define a link to the ``res.partner`` in our test model, we can write::"
msgstr ""
#: ../../content/developer/tutorials/getting_started/08_relations.rst:55
msgid "By convention, many2one fields have the ``_id`` suffix. Accessing the data in the partner can then be easily done with::"
msgstr ""
#: ../../content/developer/tutorials/getting_started/08_relations.rst:62
msgid "`foreign keys <https://www.postgresql.org/docs/12/tutorial-fk.html>`_"
msgstr ""
#: ../../content/developer/tutorials/getting_started/08_relations.rst:64
msgid "In practice a many2one can be seen as a dropdown list in a form view."
msgstr ""
#: ../../content/developer/tutorials/getting_started/08_relations.rst:66
msgid "Add the Real Estate Property Type table."
msgstr ""
#: ../../content/developer/tutorials/getting_started/08_relations.rst:68
msgid "Create the ``estate.property.type`` model and add the following field:"
msgstr ""
#: ../../content/developer/tutorials/getting_started/08_relations.rst:71
#: ../../content/developer/tutorials/getting_started/08_relations.rst:178
#: ../../content/developer/tutorials/getting_started/08_relations.rst:241
msgid "Attributes"
msgstr ""
#: ../../content/developer/tutorials/getting_started/08_relations.rst:76
#: ../../content/developer/tutorials/getting_started/08_relations.rst:183
msgid "Add the menus as displayed in this section's **Goal**"
msgstr ""
#: ../../content/developer/tutorials/getting_started/08_relations.rst:77
msgid "Add the field ``property_type_id`` into your ``estate.property`` model and its form, tree and search views"
msgstr ""
#: ../../content/developer/tutorials/getting_started/08_relations.rst:80
msgid "This exercise is a good recap of the previous chapters: you need to create a :ref:`model <tutorials/getting_started/04_basicmodel>`, set the :ref:`model <tutorials/getting_started/05_securityintro>`, add an :ref:`action and a menu <tutorials/getting_started/06_firstui>`, and :ref:`create a view <tutorials/getting_started/07_basicviews>`."
msgstr ""
#: ../../content/developer/tutorials/getting_started/08_relations.rst:86
msgid "Tip: do not forget to import any new Python files in ``__init__.py``, add new data files in ``__manifest.py__`` or add the access rights ;-)"
msgstr ""
#: ../../content/developer/tutorials/getting_started/08_relations.rst:89
msgid "Once again, restart the server and refresh to see the results!"
msgstr ""
#: ../../content/developer/tutorials/getting_started/08_relations.rst:91
msgid "In the real estate module, there are still two missing pieces of information we want on a property: the buyer and the salesperson. The buyer can be any individual, but on the other hand the salesperson must be an employee of the real estate agency (i.e. an Odoo user)."
msgstr ""
#: ../../content/developer/tutorials/getting_started/08_relations.rst:95
msgid "In Odoo, there are two models which we commonly refer to:"
msgstr ""
#: ../../content/developer/tutorials/getting_started/08_relations.rst:97
msgid "``res.partner``: a partner is a physical or legal entity. It can be a company, an individual or even a contact address."
msgstr ""
#: ../../content/developer/tutorials/getting_started/08_relations.rst:99
msgid "``res.users``: the users of the system. Users can be 'internal', i.e. they have access to the Odoo backend. Or they can be 'portal', i.e. they cannot access the backend, only the frontend (e.g. to access their previous orders in eCommerce)."
msgstr ""
#: ../../content/developer/tutorials/getting_started/08_relations.rst:103
msgid "Add the buyer and the salesperson."
msgstr ""
#: ../../content/developer/tutorials/getting_started/08_relations.rst:105
msgid "Add a buyer and a salesperson to the ``estate.property`` model using the two common models mentioned above. They should be added in a new tab of the form view, as depicted in this section's **Goal**."
msgstr ""
#: ../../content/developer/tutorials/getting_started/08_relations.rst:108
msgid "The default value for the salesperson must be the current user. The buyer should not be copied."
msgstr ""
#: ../../content/developer/tutorials/getting_started/08_relations.rst:110
msgid "Tip: to get the default value, check the note below or look at an example `here <https://github.com/odoo/odoo/blob/5bb8b927524d062be32f92eb326ef64091301de1/addons/crm/models/crm_lead.py#L92>`__."
msgstr ""
#: ../../content/developer/tutorials/getting_started/08_relations.rst:126
msgid "Now let's have a look at other types of links."
msgstr ""
#: ../../content/developer/tutorials/getting_started/08_relations.rst:129
msgid "Many2many"
msgstr ""
#: ../../content/developer/tutorials/getting_started/08_relations.rst:131
msgid "**Reference**: the documentation related to this topic can be found in :class:`~odoo.fields.Many2many`."
msgstr ""
#: ../../content/developer/tutorials/getting_started/08_relations.rst:138
msgid "a new ``estate.property.tag`` model should be created with the corresponding menu and action."
msgstr ""
#: ../../content/developer/tutorials/getting_started/08_relations.rst:0
msgid "Property tag"
msgstr ""
#: ../../content/developer/tutorials/getting_started/08_relations.rst:144
msgid "tags should be added to the ``estate.property`` model:"
msgstr ""
#: ../../content/developer/tutorials/getting_started/08_relations.rst:150
msgid "In our real estate module, we want to define the concept of property tags. A property tag is, for example, a property which is 'cozy' or 'renovated'."
msgstr ""
#: ../../content/developer/tutorials/getting_started/08_relations.rst:153
msgid "A property can have **many** tags and a tag can be assigned to **many** properties. This is supported by the **many2many** concept."
msgstr ""
#: ../../content/developer/tutorials/getting_started/08_relations.rst:156
msgid "A many2many is a bidirectional multiple relationship: any record on one side can be related to any number of records on the other side. For example, in order to define a link to the ``account.tax`` model on our test model, we can write::"
msgstr ""
#: ../../content/developer/tutorials/getting_started/08_relations.rst:162
msgid "By convention, many2many fields have the ``_ids`` suffix. This means that several taxes can be added to our test model. It behaves as a list of records, meaning that accessing the data must be done in a loop::"
msgstr ""
#: ../../content/developer/tutorials/getting_started/08_relations.rst:169
msgid "A list of records is known as a *recordset*, i.e. an ordered collection of records. It supports standard Python operations on collections, such as ``len()`` and ``iter()``, plus extra set operations like ``recs1 | recs2``."
msgstr ""
#: ../../content/developer/tutorials/getting_started/08_relations.rst:173
msgid "Add the Real Estate Property Tag table."
msgstr ""
#: ../../content/developer/tutorials/getting_started/08_relations.rst:175
msgid "Create the ``estate.property.tag`` model and add the following field:"
msgstr ""
#: ../../content/developer/tutorials/getting_started/08_relations.rst:184
msgid "Add the field ``tag_ids`` to your ``estate.property`` model and in its form and tree views"
msgstr ""
#: ../../content/developer/tutorials/getting_started/08_relations.rst:186
msgid "Tip: in the view, use the ``widget=\"many2many_tags\"`` attribute as demonstrated `here <https://github.com/odoo/odoo/blob/5bb8b927524d062be32f92eb326ef64091301de1/addons/crm_iap_lead_website/views/crm_reveal_views.xml#L36>`__. The ``widget`` attribute will be explained in detail in :ref:`a later chapter of the training <tutorials/getting_started/12_sprinkles>`. For now, you can try to adding and removing it and see the result ;-)"
msgstr ""
#: ../../content/developer/tutorials/getting_started/08_relations.rst:192
msgid "One2many"
msgstr ""
#: ../../content/developer/tutorials/getting_started/08_relations.rst:194
msgid "**Reference**: the documentation related to this topic can be found in :class:`~odoo.fields.One2many`."
msgstr ""
#: ../../content/developer/tutorials/getting_started/08_relations.rst:201
msgid "a new ``estate.property.offer`` model should be created with the corresponding form and tree view."
msgstr ""
#: ../../content/developer/tutorials/getting_started/08_relations.rst:202
msgid "offers should be added to the ``estate.property`` model:"
msgstr ""
#: ../../content/developer/tutorials/getting_started/08_relations.rst:0
msgid "Property offers"
msgstr ""
#: ../../content/developer/tutorials/getting_started/08_relations.rst:208
msgid "In our real estate module, we want to define the concept of property offers. A property offer is an amount a potential buyer offers to the seller. The offer can be lower or higher than the expected price."
msgstr ""
#: ../../content/developer/tutorials/getting_started/08_relations.rst:212
msgid "An offer applies to **one** property, but the same property can have **many** offers. The concept of **many2one** appears once again. However, in this case we want to display the list of offers for a given property so we will use the **one2many** concept."
msgstr ""
#: ../../content/developer/tutorials/getting_started/08_relations.rst:216
msgid "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::"
msgstr ""
#: ../../content/developer/tutorials/getting_started/08_relations.rst:222
msgid "The first parameter is called the ``comodel`` and the second parameter is the field we want to inverse."
msgstr ""
#: ../../content/developer/tutorials/getting_started/08_relations.rst:225
msgid "By convention, one2many fields have the ``_ids`` suffix. They behave as a list of records, meaning that accessing the data must be done in a loop::"
msgstr ""
#: ../../content/developer/tutorials/getting_started/08_relations.rst:233
msgid "Because a :class:`~odoo.fields.One2many` is a virtual relationship, there *must* be a :class:`~odoo.fields.Many2one` field defined in the comodel."
msgstr ""
#: ../../content/developer/tutorials/getting_started/08_relations.rst:236
msgid "Add the Real Estate Property Offer table."
msgstr ""
#: ../../content/developer/tutorials/getting_started/08_relations.rst:238
msgid "Create the ``estate.property.offer`` model and add the following fields:"
msgstr ""
#: ../../content/developer/tutorials/getting_started/08_relations.rst:243
msgid "price"
msgstr ""
#: ../../content/developer/tutorials/getting_started/08_relations.rst:244
msgid "no copy"
msgstr ""
#: ../../content/developer/tutorials/getting_started/08_relations.rst:244
msgid "Accepted, Refused"
msgstr ""
#: ../../content/developer/tutorials/getting_started/08_relations.rst:245
msgid "partner_id"
msgstr ""
#: ../../content/developer/tutorials/getting_started/08_relations.rst:245
msgid "Many2one (``res.partner``)"
msgstr ""
#: ../../content/developer/tutorials/getting_started/08_relations.rst:246
msgid "property_id"
msgstr ""
#: ../../content/developer/tutorials/getting_started/08_relations.rst:246
msgid "Many2one (``estate.property``)"
msgstr ""
#: ../../content/developer/tutorials/getting_started/08_relations.rst:249
msgid "Create a tree view and a form view with the ``price``, ``partner_id`` and ``status`` fields. No need to create an action or a menu."
msgstr ""
#: ../../content/developer/tutorials/getting_started/08_relations.rst:251
msgid "Add the field ``offer_ids`` to your ``estate.property`` model and in its form view as depicted in this section's **Goal**."
msgstr ""
#: ../../content/developer/tutorials/getting_started/08_relations.rst:254
msgid "There are several important things to notice here. First, we don't need an action or a menu for all models. Some models are intended to be accessed only through another model. This is the case in our exercise: an offer is always accessed through a property."
msgstr ""
#: ../../content/developer/tutorials/getting_started/08_relations.rst:258
msgid "Second, despite the fact that the ``property_id`` field is required, we did not include it in the views. How does Odoo know which property our offer is linked to? Well that's part of the magic of using the Odoo framework: sometimes things are defined implicitly. When we create a record through a one2many field, the corresponding many2one is populated automatically for convenience."
msgstr ""
#: ../../content/developer/tutorials/getting_started/08_relations.rst:264
msgid "Still alive? This chapter is definitely not the easiest one. It introduced a couple of new concepts while relying on everything that was introduced before. The :ref:`next chapter <tutorials/getting_started/09_compute_onchange>` will be lighter, don't worry ;-)"
msgstr ""
#: ../../content/developer/tutorials/getting_started/09_compute_onchange.rst:5
msgid "Chapter 9: Computed Fields And Onchanges"
msgstr ""
#: ../../content/developer/tutorials/getting_started/09_compute_onchange.rst:7
msgid "The :ref:`relations between models <tutorials/getting_started/08_relations>` are a key component of any Odoo module. They are necessary for the modelization of any business case. However, we may want links between the fields within a given model. Sometimes the value of one field is determined from the values of other fields and other times we want to help the user with data entry."
msgstr ""
#: ../../content/developer/tutorials/getting_started/09_compute_onchange.rst:12
msgid "These cases are supported by the concepts of computed fields and onchanges. Although this chapter is not technically complex, the semantics of both concepts is very important. This is also the first time we will write Python logic. Until now we haven't written anything other than class definitions and field declarations."
msgstr ""
#: ../../content/developer/tutorials/getting_started/09_compute_onchange.rst:20
msgid "**Reference**: the documentation related to this topic can be found in :ref:`reference/fields/compute`."
msgstr ""
#: ../../content/developer/tutorials/getting_started/09_compute_onchange.rst:27
msgid "In the property model, the total area and the best offer should be computed:"
msgstr ""
#: ../../content/developer/tutorials/getting_started/09_compute_onchange.rst:0
msgid "Compute fields"
msgstr ""
#: ../../content/developer/tutorials/getting_started/09_compute_onchange.rst:33
msgid "In the property offer model, the validity date should be computed and can be updated:"
msgstr ""
#: ../../content/developer/tutorials/getting_started/09_compute_onchange.rst:0
msgid "Compute field with inverse"
msgstr ""
#: ../../content/developer/tutorials/getting_started/09_compute_onchange.rst:39
msgid "In our real estate module, we have defined the living area as well as the garden area. It is then natural to define the total area as the sum of both fields. We will use the concept of a computed field for this, i.e. the value of a given field will be computed from the value of other fields."
msgstr ""
#: ../../content/developer/tutorials/getting_started/09_compute_onchange.rst:43
msgid "So far fields have been stored directly in and retrieved directly from the database. Fields can also be *computed*. In this case, the field's value is not retrieved from the database but computed on-the-fly by calling a method of the model."
msgstr ""
#: ../../content/developer/tutorials/getting_started/09_compute_onchange.rst:48
msgid "To create a computed field, create a field and set its attribute :attr:`~odoo.fields.Field.compute` to the name of a method. The computation method should set the value of the computed field for every record in ``self``."
msgstr ""
#: ../../content/developer/tutorials/getting_started/09_compute_onchange.rst:53
msgid "By convention, :attr:`~odoo.fields.Field.compute` methods are private, meaning that they cannot be called from the presentation tier, only from the business tier (see :ref:`tutorials/getting_started/01_architecture`). Private methods have a name starting with an underscore ``_``."
msgstr ""
#: ../../content/developer/tutorials/getting_started/09_compute_onchange.rst:61
msgid "The value of a computed field usually depends on the values of other fields in the computed record. The ORM expects the developer to specify those dependencies on the compute method with the decorator :func:`~odoo.api.depends`. The given dependencies are used by the ORM to trigger the recomputation of the field whenever some of its dependencies have been modified::"
msgstr ""
#: ../../content/developer/tutorials/getting_started/09_compute_onchange.rst:80
msgid "``self`` is a collection."
msgstr ""
#: ../../content/developer/tutorials/getting_started/09_compute_onchange.rst:83
msgid "The object ``self`` is a *recordset*, i.e. an ordered collection of records. It supports the standard Python operations on collections, e.g. ``len(self)`` and ``iter(self)``, plus extra set operations such as ``recs1 | recs2``."
msgstr ""
#: ../../content/developer/tutorials/getting_started/09_compute_onchange.rst:88
msgid "Iterating over ``self`` gives the records one by one, where each record is itself a collection of size 1. You can access/assign fields on single records by using the dot notation, e.g. ``record.name``."
msgstr ""
#: ../../content/developer/tutorials/getting_started/09_compute_onchange.rst:92
msgid "Many examples of computed fields can be found in Odoo. `Here <https://github.com/odoo/odoo/blob/713dd3777ca0ce9d121d5162a3d63de3237509f4/addons/account/models/account_move.py#L3420-L3423>`__ is a simple one."
msgstr ""
#: ../../content/developer/tutorials/getting_started/09_compute_onchange.rst:96
msgid "Compute the total area."
msgstr ""
#: ../../content/developer/tutorials/getting_started/09_compute_onchange.rst:98
msgid "Add the ``total_area`` field to ``estate.property``. It is defined as the sum of the ``living_area`` and the ``garden_area``."
msgstr ""
#: ../../content/developer/tutorials/getting_started/09_compute_onchange.rst:101
msgid "Add the field in the form view as depicted on the first image of this section's **Goal**."
msgstr ""
#: ../../content/developer/tutorials/getting_started/09_compute_onchange.rst:103
msgid "For relational fields it's possible to use paths through a field as a dependency::"
msgstr ""
#: ../../content/developer/tutorials/getting_started/09_compute_onchange.rst:113
msgid "The example is given with a :class:`~odoo.fields.Many2one`, but it is valid for :class:`~odoo.fields.Many2many` or a :class:`~odoo.fields.One2many`. An example can be found `here <https://github.com/odoo/odoo/blob/713dd3777ca0ce9d121d5162a3d63de3237509f4/addons/account/models/account_reconcile_model.py#L248-L251>`__."
msgstr ""
#: ../../content/developer/tutorials/getting_started/09_compute_onchange.rst:117
msgid "Let's try it in our module with the following exercise!"
msgstr ""
#: ../../content/developer/tutorials/getting_started/09_compute_onchange.rst:119
msgid "Compute the best offer."
msgstr ""
#: ../../content/developer/tutorials/getting_started/09_compute_onchange.rst:121
msgid "Add the ``best_price`` field to ``estate.property``. It is defined as the highest (i.e. maximum) of the offers' ``price``."
msgstr ""
#: ../../content/developer/tutorials/getting_started/09_compute_onchange.rst:124
msgid "Add the field to the form view as depicted in the first image of this section's **Goal**."
msgstr ""
#: ../../content/developer/tutorials/getting_started/09_compute_onchange.rst:126
msgid "Tip: you might want to try using the :meth:`~odoo.models.BaseModel.mapped` method. See `here <https://github.com/odoo/odoo/blob/f011c9aacf3a3010c436d4e4f408cd9ae265de1b/addons/account/models/account_payment.py#L686>`__ for a simple example."
msgstr ""
#: ../../content/developer/tutorials/getting_started/09_compute_onchange.rst:131
msgid "Inverse Function"
msgstr ""
#: ../../content/developer/tutorials/getting_started/09_compute_onchange.rst:133
msgid "You might have noticed that computed fields are read-only by default. This is expected since the user is not supposed to set a value."
msgstr ""
#: ../../content/developer/tutorials/getting_started/09_compute_onchange.rst:136
msgid "In some cases, it might be useful to still be able to set a value directly. In our real estate example, we can define a validity duration for an offer and set a validity date. We would like to be able to set either the duration or the date with one impacting the other."
msgstr ""
#: ../../content/developer/tutorials/getting_started/09_compute_onchange.rst:140
msgid "To support this Odoo provides the ability to use an ``inverse`` function::"
msgstr ""
#: ../../content/developer/tutorials/getting_started/09_compute_onchange.rst:159
msgid "An example can be found `here <https://github.com/odoo/odoo/blob/2ccf0bd0dcb2e232ee894f07f24fdc26c51835f7/addons/crm/models/crm_lead.py#L308-L317>`__."
msgstr ""
#: ../../content/developer/tutorials/getting_started/09_compute_onchange.rst:162
msgid "A compute method sets the field while an inverse method sets the field's dependencies."
msgstr ""
#: ../../content/developer/tutorials/getting_started/09_compute_onchange.rst:165
msgid "Note that the ``inverse`` method is called when saving the record, while the ``compute`` method is called at each change of its dependencies."
msgstr ""
#: ../../content/developer/tutorials/getting_started/09_compute_onchange.rst:168
msgid "Compute a validity date for offers."
msgstr ""
#: ../../content/developer/tutorials/getting_started/09_compute_onchange.rst:170
msgid "Add the following fields to the ``estate.property.offer`` model:"
msgstr ""
#: ../../content/developer/tutorials/getting_started/09_compute_onchange.rst:175
msgid "validity"
msgstr ""
#: ../../content/developer/tutorials/getting_started/09_compute_onchange.rst:175
msgid "7"
msgstr ""
#: ../../content/developer/tutorials/getting_started/09_compute_onchange.rst:176
msgid "date_deadline"
msgstr ""
#: ../../content/developer/tutorials/getting_started/09_compute_onchange.rst:179
msgid "Where ``date_deadline`` is a computed field which is defined as the sum of two fields from the offer: the ``create_date`` and the ``validity``. Define an appropriate inverse function so that the user can set either the date or the validity."
msgstr ""
#: ../../content/developer/tutorials/getting_started/09_compute_onchange.rst:183
msgid "Tip: the ``create_date`` is only filled in when the record is created, therefore you will need a fallback to prevent crashing at time of creation."
msgstr ""
#: ../../content/developer/tutorials/getting_started/09_compute_onchange.rst:186
msgid "Add the fields in the form view and the list view as depicted on the second image of this section's **Goal**."
msgstr ""
#: ../../content/developer/tutorials/getting_started/09_compute_onchange.rst:189
#: ../../content/developer/tutorials/getting_started/09_compute_onchange.rst:275
msgid "Additional Information"
msgstr ""
#: ../../content/developer/tutorials/getting_started/09_compute_onchange.rst:191
msgid "Computed fields are **not stored** in the database by default. Therefore it is **not possible** to search on a computed field unless a ``search`` method is defined. This topic is beyond the scope of this training, so we won't cover it. An example can be found `here <https://github.com/odoo/odoo/blob/f011c9aacf3a3010c436d4e4f408cd9ae265de1b/addons/event/models/event_event.py#L188>`__."
msgstr ""
#: ../../content/developer/tutorials/getting_started/09_compute_onchange.rst:196
msgid "Another solution is to store the field with the ``store=True`` attribute. While this is usually convenient, pay attention to the potential computation load added to your model. Lets re-use our example::"
msgstr ""
#: ../../content/developer/tutorials/getting_started/09_compute_onchange.rst:208
msgid "Every time the partner ``name`` is changed, the ``description`` is automatically recomputed for **all the records** referring to it! This can quickly become prohibitive to recompute when millions of records need recomputation."
msgstr ""
#: ../../content/developer/tutorials/getting_started/09_compute_onchange.rst:212
msgid "It is also worth noting that a computed field can depend on another computed field. The ORM is smart enough to correctly recompute all the dependencies in the right order... but sometimes at the cost of degraded performance."
msgstr ""
#: ../../content/developer/tutorials/getting_started/09_compute_onchange.rst:216
msgid "In general performance must always be kept in mind when defining computed fields. The more complex is your field to compute (e.g. with a lot of dependencies or when a computed field depends on other computed fields), the more time it will take to compute. Always take some time to evaluate the cost of a computed field beforehand. Most of the time it is only when your code reaches a production server that you realize it slows down a whole process. Not cool :-("
msgstr ""
#: ../../content/developer/tutorials/getting_started/09_compute_onchange.rst:223
msgid "Onchanges"
msgstr ""
#: ../../content/developer/tutorials/getting_started/09_compute_onchange.rst:225
msgid "**Reference**: the documentation related to this topic can be found in :func:`~odoo.api.onchange`:"
msgstr ""
#: ../../content/developer/tutorials/getting_started/09_compute_onchange.rst:230
msgid "**Goal**: at the end of this section, enabling the garden will set a default area of 10 and an orientation to North."
msgstr ""
#: ../../content/developer/tutorials/getting_started/09_compute_onchange.rst:237
msgid "In our real estate module, we also want to help the user with data entry. When the 'garden' field is set, we want to give a default value for the garden area as well as the orientation. Additionally, when the 'garden' field is unset we want the garden area to reset to zero and the orientation to be removed. In this case, the value of a given field modifies the value of other fields."
msgstr ""
#: ../../content/developer/tutorials/getting_started/09_compute_onchange.rst:243
msgid "The 'onchange' mechanism provides a way for the client interface to update a form without saving anything to the database whenever the user has filled in a field value. To achieve this, we define a method where ``self`` represents the record in the form view and decorate it with :func:`~odoo.api.onchange` to specify which field it is triggered by. Any change you make on ``self`` will be reflected on the form::"
msgstr ""
#: ../../content/developer/tutorials/getting_started/09_compute_onchange.rst:264
msgid "In this example, changing the partner will also change the name and the description values. It is up to the user whether or not to change the name and description values afterwards. Also note that we do not loop on ``self``, this is because the method is only triggered in a form view, where ``self`` is always a single record."
msgstr ""
#: ../../content/developer/tutorials/getting_started/09_compute_onchange.rst:269
msgid "Set values for garden area and orientation."
msgstr ""
#: ../../content/developer/tutorials/getting_started/09_compute_onchange.rst:271
msgid "Create an ``onchange`` in the ``estate.property`` model in order to set values for the garden area (10) and orientation (North) when garden is set to True. When unset, clear the fields."
msgstr ""
#: ../../content/developer/tutorials/getting_started/09_compute_onchange.rst:277
msgid "Onchanges methods can also return a non-blocking warning message (`example <https://github.com/odoo/odoo/blob/cd9af815ba591935cda367d33a1d090f248dd18d/addons/payment_authorize/models/payment.py#L34-L36>`__)."
msgstr ""
#: ../../content/developer/tutorials/getting_started/09_compute_onchange.rst:281
msgid "How to use them?"
msgstr ""
#: ../../content/developer/tutorials/getting_started/09_compute_onchange.rst:283
msgid "There is no strict rule for the use of computed fields and onchanges."
msgstr ""
#: ../../content/developer/tutorials/getting_started/09_compute_onchange.rst:285
msgid "In many cases, both computed fields and onchanges may be used to achieve the same result. Always prefer computed fields since they are also triggered outside of the context of a form view. Never ever use an onchange to add business logic to your model. This is a **very bad** idea since onchanges are not automatically triggered when creating a record programmatically; they are only triggered in the form view."
msgstr ""
#: ../../content/developer/tutorials/getting_started/09_compute_onchange.rst:291
msgid "The usual pitfall of computed fields and onchanges is trying to be 'too smart' by adding too much logic. This can have the opposite result of what was expected: the end user is confused from all the automation."
msgstr ""
#: ../../content/developer/tutorials/getting_started/09_compute_onchange.rst:295
msgid "Computed fields tend to be easier to debug: such a field is set by a given method, so it's easy to track when the value is set. Onchanges, on the other hand, may be confusing: it is very difficult to know the extent of an onchange. Since several onchange methods may set the same fields, it easily becomes difficult to track where a value is coming from."
msgstr ""
#: ../../content/developer/tutorials/getting_started/09_compute_onchange.rst:300
msgid "When using stored computed fields, pay close attention to the dependencies. When computed fields depend on other computed fields, changing a value can trigger a large number of recomputations. This leads to poor performance."
msgstr ""
#: ../../content/developer/tutorials/getting_started/09_compute_onchange.rst:304
msgid "In the :ref:`next chapter <tutorials/getting_started/10_actions>`, we'll see how we can trigger some business logic when buttons are clicked."
msgstr ""
#: ../../content/developer/tutorials/getting_started/10_actions.rst:5
msgid "Chapter 10: Ready For Some Action?"
msgstr ""
#: ../../content/developer/tutorials/getting_started/10_actions.rst:7
msgid "So far we have mostly built our module by declaring fields and views. We just introduced business logic in the :ref:`previous chapter <tutorials/getting_started/09_compute_onchange>` thanks to computed fields and onchanges. In any real business scenario, we would want to link some business logic to action buttons. In our real estate example, we would like to be able to:"
msgstr ""
#: ../../content/developer/tutorials/getting_started/10_actions.rst:12
msgid "cancel or set a property as sold"
msgstr ""
#: ../../content/developer/tutorials/getting_started/10_actions.rst:13
msgid "accept or refuse an offer"
msgstr ""
#: ../../content/developer/tutorials/getting_started/10_actions.rst:15
msgid "One could argue that we can already do these things by changing the state manually, but this is not really convenient. Moreover, we want to add some extra processing: when an offer is accepted we want to set the selling price and the buyer for the property."
msgstr ""
#: ../../content/developer/tutorials/getting_started/10_actions.rst:20
msgid "Object Type"
msgstr ""
#: ../../content/developer/tutorials/getting_started/10_actions.rst:22
msgid "**Reference**: the documentation related to this topic can be found in :doc:`../../reference/backend/actions` and :ref:`reference/exceptions`."
msgstr ""
#: ../../content/developer/tutorials/getting_started/10_actions.rst:29
msgid "You should be able to cancel or set a property as sold:"
msgstr ""
#: ../../content/developer/tutorials/getting_started/10_actions.rst:0
msgid "Cancel and set to sold"
msgstr ""
#: ../../content/developer/tutorials/getting_started/10_actions.rst:35
msgid "A canceled property cannot be sold and a sold property cannot be canceled. For the sake of clarity, the ``state`` field has been added on the view."
msgstr ""
#: ../../content/developer/tutorials/getting_started/10_actions.rst:38
msgid "You should be able to accept or refuse an offer:"
msgstr ""
#: ../../content/developer/tutorials/getting_started/10_actions.rst:0
msgid "Accept or refuse an offer"
msgstr ""
#: ../../content/developer/tutorials/getting_started/10_actions.rst:44
msgid "Once an offer is accepted, the selling price and the buyer should be set:"
msgstr ""
#: ../../content/developer/tutorials/getting_started/10_actions.rst:0
msgid "Accept an offer"
msgstr ""
#: ../../content/developer/tutorials/getting_started/10_actions.rst:50
msgid "In our real estate module, we want to link business logic with some buttons. The most common way to do this is to:"
msgstr ""
#: ../../content/developer/tutorials/getting_started/10_actions.rst:53
msgid "Add a button in the view, for example in the ``header`` of the view:"
msgstr ""
#: ../../content/developer/tutorials/getting_started/10_actions.rst:66
msgid "and link this button to business logic:"
msgstr ""
#: ../../content/developer/tutorials/getting_started/10_actions.rst:82
msgid "By assigning ``type=\"object\"`` to our button, the Odoo framework will execute a Python method with ``name=\"action_do_something\"`` on the given model."
msgstr ""
#: ../../content/developer/tutorials/getting_started/10_actions.rst:85
msgid "The first important detail to note is that our method name isn't prefixed with an underscore (``_``). This makes our method a **public** method, which can be called directly from the Odoo interface (through an RPC call). Until now, all methods we created (compute, onchange) were called internally, so we used **private** methods prefixed by an underscore. You should always define your methods as private unless they need to be called from the user interface."
msgstr ""
#: ../../content/developer/tutorials/getting_started/10_actions.rst:91
msgid "Also note that we loop on ``self``. Always assume that a method can be called on multiple records; it's better for reusability."
msgstr ""
#: ../../content/developer/tutorials/getting_started/10_actions.rst:94
msgid "Finally, a public method should always return something so that it can be called through XML-RPC. When in doubt, just ``return True``."
msgstr ""
#: ../../content/developer/tutorials/getting_started/10_actions.rst:97
msgid "There are hundreds of examples in the Odoo source code. One example is this `button in a view <https://github.com/odoo/odoo/blob/cd9af815ba591935cda367d33a1d090f248dd18d/addons/crm/views/crm_lead_views.xml#L9-L11>`__ and its `corresponding Python method <https://github.com/odoo/odoo/blob/cd9af815ba591935cda367d33a1d090f248dd18d/addons/crm/models/crm_lead.py#L746-L760>`__"
msgstr ""
#: ../../content/developer/tutorials/getting_started/10_actions.rst:102
msgid "Cancel and set a property as sold."
msgstr ""
#: ../../content/developer/tutorials/getting_started/10_actions.rst:104
msgid "Add the buttons 'Cancel' and 'Sold' to the ``estate.property`` model. A canceled property cannot be set as sold, and a sold property cannot be canceled."
msgstr ""
#: ../../content/developer/tutorials/getting_started/10_actions.rst:107
msgid "Refer to the first image of the **Goal** for the expected result."
msgstr ""
#: ../../content/developer/tutorials/getting_started/10_actions.rst:109
msgid "Tip: in order to raise an error, you can use the :ref:`UserError<reference/exceptions>` function. There are plenty of examples in the Odoo source code ;-)"
msgstr ""
#: ../../content/developer/tutorials/getting_started/10_actions.rst:112
msgid "Add the buttons 'Accept' and 'Refuse' to the ``estate.property.offer`` model."
msgstr ""
#: ../../content/developer/tutorials/getting_started/10_actions.rst:114
msgid "Refer to the second image of the **Goal** for the expected result."
msgstr ""
#: ../../content/developer/tutorials/getting_started/10_actions.rst:116
msgid "Tip: to use an icon as a button, have a look `at this example <https://github.com/odoo/odoo/blob/cd9af815ba591935cda367d33a1d090f248dd18d/addons/event/views/event_views.xml#L521>`__."
msgstr ""
#: ../../content/developer/tutorials/getting_started/10_actions.rst:119
msgid "When an offer is accepted, set the buyer and the selling price for the corresponding property."
msgstr ""
#: ../../content/developer/tutorials/getting_started/10_actions.rst:121
msgid "Refer to the third image of the **Goal** for the expected result."
msgstr ""
#: ../../content/developer/tutorials/getting_started/10_actions.rst:123
msgid "Pay attention: in real life only one offer can be accepted for a given property!"
msgstr ""
#: ../../content/developer/tutorials/getting_started/10_actions.rst:126
msgid "Action Type"
msgstr ""
#: ../../content/developer/tutorials/getting_started/10_actions.rst:128
msgid "In :ref:`tutorials/getting_started/06_firstui`, we created an action that was linked to a menu. You may be wondering if it is possible to link an action to a button. Good news, it is! One way to do it is:"
msgstr ""
#: ../../content/developer/tutorials/getting_started/10_actions.rst:136
msgid "We use ``type=\"action\"`` and we refer to the :term:`external identifier` in the ``name``."
msgstr ""
#: ../../content/developer/tutorials/getting_started/10_actions.rst:138
msgid "In the :ref:`next chapter <tutorials/getting_started/11_constraints>` we'll see how we can prevent encoding incorrect data in Odoo."
msgstr ""
#: ../../content/developer/tutorials/getting_started/11_constraints.rst:5
msgid "Chapter 11: Constraints"
msgstr ""
#: ../../content/developer/tutorials/getting_started/11_constraints.rst:7
msgid "The :ref:`previous chapter <tutorials/getting_started/10_actions>` introduced the ability to add some business logic to our model. We can now link buttons to business code, but how can we prevent users from entering incorrect data? For example, in our real estate module nothing prevents users from setting a negative expected price."
msgstr ""
#: ../../content/developer/tutorials/getting_started/11_constraints.rst:17
msgid "SQL"
msgstr ""
#: ../../content/developer/tutorials/getting_started/11_constraints.rst:19
msgid "**Reference**: the documentation related to this topic can be found in :ref:`reference/orm/models` and in the `PostgreSQL's documentation`_."
msgstr ""
#: ../../content/developer/tutorials/getting_started/11_constraints.rst:26
msgid "Amounts should be (strictly) positive"
msgstr ""
#: ../../content/developer/tutorials/getting_started/11_constraints.rst:0
msgid "Constraints on amounts"
msgstr ""
#: ../../content/developer/tutorials/getting_started/11_constraints.rst:32
msgid "Property types and tags should have a unique name"
msgstr ""
#: ../../content/developer/tutorials/getting_started/11_constraints.rst:0
msgid "Constraints on names"
msgstr ""
#: ../../content/developer/tutorials/getting_started/11_constraints.rst:38
msgid "SQL constraints are defined through the model attribute :attr:`~odoo.models.Model._sql_constraints`. This attribute is assigned a list of triples containing strings ``(name, sql_definition, message)``, where ``name`` is a valid SQL constraint name, ``sql_definition`` is a table_constraint_ expression and ``message`` is the error message."
msgstr ""
#: ../../content/developer/tutorials/getting_started/11_constraints.rst:44
msgid "You can find a simple example `here <https://github.com/odoo/odoo/blob/24b0b6f07f65b6151d1d06150e376320a44fd20a/addons/analytic/models/analytic_account.py#L20-L23>`__."
msgstr ""
#: ../../content/developer/tutorials/getting_started/11_constraints.rst:47
msgid "Add SQL constraints."
msgstr ""
#: ../../content/developer/tutorials/getting_started/11_constraints.rst:49
msgid "Add the following constraints to their corresponding models:"
msgstr ""
#: ../../content/developer/tutorials/getting_started/11_constraints.rst:51
msgid "A property expected price must be strictly positive"
msgstr ""
#: ../../content/developer/tutorials/getting_started/11_constraints.rst:52
msgid "A property selling price must be positive"
msgstr ""
#: ../../content/developer/tutorials/getting_started/11_constraints.rst:53
msgid "An offer price must be strictly positive"
msgstr ""
#: ../../content/developer/tutorials/getting_started/11_constraints.rst:54
msgid "A property tag name and property type name must be unique"
msgstr ""
#: ../../content/developer/tutorials/getting_started/11_constraints.rst:56
msgid "Tip: search for the ``unique`` keyword in the Odoo codebase for examples of unique names."
msgstr ""
#: ../../content/developer/tutorials/getting_started/11_constraints.rst:58
msgid "Restart the server with the ``-u estate`` option to see the result. Note that you might have data that prevents a SQL constraint from being set. An error message similar to the following might pop up:"
msgstr ""
#: ../../content/developer/tutorials/getting_started/11_constraints.rst:65
msgid "For example, if some offers have a price of zero, then the constraint can't be applied. You can delete the problematic data in order to apply the new constraints."
msgstr ""
#: ../../content/developer/tutorials/getting_started/11_constraints.rst:71
msgid "**Reference**: the documentation related to this topic can be found in :func:`~odoo.api.constrains`."
msgstr ""
#: ../../content/developer/tutorials/getting_started/11_constraints.rst:76
msgid "**Goal**: at the end of this section, it will not be possible to accept an offer lower than 90% of the expected price."
msgstr ""
#: ../../content/developer/tutorials/getting_started/11_constraints.rst:0
msgid "Python constraint"
msgstr ""
#: ../../content/developer/tutorials/getting_started/11_constraints.rst:83
msgid "SQL constraints are an efficient way of ensuring data consistency. However it may be necessary to make more complex checks which require Python code. In this case we need a Python constraint."
msgstr ""
#: ../../content/developer/tutorials/getting_started/11_constraints.rst:86
msgid "A Python constraint is defined as a method decorated with :func:`~odoo.api.constrains` and is invoked on a recordset. The decorator specifies which fields are involved in the constraint. The constraint is automatically evaluated when any of these fields are modified . The method is expected to raise an exception if its invariant is not satisfied::"
msgstr ""
#: ../../content/developer/tutorials/getting_started/11_constraints.rst:103
msgid "A simple example can be found `here <https://github.com/odoo/odoo/blob/274dd3bf503e1b612179db92e410b336bfaecfb4/addons/stock/models/stock_quant.py#L239-L244>`__."
msgstr ""
#: ../../content/developer/tutorials/getting_started/11_constraints.rst:106
msgid "Add Python constraints."
msgstr ""
#: ../../content/developer/tutorials/getting_started/11_constraints.rst:108
msgid "Add a constraint so that the selling price cannot be lower than 90% of the expected price."
msgstr ""
#: ../../content/developer/tutorials/getting_started/11_constraints.rst:110
msgid "Tip: the selling price is zero until an offer is validated. You will need to fine tune your check to take this into account."
msgstr ""
#: ../../content/developer/tutorials/getting_started/11_constraints.rst:115
msgid "Always use the :meth:`~odoo.tools.float_utils.float_compare` and :meth:`~odoo.tools.float_utils.float_is_zero` methods from `odoo.tools.float_utils` when working with floats!"
msgstr ""
#: ../../content/developer/tutorials/getting_started/11_constraints.rst:119
msgid "Ensure the constraint is triggered every time the selling price or the expected price is changed!"
msgstr ""
#: ../../content/developer/tutorials/getting_started/11_constraints.rst:121
msgid "SQL constraints are usually more efficient than Python constraints. When performance matters, always prefer SQL over Python constraints."
msgstr ""
#: ../../content/developer/tutorials/getting_started/11_constraints.rst:124
msgid "Our real estate module is starting to look good. We added some business logic, and now we make sure the data is consistent. However, the user interface is still a bit rough. Let's see how we can improve it in the :ref:`next chapter <tutorials/getting_started/12_sprinkles>`."
msgstr ""
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:5
msgid "Chapter 12: Add The Sprinkles"
msgstr ""
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:7
msgid "Our real estate module now makes sense from a business perspective. We created :ref:`specific views <tutorials/getting_started/07_basicviews>`, added several :ref:`action buttons <tutorials/getting_started/10_actions>` and :ref:`constraints <tutorials/getting_started/11_constraints>`. However our user interface is still a bit rough. We would like to add some colors to the list views and make some fields and buttons conditionally disappear. For example, the 'Sold' and 'Cancel' buttons should disappear when the property is sold or canceled since it is no longer allowed to change the state at this point."
msgstr ""
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:15
msgid "This chapter covers a very small subset of what can be done in the views. Do not hesitate to read the reference documentation for a more complete overview."
msgstr ""
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:18
msgid "**Reference**: the documentation related to this chapter can be found in :doc:`../../reference/user_interface/view_records` and :doc:`../../reference/user_interface/view_architectures`."
msgstr ""
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:23
msgid "Inline Views"
msgstr ""
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:27
msgid "**Goal**: at the end of this section, a specific list of properties should be added to the property type view:"
msgstr ""
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:0
msgid "Inline list view"
msgstr ""
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:34
msgid "In the real estate module we added a list of offers for a property. We simply added the field ``offer_ids`` with:"
msgstr ""
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:41
msgid "The field uses the specific view for ``estate.property.offer``. In some cases we want to define a specific list view which is only used in the context of a form view. For example, we would like to display the list of properties linked to a property type. However, we only want to display 3 fields for clarity: name, expected price and state."
msgstr ""
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:46
msgid "To do this, we can define *inline* list views. An inline list view is defined directly inside a form view. For example:"
msgstr ""
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:82
msgid "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``."
msgstr ""
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:85
msgid "An example can be found `here <https://github.com/odoo/odoo/blob/0e12fa135882cd5095dbf15fe2f64231c6a84336/addons/event/views/event_tag_views.xml#L27-L33>`__."
msgstr ""
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:88
msgid "Add an inline list view."
msgstr ""
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:90
msgid "Add the ``One2many`` field ``property_ids`` to the ``estate.property.type`` model."
msgstr ""
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:91
msgid "Add the field in the ``estate.property.type`` form view as depicted in the **Goal** of this section."
msgstr ""
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:97
msgid "**Reference**: the documentation related to this section can be found in :ref:`reference/js/widgets`."
msgstr ""
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:102
msgid "**Goal**: at the end of this section, the state of the property should be displayed using a specific widget:"
msgstr ""
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:-1
msgid "Statusbar widget"
msgstr ""
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:109
msgid "Four states are displayed: New, Offer Received, Offer Accepted and Sold."
msgstr ""
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:111
msgid "Whenever we've added fields to our models, we've (almost) never had to worry about how these fields would look like in the user interface. For example, a date picker is provided for a ``Date`` field and a ``One2many`` field is automatically displayed as a list. Odoo chooses the right 'widget' depending on the field type."
msgstr ""
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:116
msgid "However, in some cases, we want a specific representation of a field which can be done thanks to the ``widget`` attribute. We already used it for the ``tag_ids`` field when we used the ``widget=\"many2many_tags\"`` attribute. If we hadn't used it, then the field would have displayed as a list."
msgstr ""
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:121
msgid "Each field type has a set of widgets which can be used to fine tune its display. Some widgets also take extra options. An exhaustive list can be found in :ref:`reference/js/widgets`."
msgstr ""
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:124
msgid "Use the status bar widget."
msgstr ""
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:126
msgid "Use the ``statusbar`` widget in order to display the ``state`` of the ``estate.property`` as depicted in the **Goal** of this section."
msgstr ""
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:129
msgid "Tip: a simple example can be found `here <https://github.com/odoo/odoo/blob/0e12fa135882cd5095dbf15fe2f64231c6a84336/addons/account/views/account_bank_statement_views.xml#L136>`__."
msgstr ""
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:132
msgid "Same field multiple times in a view"
msgstr ""
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:134
msgid "Add a field only **once** to a list or a form view. Adding it multiple times is not supported."
msgstr ""
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:138
msgid "List Order"
msgstr ""
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:140
msgid "**Reference**: the documentation related to this section can be found in :ref:`reference/orm/models`."
msgstr ""
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:145
msgid "**Goal**: at the end of this section, all lists should display by default in a deterministic order. Property types can be ordered manually."
msgstr ""
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:148
msgid "During the previous exercises, we created several list views. However, at no point did we specify which order the records had to be listed in by default. This is a very important thing for many business cases. For example, in our real estate module we would want to display the highest offers on top of the list."
msgstr ""
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:156
msgid "Odoo provides several ways to set a default order. The most common way is to define the ``_order`` attribute directly in the model. This way, the retrieved records will follow a deterministic order which will be consistent in all views including when records are searched programmatically. By default there is no order specified, therefore the records will be retrieved in a non-deterministic order depending on PostgreSQL."
msgstr ""
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:162
msgid "The ``_order`` attribute takes a string containing a list of fields which will be used for sorting. It will be converted to an order_by_ clause in SQL. For example:"
msgstr ""
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:176
msgid "Our records are ordered by descending ``id``, meaning the highest comes first."
msgstr ""
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:178
msgid "Add model ordering."
msgstr ""
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:180
msgid "Define the following orders in their corresponding models:"
msgstr ""
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:183
msgid "Order"
msgstr ""
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:185
msgid "``estate.property``"
msgstr ""
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:185
msgid "Descending ID"
msgstr ""
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:186
msgid "``estate.property.offer``"
msgstr ""
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:186
msgid "Descending Price"
msgstr ""
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:187
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:265
msgid "``estate.property.tag``"
msgstr ""
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:188
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:218
msgid "``estate.property.type``"
msgstr ""
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:192
msgid "View"
msgstr ""
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:194
msgid "Ordering is possible at the model level. This has the advantage of a consistent order everywhere a list of records is retrieved. However, it is also possible to define a specific order directly in a view thanks to the ``default_order`` attribute (`example <https://github.com/odoo/odoo/blob/892dd6860733c46caf379fd36f57219082331b66/addons/crm/report/crm_activity_report_views.xml#L30>`__)."
msgstr ""
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:200
msgid "Manual"
msgstr ""
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:202
msgid "Both model and view ordering allow flexibility when sorting records, but there is still one case we need to cover: the manual ordering. A user may want to sort records depending on the business logic. For example, in our real estate module we would like to sort the property types manually. It is indeed useful to have the most used types appear at the top of the list. If our real estate agency mainly sells houses, it is more convenient to have 'House' appear before 'Apartment'."
msgstr ""
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:208
msgid "To do so, a ``sequence`` field is used in combination with the ``handle`` widget. Obviously the ``sequence`` field must be the first field in the ``_order`` attribute."
msgstr ""
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:211
msgid "Add manual ordering."
msgstr ""
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:213
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:260
msgid "Add the following field:"
msgstr ""
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:221
msgid "Add the sequence to the ``estate.property.type`` list view with the correct widget."
msgstr ""
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:223
msgid "Tip: you can find an example here: `model <https://github.com/odoo/odoo/blob/892dd6860733c46caf379fd36f57219082331b66/addons/crm/models/crm_stage.py#L36>`__ and `view <https://github.com/odoo/odoo/blob/892dd6860733c46caf379fd36f57219082331b66/addons/crm/views/crm_stage_views.xml#L23>`__."
msgstr ""
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:229
msgid "Attributes and options"
msgstr ""
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:231
msgid "It would be prohibitive to detail all the available features which allow fine tuning of the look of a view. Therefore, we'll stick to the most common ones."
msgstr ""
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:239
msgid "**Goal**: at the end of this section, the property form view will have:"
msgstr ""
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:241
msgid "Conditional display of buttons and fields"
msgstr ""
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:242
msgid "Tag colors"
msgstr ""
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:0
msgid "Form view with sprinkles"
msgstr ""
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:249
msgid "In our real estate module, we want to modify the behavior of some fields. For example, we don't want to be able to create or edit a property type from the form view. Instead we expect the types to be handled in their appropriate menu. We also want to give tags a color. In order to add these behavior customizations, we can add the ``options`` attribute to several field widgets."
msgstr ""
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:254
msgid "Add widget options."
msgstr ""
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:256
msgid "Add the appropriate option to the ``property_type_id`` field to prevent the creation and the editing of a property type from the property form view. Have a look at the :ref:`Many2one widget documentation <reference/js/widgets>` for more info."
msgstr ""
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:268
msgid "Then add the appropriate option to the ``tag_ids`` field to add a color picker on the tags. Have a look at the :ref:`FieldMany2ManyTags widget documentation <reference/js/widgets>` for more info."
msgstr ""
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:272
msgid "In :ref:`tutorials/getting_started/06_firstui`, we saw that reserved fields were used for specific behaviors. For example, the ``active`` field is used to automatically filter out inactive records. We added the ``state`` as a reserved field as well. It's now time to use it! A ``state`` field can be used in combination with an ``invisible`` attribute in the view to display buttons conditionally."
msgstr ""
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:278
msgid "Add conditional display of buttons."
msgstr ""
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:280
msgid "Use the ``invisible`` attribute to display the header buttons conditionally as depicted in this section's **Goal** (notice how the 'Sold' and 'Cancel' buttons change when the state is modified)."
msgstr ""
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:283
msgid "Tip: do not hesitate to search for ``invisible=`` in the Odoo XML files for some examples."
msgstr ""
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:285
msgid "More generally, it is possible to make a field ``invisible``, ``readonly`` or ``required`` based on the value of other fields. Note that ``invisible`` can also be applied to other elements of the view such as ``button`` or ``group``."
msgstr ""
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:289
msgid "`invisible`, `readonly` and `required` can have any Python expression as value. The expression gives the condition in which the property applies. For example:"
msgstr ""
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:299
msgid "This means that the ``description`` field is invisible when ``is_partner`` is ``False``. It is important to note that a field used in ``invisible`` **must** be present in the view. If it should not be displayed to the user, we can use the ``invisible`` attribute to hide it."
msgstr ""
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:303
msgid "Use ``invisible``."
msgstr ""
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:305
msgid "Make the garden area and orientation invisible in the ``estate.property`` form view when there is no garden."
msgstr ""
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:307
msgid "Make the 'Accept' and 'Refuse' buttons invisible once the offer state is set."
msgstr ""
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:308
msgid "Do not allow adding an offer when the property state is 'Offer Accepted', 'Sold' or 'Canceled'. To do this use the ``readonly`` attribute."
msgstr ""
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:313
msgid "Using a (conditional) ``readonly`` attribute in the view can be useful to prevent data entry errors, but keep in mind that it doesn't provide any level of security! There is no check done server-side, therefore it's always possible to write on the field through a RPC call."
msgstr ""
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:322
msgid "**Goal**: at the end of this section, the property and offer list views should have color decorations. Additionally, offers and tags will be editable directly in the list, and the availability date will be hidden by default."
msgstr ""
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:0
msgid "List view with decorations and optional field"
msgstr ""
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:0
msgid "Editable list"
msgstr ""
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:334
msgid "When the model only has a few fields, it can be useful to edit records directly through the list view and not have to open the form view. In the real estate example, there is no need to open a form view to add an offer or create a new tag. This can be achieved thanks to the ``editable`` attribute."
msgstr ""
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:338
msgid "Make list views editable."
msgstr ""
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:340
msgid "Make the ``estate.property.offer`` and ``estate.property.tag`` list views editable."
msgstr ""
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:342
msgid "On the other hand, when a model has a lot of fields it can be tempting to add too many fields in the list view and make it unclear. An alternative method is to add the fields, but make them optionally hidden. This can be achieved thanks to the ``optional`` attribute."
msgstr ""
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:346
msgid "Make a field optional."
msgstr ""
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:348
msgid "Make the field ``date_availability`` on the ``estate.property`` list view optional and hidden by default."
msgstr ""
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:351
msgid "Finally, color codes are useful to visually emphasize records. For example, in the real estate module we would like to display refused offers in red and accepted offers in green. This can be achieved thanks to the ``decoration-{$name}`` attribute (see :ref:`reference/js/widgets` for a complete list):"
msgstr ""
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:363
msgid "The records where ``is_partner`` is ``True`` will be displayed in green."
msgstr ""
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:365
msgid "Add some decorations."
msgstr ""
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:367
msgid "On the ``estate.property`` list view:"
msgstr ""
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:369
msgid "Properties with an offer received are green"
msgstr ""
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:370
msgid "Properties with an offer accepted are green and bold"
msgstr ""
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:371
msgid "Properties sold are muted"
msgstr ""
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:373
msgid "On the ``estate.property.offer`` list view:"
msgstr ""
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:375
msgid "Refused offers are red"
msgstr ""
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:376
msgid "Accepted offers are green"
msgstr ""
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:377
msgid "The state should not be visible anymore"
msgstr ""
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:381
msgid "Keep in mind that **all** fields used in attributes must be in the view!"
msgstr ""
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:382
msgid "If you want to test the color of the \"Offer Received\" and \"Offer Accepted\" states, add the field in the form view and change it manually (we'll implement the business logic for this later)."
msgstr ""
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:388
msgid "**Reference**: the documentation related to this section can be found in :ref:`reference/view_architectures/search` and :ref:`reference/view_architectures/search/defaults`."
msgstr ""
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:393
msgid "**Goal**: at the end of this section, the available properties will be filtered by default, and searching on the living area returns results where the area is larger than the given number."
msgstr ""
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:0
msgid "Default filters and domains"
msgstr ""
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:401
msgid "Last but not least, there are some tweaks we would like to apply when searching. First of all, we want to have our 'Available' filter applied by default when we access the properties. To make this happen, we need to use the ``search_default_{$name}`` action context, where ``{$name}`` is the filter name. This means that we can define which filter(s) will be activated by default at the action level."
msgstr ""
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:406
msgid "Here is an example of an `action <https://github.com/odoo/odoo/blob/6decc32a889b46947db6dd4d42ef995935894a2a/addons/crm/report/crm_opportunity_report_views.xml#L115>`__ with its `corresponding filter <https://github.com/odoo/odoo/blob/6decc32a889b46947db6dd4d42ef995935894a2a/addons/crm/report/crm_opportunity_report_views.xml#L68>`__."
msgstr ""
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:411
msgid "Add a default filter."
msgstr ""
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:413
msgid "Make the 'Available' filter selected by default in the ``estate.property`` action."
msgstr ""
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:415
msgid "Another useful improvement in our module would be the ability to search efficiently by living area. In practice, a user will want to search for properties of 'at least' the given area. It is unrealistic to expect users would want to find a property of an exact living area. It is always possible to make a custom search, but that's inconvenient."
msgstr ""
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:420
msgid "Search view ``<field>`` elements can have a ``filter_domain`` that overrides the domain generated for searching on the given field. In the given domain, ``self`` represents the value entered by the user. In the example below, it is used to search on both ``name`` and ``description`` fields."
msgstr ""
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:432
msgid "Change the living area search."
msgstr ""
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:434
msgid "Add a ``filter_domain`` to the living area to include properties with an area equal to or greater than the given value."
msgstr ""
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:438
msgid "Stat Buttons"
msgstr ""
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:442
msgid "**Goal**: at the end of this section, there will be a stat button on the property type form view which shows the list of all offers related to properties of the given type when it is clicked on."
msgstr ""
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:0
msgid "Stat button"
msgstr ""
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:449
msgid "If you've already used some functional modules in Odoo, you've probably already encountered a 'stat button'. These buttons are displayed on the top right of a form view and give a quick access to linked documents. In our real estate module, we would like to have a quick link to the offers related to a given property type as depicted in the **Goal** of this section."
msgstr ""
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:454
msgid "At this point of the tutorial we have already seen most of the concepts to do this. However, there is not a single solution and it can still be confusing if you don't know where to start from. We'll describe a step-by-step solution in the exercise. It can always be useful to find some examples in the Odoo codebase by looking for ``oe_stat_button``."
msgstr ""
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:459
msgid "The following exercise might be a bit more difficult than the previous ones since it assumes you are able to search for examples in the source code on your own. If you are stuck there is probably someone nearby who can help you ;-)"
msgstr ""
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:463
msgid "The exercise introduces the concept of :ref:`reference/fields/related`. The easiest way to understand it is to consider it as a specific case of a computed field. The following definition of the ``description`` field:"
msgstr ""
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:474
msgid "is equivalent to:"
msgstr ""
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:488
msgid "Every time the partner name is changed, the description is modified."
msgstr ""
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:490
msgid "Add a stat button to property type."
msgstr ""
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:492
msgid "Add the field ``property_type_id`` to ``estate.property.offer``. We can define it as a related field on ``property_id.property_type_id`` and set it as stored."
msgstr ""
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:495
msgid "Thanks to this field, an offer will be linked to a property type when it's created. You can add the field to the list view of offers to make sure it works."
msgstr ""
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:498
msgid "Add the field ``offer_ids`` to ``estate.property.type`` which is the One2many inverse of the field defined in the previous step."
msgstr ""
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:501
msgid "Add the field ``offer_count`` to ``estate.property.type``. It is a computed field that counts the number of offers for a given property type (use ``offer_ids`` to do so)."
msgstr ""
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:504
msgid "At this point, you have all the information necessary to know how many offers are linked to a property type. When in doubt, add ``offer_ids`` and ``offer_count`` directly to the view. The next step is to display the list when clicking on the stat button."
msgstr ""
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:508
msgid "Create a stat button on ``estate.property.type`` pointing to the ``estate.property.offer`` action. This means you should use the ``type=\"action\"`` attribute (go back to the end of :ref:`tutorials/getting_started/10_actions` if you need a refresher)."
msgstr ""
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:512
msgid "At this point, clicking on the stat button should display all offers. We still need to filter out the offers."
msgstr ""
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:515
msgid "On the ``estate.property.offer`` action, add a domain that defines ``property_type_id`` as equal to the ``active_id`` (= the current record, `here is an example <https://github.com/odoo/odoo/blob/df37ce50e847e3489eb43d1ef6fc1bac6d6af333/addons/event/views/event_views.xml#L162>`__)"
msgstr ""
#: ../../content/developer/tutorials/getting_started/12_sprinkles.rst:519
msgid "Looking good? If not, don't worry, the :ref:`next chapter <tutorials/getting_started/13_inheritance>` doesn't require stat buttons ;-)"
msgstr ""
#: ../../content/developer/tutorials/getting_started/13_inheritance.rst:5
msgid "Chapter 13: Inheritance"
msgstr ""
#: ../../content/developer/tutorials/getting_started/13_inheritance.rst:7
msgid "A powerful aspect of Odoo is its modularity. A module is dedicated to a business need, but modules can also interact with one another. This is useful for extending the functionality of an existing module. For example, in our real estate scenario we want to display the list of a salesperson's properties directly in the regular user view."
msgstr ""
#: ../../content/developer/tutorials/getting_started/13_inheritance.rst:12
msgid "But before going through the specific Odoo module inheritance, let's see how we can alter the behavior of the standard CRUD (Create, Retrieve, Update or Delete) methods."
msgstr ""
#: ../../content/developer/tutorials/getting_started/13_inheritance.rst:16
msgid "Python Inheritance"
msgstr ""
#: ../../content/developer/tutorials/getting_started/13_inheritance.rst:22
msgid "It should not be possible to delete a property which is not new or canceled."
msgstr ""
#: ../../content/developer/tutorials/getting_started/13_inheritance.rst:28
msgid "When an offer is created, the property state should change to 'Offer Received'"
msgstr ""
#: ../../content/developer/tutorials/getting_started/13_inheritance.rst:29
msgid "It should not be possible to create an offer with a lower price than an existing offer"
msgstr ""
#: ../../content/developer/tutorials/getting_started/13_inheritance.rst:0
msgid "Create"
msgstr ""
#: ../../content/developer/tutorials/getting_started/13_inheritance.rst:35
msgid "In our real estate module, we never had to develop anything specific to be able to do the standard CRUD actions. The Odoo framework provides the necessary tools to do them. In fact, such actions are already included in our model thanks to classical Python inheritance::"
msgstr ""
#: ../../content/developer/tutorials/getting_started/13_inheritance.rst:48
msgid "Our ``class TestModel`` inherits from :class:`~odoo.models.Model` which provides :meth:`~odoo.models.Model.create`, :meth:`~odoo.models.Model.read`, :meth:`~odoo.models.Model.write` and :meth:`~odoo.models.Model.unlink`."
msgstr ""
#: ../../content/developer/tutorials/getting_started/13_inheritance.rst:52
msgid "These methods (and any other method defined on :class:`~odoo.models.Model`) can be extended to add specific business logic::"
msgstr ""
#: ../../content/developer/tutorials/getting_started/13_inheritance.rst:70
msgid "The decorator :func:`~odoo.api.model` is necessary for the :meth:`~odoo.models.Model.create` method because the content of the recordset ``self`` is not relevant in the context of creation, but it is not necessary for the other CRUD methods."
msgstr ""
#: ../../content/developer/tutorials/getting_started/13_inheritance.rst:74
msgid "It is also important to note that even though we can directly override the :meth:`~odoo.models.Model.unlink` method, you will almost always want to write a new method with the decorator :func:`~odoo.api.ondelete` instead. Methods marked with this decorator will be called during :meth:`~odoo.models.Model.unlink` and avoids some issues that can occur during uninstalling the model's module when :meth:`~odoo.models.Model.unlink` is directly overridden."
msgstr ""
#: ../../content/developer/tutorials/getting_started/13_inheritance.rst:80
msgid "In Python 3, ``super()`` is equivalent to ``super(TestModel, self)``. The latter may be necessary when you need to call the parent method with a modified recordset."
msgstr ""
#: ../../content/developer/tutorials/getting_started/13_inheritance.rst:85
msgid "It is very important to **always** call ``super()`` to avoid breaking the flow. There are only a few very specific cases where you don't want to call it."
msgstr ""
#: ../../content/developer/tutorials/getting_started/13_inheritance.rst:87
msgid "Make sure to **always** return data consistent with the parent method. For example, if the parent method returns a ``dict()``, your override must also return a ``dict()``."
msgstr ""
#: ../../content/developer/tutorials/getting_started/13_inheritance.rst:90
msgid "Add business logic to the CRUD methods."
msgstr ""
#: ../../content/developer/tutorials/getting_started/13_inheritance.rst:92
msgid "Prevent deletion of a property if its state is not 'New' or 'Canceled'"
msgstr ""
#: ../../content/developer/tutorials/getting_started/13_inheritance.rst:94
msgid "Tip: create a new method with the :func:`~odoo.api.ondelete` decorator and remember that ``self`` can be a recordset with more than one record."
msgstr ""
#: ../../content/developer/tutorials/getting_started/13_inheritance.rst:97
msgid "At offer creation, set the property state to 'Offer Received'. Also raise an error if the user tries to create an offer with a lower amount than an existing offer."
msgstr ""
#: ../../content/developer/tutorials/getting_started/13_inheritance.rst:100
msgid "Tip: the ``property_id`` field is available in the ``vals``, but it is an ``int``. To instantiate an ``estate.property`` object, use ``self.env[model_name].browse(value)`` (`example <https://github.com/odoo/odoo/blob/136e4f66cd5cafe7df450514937c7218c7216c93/addons/gamification/models/badge.py#L57>`__)"
msgstr ""
#: ../../content/developer/tutorials/getting_started/13_inheritance.rst:105
msgid "Model Inheritance"
msgstr ""
#: ../../content/developer/tutorials/getting_started/13_inheritance.rst:107
msgid "**Reference**: the documentation related to this topic can be found in :ref:`reference/orm/inheritance`."
msgstr ""
#: ../../content/developer/tutorials/getting_started/13_inheritance.rst:110
msgid "In our real estate module, we would like to display the list of properties linked to a salesperson directly in the Settings / Users & Companies / Users form view. To do this, we need to add a field to the ``res.users`` model and adapt its view to show it."
msgstr ""
#: ../../content/developer/tutorials/getting_started/13_inheritance.rst:116
msgid "The first inheritance mechanism allows modules to modify the behavior of a model defined in an another module by:"
msgstr ""
#: ../../content/developer/tutorials/getting_started/13_inheritance.rst:119
msgid "adding fields to the model,"
msgstr ""
#: ../../content/developer/tutorials/getting_started/13_inheritance.rst:120
msgid "overriding the definition of fields in the model,"
msgstr ""
#: ../../content/developer/tutorials/getting_started/13_inheritance.rst:121
msgid "adding constraints to the model,"
msgstr ""
#: ../../content/developer/tutorials/getting_started/13_inheritance.rst:122
msgid "adding methods to the model,"
msgstr ""
#: ../../content/developer/tutorials/getting_started/13_inheritance.rst:123
msgid "overriding existing methods in the model."
msgstr ""
#: ../../content/developer/tutorials/getting_started/13_inheritance.rst:125
msgid "The second inheritance mechanism (delegation) allows every record of a model to be linked to a parent model's record and provides transparent access to the fields of this parent record."
msgstr ""
#: ../../content/developer/tutorials/getting_started/13_inheritance.rst:-1
msgid "Inheritance Methods"
msgstr ""
#: ../../content/developer/tutorials/getting_started/13_inheritance.rst:133
msgid "In Odoo, the first mechanism is by far the most used. In our case, we want to add a field to an existing model, which means we will use the first mechanism. For example::"
msgstr ""
#: ../../content/developer/tutorials/getting_started/13_inheritance.rst:143
msgid "A practical example where two fields are added to a model can be found `here <https://github.com/odoo/odoo/blob/60e9410e9aa3be4a9db50f6f7534ba31fea3bc29/addons/account_fleet/models/account_move.py#L39-L47>`__."
msgstr ""
#: ../../content/developer/tutorials/getting_started/13_inheritance.rst:147
msgid "By convention, each inherited model is defined in its own Python file. In our example, it would be ``models/inherited_model.py``."
msgstr ""
#: ../../content/developer/tutorials/getting_started/13_inheritance.rst:150
msgid "Add a field to Users."
msgstr ""
#: ../../content/developer/tutorials/getting_started/13_inheritance.rst:152
msgid "Add the following field to ``res.users``:"
msgstr ""
#: ../../content/developer/tutorials/getting_started/13_inheritance.rst:157
msgid "property_ids"
msgstr ""
#: ../../content/developer/tutorials/getting_started/13_inheritance.rst:157
msgid "One2many inverse of the field that references the salesperson in ``estate.property``"
msgstr ""
#: ../../content/developer/tutorials/getting_started/13_inheritance.rst:161
msgid "Add a domain to the field so it only lists the available properties."
msgstr ""
#: ../../content/developer/tutorials/getting_started/13_inheritance.rst:163
msgid "In the next section let's add the field to the view and check that everything is working well!"
msgstr ""
#: ../../content/developer/tutorials/getting_started/13_inheritance.rst:166
msgid "View Inheritance"
msgstr ""
#: ../../content/developer/tutorials/getting_started/13_inheritance.rst:168
msgid "**Reference**: the documentation related to this topic can be found in :ref:`reference/view_records/inheritance`."
msgstr ""
#: ../../content/developer/tutorials/getting_started/13_inheritance.rst:173
msgid "**Goal**: at the end of this section, the list of available properties linked to a salesperson should be displayed in their user form view"
msgstr ""
#: ../../content/developer/tutorials/getting_started/13_inheritance.rst:0
msgid "Users"
msgstr ""
#: ../../content/developer/tutorials/getting_started/13_inheritance.rst:180
msgid "Instead of modifying existing views in place (by overwriting them), Odoo provides view inheritance where children 'extension' views are applied on top of root views. These extension can both add and remove content from their parent view."
msgstr ""
#: ../../content/developer/tutorials/getting_started/13_inheritance.rst:184
msgid "An extension view references its parent using the ``inherit_id`` field. Instead of a single view, its ``arch`` field contains a number of ``xpath`` elements that select and alter the content of their parent view:"
msgstr ""
#: ../../content/developer/tutorials/getting_started/13_inheritance.rst:210
msgid "appends ``xpath``'s body to the end of the matched element"
msgstr ""
#: ../../content/developer/tutorials/getting_started/13_inheritance.rst:219
msgid "alters the attributes of the matched element using the special ``attribute`` elements in the ``xpath``'s body"
msgstr ""
#: ../../content/developer/tutorials/getting_started/13_inheritance.rst:222
msgid "When matching a single element, the ``position`` attribute can be set directly on the element to be found. Both inheritances below have the same result."
msgstr ""
#: ../../content/developer/tutorials/getting_started/13_inheritance.rst:235
msgid "An example of a view inheritance extension can be found `here <https://github.com/odoo/odoo/blob/691d1f087040f1ec7066e485d19ce3662dfc6501/addons/account_fleet/views/account_move_views.xml#L3-L17>`__."
msgstr ""
#: ../../content/developer/tutorials/getting_started/13_inheritance.rst:238
msgid "Add fields to the Users view."
msgstr ""
#: ../../content/developer/tutorials/getting_started/13_inheritance.rst:240
msgid "Add the ``property_ids`` field to the ``base.view_users_form`` in a new notebook page."
msgstr ""
#: ../../content/developer/tutorials/getting_started/13_inheritance.rst:242
msgid "Tip: an example an inheritance of the users' view can be found `here <https://github.com/odoo/odoo/blob/691d1f087040f1ec7066e485d19ce3662dfc6501/addons/gamification/views/res_users_views.xml#L5-L14>`__."
msgstr ""
#: ../../content/developer/tutorials/getting_started/13_inheritance.rst:245
msgid "Inheritance is extensively used in Odoo due to its modular concept. Do not hesitate to read the corresponding documentation for more info!"
msgstr ""
#: ../../content/developer/tutorials/getting_started/13_inheritance.rst:248
msgid "In the :ref:`next chapter <tutorials/getting_started/14_other_module>`, we will learn how to interact with other modules."
msgstr ""
#: ../../content/developer/tutorials/getting_started/14_other_module.rst:5
msgid "Chapter 14: Interact With Other Modules"
msgstr ""
#: ../../content/developer/tutorials/getting_started/14_other_module.rst:7
msgid "In the :ref:`previous chapter <tutorials/getting_started/13_inheritance>`, we used inheritance to modify the behavior of a module. In our real estate scenario, we would like to go a step further and be able to generate invoices for our customers. Odoo provides an Invoicing module, so it would be neat to create an invoice directly from our real estate module, i.e. once a property is set to 'Sold', an invoice is created in the Invoicing application."
msgstr ""
#: ../../content/developer/tutorials/getting_started/14_other_module.rst:14
msgid "Concrete Example: Account Move"
msgstr ""
#: ../../content/developer/tutorials/getting_started/14_other_module.rst:20
msgid "A new module ``estate_account`` should be created"
msgstr ""
#: ../../content/developer/tutorials/getting_started/14_other_module.rst:21
msgid "When a property is sold, an invoice should be issued for the buyer"
msgstr ""
#: ../../content/developer/tutorials/getting_started/14_other_module.rst:0
msgid "Invoice creation"
msgstr ""
#: ../../content/developer/tutorials/getting_started/14_other_module.rst:27
msgid "Any time we interact with another module, we need to keep in mind the modularity. If we intend to sell our application to real estate agencies, some may want the invoicing feature but others may not want it."
msgstr ""
#: ../../content/developer/tutorials/getting_started/14_other_module.rst:32
msgid "Link Module"
msgstr ""
#: ../../content/developer/tutorials/getting_started/14_other_module.rst:34
msgid "The common approach for such use cases is to create a 'link' module. In our case, the module would depend on ``estate`` and ``account`` and would include the invoice creation logic of the estate property. This way the real estate and the accounting modules can be installed independently. When both are installed, the link module provides the new feature."
msgstr ""
#: ../../content/developer/tutorials/getting_started/14_other_module.rst:39
msgid "Create a link module."
msgstr ""
#: ../../content/developer/tutorials/getting_started/14_other_module.rst:41
msgid "Create the ``estate_account`` module, which depends on the ``estate`` and ``account`` modules. For now, it will be an empty shell."
msgstr ""
#: ../../content/developer/tutorials/getting_started/14_other_module.rst:44
msgid "Tip: you already did this at the :ref:`beginning of the tutorial <tutorials/getting_started/03_newapp>`. The process is very similar."
msgstr ""
#: ../../content/developer/tutorials/getting_started/14_other_module.rst:48
msgid "When the ``estate_account`` module appears in the list, go ahead and install it! You'll notice that the Invoicing application is installed as well. This is expected since your module depends on it. If you uninstall the Invoicing application, your module will be uninstalled as well."
msgstr ""
#: ../../content/developer/tutorials/getting_started/14_other_module.rst:55
msgid "Invoice Creation"
msgstr ""
#: ../../content/developer/tutorials/getting_started/14_other_module.rst:57
msgid "It's now time to generate the invoice. We want to add functionality to the ``estate.property`` model, i.e. we want to add some extra logic for when a property is sold. Does that sound familiar? If not, it's a good idea to go back to the :ref:`previous chapter <tutorials/getting_started/13_inheritance>` since you might have missed something ;-)"
msgstr ""
#: ../../content/developer/tutorials/getting_started/14_other_module.rst:63
msgid "As a first step, we need to extend the action called when pressing the :ref:`'Sold' button <tutorials/getting_started/10_actions>` on a property. To do so, we need to create a :ref:`model inheritance <tutorials/getting_started/13_inheritance>` in the `estate_account` module for the ``estate.property`` model. For now, the overridden action will simply return the ``super`` call. Maybe an example will make things clearer::"
msgstr ""
#: ../../content/developer/tutorials/getting_started/14_other_module.rst:77
msgid "A practical example can be found `here <https://github.com/odoo/odoo/blob/f1f48cdaab3dd7847e8546ad9887f24a9e2ed4c1/addons/event_sale/models/account_move.py#L7-L16>`__."
msgstr ""
#: ../../content/developer/tutorials/getting_started/14_other_module.rst:80
msgid "Add the first step of invoice creation."
msgstr ""
#: ../../content/developer/tutorials/getting_started/14_other_module.rst:82
msgid "Create a ``estate_property.py`` file in the correct folder of the ``estate_account`` module."
msgstr ""
#: ../../content/developer/tutorials/getting_started/14_other_module.rst:83
msgid "``_inherit`` the ``estate.property`` model."
msgstr ""
#: ../../content/developer/tutorials/getting_started/14_other_module.rst:84
msgid "Override the ``action_sold`` method (you might have named it differently) to return the ``super`` call."
msgstr ""
#: ../../content/developer/tutorials/getting_started/14_other_module.rst:87
msgid "Tip: to make sure it works, add a ``print`` or a debugger breakpoint in the overridden method."
msgstr ""
#: ../../content/developer/tutorials/getting_started/14_other_module.rst:89
msgid "Is it working? If not, maybe check that all Python files are correctly imported."
msgstr ""
#: ../../content/developer/tutorials/getting_started/14_other_module.rst:91
msgid "If the override is working, we can move forward and create the invoice. Unfortunately, there is no easy way to know how to create any given object in Odoo. Most of the time, it is necessary to have a look at its model to find the required fields and provide appropriate values."
msgstr ""
#: ../../content/developer/tutorials/getting_started/14_other_module.rst:95
msgid "A good way to learn is to look at how other modules already do what you want to do. For example, one of the basic flows of Sales is the creation of an invoice from a sales order. This looks like a good starting point since it does exactly what we want to do. Take some time to read and understand the `_create_invoices <https://github.com/odoo/odoo/blob/f1f48cdaab3dd7847e8546ad9887f24a9e2ed4c1/addons/sale/models/sale.py#L610-L717>`__ method. When you are done crying because this simple task looks awfully complex, we can move forward in the tutorial."
msgstr ""
#: ../../content/developer/tutorials/getting_started/14_other_module.rst:102
msgid "To create an invoice, we need the following information:"
msgstr ""
#: ../../content/developer/tutorials/getting_started/14_other_module.rst:104
msgid "a ``partner_id``: the customer"
msgstr ""
#: ../../content/developer/tutorials/getting_started/14_other_module.rst:105
msgid "a ``move_type``: it has several `possible values <https://github.com/odoo/odoo/blob/f1f48cdaab3dd7847e8546ad9887f24a9e2ed4c1/addons/account/models/account_move.py#L138-L147>`__"
msgstr ""
#: ../../content/developer/tutorials/getting_started/14_other_module.rst:106
msgid "a ``journal_id``: the accounting journal"
msgstr ""
#: ../../content/developer/tutorials/getting_started/14_other_module.rst:108
msgid "This is enough to create an empty invoice."
msgstr ""
#: ../../content/developer/tutorials/getting_started/14_other_module.rst:110
msgid "Add the second step of invoice creation."
msgstr ""
#: ../../content/developer/tutorials/getting_started/14_other_module.rst:112
msgid "Create an empty ``account.move`` in the override of the ``action_sold`` method:"
msgstr ""
#: ../../content/developer/tutorials/getting_started/14_other_module.rst:114
msgid "the ``partner_id`` is taken from the current ``estate.property``"
msgstr ""
#: ../../content/developer/tutorials/getting_started/14_other_module.rst:115
msgid "the ``move_type`` should correspond to a 'Customer Invoice'"
msgstr ""
#: ../../content/developer/tutorials/getting_started/14_other_module.rst:119
msgid "to create an object, use ``self.env[model_name].create(values)``, where ``values`` is a ``dict``."
msgstr ""
#: ../../content/developer/tutorials/getting_started/14_other_module.rst:121
msgid "the ``create`` method doesn't accept recordsets as field values."
msgstr ""
#: ../../content/developer/tutorials/getting_started/14_other_module.rst:123
msgid "When a property is set to 'Sold', you should now have a new customer invoice created in Invoicing / Customers / Invoices."
msgstr ""
#: ../../content/developer/tutorials/getting_started/14_other_module.rst:126
msgid "Obviously we don't have any invoice lines so far. To create an invoice line, we need the following information:"
msgstr ""
#: ../../content/developer/tutorials/getting_started/14_other_module.rst:129
msgid "``name``: a description of the line"
msgstr ""
#: ../../content/developer/tutorials/getting_started/14_other_module.rst:130
msgid "``quantity``"
msgstr ""
#: ../../content/developer/tutorials/getting_started/14_other_module.rst:131
msgid "``price_unit``"
msgstr ""
#: ../../content/developer/tutorials/getting_started/14_other_module.rst:133
msgid "Moreover, an invoice line needs to be linked to an invoice. The easiest and most efficient way to link a line to an invoice is to include all lines at invoice creation. To do this, the ``invoice_line_ids`` field is included in the ``account.move`` creation, which is a :class:`~odoo.fields.One2many`. One2many and Many2many use special 'commands' which have been made human readable with the :class:`~odoo.fields.Command` namespace. This namespace represents 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``::"
msgstr ""
#: ../../content/developer/tutorials/getting_started/14_other_module.rst:159
msgid "Add the third step of invoice creation."
msgstr ""
#: ../../content/developer/tutorials/getting_started/14_other_module.rst:161
msgid "Add two invoice lines during the creation of the ``account.move``. Each property sold will be invoiced following these conditions:"
msgstr ""
#: ../../content/developer/tutorials/getting_started/14_other_module.rst:164
msgid "6% of the selling price"
msgstr ""
#: ../../content/developer/tutorials/getting_started/14_other_module.rst:165
msgid "an additional 100.00 from administrative fees"
msgstr ""
#: ../../content/developer/tutorials/getting_started/14_other_module.rst:167
msgid "Tip: Add the ``invoice_line_ids`` at creation following the example above. For each line, we need a ``name``, ``quantity`` and ``price_unit``."
msgstr ""
#: ../../content/developer/tutorials/getting_started/14_other_module.rst:170
msgid "This chapter might be one of the most difficult that has been covered so far, but it is the closest to what Odoo development will be in practice. In the :ref:`next chapter <tutorials/getting_started/15_qwebintro>`, we will introduce the templating mechanism used in Odoo."
msgstr ""
#: ../../content/developer/tutorials/getting_started/15_qwebintro.rst:5
msgid "Chapter 15: A Brief History Of QWeb"
msgstr ""
#: ../../content/developer/tutorials/getting_started/15_qwebintro.rst:7
msgid "So far the interface design of our real estate module has been rather limited. Building a list view is straightforward since only the list of fields is necessary. The same holds true for the form view: despite the use of a few tags such as ``<group>`` or ``<page>``, there is very little to do in terms of design."
msgstr ""
#: ../../content/developer/tutorials/getting_started/15_qwebintro.rst:12
msgid "However, if we want to give a unique look to our application, it is necessary to go a step further and be able to design new views. Moreover, other features such as PDF reports or website pages need another tool to be created with more flexibility: a templating_ engine."
msgstr ""
#: ../../content/developer/tutorials/getting_started/15_qwebintro.rst:16
msgid "You might already be familiar with existing engines such as Jinja (Python), ERB (Ruby) or Twig (PHP). Odoo comes with its own built-in engine: :ref:`reference/qweb`. QWeb is the primary templating engine used by Odoo. It is an XML templating engine and used mostly to generate HTML fragments and pages."
msgstr ""
#: ../../content/developer/tutorials/getting_started/15_qwebintro.rst:21
msgid "You probably already have come across the `kanban board`_ in Odoo where the records are displayed in a card-like structure. We will build such a view for our real estate module."
msgstr ""
#: ../../content/developer/tutorials/getting_started/15_qwebintro.rst:25
msgid "Concrete Example: A Kanban View"
msgstr ""
#: ../../content/developer/tutorials/getting_started/15_qwebintro.rst:27
msgid "**Reference**: the documentation related to this topic can be found in :ref:`reference/view_architectures/kanban`."
msgstr ""
#: ../../content/developer/tutorials/getting_started/15_qwebintro.rst:32
msgid "**Goal**: at the end of this section a Kanban view of the properties should be created:"
msgstr ""
#: ../../content/developer/tutorials/getting_started/15_qwebintro.rst:38
msgid "In our estate application, we would like to add a Kanban view to display our properties. Kanban views are a standard Odoo view (like the form and list views), but their structure is much more flexible. In fact, the structure of each card is a mix of form elements (including basic HTML) and QWeb. The definition of a Kanban view is similar to the definition of the list and form views, except that their root element is ``<kanban>``. In its simplest form, a Kanban view looks like:"
msgstr ""
#: ../../content/developer/tutorials/getting_started/15_qwebintro.rst:57
msgid "Let's break down this example:"
msgstr ""
#: ../../content/developer/tutorials/getting_started/15_qwebintro.rst:59
msgid "``<templates>``: defines a list of :ref:`reference/qweb` templates. Kanban views *must* define at least one root template ``kanban-box``, which will be rendered once for each record."
msgstr ""
#: ../../content/developer/tutorials/getting_started/15_qwebintro.rst:61
msgid "``<t t-name=\"kanban-box\">``: ``<t>`` is a placeholder element for QWeb directives. In this case, it is used to set the ``name`` of the template to ``kanban-box``"
msgstr ""
#: ../../content/developer/tutorials/getting_started/15_qwebintro.rst:63
msgid "``<div class=\"oe_kanban_global_click\">``: the ``oe_kanban_global_click`` makes the ``<div>`` clickable to open the record."
msgstr ""
#: ../../content/developer/tutorials/getting_started/15_qwebintro.rst:65
msgid "``<field name=\"name\"/>``: this will add the ``name`` field to the view."
msgstr ""
#: ../../content/developer/tutorials/getting_started/15_qwebintro.rst:67
msgid "Make a minimal kanban view."
msgstr ""
#: ../../content/developer/tutorials/getting_started/15_qwebintro.rst:69
msgid "Using the simple example provided, create a minimal Kanban view for the properties. The only field to display is the ``name``."
msgstr ""
#: ../../content/developer/tutorials/getting_started/15_qwebintro.rst:72
msgid "Tip: you must add ``kanban`` in the ``view_mode`` of the corresponding ``ir.actions.act_window``."
msgstr ""
#: ../../content/developer/tutorials/getting_started/15_qwebintro.rst:75
msgid "Once the Kanban view is working, we can start improving it. If we want to display an element conditionally, we can use the ``t-if`` directive (see :ref:`reference/qweb/conditionals`)."
msgstr ""
#: ../../content/developer/tutorials/getting_started/15_qwebintro.rst:94
msgid "We added a few things:"
msgstr ""
#: ../../content/developer/tutorials/getting_started/15_qwebintro.rst:96
msgid "``t-if``: the ``<div>`` element is rendered if the condition is true."
msgstr ""
#: ../../content/developer/tutorials/getting_started/15_qwebintro.rst:97
msgid "``record``: an object with all the requested fields as its attributes. Each field has two attributes ``value`` and ``raw_value``. The former is formatted according to current user parameters and the latter is the direct value from a :meth:`~odoo.models.Model.read`."
msgstr ""
#: ../../content/developer/tutorials/getting_started/15_qwebintro.rst:101
msgid "In the above example, the field ``name`` was added in the ``<templates>`` element, but ``state`` is outside of it. When we need the value of a field but don't want to display it in the view, it is possible to add it outside of the ``<templates>`` element."
msgstr ""
#: ../../content/developer/tutorials/getting_started/15_qwebintro.rst:105
msgid "Improve the Kanban view."
msgstr ""
#: ../../content/developer/tutorials/getting_started/15_qwebintro.rst:107
msgid "Add the following fields to the Kanban view: expected price, best price, selling price and tags. Pay attention: the best price is only displayed when an offer is received, while the selling price is only displayed when an offer is accepted."
msgstr ""
#: ../../content/developer/tutorials/getting_started/15_qwebintro.rst:111
#: ../../content/developer/tutorials/getting_started/15_qwebintro.rst:122
msgid "Refer to the **Goal** of the section for a visual example."
msgstr ""
#: ../../content/developer/tutorials/getting_started/15_qwebintro.rst:113
msgid "Let's give the final touch to our view: the properties must be grouped by type by default. You might want to have a look at the various options described in :ref:`reference/view_architectures/kanban`."
msgstr ""
#: ../../content/developer/tutorials/getting_started/15_qwebintro.rst:117
msgid "Add default grouping."
msgstr ""
#: ../../content/developer/tutorials/getting_started/15_qwebintro.rst:119
msgid "Use the appropriate attribute to group the properties by type by default. You must also prevent drag and drop."
msgstr ""
#: ../../content/developer/tutorials/getting_started/15_qwebintro.rst:124
msgid "Kanban views are a typical example of how it is always a good idea to start from an existing view and fine tune it instead of starting from scratch. There are many options and classes available, so... read and learn!"
msgstr ""
#: ../../content/developer/tutorials/getting_started/16_final_word.rst:5
msgid "Chapter 16: The final word"
msgstr ""
#: ../../content/developer/tutorials/getting_started/16_final_word.rst:8
msgid "Coding guidelines"
msgstr ""
#: ../../content/developer/tutorials/getting_started/16_final_word.rst:10
msgid "We will start refactoring the code to match to the Odoo coding guidelines. The guidelines aim to improve the quality of the Odoo Apps code."
msgstr ""
#: ../../content/developer/tutorials/getting_started/16_final_word.rst:13
msgid "**Reference**: you will find the Odoo coding guidelines in :doc:`/contributing/development/coding_guidelines`."
msgstr ""
#: ../../content/developer/tutorials/getting_started/16_final_word.rst:16
msgid "Polish your code."
msgstr ""
#: ../../content/developer/tutorials/getting_started/16_final_word.rst:18
msgid "Refactor your code to respect the coding guidelines. Don't forget to run your linter and respect the module structure, the variable names, the method name convention, the model attribute order and the xml ids."
msgstr ""
#: ../../content/developer/tutorials/getting_started/16_final_word.rst:23
msgid "Test on the runbot"
msgstr ""
#: ../../content/developer/tutorials/getting_started/16_final_word.rst:25
msgid "Odoo has its own :abbr:`CI (Continuous integration)` server named `runbot <https://runbot.odoo.com/>`__. All commits, branches and PR will be tested to avoid regressions or breaking of the stable versions. All the runs that pass the tests are deployed on their own server with demo data."
msgstr ""
#: ../../content/developer/tutorials/getting_started/16_final_word.rst:29
msgid "Play with the runbot."
msgstr ""
#: ../../content/developer/tutorials/getting_started/16_final_word.rst:31
msgid "Feel free to go to the runbot website and open the last stable version of Odoo to check out all the available applications and functionalities."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework.rst:5
msgid "Master the Odoo web framework"
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework.rst:13
msgid "This tutorial is designed for those who have completed the :doc:`discover_js_framework` tutorial and are looking to deepen their knowledge of the Odoo web framework. It is organized in four independant projects, each focusing on different features of Odoo."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework.rst:19
msgid "Each of these chapters can be done independantly, in any order. Also, be aware that some of them cover a lot of material, so they may be quite long."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework.rst:22
msgid "The first project is about building a `clicker game <https://en.wikipedia.org/wiki/Incremental_game>`_. While working on it, you will learn various aspects of the web framework: systray, command palette, dialogs, notifications, customizing existing components and much more."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework.rst:26
msgid "The second project is focused on an important category of components: fields. Field components represent the value of a field for a record, they appear in many places in the web client: in form views, obviously, but also in kanban and list views, and may even be used alone, without a view. Due to their importance, it makes sense to learn how to create and manipulate such components."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework.rst:31
msgid "In the context of the web framework, views usually refers to the javascript implementation of a component that represents one or many records, depending on a description (`ir.ui.view`). Such components are actually quite complicated and usually requires various sub systems (a renderer, a model, a controller, a arch parser, ...). In chapter 3, we create a new view from scratch to represent a list of images."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework.rst:37
msgid "Finally, the last project in chapter 4 is about customizing an existing view (a kanban view) by adding a search panel on its left. It is interesting to see how one can take existing code, and modify it to suit our needs. Also, it is a realistic project, that will feature many common issues that arises while working on Odoo."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework.rst:51
msgid "Start a new Odoo database and install the modules for each chapter that you want to work on: `awesome_clicker` (for chapter 1), `awesome_fields` (for chapter 2), `awesome_gallery` (for chapter 3) or `awesome_kanban` (for chapter 4)."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework.rst:57
msgid ":doc:`master_odoo_web_framework/01_build_clicker_game`"
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework.rst:58
msgid ":doc:`master_odoo_web_framework/02_create_gallery_view`"
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework.rst:59
msgid ":doc:`master_odoo_web_framework/03_customize_kanban_view`"
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/01_build_clicker_game.rst:3
msgid "Chapter 1: Build a Clicker game"
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/01_build_clicker_game.rst:5
msgid "For this project, we will build together a `clicker game <https://en.wikipedia.org/wiki/Incremental_game>`_, completely integrated with Odoo. In this game, the goal is to accumulate a large number of clicks, and to automate the system. The interesting part is that we will use the Odoo user interface as our playground. For example, we will hide bonuses in some random parts of the web client."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/01_build_clicker_game.rst:10
msgid "To get started, you need a running Odoo server and a development environment. Before getting into the exercises, make sure you have followed all the steps described in this :ref:`tutorial introduction <tutorials/master_odoo_web_framework/setup>`."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/01_build_clicker_game.rst:21
msgid "The solutions for each exercise of the chapter are hosted on the `official Odoo tutorials repository <https://github.com/odoo/tutorials/commits/17.0-master-odoo-web-framework-solutions/awesome_clicker>`_."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/01_build_clicker_game.rst:27
msgid "1. Create a systray item"
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/01_build_clicker_game.rst:29
msgid "To get started, we want to display a counter in the systray."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/01_build_clicker_game.rst:31
msgid "Create a `clicker_systray_item.js` (and `xml`) file with a hello world Owl component."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/01_build_clicker_game.rst:32
msgid "Register it to the systray registry, and make sure it is visible."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/01_build_clicker_game.rst:33
msgid "Update the content of the item so that it displays the following string: `Clicks: 0`, and add a button on the right to increment the value."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/01_build_clicker_game.rst:39
msgid "And voila, we have a completely working clicker game!"
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/01_build_clicker_game.rst:43
msgid ":ref:`Documentation on the systray registry <frontend/registries/systray>`"
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/01_build_clicker_game.rst:44
msgid "`Example: adding a systray item to the registry <https://github.com/odoo/odoo/blob/c4fb9c92d7826ddbc183d38b867ca4446b2fb709/addons/web/static/src/webclient/user_menu/user_menu.js#L41-L42>`_"
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/01_build_clicker_game.rst:48
msgid "2. Count external clicks"
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/01_build_clicker_game.rst:50
msgid "Well, to be honest, it is not much fun yet. So let us add a new feature: we want all clicks in the user interface to count, so the user is incentivized to use Odoo as much as possible! But obviously, the intentional clicks on the main counter should still count more."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/01_build_clicker_game.rst:54
msgid "Use `useExternalListener` to listen on all clicks on `document.body`."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/01_build_clicker_game.rst:55
msgid "Each of these clicks should increase the counter value by 1."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/01_build_clicker_game.rst:56
msgid "Modify the code so that each click on the counter increased the value by 10"
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/01_build_clicker_game.rst:57
msgid "Make sure that a click on the counter does not increase the value by 11!"
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/01_build_clicker_game.rst:58
msgid "Also additional challenge: make sure the external listener capture the events, so we don't miss any clicks."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/01_build_clicker_game.rst:63
msgid "`Owl documentation on useExternalListener <https://github.com/odoo/owl/blob/master/doc/reference/hooks.md#useexternallistener>`_"
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/01_build_clicker_game.rst:64
msgid "`MDN page on event capture <https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Building_blocks/Events#event_capture>`_"
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/01_build_clicker_game.rst:68
msgid "3. Create a client action"
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/01_build_clicker_game.rst:70
msgid "Currently, the current user interface is quite small: it is just a systray item. We certainly need more room to display more of our game. To do that, let us create a client action. A client action is a main action, managed by the web client, that displays a component."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/01_build_clicker_game.rst:74
msgid "Create a `client_action.js` (and `xml`) file, with a hello world component."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/01_build_clicker_game.rst:75
msgid "Register that client action in the action registry under the name `awesome_clicker.client_action`"
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/01_build_clicker_game.rst:76
msgid "Add a button on the systray item with the text `Open`. Clicking on it should open the client action `awesome_clicker.client_action` (use the action service to do that)."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/01_build_clicker_game.rst:78
msgid "To avoid disrupting employees' workflow, we prefer the client action to open within a popover rather than in fullscreen mode. Modify the `doAction` call to open it in a popover."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/01_build_clicker_game.rst:83
msgid "You can use `target: \"new\"` in the `doAction` to open the action in a popover:"
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/01_build_clicker_game.rst:99
msgid ":ref:`How to create a client action <howtos/javascript_client_action>`"
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/01_build_clicker_game.rst:102
msgid "4. Move the state to a service"
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/01_build_clicker_game.rst:104
msgid "For now, our client action is just a hello world component. We want it to display our game state, but that state is currently only available in the systray item. So it means that we need to change the location of our state to make it available for all our components. This is a perfect use case for services."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/01_build_clicker_game.rst:108
msgid "Create a `clicker_service.js` file with the corresponding service."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/01_build_clicker_game.rst:109
msgid "This service should export a reactive value (the number of clicks) and a few functions to update it:"
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/01_build_clicker_game.rst:122
msgid "Access the state in both the systray item and the client action (don't forget to `useState` it). Modify the systray item to remove its own local state and use it. Also, you can remove the `+10 clicks` button."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/01_build_clicker_game.rst:124
msgid "Display the state in the client action, and add a `+10` clicks button in it."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/01_build_clicker_game.rst:131
msgid ":ref:`Short explanation on services <tutorials/discover_js_framework/services>`"
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/01_build_clicker_game.rst:134
msgid "5. Use a custom hook"
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/01_build_clicker_game.rst:136
msgid "Right now, every part of the code that will need to use our clicker service will have to import `useService` and `useState`. Since it is quite common, let us use a custom hook. It is also useful to put more emphasis on the `clicker` part, and less emphasis on the `service` part."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/01_build_clicker_game.rst:140
msgid "Export a `useClicker` hook."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/01_build_clicker_game.rst:141
msgid "Update all current uses of the clicker service to the new hook:"
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/01_build_clicker_game.rst:149
msgid "`Documentation on hooks: <https://github.com/odoo/owl/blob/master/doc/reference/hooks.md>`_"
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/01_build_clicker_game.rst:152
msgid "6. Humanize the displayed value"
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/01_build_clicker_game.rst:154
msgid "We will in the future display large numbers, so let us get ready for that. There is a `humanNumber` function that format numbers in a easier to comprehend way: for example, `1234` could be formatted as `1.2k`"
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/01_build_clicker_game.rst:157
msgid "Use it to display our counters (both in the systray item and the client action)."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/01_build_clicker_game.rst:158
msgid "Create a `ClickValue` component that display the value."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/01_build_clicker_game.rst:162
msgid "Owl allows component that contains just text nodes!"
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/01_build_clicker_game.rst:169
msgid "`definition of humanNumber function <https://github.com/odoo/odoo/blob/c638913df191dfcc5547f90b8b899e7738c386f1/addons/web/static/src/core/utils/numbers.js#L119>`_"
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/01_build_clicker_game.rst:172
msgid "7. Add a tooltip in `ClickValue` component"
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/01_build_clicker_game.rst:174
msgid "With the `humanNumber` function, we actually lost some precision on our interface. Let us display the real number as a tooltip."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/01_build_clicker_game.rst:177
msgid "Tooltip needs an html element. Change the `ClickValue` to wrap the value in a `<span/>` element"
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/01_build_clicker_game.rst:178
msgid "Add a dynamic `data-tooltip` attribute to display the exact value."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/01_build_clicker_game.rst:185
msgid "`Documentation in the tooltip service <https://github.com/odoo/odoo/blob/c638913df191dfcc5547f90b8b899e7738c386f1/addons/web/static/src/core/tooltip/tooltip_service.js#L17>`_"
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/01_build_clicker_game.rst:188
msgid "8. Buy ClickBots"
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/01_build_clicker_game.rst:190
msgid "Let us make our game even more interesting: once a player get to 1000 clicks for the first time, the game should unlock a new feature: the player can buy robots for 1000 clicks. These robots will generate 10 clicks every 10 seconds."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/01_build_clicker_game.rst:194
msgid "Add a `level` number to our state. This is a number that will be incremented at some milestones, and open new features"
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/01_build_clicker_game.rst:196
msgid "Add a `clickBots` number to our state. It represents the number of robots that have been purchased."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/01_build_clicker_game.rst:197
msgid "Modify the client action to display the number of click bots (only if `level >= 1`), with a `Buy` button that is enabled if `clicks >= 1000`. The `Buy` button should increment the number of clickbots by 1."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/01_build_clicker_game.rst:199
msgid "Set a 10s interval in the service that will increment the number of clicks by `10*clickBots`."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/01_build_clicker_game.rst:200
msgid "Make sure the Buy button is disabled if the player does not have enough clicks."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/01_build_clicker_game.rst:206
msgid "9. Refactor to a class model"
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/01_build_clicker_game.rst:208
msgid "The current code is written in a somewhat functional style. But to do so, we have to export the state and all its update functions in our clicker object. As this project grows, this may become more and more complex. To make it simpler, let us split our business logic out of our service and into a class."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/01_build_clicker_game.rst:212
msgid "Create a `clicker_model` file that exports a reactive class. Move all the state and update functions from the service into the model."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/01_build_clicker_game.rst:217
msgid "You can extends the ClickerModel with the `Reactive` class from :file:`@web/core/utils/reactive`. The `Reactive` class wrap the model into a reactive proxy."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/01_build_clicker_game.rst:220
msgid "Rewrite the clicker service to instantiate and export the clicker model class."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/01_build_clicker_game.rst:224
msgid "`Example of subclassing Reactive <https://github.com/odoo/odoo/blob/c638913df191dfcc5547f90b8b899e7738c386f1/addons/web/static/src/model/relational_model/datapoint.js#L32>`_"
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/01_build_clicker_game.rst:227
msgid "10. Notify when a milestone is reached"
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/01_build_clicker_game.rst:229
msgid "There is not much feedback that something changed when we reached 1k clicks. Let us use the `effect` service to communicate that information clearly. The problem is that our click model does not have access to services. Also, we want to keep as much as possible the UI concern out of the model. So, we can explore a new strategy for communication: event buses."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/01_build_clicker_game.rst:234
msgid "Update the clicker model to instantiate a bus, and to trigger a `MILESTONE_1k` event when we reach 1000 clicks for the first time."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/01_build_clicker_game.rst:236
msgid "Change the clicker service to listen to the same event on the model bus."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/01_build_clicker_game.rst:237
msgid "When that happens, use the `effect` service to display a rainbow man."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/01_build_clicker_game.rst:238
msgid "Add some text to explain that the user can now buy clickbots."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/01_build_clicker_game.rst:245
msgid "`Owl documentation on event bus <https://github.com/odoo/owl/blob/master/doc/reference/utils.md#eventbus>`_"
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/01_build_clicker_game.rst:246
msgid ":ref:`Documentation on effect service <frontend/services/effect>`"
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/01_build_clicker_game.rst:249
msgid "11. Add BigBots"
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/01_build_clicker_game.rst:251
msgid "Clearly, we need a way to provide the player with more choices. Let us add a new type of clickbot: `BigBots`, which are just more powerful: they provide with 100 clicks each 10s, but they cost 5000 clicks"
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/01_build_clicker_game.rst:254
msgid "increment `level` when it gets to 5k (so it should be 2)"
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/01_build_clicker_game.rst:255
msgid "Update the state to keep track of bigbots"
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/01_build_clicker_game.rst:256
msgid "bigbots should be available at `level >=2`"
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/01_build_clicker_game.rst:257
msgid "Display the corresponding information in the client action"
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/01_build_clicker_game.rst:261
msgid "If you need to use `<` or `>` in a template as a javascript expression, be careful since it might class with the xml parser. To solve that, you can use one of the special aliases: `gt, gte, lt` or `lte`. See the `Owl documentation page on template expressions <https://github.com/odoo/owl/blob/master/doc/reference/templates.md#expression-evaluation>`_."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/01_build_clicker_game.rst:269
msgid "12. Add a new type of resource: power"
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/01_build_clicker_game.rst:271
msgid "Now, to add another scaling point, let us add a new type of resource: a power multiplier. This is a number that can be increased at `level >= 3`, and multiplies the action of the bots (so, instead of providing one click, clickbots now provide us with `multiplier` clicks)."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/01_build_clicker_game.rst:275
msgid "increment `level` when it gets to 100k (so it should be 3)."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/01_build_clicker_game.rst:276
msgid "update the state to keep track of the power (initial value is 1)."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/01_build_clicker_game.rst:277
msgid "change bots to use that number as a multiplier."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/01_build_clicker_game.rst:278
msgid "Update the user interface to display and let the user purchase a new power level (costs: 50k)."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/01_build_clicker_game.rst:284
msgid "13. Define some random rewards"
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/01_build_clicker_game.rst:286
msgid "We want the user to obtain sometimes bonuses, to reward using Odoo."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/01_build_clicker_game.rst:288
msgid "Define a list of rewards in `click_rewards.js`. A reward is an object with: - a `description` string. - a `apply` function that take the game state in argument and can modify it. - a `minLevel` number (optional) that describes at which unlock level the bonus is available. - a `maxLevel` number (optional) that describes at which unlock level a bonus is no longer available."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/01_build_clicker_game.rst:323
msgid "You can add whatever you want to that list!"
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/01_build_clicker_game.rst:325
msgid "Define a function `getReward` that will select a random reward from the list of rewards that matches the current unlock level."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/01_build_clicker_game.rst:327
msgid "Extract the code that choose randomly in an array in a function `choose` that you can move to another `utils.js` file."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/01_build_clicker_game.rst:330
msgid "14. Provide a reward when opening a form view"
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/01_build_clicker_game.rst:332
msgid "Patch the form controller. Each time a form controller is created, it should randomly decides (1% chance) if a reward should be given."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/01_build_clicker_game.rst:334
msgid "If the answer is yes, call a method `getReward` on the model."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/01_build_clicker_game.rst:335
msgid "That method should choose a reward, send a sticky notification, with a button `Collect` that will then apply the reward, and finally, it should open the `clicker` client action."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/01_build_clicker_game.rst:343
msgid ":ref:`Documentation on patching a class <frontend/patching_class>`"
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/01_build_clicker_game.rst:344
msgid "`Definition of patch function <https://github.com/odoo/odoo/blob/c638913df191dfcc5547f90b8b899e7738c386f1/addons/web/static/src/core/utils/patch.js#L71>`_"
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/01_build_clicker_game.rst:345
msgid "`Example of patching a class <https://github.com/odoo/odoo/blob/c638913df191dfcc5547f90b8b899e7738c386f1/addons/pos_mercury/static/src/app/screens/receipt_screen/receipt_screen.js#L6>`_"
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/01_build_clicker_game.rst:348
msgid "15. Add commands in command palette"
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/01_build_clicker_game.rst:350
msgid "Add a command `Open Clicker Game` to the command palette."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/01_build_clicker_game.rst:351
msgid "Add another command: `Buy 1 click bot`."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/01_build_clicker_game.rst:358
msgid "`Example of use of command provider registry <https://github.com/odoo/odoo/blob/c638913df191dfcc5547f90b8b899e7738c386f1/addons/web/static/src/core/debug/debug_providers.js#L10>`_"
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/01_build_clicker_game.rst:361
msgid "16. Add yet another resource: trees"
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/01_build_clicker_game.rst:363
msgid "It is now time to introduce a completely new type of resources. Here is one that should not be too controversial: trees. We will now allow the user to plant (collect?) fruit trees. A tree costs 1 million clicks, but it will provide us with fruits (either pears or cherries)."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/01_build_clicker_game.rst:367
msgid "Update the state to keep track of various types of trees: pear/cherries, and their fruits."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/01_build_clicker_game.rst:368
msgid "Add a function that computes the total number of trees and fruits."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/01_build_clicker_game.rst:369
msgid "Define a new unlock level at `clicks >= 1 000 000`."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/01_build_clicker_game.rst:370
msgid "Update the client user interface to display the number of trees and fruits, and also, to buy trees."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/01_build_clicker_game.rst:371
msgid "Increment the fruit number by 1 for each tree every 30s."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/01_build_clicker_game.rst:377
msgid "17. Use a dropdown menu for the systray item"
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/01_build_clicker_game.rst:379
msgid "Our game starts to become interesting. But for now, the systray only displays the total number of clicks. We want to see more information: the total number of trees and fruits. Also, it would be useful to have a quick access to some commands and some more information. Let us use a dropdown menu!"
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/01_build_clicker_game.rst:383
msgid "Replace the systray item by a dropdown menu."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/01_build_clicker_game.rst:384
msgid "It should display the numbers of clicks, trees, and fruits, each with a nice icon."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/01_build_clicker_game.rst:385
msgid "Clicking on it should open a dropdown menu that displays more detailed information: each types of trees and fruits."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/01_build_clicker_game.rst:387
msgid "Also, a few dropdown items with some commands: open the clicker game, buy a clickbot, ..."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/01_build_clicker_game.rst:393
msgid "18. Use a Notebook component"
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/01_build_clicker_game.rst:395
msgid "We now keep track of a lot more information. Let us improve our client interface by organizing the information and features in various tabs, with the `Notebook` component:"
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/01_build_clicker_game.rst:398
msgid "Use the `Notebook` component."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/01_build_clicker_game.rst:399
msgid "All `click` content should be displayed in one tab."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/01_build_clicker_game.rst:400
msgid "All `tree/fruits` content should be displayed in another tab."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/01_build_clicker_game.rst:407
msgid ":ref:`Odoo: Documentation on Notebook component <frontend/owl/notebook>`"
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/01_build_clicker_game.rst:408
msgid "`Owl: Documentation on slots <https://github.com/odoo/owl/blob/master/doc/reference/slots.md>`_"
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/01_build_clicker_game.rst:409
msgid "`Tests of Notebook component <https://github.com/odoo/odoo/blob/c638913df191dfcc5547f90b8b899e7738c386f1/addons/web/static/tests/core/notebook_tests.js#L27>`_"
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/01_build_clicker_game.rst:412
msgid "19. Persist the game state"
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/01_build_clicker_game.rst:414
msgid "You certainly noticed a big flaw in our game: it is transient. The game state is lost each time the user closes the browser tab. Let us fix that. We will use the local storage to persist the state."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/01_build_clicker_game.rst:417
msgid "Import `browser` from :file:`@web/core/browser/browser` to access the localstorage."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/01_build_clicker_game.rst:418
msgid "Serialize the state every 10s (in the same interval code) and store it on the local storage."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/01_build_clicker_game.rst:419
msgid "When the `clicker` service is started, it should load the state from the local storage (if any), or initialize itself otherwise."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/01_build_clicker_game.rst:423
msgid "20. Introduce state migration system"
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/01_build_clicker_game.rst:425
msgid "Once you persist state somewhere, a new problem arises: what happens when you update your code, so the shape of the state changes, and the user opens its browser with a state that was created with an old version? Welcome to the world of migration issues!"
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/01_build_clicker_game.rst:429
msgid "It is probably wise to tackle the problem early. What we will do here is add a version number to the state, and introduce a system to automatically update the states if it is not up to date."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/01_build_clicker_game.rst:432
msgid "Add a version number to the state."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/01_build_clicker_game.rst:433
msgid "Define an (empty) list of migrations. A migration is an object with a `fromVersion` number, a `toVersion` number, and a `apply` function."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/01_build_clicker_game.rst:434
msgid "Whenever the code loads the state from the local storage, it should check the version number. If the state is not uptodate, it should apply all necessary migrations."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/01_build_clicker_game.rst:438
msgid "21. Add another type of trees"
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/01_build_clicker_game.rst:440
msgid "To test our migration system, let us add a new type of trees: peaches."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/01_build_clicker_game.rst:442
msgid "Add `peach` trees."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/01_build_clicker_game.rst:443
msgid "Increment the state version number."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/01_build_clicker_game.rst:444
msgid "Define a migration."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/02_create_gallery_view.rst:3
msgid "Chapter 2: Create a Gallery View"
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/02_create_gallery_view.rst:5
msgid "Let us see how one can create a new view, completely from scratch. In a way, it is not very difficult to do, but there are no really good resources on how to do it. Note that most situations should be solved by either customizing an existing view, or with a client action."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/02_create_gallery_view.rst:9
msgid "For this exercise, let's assume that we want to create a `gallery` view, which is a view that lets us represent a set of records with an image field."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/02_create_gallery_view.rst:12
msgid "The problem could certainly be solved with a kanban view, but this means that it is not possible to have our normal kanban view and the gallery view in the same action."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/02_create_gallery_view.rst:15
msgid "Let us make a gallery view. Each gallery view will be defined by an `image_field` attribute in its arch:"
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/02_create_gallery_view.rst:22
msgid "To complete the tasks in this chapter, you will need to install the awesome_gallery addon. This addon includes the necessary server files to add a new view."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/02_create_gallery_view.rst:32
msgid "The solutions for each exercise of the chapter are hosted on the `official Odoo tutorials repository <https://github.com/odoo/tutorials/commits/17.0-master-odoo-web-framework-solutions/awesome_gallery>`_."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/02_create_gallery_view.rst:37
msgid "1. Make a hello world view"
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/02_create_gallery_view.rst:39
msgid "First step is to create a JavaScript implementation with a simple component."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/02_create_gallery_view.rst:41
msgid "Create the `gallery_view.js` , `gallery_controller.js` and `gallery_controller.xml` files in `static/src`."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/02_create_gallery_view.rst:43
msgid "Implement a simple hello world component in `gallery_controller.js`."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/02_create_gallery_view.rst:44
msgid "In `gallery_view.js`, import the controller, create a view object, and register it in the view registry under the name `gallery`."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/02_create_gallery_view.rst:48
msgid "Here is an example on how to define a view object:"
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/02_create_gallery_view.rst:65
msgid "Add `gallery` as one of the view type in the `contacts.action_contacts` action."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/02_create_gallery_view.rst:66
msgid "Make sure that you can see your hello world component when switching to the gallery view."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/02_create_gallery_view.rst:75
msgid "2. Use the Layout component"
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/02_create_gallery_view.rst:77
msgid "So far, our gallery view does not look like a standard view. Let's use the `Layout` component to have the standard features like other views."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/02_create_gallery_view.rst:80
msgid "Import the `Layout` component and add it to the `components` of `GalleryController`."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/02_create_gallery_view.rst:81
msgid "Update the template to use `Layout`. It needs a `display` prop, which can be found in `props.display`."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/02_create_gallery_view.rst:88
msgid "3. Parse the arch"
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/02_create_gallery_view.rst:90
msgid "For now, our gallery view does not do much. Let's start by reading the information contained in the arch of the view."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/02_create_gallery_view.rst:93
msgid "The process of parsing an arch is usually done with a `ArchParser`, specific to each view. It inherits from a generic `XMLParser` class."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/02_create_gallery_view.rst:98
msgid "Here is an example of what an ArchParser might look like:"
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/02_create_gallery_view.rst:111
msgid "Create the `ArchParser` class in its own file."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/02_create_gallery_view.rst:112
msgid "Use it to read the `image_field` information."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/02_create_gallery_view.rst:113
msgid "Update the `gallery` view code to add it to the props received by the controller."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/02_create_gallery_view.rst:116
msgid "It is probably a little overkill to do it like that, since we basically only need to read one attribute from the arch, but it is a design that is used by every other odoo views, since it lets us extract some upfront processing out of the controller."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/02_create_gallery_view.rst:121
msgid "`Example: The graph arch parser <https://github.com/odoo/odoo/blob/17.0/addons/web/static/src/views/graph/graph_arch_parser.js>`_"
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/02_create_gallery_view.rst:125
msgid "4. Load some data"
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/02_create_gallery_view.rst:127
msgid "Let us now get some real data from the server. For that we must use `webSearchRead` from the orm service."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/02_create_gallery_view.rst:132
msgid "Here is an example of a `webSearchRead` to get the records from a model:"
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/02_create_gallery_view.rst:146
msgid "Add a :code:`loadImages(domain) {...}` method to the `GalleryController`. It should perform a `webSearchRead` call from the orm service to fetch records corresponding to the domain, and use `imageField` received in props."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/02_create_gallery_view.rst:149
msgid "If you didn't include `bin_size` in the context of the call, you will receive the image field encoded in base64. Make sure to put `bin_size` in the context to receive the size of the image field. We will display the image later."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/02_create_gallery_view.rst:152
msgid "Modify the `setup` code to call that method in the `onWillStart` and `onWillUpdateProps` hooks."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/02_create_gallery_view.rst:154
msgid "Modify the template to display the id and the size of each image inside the default slot of the `Layout` component."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/02_create_gallery_view.rst:158
msgid "The loading data code will be moved into a proper model in a next exercise."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/02_create_gallery_view.rst:164
msgid "5. Solve the concurrency problem"
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/02_create_gallery_view.rst:166
msgid "For now, our code is not concurrency proof. If one changes the domain twice, it will trigger the `loadImages(domain)` twice. We have thus two requests that can arrive at different time depending on different factors. Receiving the response for the first request after receiving the response for the second request will lead to an inconsistent state."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/02_create_gallery_view.rst:171
msgid "The `KeepLast` primitive from Odoo solves this problem, it manages a list of tasks, and only keeps the last task active."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/02_create_gallery_view.rst:174
msgid "Import `KeepLast` from :file:`@web/core/utils/concurrency`."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/02_create_gallery_view.rst:175
msgid "Instanciate a `KeepLast` object in the model."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/02_create_gallery_view.rst:176
msgid "Add the `webSearchRead` call in the `KeepLast` so that only the last call is resolved."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/02_create_gallery_view.rst:179
msgid "`Example: usage of KeepLast <https://github.com/odoo/odoo/blob/ebf646b44f747567ff8788c884f7f18dffd453e0/addons/web/static/src/core/model_field_selector/model_field_selector_popover.js#L164>`_"
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/02_create_gallery_view.rst:182
msgid "6. Reorganize code"
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/02_create_gallery_view.rst:184
msgid "Real views are a little bit more organized. This may be overkill in this example, but it is intended to learn how to structure code in Odoo. Also, this will scale better with changing requirements."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/02_create_gallery_view.rst:187
msgid "Move all the model code in its own `GalleryModel` class."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/02_create_gallery_view.rst:188
msgid "Move all the rendering code in a `GalleryRenderer` component."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/02_create_gallery_view.rst:189
msgid "Import `GalleryModel` and `GalleryRenderer` in `GalleryController` to make it work."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/02_create_gallery_view.rst:192
msgid "7. Make the view extensible"
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/02_create_gallery_view.rst:194
msgid "To extends the view, one could import the gallery view object to modify it to their taste. The problem is that for the moment, it is not possible to define a custom model or renderer because it is hardcoded in the controller."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/02_create_gallery_view.rst:198
msgid "Import `GalleryModel` and `GalleryRenderer` in the gallery view file."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/02_create_gallery_view.rst:199
msgid "Add a `Model` and `Renderer` key to the gallery view object and assign them to `GalleryModel` and `GalleryRenderer`. Pass `Model` and `Renderer` as props to the controller."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/02_create_gallery_view.rst:201
msgid "Remove the hardcoded import in the controller and get them from the props."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/02_create_gallery_view.rst:202
msgid "Use `t-component <https://github.com/odoo/owl/blob/master/doc/reference/component.md#dynamic-sub-components>`_ to have dynamic sub component."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/02_create_gallery_view.rst:208
msgid "This is how someone could now extend the gallery view by modifying the renderer:"
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/02_create_gallery_view.rst:232
msgid "8. Display images"
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/02_create_gallery_view.rst:234
msgid "Update the renderer to display images in a nice way, if the field is set. If `image_field` is empty, display an empty box instead."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/02_create_gallery_view.rst:239
msgid "There is a controller that allows to retrieve an image from a record. You can use this snippet to construct the link:"
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/02_create_gallery_view.rst:255
msgid "9. Switch to form view on click"
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/02_create_gallery_view.rst:257
msgid "Update the renderer to react to a click on an image and switch to a form view. You can use the `switchView` function from the action service."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/02_create_gallery_view.rst:261
msgid "`Code: The switchView function <https://github.com/odoo/odoo/blob/db2092d8d389fdd285f54e9b34a5a99cc9523d27/addons/web/static/src/webclient/actions/action_service.js#L1064>`_"
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/02_create_gallery_view.rst:264
msgid "10. Add an optional tooltip"
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/02_create_gallery_view.rst:266
msgid "It is useful to have some additional information on mouse hover."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/02_create_gallery_view.rst:268
msgid "Update the code to allow an optional additional attribute on the arch:"
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/02_create_gallery_view.rst:274
msgid "On mouse hover, display the content of the tooltip field. It should work if the field is a char field, a number field or a many2one field. To put a tooltip to an html element, you can put the string in the `data-tooltip` attribute of the element."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/02_create_gallery_view.rst:277
msgid "Update the customer gallery view arch to add the customer as tooltip field."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/02_create_gallery_view.rst:284
msgid "`Example: usage of t-att-data-tooltip <https://github.com/odoo/odoo/blob/145fe958c212ddef9fab56a232c8b2d3db635c8e/addons/survey/static/src/views/widgets/survey_question_trigger/survey_question_trigger.xml#L8>`_"
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/02_create_gallery_view.rst:287
msgid "11. Add pagination"
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/02_create_gallery_view.rst:289
msgid "Let's add a pager on the control panel and manage all the pagination like in a normal Odoo view."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/02_create_gallery_view.rst:295
msgid "`Code: The usePager hook <https://github.com/odoo/odoo/blob/17.0/addons/web/static/src/search/pager_hook.js>`_"
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/02_create_gallery_view.rst:296
msgid "`Example: usePager in list controller <https://github.com/odoo/odoo/blob/48ef812a635f70571b395f82ffdb2969ce99da9e/addons/web/static/src/views/list/list_controller.js#L109-L128>`_"
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/02_create_gallery_view.rst:299
msgid "12. Validating views"
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/02_create_gallery_view.rst:301
msgid "We have a nice and useful view so far. But in real life, we may have issue with users incorrectly encoding the `arch` of their Gallery view: it is currently only an unstructured piece of XML."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/02_create_gallery_view.rst:304
msgid "Let us add some validation! In Odoo, XML documents can be described with an RN file :dfn:`(Relax NG file)`, and then validated."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/02_create_gallery_view.rst:307
msgid "Add an RNG file that describes the current grammar:"
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/02_create_gallery_view.rst:309
msgid "A mandatory attribute `image_field`."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/02_create_gallery_view.rst:310
msgid "An optional attribute: `tooltip_field`."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/02_create_gallery_view.rst:312
msgid "Add some code to make sure all views are validated against this RNG file."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/02_create_gallery_view.rst:313
msgid "While we are at it, let us make sure that `image_field` and `tooltip_field` are fields from the current model."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/02_create_gallery_view.rst:316
msgid "Since validating an RNG file is not trivial, here is a snippet to help:"
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/02_create_gallery_view.rst:353
msgid "`Example: The RNG file of the graph view <https://github.com/odoo/odoo/blob/70942e4cfb7a8993904b4d142e3b1749a40db806/odoo/addons/base/rng/graph_view.rng>`_"
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/02_create_gallery_view.rst:356
msgid "13. Uploading an image"
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/02_create_gallery_view.rst:358
msgid "Our gallery view does not allow users to upload images. Let us implement that."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/02_create_gallery_view.rst:360
msgid "Add a button on each image by using the `FileUploader` component."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/02_create_gallery_view.rst:361
msgid "The `FileUploader` component accepts the `onUploaded` props, which is called when the user uploads an image. Make sure to call `webSave` from the orm service to upload the new image."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/02_create_gallery_view.rst:363
msgid "You maybe noticed that the image is uploaded but it is not re-rendered by the browser. This is because the image link did not change so the browser do not re-fetch them. Include the `write_date` from the record to the image url."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/02_create_gallery_view.rst:366
msgid "Make sure that clicking on the upload button does not trigger the switchView."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/02_create_gallery_view.rst:374
msgid "`Example: usage of FileUploader <https://github.com/odoo/odoo/blob/7710c3331ebd22f8396870bd0731f8c1152d9c41/addons/mail/static/src/web/activity/activity.xml#L48-L52>`_"
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/02_create_gallery_view.rst:375
msgid "`Odoo: webSave definition <https://github.com/odoo/odoo/blob/ebd538a1942c532bcf1c9deeab3c25efe23b6893/addons/web/static/src/core/orm_service.js#L312>`_"
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/02_create_gallery_view.rst:378
msgid "14. Advanced tooltip template"
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/02_create_gallery_view.rst:380
msgid "For now we can only specify a tooltip field. But what if we want to allow to write a specific template for it ?"
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/02_create_gallery_view.rst:385
msgid "This is an example of a gallery arch view that should work after this exercise."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/02_create_gallery_view.rst:404
msgid "Replace the `res.partner` gallery arch view in :file:`awesome_gallery/views/views.xml` with the arch in example above. Don't worry if it does not pass the rng validation."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/02_create_gallery_view.rst:406
msgid "Modify the gallery rng validator to accept the new arch structure."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/02_create_gallery_view.rst:410
msgid "You can use this rng snippet to validate the tooltip-template tag"
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/02_create_gallery_view.rst:437
msgid "The arch parser should parse the fields and the tooltip template. Import `visitXML` from :file:`@web/core/utils/xml` and use it to parse field names and the tooltip template."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/02_create_gallery_view.rst:439
msgid "Make sure that the model call the `webSearchRead` by including the parsed field names in the specification."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/02_create_gallery_view.rst:441
msgid "The renderer (or any sub-component you created for it) should receive the parsed tooltip template. Manipulate this template to replace the `<field>` element into a `<t t-esc=\"x\">` element."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/02_create_gallery_view.rst:447
msgid "The template is an `Element` object so it can be manipulated like a HTML element."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/02_create_gallery_view.rst:449
msgid "Register the template to Owl thanks to the `xml` function from :file:`@odoo/owl`."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/02_create_gallery_view.rst:450
msgid "Use the `useTooltip` hook from :file:`@web/core/tooltip/tooltip_hook` to display the tooltips. This hooks take as argument the Owl template and the variable needed by the template."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/02_create_gallery_view.rst:460
msgid "`Example: useTooltip used in Kaban <https://github.com/odoo/odoo/blob/0e6481f359e2e4dd4f5b5147a1754bb3cca57311/addons/web/static/src/views/kanban/kanban_record.js#L189-L192>`_"
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/02_create_gallery_view.rst:461
msgid "`Example: visitXML usage <https://github.com/odoo/odoo/blob/48ef812a635f70571b395f82ffdb2969ce99da9e/addons/web/static/src/views/list/list_arch_parser.js#L19>`_"
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/02_create_gallery_view.rst:462
msgid "`Owl: Inline templates with xml helper function <https://github.com/odoo/owl/blob/master/doc/reference/templates.md#inline-templates>`_"
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/03_customize_kanban_view.rst:3
msgid "Chapter 3: Customize a kanban view"
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/03_customize_kanban_view.rst:5
msgid "We have gained an understanding of the numerous capabilities offered by the Odoo web framework. As a next step, we will customize a kanban view. This is a more complicated project that will showcase some non trivial aspects of the framework. The goal is to practice composing views, coordinating various aspects of the UI, and doing it in a maintainable way."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/03_customize_kanban_view.rst:10
msgid "Bafien had the greatest idea ever: a mix of a kanban view and a list view would be perfect for your needs! In a nutshell, he wants a list of customers on the left of the CRM kanban view. When you click on a customer on the left sidebar, the kanban view on the right is filtered to only display leads linked to that customer."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/03_customize_kanban_view.rst:22
msgid "The solutions for each exercise of the chapter are hosted on the `official Odoo tutorials repository <https://github.com/odoo/tutorials/commits/17.0-master-odoo-web-framework-solutions/awesome_kanban>`_."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/03_customize_kanban_view.rst:27
msgid "1. Create a new kanban view"
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/03_customize_kanban_view.rst:29
msgid "Since we are customizing the kanban view, let us start by extending it and using our extension in the kanban view of CRM."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/03_customize_kanban_view.rst:32
msgid "Create a new empty component that extends the `KanbanController` component from :file:`@web/views/kanban/kanban_controller`."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/03_customize_kanban_view.rst:34
msgid "Create a new view object and assign all keys and values from `kanbanView` from :file:`@web/views/kanban/kanban_view`. Override the Controller key by putting your newly created controller."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/03_customize_kanban_view.rst:37
msgid "Register it in the views registry under `awesome_kanban`."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/03_customize_kanban_view.rst:38
msgid "Update the crm kanban arch in :file:`awesome_kanban/views/views.xml` to use the extended view. This can be done by specifying the `js_class` attribute in the kanban node."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/03_customize_kanban_view.rst:43
msgid "`Example: Create a new view by extending a pre-existing one <https://github.com/odoo/odoo/blob/0a59f37e7dd73daff2e9926542312195b3de4154/addons/todo/static/src/views/todo_conversion_form/todo_conversion_form_view.js>`_"
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/03_customize_kanban_view.rst:46
msgid "2. Create a CustomerList component"
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/03_customize_kanban_view.rst:48
msgid "We will need to display a list of customers, so we might as well create the component."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/03_customize_kanban_view.rst:50
msgid "Create a `CustomerList` component which only displays a `div` with some text for now."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/03_customize_kanban_view.rst:51
msgid "It should have a `selectCustomer` prop."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/03_customize_kanban_view.rst:52
msgid "Create a new template extending (XPath) the kanban controller template `web.KanbanView` to add the `CustomerList` next to the kanban renderer. Give it an empty function as `selectCustomer` for now."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/03_customize_kanban_view.rst:58
msgid "You can use this xpath inside the template to add a div before the renderer component."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/03_customize_kanban_view.rst:66
msgid "Subclass the kanban controller to add `CustomerList` in its sub-components."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/03_customize_kanban_view.rst:67
msgid "Make sure you see your component in the kanban view."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/03_customize_kanban_view.rst:74
msgid ":ref:`Template inheritance <reference/qweb/template_inheritance>`"
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/03_customize_kanban_view.rst:77
msgid "3. Load and display data"
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/03_customize_kanban_view.rst:79
msgid "Modify the `CustomerList` component to fetch a list of all customers in `onWillStart`."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/03_customize_kanban_view.rst:80
msgid "Display the list in the template with a `t-foreach`."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/03_customize_kanban_view.rst:81
msgid "Whenever a customer is selected, call the `selectCustomer` function prop."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/03_customize_kanban_view.rst:88
msgid "`Example: fetching records from a model <https://github.com/odoo/odoo/blob/986c00c1bd1b3ca16a04ab25f5a2504108136112/addons/project/static/src/views/burndown_chart/burndown_chart_model.js#L26-L31>`_"
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/03_customize_kanban_view.rst:91
msgid "4. Update the main kanban view"
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/03_customize_kanban_view.rst:93
msgid "Implement `selectCustomer` in the kanban controller to add the proper domain."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/03_customize_kanban_view.rst:97
msgid "Since it is not trivial to interact with the search view, here is a snippet to create a filter:"
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/03_customize_kanban_view.rst:108
msgid "By clicking on multiple customers, you can see that the old customer filter is not replaced. Make sure that by clicking on a customer, the old filter is replaced by the new one."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/03_customize_kanban_view.rst:113
msgid "You can use this snippet to get the customers filters and toggle them."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/03_customize_kanban_view.rst:127
msgid "Modify the template to give the real function to the `CustomerList` `selectCustomer` prop."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/03_customize_kanban_view.rst:131
msgid "You can use `Symbol <https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol>`_ to make sure that the custom `isFromAwesomeKanban` key will not collide with keys any other code might add to the object."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/03_customize_kanban_view.rst:140
msgid "5. Only display customers which have an active order"
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/03_customize_kanban_view.rst:142
msgid "There is a `opportunity_ids` field on `res.partner`. Let us allow the user to filter results on customers with at least one opportunity."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/03_customize_kanban_view.rst:145
msgid "Add an input of type checkbox in the `CustomerList` component, with a label \"Active customers\" next to it."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/03_customize_kanban_view.rst:147
msgid "Changing the value of the checkbox should filter the list of customers."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/03_customize_kanban_view.rst:154
msgid "6. Add a search bar to the customer list"
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/03_customize_kanban_view.rst:156
msgid "Add an input above the customer list that allows the user to enter a string and to filter the displayed customers, according to their name."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/03_customize_kanban_view.rst:160
msgid "You can use the `fuzzyLookup` from :file:`@web/core/utils/search` function to perform the filter."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/03_customize_kanban_view.rst:169
msgid "`Code: The fuzzylookup function <https://github.com/odoo/odoo/blob/235fc69280a18a5805d8eb84d76ada91ba49fe67/addons/web/static/src/core/utils/search.js#L41-L54>`_"
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/03_customize_kanban_view.rst:170
msgid "`Example: Using fuzzyLookup <https://github.com/odoo/odoo/blob/1f4e583ba20a01f4c44b0a4ada42c4d3bb074273/ addons/web/static/tests/core/utils/search_test.js#L17>`_"
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/03_customize_kanban_view.rst:175
msgid "7. Refactor the code to use `t-model`"
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/03_customize_kanban_view.rst:177
msgid "To solve the previous two exercises, it is likely that you used an event listener on the inputs. Let us see how we could do it in a more declarative way, with the `t-model <https://github.com/odoo/owl/blob/master/doc/reference/input_bindings.md>`_ directive."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/03_customize_kanban_view.rst:181
msgid "Make sure you have a reactive object that represents the fact that the filter is active (something like :code:`this.state = useState({ displayActiveCustomers: false, searchString: ''})`)."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/03_customize_kanban_view.rst:184
msgid "Modify the code to add a getter `displayedCustomers` which returns the currently active list of customers."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/03_customize_kanban_view.rst:186
msgid "Modify the template to use `t-model`."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/03_customize_kanban_view.rst:189
msgid "8. Paginate customers!"
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/03_customize_kanban_view.rst:191
msgid "Add a :ref:`pager <frontend/pager>` in the `CustomerList`, and only load/render the first 20 customers."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/03_customize_kanban_view.rst:193
msgid "Whenever the pager is changed, the customer list should update accordingly."
msgstr ""
#: ../../content/developer/tutorials/master_odoo_web_framework/03_customize_kanban_view.rst:195
msgid "This is actually pretty hard, in particular in combination with the filtering done in the previous exercise. There are many edge cases to take into account."
msgstr ""
#: ../../content/developer/tutorials/mixins.rst:3
msgid "Reuse code with mixins"
msgstr ""
#: ../../content/developer/tutorials/mixins.rst:5
msgid "If you need to interface with common Odoo features such as the chatter, you can rely on :doc:`mixins <../reference/backend/mixins>`. They are Odoo models exposing useful methods through inheritance."
msgstr ""
#: ../../content/developer/tutorials/mixins.rst:9
msgid "To learn and play with mixins, visit `this repository <https://github.com/tivisse/odoodays-2018/>`_. This module for a plant nursery is training material developed for the OXP 2018. You don't need to code it on your side. But you can check the presentations in the :file:`/static/pdf` directory and play with the module to discover some magic features in Odoo."
msgstr ""
#: ../../content/developer/tutorials/pdf_reports.rst:3
msgid "Build PDF Reports"
msgstr ""
#: ../../content/developer/tutorials/pdf_reports.rst:12
msgid "We were previously :ref:`introduced to QWeb <tutorials/getting_started/15_qwebintro>` where it was used to build a kanban view. Now we will expand on one of QWeb's other main uses: creating PDF reports. A common business requirement is the ability to create documents to send to customers and to use internally. These reports can be used to summarize and display information in an organized template to support the business in different ways. Odoo can additionally add our company's header and footer to our reports with minimal extra effort."
msgstr ""
#: ../../content/developer/tutorials/pdf_reports.rst:19
msgid "The documentation related to this topic can be found in :ref:`reference/qweb`, :ref:`reference/reports/report`, and the :ref:`reference/actions/report` section of the Actions reference."
msgstr ""
#: ../../content/developer/tutorials/pdf_reports.rst:24
msgid "File Structure"
msgstr ""
#: ../../content/developer/tutorials/pdf_reports.rst:26
msgid "The bulk of a PDF report is its QWeb template. It also typically needs a corresponding ``ir.actions.report`` to include the report within a module's business logic. There is no strict rule for the file names or where they are located, but these two parts are typically stored in 2 separate files within a ``report`` folder at the top level of your module's directory. If a module has many or multiple long report templates, then they are often organized logically across different files named after the report(s) they contain. All actions for the reports are usually stored in the same file ending with ``_reports.xml``, regardless of the number of reports it contains."
msgstr ""
#: ../../content/developer/tutorials/pdf_reports.rst:35
msgid "Therefore, it is expected that your work tree will look something like this:"
msgstr ""
#: ../../content/developer/tutorials/pdf_reports.rst:53
msgid "Don't forget to add whatever files your template and action view will be into to your ``__manifest__.py``. In this case, you will want to add the files to the ``data`` list and remember that the files listed in a manifest are loaded sequentially!"
msgstr ""
#: ../../content/developer/tutorials/pdf_reports.rst:58
msgid "Basic Report"
msgstr ""
#: ../../content/developer/tutorials/pdf_reports.rst:62
msgid "**Goal**: at the end of this section, we will can print a report that displays all offers for a property."
msgstr ""
#: ../../content/developer/tutorials/pdf_reports.rst:0
msgid "Simple PDF report"
msgstr ""
#: ../../content/developer/tutorials/pdf_reports.rst:69
msgid "In our real estate example there are many useful reports that we could create. One simple report we can create is one that displays all of a property's offers."
msgstr ""
#: ../../content/developer/tutorials/pdf_reports.rst:73
msgid "Report Data"
msgstr ""
#: ../../content/developer/tutorials/pdf_reports.rst:75
msgid "Before we do anything we first need some data to populate our reports or else this tutorial won't be very interesting. When creating reports, you will need some data to test your report code and check that the resulting look is as expected. It is a good idea to test with data that will cover most or all of your expected use cases. A good representation set for our simple report is:"
msgstr ""
#: ../../content/developer/tutorials/pdf_reports.rst:80
msgid "At least 3 properties where 1 is \"sold\", 1 is \"offer received\" and 1 is \"new\"."
msgstr ""
#: ../../content/developer/tutorials/pdf_reports.rst:81
msgid "At least 2-3 offers for our \"sold\" and \"offer received\" properties"
msgstr ""
#: ../../content/developer/tutorials/pdf_reports.rst:83
msgid "If you don't have a set of data like this already, you can either:"
msgstr ""
#: ../../content/developer/tutorials/pdf_reports.rst:85
msgid "Complete the :doc:`define_module_data` tutorial (if you haven't done so already) and add the extra cases to your demo data (you may need to create a new database to load in the demo data)."
msgstr ""
#: ../../content/developer/tutorials/pdf_reports.rst:87
msgid "Manually create the data in your database."
msgstr ""
#: ../../content/developer/tutorials/pdf_reports.rst:88
msgid "Copy this `data file <https://github.com/odoo/technical-training-solutions/blob/17.0-J_reports/estate/data/estate_demo.xml>`_ into a new directory (data) in your estate module and copy `these lines <https://github.com/odoo/technical-training-solutions/blob/17.0-J_reports/estate/__manifest__.py#L21-L23>`_ into your __manifest__.py file (you may need to create a new database to load in the demo data)."
msgstr ""
#: ../../content/developer/tutorials/pdf_reports.rst:94
msgid "Before continuing, click through your data in your database and make sure your data is as expected. Of course you can add the data after you write your report code, but then you will not be able to incrementally test portions of your code as you write it. This can make checking for mistakes and debugging your code more difficult in the long run for complicated reports."
msgstr ""
#: ../../content/developer/tutorials/pdf_reports.rst:100
msgid "Minimal Template"
msgstr ""
#: ../../content/developer/tutorials/pdf_reports.rst:102
msgid "A minimal viable template is viewable under the \"Minimal viable template\" section of the :ref:`reference/reports/templates` documentation. We can modify this example to build our minimal property offers template file:"
msgstr ""
#: ../../content/developer/tutorials/pdf_reports.rst:144
msgid "Most of the Odoo specific (i.e. non-HTML) items in our file are explained in the minimal viable template section. Some additional features in our template are:"
msgstr ""
#: ../../content/developer/tutorials/pdf_reports.rst:147
msgid "The use of the ``class=\"table\"`` attribute, so our table has some nice formatting. Twitter Bootstrap (we're using its table class in this case), and Font Awesome (useful for adding icons) classes can be used in your report template."
msgstr ""
#: ../../content/developer/tutorials/pdf_reports.rst:150
msgid "The use of ``t-set``, ``t-value``, ``t-foreach``, and ``t-as`` so that we can loop over all the ``offer_ids``."
msgstr ""
#: ../../content/developer/tutorials/pdf_reports.rst:152
msgid "If you are already familiar with website templating engines, then the QWeb directives (i.e. the `t-` commands) probably don't need much explanation and you can just look at its :ref:`documentation <reference/qweb>` and skip ahead to the next subsection."
msgstr ""
#: ../../content/developer/tutorials/pdf_reports.rst:156
msgid "Otherwise you are encouraged to read more about them ( `Wikipedia <https://en.wikipedia.org/wiki/Template_processor>`__ has a good high level description), but the general idea is that QWeb provides the ability to dynamically generate web code based on Odoo data and simple commands. I.e. QWeb can access recordset data (and methods) and process simple programming operations such as setting and accessing temporary variables. For example, in the above example:"
msgstr ""
#: ../../content/developer/tutorials/pdf_reports.rst:162
msgid "``t-set`` creates a temporary variable called \"offers\" that has its value set by ``t-value`` to the current ``estate.property`` recordset's ``offer_ids``."
msgstr ""
#: ../../content/developer/tutorials/pdf_reports.rst:164
msgid "The ``t-foreach`` and ``t-as`` usage is the equivalent to the Python:"
msgstr ""
#: ../../content/developer/tutorials/pdf_reports.rst:171
msgid "Report Action"
msgstr ""
#: ../../content/developer/tutorials/pdf_reports.rst:173
msgid "Now that we have a template, we need to make it accessible in our app via a ``ir.actions.report``. A practical example of ``ir.actions.report`` is `here <https://github.com/odoo/odoo/blob/0e12fa135882cd5095dbf15fe2f64231c6a84336/addons/event/report/event_event_reports.xml#L20-L30>`__ corresponding to `this template <https://github.com/odoo/odoo/blob/0e12fa135882cd5095dbf15fe2f64231c6a84336/addons/event/report/event_event_templates.xml#L5>`__. Its contents are all explained in :ref:`the documentation <reference/actions/report>`."
msgstr ""
#: ../../content/developer/tutorials/pdf_reports.rst:180
msgid "An ``ir.actions.report`` is primarily used via the Print menu of a model's view. In the practical example, the ``binding_model_id`` specifies which model's views the report should show, and Odoo will auto-magically add it for you. Another common use case of the report action is to link it to a button as we learned in :ref:`tutorials/getting_started/10_actions`. This is handy for reports that only make sense under specific conditions. For example, if we wanted to make a \"Final Sale\" report, then we can link it to a \"Print Sale Info\" button that appears in the form view only when the property is \"Sold\"."
msgstr ""
#: ../../content/developer/tutorials/pdf_reports.rst:-1
msgid "Print Menu Button"
msgstr ""
#: ../../content/developer/tutorials/pdf_reports.rst:192
msgid "You may have noticed or are wondered why our report template loops through a recordset. When our template is passed more than one record, it can produce one PDF report for all the records. Using the Print menu in the list view with multiple records selected will demonstrate this."
msgstr ""
#: ../../content/developer/tutorials/pdf_reports.rst:197
msgid "Make a Report"
msgstr ""
#: ../../content/developer/tutorials/pdf_reports.rst:199
msgid "Finally, you now know where to create your files and how the content of the files should look. Happy report making!"
msgstr ""
#: ../../content/developer/tutorials/pdf_reports.rst:201
msgid "Make a report."
msgstr ""
#: ../../content/developer/tutorials/pdf_reports.rst:203
msgid "Add the property offers report from the minimal template subsection to the Print menu of the Property views."
msgstr ""
#: ../../content/developer/tutorials/pdf_reports.rst:205
msgid "Improve the report by adding more data. Refer to the **Goal** of this section to see what additional data you can add and feel free to add even more."
msgstr ""
#: ../../content/developer/tutorials/pdf_reports.rst:208
msgid "Bonus: Make an extra flexible report by adding in some logic so that when there are no offers on a property then we don't create a table and instead write something about how there are no offers yet. Hint: you will need to use ``t-if`` and ``t-else``."
msgstr ""
#: ../../content/developer/tutorials/pdf_reports.rst:212
msgid "Remember to check that your PDF reports match your data as expected."
msgstr ""
#: ../../content/developer/tutorials/pdf_reports.rst:216
msgid "Sub-templates"
msgstr ""
#: ../../content/developer/tutorials/pdf_reports.rst:220
msgid "**Goal**: at the end of this section, we will have a sub-template that we use in 2 reports."
msgstr ""
#: ../../content/developer/tutorials/pdf_reports.rst:0
msgid "Report using a subtemplate"
msgstr ""
#: ../../content/developer/tutorials/pdf_reports.rst:226
msgid "There are two main reasons for using sub-templates. One is to make the code easier to read when working with extra-long or complicated templates. The other is to reuse code where possible. Our simple property offers report is useful, but listing property offers information can be useful for more than just one report template. One example is a report that lists all of a salesman's properties' offers."
msgstr ""
#: ../../content/developer/tutorials/pdf_reports.rst:231
msgid "See if you can understand how to call a sub-template by reading the :ref:`documentation <reference/qweb/sub-templates>` on it and/or by looking at an `example <https://github.com/odoo/odoo/blob/0e12fa135882cd5095dbf15fe2f64231c6a84336/addons/portal/static/src/xml/portal_chatter.xml#L147-L160>`__ (remember QWeb uses the same control flows regardless if it is for a report or a view in Odoo.)"
msgstr ""
#: ../../content/developer/tutorials/pdf_reports.rst:236
msgid "Create and use a sub-template."
msgstr ""
#: ../../content/developer/tutorials/pdf_reports.rst:238
msgid "Split the table portion of the offers into its own template. Remember to check that your original report still prints correctly afterwards."
msgstr ""
#: ../../content/developer/tutorials/pdf_reports.rst:241
msgid "Add a new report for ``res.users`` that allows you to print all of the Real Estate Properties that are visible in their form view (i.e. in the \"Settings\" app). Include the offers for each of those saleman's properties in the same report. Hint: since the ``binding_model_id`` in this case will not be within the estate module, you will need to use ``ref=\"base.model_res_users\"``."
msgstr ""
#: ../../content/developer/tutorials/pdf_reports.rst:246
msgid "Your end result should look similar to the image in the **Goal** of this section."
msgstr ""
#: ../../content/developer/tutorials/pdf_reports.rst:248
msgid "Remember to check that your reports match your data as expected!"
msgstr ""
#: ../../content/developer/tutorials/pdf_reports.rst:251
msgid "Report Inheritance"
msgstr ""
#: ../../content/developer/tutorials/pdf_reports.rst:255
msgid "**Goal**: at the end of this section, we will inherit the property report in the ``estate_account`` module."
msgstr ""
#: ../../content/developer/tutorials/pdf_reports.rst:0
msgid "An inherited report"
msgstr ""
#: ../../content/developer/tutorials/pdf_reports.rst:262
msgid "Inheritance in QWeb uses the same ``xpath`` elements as :ref:`views inheritance <reference/view_records/inheritance>`. A QWeb template refers to its parent template in a different way though. It is even easier to do by just adding the ``inherit_id`` attribute to the ``template`` element and setting it equal to the *module.parent_template_id*."
msgstr ""
#: ../../content/developer/tutorials/pdf_reports.rst:266
msgid "We didn't add any new fields to any of the estate models in `estate_account`, but we can still add information to our existing property report. For example, we know that any \"Sold\" properties will already have an invoice created for them, so we can add this information to our report."
msgstr ""
#: ../../content/developer/tutorials/pdf_reports.rst:270
msgid "Inherit a report."
msgstr ""
#: ../../content/developer/tutorials/pdf_reports.rst:272
msgid "Extend the property report to include some information about the invoice. You can look at the **Goal** of this section for inspiration (i.e. print a line when the property is Done, otherwise print nothing)."
msgstr ""
#: ../../content/developer/tutorials/pdf_reports.rst:275
msgid "Again, remember to check that your reports match your data as expected!"
msgstr ""
#: ../../content/developer/tutorials/pdf_reports.rst:278
msgid "Additional Features"
msgstr ""
#: ../../content/developer/tutorials/pdf_reports.rst:280
msgid "All the following extra features are described further in the :ref:`reference/reports/report` documentation, including how to implement each of them."
msgstr ""
#: ../../content/developer/tutorials/pdf_reports.rst:286
msgid "We all know Odoo is used in multiple languages thanks to automated and manual translating. QWeb reports are no exception! Note that sometimes the translations do not work properly if there are unnecessary spaces in your template's text content, so try to avoid them when possible (especially leading spaces)."
msgstr ""
#: ../../content/developer/tutorials/pdf_reports.rst:293
msgid "You probably are tired of hearing that QWeb creates HTML, but we're saying it again! One of the neat features of reports being written in QWeb is they can be viewed within the web browser. This can be useful if you want to embed a hyperlink that leads to a specific report. Note that the usual security checks will still apply to prevent unauthorized users from accessing the reports."
msgstr ""
#: ../../content/developer/tutorials/pdf_reports.rst:301
msgid "Odoo has a built-in barcode image creator that allows for barcodes to be embedded in your reports. Check out the corresponding `code <https://github.com/odoo/odoo/blob/0e12fa135882cd5095dbf15fe2f64231c6a84336/addons/web/controllers/main.py#L2044-L2046>`__ to see all the supported barcode types."
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:3
msgid "Restrict access to data"
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:12
msgid "So far we have mostly concerned ourselves with implementing useful features. However in most business scenarios *security* quickly becomes a concern: currently,"
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:16
msgid "Any employee (which is what ``group_user`` stands for) can create, read, update or delete properties, property types, or property tags."
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:18
msgid "If ``estate_account`` is installed then only agents allowed to interact with invoicing can confirm sales as that's necessary to :ref:`create an invoice <tutorials/getting_started/14_other_module/create>`."
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:22
msgid "However:"
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:24
msgid "We do not want third parties to be able to access properties directly."
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:25
msgid "Not all our employees may be real-estate agents (e.g. administrative personnel, property managers, ...), we don't want non-agents to see the available properties."
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:28
msgid "Real-estate agents don't need or get to decide what property types or tags are *available*."
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:30
msgid "Real-estate agents can have *exclusive* properties, we do not want one agent to be able to manage another's exclusives."
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:32
msgid "All real-estate agents should be able to confirm the sale of a property they can manage, but we do not want them to be able to validate or mark as paid any invoice in the system."
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:38
msgid "We may actually be fine with some or most of these for a small business."
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:40
msgid "Because it's easier for users to disable unnecessary security rules than it is to create them from nothing, it's better to err on the side of caution and limit access: users can relax that access if necessary or convenient."
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:45
msgid "Groups"
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:49
msgid "The documentation related to this topic can be found in :ref:`the security reference <reference/security>`."
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:52
msgid ":doc:`/contributing/development/coding_guidelines` document the format and location of master data items."
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:55
#: ../../content/developer/tutorials/restrict_data_access.rst:137
#: ../../content/developer/tutorials/restrict_data_access.rst:202
#: ../../content/developer/tutorials/restrict_data_access.rst:271
#: ../../content/developer/tutorials/restrict_data_access.rst:315
#: ../../content/developer/tutorials/restrict_data_access.rst:392
#: ../../content/developer/tutorials/restrict_data_access.rst:463
msgid "**Goal**"
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:57
#: ../../content/developer/tutorials/restrict_data_access.rst:139
msgid "At the end of this section,"
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:59
msgid "We can make employees *real-estate agents* or *real-estate managers*."
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:60
msgid "The ``admin`` user is a real-estate manager."
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:61
msgid "We have a new *real-estate agent* employee with no access to invoicing or administration."
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:64
msgid "It would not be practical to attach individual security rules to employees any time we need a change so *groups* link security rules and users. They correspond to roles that can be assigned to employees."
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:68
msgid "For most Odoo applications [#app]_ a good baseline is to have *user* and *manager* (or administrator) roles: the manager can change the configuration of the application and oversee the entirety of its use while the user can well, use the application [#appuser]_."
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:73
msgid "This baseline seems sufficient for us:"
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:75
msgid "Real estate managers can configure the system (manage available types and tags) as well as oversee every property in the pipeline."
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:77
msgid "Real estate agents can manage the properties under their care, or properties which are not specifically under the care of any agent."
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:80
msgid "In keeping with Odoo's data-driven nature, a group is no more than a record of the ``res.groups`` model. They are normally part of a module's :doc:`master data <define_module_data>`, defined in one of the module's data files."
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:84
msgid "As simple example `can be found here <https://github.com/odoo/odoo/blob/532c083cbbe0ee6e7a940e2bdc9c677bd56b62fa/addons/hr/security/hr_security.xml#L9-L14>`_."
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:88
msgid "Create the ``security.xml`` file in the appropriate folder and add it to the ``__manifest__.py`` file."
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:90
msgid "If not already, add a ``'category'`` field to your ``__manifest__.py`` with value ``Real Estate/Brokerage``."
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:92
msgid "Add a record creating a group with the id ``estate_group_user``, the name \"Agent\" and the category ``base.module_category_real_estate_brokerage``."
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:95
msgid "Below that, add a record creating a group with the id ``estate_group_manager``, the name \"Manager\" and the category ``base.module_category_real_estate_brokerage``. The ``estate_group_manager`` group needs to imply ``estate_group_user``."
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:101
msgid "Where does that **category** comes from ? It's a *module category*. Here we used the category id ``base.module_category_real_estate_brokerage`` which was automatically generated by Odoo based on the `category` set in the ``__manifest__.py`` of the module. You can also find here the list of `default module categories <https://github.com/odoo/odoo/blob/71da80deb044852a2af6b111d695f94aad7803ac/odoo/addons/base/data/ir_module_category_data.xml>`_ provided by Odoo."
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:110
msgid "Since we modified data files, remember to restart Odoo and update the module using ``-u estate``."
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:113
msgid "If you go to :menuselection:`Settings --> Manage Users` and open the ``admin`` user (\"Mitchell Admin\"), you should see a new section:"
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:118
msgid "Set the admin user to be a *Real Estate manager*."
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:122
msgid "Via the web interface, create a new user with only the \"real estate agent\" access. The user should not have any Invoicing or Administration access."
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:125
msgid "Use a private tab or window to log in with the new user (remember to set a password), as the real-estate agent you should only see the real estate application, and possibly the Discuss (chat) application:"
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:134
msgid "The documentation related to this topic can be found at :ref:`reference/security/acl`."
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:141
msgid "Employees who are not at least real-estate agents will not see the real-estate application."
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:143
msgid "Real-estate agents will not be able to update the property types or tags."
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:145
msgid "Access rights were first introduced in :ref:`tutorials/getting_started/05_securityintro`."
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:147
msgid "Access rights are a way to give users access to models *via* groups: associate an access right to a group, then all users with that group will have the access."
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:150
msgid "For instance we don't want real-estate agents to be able to modify what property types are available, so we would not link that access to the \"user\" group."
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:153
msgid "Access rights can only give access, they can't remove it: when access is checked, the system looks to see if *any* access right associated with the user (via any group) grants that access."
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:158
msgid "group"
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:158
msgid "read"
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:158
msgid "update"
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:160
msgid "A"
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:160
#: ../../content/developer/tutorials/restrict_data_access.rst:161
#: ../../content/developer/tutorials/restrict_data_access.rst:162
msgid "X"
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:161
msgid "B"
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:162
msgid "C"
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:165
msgid "A user with the groups A and C will be able to do anything but delete the object while one with B and C will be able to read and update it, but not create or delete it."
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:170
msgid "The group of an access right can be omitted, this means the ACL applies to *every user*, this is a useful but risky fallback as depending on the applications installed it can grant even non-users access to the model."
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:173
msgid "If no access right applies to a user, they are not granted access (default-deny)."
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:175
msgid "If a menu item points to a model to which a user doesn't have access and has no submenus which the user can see, the menu will not be displayed."
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:178
msgid "Update the access rights file to:"
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:180
msgid "Give full access to all objects to your Real Estate Manager group."
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:181
msgid "Give agents (real estate users) only read access to types and tags."
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:182
msgid "Give nobody the right to delete properties."
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:183
msgid "Check that your agent user is not able to alter types or tags, or to delete properties, but that they can otherwise create or update properties."
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:189
msgid "Remember to give different xids to your ``ir.model.access`` records otherwise they will overwrite one another."
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:192
msgid "Since the \"demo\" user was not made a real-estate agent or manager, they should not even be able to see the real-estate application. Use a private tab or window to check for this (the \"demo\" user has the password \"demo\")."
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:199
msgid "The documentation related to this topic can be found at :ref:`reference/security/rules`."
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:204
msgid "At the end of this section, agents will not be able to see the properties exclusive to their colleagues; but managers will still be able to see everything."
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:208
msgid "Access rights can grant access to an entire model but often we need to be more specific: while an agent can interact with properties in general we may not want them to update or even see properties managed by one of their colleagues."
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:212
msgid "Record *rules* provide that precision: they can grant or reject access to individual records:"
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:228
msgid "The :ref:`reference/orm/domains` is how access is managed: if the record passes then access is granted, otherwise access is rejected."
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:233
msgid "Because rules tends to be rather complex and not created in bulk, they're usually created in XML rather than the CSV used for access rights."
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:236
msgid "The rule above:"
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:238
msgid "Only applies to the \"create\", \"update\" (write) and \"delete\" (unlink) operations: here we want every employee to be able to see other users' records but only the author / assignee can update a record."
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:241
msgid "Is :ref:`non-global <reference/security/rules/global>` so we can provide an additional rule for e.g. managers."
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:243
msgid "Allows the operation if the current user (``user.id``) is set (e.g. created, or is assigned) on the record, or if the record has no associated user at all."
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:248
msgid "If no rule is defined or applies to a model and operation, then the operation is allowed (*default-allow*), this can have odd effects if access rights are not set up correctly (are too permissive)."
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:254
msgid "Define a rule which limits agents to only being able to see or modify properties which have no salesperson, or for which they are the salesperson."
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:257
msgid "You may want to create a second real-estate agent user, or create a few properties for which the salesperson is a manager or some other user."
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:260
msgid "Verify that your real estate manager(s) can still see all properties. If not, why not? Remember:"
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:263
msgid "The ``estate_group_manager`` group needs to imply ``estate_group_user``."
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:266
msgid "Security Override"
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:269
msgid "Bypassing Security"
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:273
msgid "At the end of this section, agents should be able to confirm property sales without needing invoicing access."
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:276
msgid "If you try to mark a property as \"sold\" as the real estate agent, you should get an access error:"
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:281
msgid "This happens because ``estate_account`` tries to create an invoice during the process, but creating an invoice requires the right to all invoice management."
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:284
msgid "We want agents to be able to confirm a sale without them having full invoicing access, which means we need to *bypass* the normal security checks of Odoo in order to create an invoice *despite* the current user not having the right to do so."
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:289
msgid "There are two main ways to bypass existing security checks in Odoo, either wilfully or as a side-effect:"
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:292
msgid "The ``sudo()`` method will create a new recordset in \"sudo mode\", this ignores all access rights and record rules (although hard-coded group and user checks may still apply)."
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:295
msgid "Performing raw SQL queries will bypass access rights and record rules as a side-effect of bypassing the ORM itself."
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:300
msgid "Update ``estate_account`` to bypass access rights and rules when creating the invoice."
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:305
msgid "These features should generally be avoided, and only used with extreme care, after having checked that the current user and operation should be able to bypass normal access rights validation."
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:309
msgid "Operations performed in such modes should also rely on user input as little as possible, and should validate it to the maximum extent they can."
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:313
msgid "Programmatically checking security"
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:317
msgid "At the end of this section, the creation of the invoice should be resilient to security issues regardless to changes to ``estate``."
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:320
msgid "In Odoo, access rights and record rules are only checked *when performing data access via the ORM* e.g. creating, reading, searching, writing, or unlinking a record via ORM methods. Other methods do *not* necessarily check against any sort of access rights."
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:325
msgid "In the previous section, we bypassed the record rules when creating the invoice in ``action_sold``. This bypass can be reached by any user without any access right being checked:"
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:329
msgid "Add a print to ``action_sold`` in ``estate_account`` before the creation of the invoice (as creating the invoice accesses the property, therefore triggers an ACL check) e.g.::"
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:335
msgid "You should see ``reached`` in your Odoo log, followed by an access error."
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:337
msgid "Just because you're already in Python code does not mean any access right or rule has or will be checked."
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:340
msgid "*Currently* the accesses are implicitly checked by accessing data on ``self`` as well as calling ``super()`` (which does the same and *updates* ``self``), triggering access errors and cancelling the transaction \"uncreating\" our invoice."
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:345
msgid "*However* if this changes in the future, or we add side-effects to the method (e.g. reporting the sale to a government agency), or bugs are introduced in ``estate``, ... it would be possible for non-agents to trigger operations they should not have access to."
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:350
msgid "Therefore when performing non-CRUD operations, or legitimately bypassing the ORM or security, or when triggering other side-effects, it is extremely important to perform *explicit security checks*."
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:354
msgid "Explicit security checks can be performed by:"
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:356
msgid "Checking who the current user is (``self.env.user``) and match them against specific models or records."
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:358
msgid "Checking that the current user has specific groups hard-coded to allow or deny an operation (``self.env.user.has_group``)."
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:360
msgid "Calling the ``check_access_rights(operation)`` method on a recordset, this verifies whether the current user has access to the model itself."
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:362
msgid "Calling ``check_access_rule(operations)`` on a non-empty recordset, this verifies that the current user is allowed to perform the operation on *every* record of the set."
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:366
msgid "Checking access rights and checking record rules are separate operations, if you're checking record rules you usually want to also check access rights beforehand."
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:372
msgid "Before creating the invoice, use ``check_access_rights`` and ``check_access_rule`` to ensure that the current user can update properties in general as well as the specific property the invoice is for."
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:376
msgid "Re-run the bypass script, check that the error occurs before the print."
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:381
msgid "Multi-company security"
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:385
msgid ":ref:`reference/howtos/company` for an overview of multi-company facilities in general, and :ref:`multi-company security rules <howto/company/security>` in particular."
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:389
msgid "Documentation on rules in general can, again, be found at :ref:`reference/security/rules`."
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:394
msgid "At the end of this section, agents should only have access to properties of their agency (or agencies)."
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:397
msgid "For one reason or another we might need to manage our real-estate business as multiple companies e.g. we might have largely autonomous agencies, a franchise setup, or multiple brands (possibly from having acquired other real-estate businesses) which remain legally or financially separate from one another."
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:403
msgid "Odoo can be used to manage multiple companies inside the same system, however the actual handling is up to individual modules: Odoo itself provides the tools to manage the issue of company-dependent fields and *multi-company rules*, which is what we're going to concern ourselves with."
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:408
msgid "We want different agencies to be \"siloed\" from one another, with properties belonging to a given agency and users (whether agents or managers) only able to see properties linked to their agency."
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:412
msgid "As before, because this is based on non-trivial records it's easier for a user to relax rules than to tighten them so it makes sense to default to a relatively stronger security model."
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:416
msgid "Multi-company rules are simply record rules based on the ``company_ids`` or ``company_id`` fields:"
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:419
msgid "``company_ids`` is all the companies to which the current user has access"
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:420
msgid "``company_id`` is the currently active company (the one the user is currently working in / for)."
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:423
msgid "Multi-company rules will *usually* use the former i.e. check if the record is associated with *one* of the companies the user has access to:"
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:439
msgid "Multi-company rules are usually :ref:`global <reference/security/rules/global>`, otherwise there is a high risk that additional rules would allow bypassing the multi-company rules."
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:445
msgid "Add a ``company_id`` field to ``estate.property``, it should be required (we don't want agency-less properties), and should default to the current user's current company."
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:448
msgid "Create a new company, with a new estate agent in that company."
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:449
msgid "The manager should be a member of both companies."
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:450
msgid "The old agent should only be a member of the old company."
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:451
msgid "Create a few properties in each company (either use the company selector as the manager or use the agents). Unset the default salesman to avoid triggering *that* rule."
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:454
msgid "All agents can see all companies, which is not desirable, add the record rule restricting this behaviour."
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:457
msgid "remember to ``--update`` your module when you change its model or data"
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:461
msgid "Visibility != security"
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:465
msgid "At the end of this section, real-estate agents should not see the Settings menu of the real-estate application, but should still be able to set the property type or tags."
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:469
msgid "Specific Odoo models can be associated directly with groups (or companies, or users). It is important to figure out whether this association is a *security* or a *visibility* feature before using it:"
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:473
msgid "*Visibility* features mean a user can still access the model or record otherwise, either through another part of the interface or by :doc:`performing operations remotely using RPC <../reference/external_api>`, things might just not be visible in the web interface in some contexts."
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:477
msgid "*Security* features mean a user can not access records, fields or operations."
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:479
msgid "Here are some examples:"
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:481
msgid "Groups on *model fields* (in Python) are a security feature, users outside the group will not be able to retrieve the field, or even know it exists."
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:484
msgid "Example: in server actions, `only system users can see or update Python code <https://github.com/odoo/odoo/blob/7058e338a980268df1c502b8b2860bdd8be9f727/odoo/addons/base/models/ir_actions.py#L414-L417>`_."
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:486
msgid "Groups on *view elements* (in XML) are a visibility feature, users outside the group will not be able to see the element or its content in the form but they will otherwise be able to interact with the object (including that field)."
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:490
msgid "Example: `only managers have an immediate filter to see their teams' leaves <https://github.com/odoo/odoo/blob/8e19904bcaff8300803a7b596c02ec45fcf36ae6/addons/hr_holidays/report/hr_leave_reports.xml#L16>`_."
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:492
msgid "Groups on menus and actions are visibility features, the menu or action will not be shown in the interface but that doesn't prevent directly interacting with the underlying object."
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:496
msgid "Example: `only system administrators can see the elearning settings menu <https://github.com/odoo/odoo/blob/ff828a3e0c5386dc54e6a46fd71de9272ef3b691/addons/website_slides/views/website_slides_menu_views.xml#L64-L69>`_."
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:501
msgid "Real Estate agents can not add property types or tags, but can see their options from the Property form view when creating it."
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:504
msgid "The Settings menu just adds noise to their interface, make it only visible to managers."
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:507
msgid "Despite not having access to the Property Types and Property Tags menus anymore, agents can still access the underlying objects since they can still select tags or a type to set on their properties."
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:511
msgid "An Odoo Application is a group of related modules covering a business area or field, usually composed of a base module and a number of expansions on that base to add optional or specific features, or link to other business areas."
msgstr ""
#: ../../content/developer/tutorials/restrict_data_access.rst:516
msgid "For applications which would be used by most or every employees, the \"application user\" role might be done away with and its abilities granted to all employees directly e.g. generally all employees can submit expenses or take time off."
msgstr ""
#: ../../content/developer/tutorials/unit_tests.rst:3
msgid "Safeguard your code with unit tests"
msgstr ""
#: ../../content/developer/tutorials/unit_tests.rst:12
msgid "**Reference**: `Odoo's Test Framework: Learn Best Practices <https://www.youtube.com/watch?v=JEIscps0OOQ>`__ (Odoo Experience 2020) on YouTube."
msgstr ""
#: ../../content/developer/tutorials/unit_tests.rst:16
msgid "Writing tests is a necessity for multiple reasons. Here is a non-exhaustive list:"
msgstr ""
#: ../../content/developer/tutorials/unit_tests.rst:18
msgid "Ensure code will not be broken in the future"
msgstr ""
#: ../../content/developer/tutorials/unit_tests.rst:19
msgid "Define the scope of your code"
msgstr ""
#: ../../content/developer/tutorials/unit_tests.rst:20
msgid "Give examples of use cases"
msgstr ""
#: ../../content/developer/tutorials/unit_tests.rst:21
msgid "It is one way to technically document the code"
msgstr ""
#: ../../content/developer/tutorials/unit_tests.rst:22
msgid "Help your coding by defining your goal before working towards it"
msgstr ""
#: ../../content/developer/tutorials/unit_tests.rst:25
msgid "Running Tests"
msgstr ""
#: ../../content/developer/tutorials/unit_tests.rst:27
msgid "Before knowing how to write tests, we need to know how to run them."
msgstr ""
#: ../../content/developer/tutorials/unit_tests.rst:79
msgid "Integration Bots"
msgstr ""
#: ../../content/developer/tutorials/unit_tests.rst:81
msgid "This section is only for Odoo employees and people that are contributing to `github.com/odoo`. We highly recommend having your own CI otherwise."
msgstr ""
#: ../../content/developer/tutorials/unit_tests.rst:84
msgid "When a test is written, it is important to make sure it always passes when modifications are applied to the source code. To automate this task, we use a development practice called Continuous Integration (CI). This is why we have some bots running all the tests at different moments. Whether you are working at Odoo or not, if you are trying to merge something inside `odoo/odoo`, `odoo/enterprise`, `odoo/upgrade` or on odoo.sh, you will have to go through the CI. If you are working on another project, you should think of adding your own CI."
msgstr ""
#: ../../content/developer/tutorials/unit_tests.rst:93
msgid "Runbot"
msgstr ""
#: ../../content/developer/tutorials/unit_tests.rst:95
msgid "**Reference**: the documentation related to this topic can be found in `Runbot FAQ <https://runbot.odoo.com/doc>`__."
msgstr ""
#: ../../content/developer/tutorials/unit_tests.rst:98
msgid "Most of the tests are run on `Runbot <https://runbot.odoo.com>`__ every time a commit is pushed on GitHub."
msgstr ""
#: ../../content/developer/tutorials/unit_tests.rst:101
msgid "You can see the state of a commit/branch by filtering on the runbot dashboard."
msgstr ""
#: ../../content/developer/tutorials/unit_tests.rst:103
msgid "A **bundle** is created for each branch. A bundle consists of a configuration and batches."
msgstr ""
#: ../../content/developer/tutorials/unit_tests.rst:106
msgid "A **batch** is a set of builds, depending on the parameters of the bundle. A batch is green (i.e. passes the tests) if all the builds are green."
msgstr ""
#: ../../content/developer/tutorials/unit_tests.rst:109
msgid "A **build** is when we launch a server. It can be divided in sub-builds. Usually there are builds for the community version, the enterprise version (only if there is an enterprise branch but you can force the build), and the migration of the branch. A build is green if every sub-build is green."
msgstr ""
#: ../../content/developer/tutorials/unit_tests.rst:114
msgid "A **sub-build** only does some parts of what a full build does. It is used to speed up the CI process. Generally it is used to split the post install tests in 4 parallel instances. A sub-build is green if all the tests are passing and there are no errors/warnings logged."
msgstr ""
#: ../../content/developer/tutorials/unit_tests.rst:119
msgid "All tests are run regardless of the modifications done. Correcting a typo in an error message or refactoring a whole module triggers the same tests. All modules will be installed as well. This means something might not work even if the Runbot is green, i.e. your changes depend on a module that the module the changes are in doesn't depend on."
msgstr ""
#: ../../content/developer/tutorials/unit_tests.rst:123
msgid "The localization modules (i.e. country-specific modules) are not installed on Runbot (except the generic one). Some modules with external dependencies can also be excluded."
msgstr ""
#: ../../content/developer/tutorials/unit_tests.rst:125
msgid "There is a nightly build running additional tests: module operations, localization, single module installs, multi-builds for nondeterministic bugs, etc. These are not kept in the standard CI to shorten the time of execution."
msgstr ""
#: ../../content/developer/tutorials/unit_tests.rst:129
msgid "You can also login to a build built by Runbot. There are 3 users usable: `admin`, `demo` and `portal`. The password is the same as the login. This is useful to quickly test things on different versions without having to build it locally. The full logs are also available; these are used for monitoring."
msgstr ""
#: ../../content/developer/tutorials/unit_tests.rst:135
msgid "Robodoo"
msgstr ""
#: ../../content/developer/tutorials/unit_tests.rst:137
msgid "You will most likely have to gain a little bit more experience before having the rights to summon robodoo, but here are a few remarks anyways."
msgstr ""
#: ../../content/developer/tutorials/unit_tests.rst:140
msgid "Robodoo is the guy spamming the CI status as tags on your PRs, but he is also the guy that kindly integrates your commits into the main repositories."
msgstr ""
#: ../../content/developer/tutorials/unit_tests.rst:143
msgid "When the last batch is green, the reviewer can ask robodoo to merge your PR (it is more a `rebase` than a `merge`). It will then go to the mergebot."
msgstr ""
#: ../../content/developer/tutorials/unit_tests.rst:147
msgid "Mergebot"
msgstr ""
#: ../../content/developer/tutorials/unit_tests.rst:149
msgid "`Mergebot <https://mergebot.odoo.com>`__ is the last testing phase before merging a PR."
msgstr ""
#: ../../content/developer/tutorials/unit_tests.rst:151
msgid "It will take the commits in your branch not yet present on the target, stage it and rerun the tests one more time, including the enterprise version even if you are only changing something in community."
msgstr ""
#: ../../content/developer/tutorials/unit_tests.rst:155
msgid "This step can fail with a `Staging failed` error message. This could be due to"
msgstr ""
#: ../../content/developer/tutorials/unit_tests.rst:157
msgid "a nondeterministic bug that is already on the target. If you are an Odoo employee, you can check those here: https://runbot.odoo.com/runbot/errors"
msgstr ""
#: ../../content/developer/tutorials/unit_tests.rst:159
msgid "a nondeterministic bug that you introduced but wasn't detected in the CI before"
msgstr ""
#: ../../content/developer/tutorials/unit_tests.rst:160
msgid "an incompatibility with another commit merged right before and what you are trying to merge"
msgstr ""
#: ../../content/developer/tutorials/unit_tests.rst:161
msgid "an incompatibility with the enterprise repository if you only did changes in the community repo"
msgstr ""
#: ../../content/developer/tutorials/unit_tests.rst:163
msgid "Always check that the issue does not come from you before asking the merge bot to retry: rebase your branch on the target and rerun the tests locally."
msgstr ""
#: ../../content/developer/tutorials/unit_tests.rst:169
msgid "Because Odoo is modular, the tests need to be also modular. This means tests are defined in the module that adds the functionality you are adding in, and tests cannot depend on functionality coming from modules your module doesn't depend on."
msgstr ""
#: ../../content/developer/tutorials/unit_tests.rst:173
msgid "**Reference**: the documentation related to this topic can be found in :ref:`Special Tags<reference/testing/tags>`."
msgstr ""
#: ../../content/developer/tutorials/unit_tests.rst:194
msgid "If the behavior you want to test can be changed by the installation of another module, you need to ensure that the tag `at_install` is set; otherwise, you can use the tag `post_install` to speed up the CI and ensure it is not changed if it shouldn't."
msgstr ""
#: ../../content/developer/tutorials/unit_tests.rst:199
msgid "Writing a test"
msgstr ""
#: ../../content/developer/tutorials/unit_tests.rst:201
msgid "**Reference**: the documentation related to this topic can be found in `Python unittest <https://docs.python.org/3/library/unittest.html>`__ and :ref:`Testing Odoo<reference/testing>`."
msgstr ""
#: ../../content/developer/tutorials/unit_tests.rst:205
msgid "Here are a few things to take into consideration before writing a test"
msgstr ""
#: ../../content/developer/tutorials/unit_tests.rst:207
msgid "The tests should be independent of the data currently in the database (including demo data)"
msgstr ""
#: ../../content/developer/tutorials/unit_tests.rst:208
msgid "Tests should not impact the database by leaving/changing residual data. This is usually done by the test framework by doing a rollback. Therefore, you must never call ``cr.commit`` in a test (nor anywhere else in the business code)."
msgstr ""
#: ../../content/developer/tutorials/unit_tests.rst:211
msgid "For a bug fix, the test should fail before applying the fix and pass after."
msgstr ""
#: ../../content/developer/tutorials/unit_tests.rst:212
msgid "Don't test something that is already tested elsewhere; you can trust the ORM. Most of the tests in business modules should only test the business flows."
msgstr ""
#: ../../content/developer/tutorials/unit_tests.rst:214
msgid "You shouldn't need to flush data into the database."
msgstr ""
#: ../../content/developer/tutorials/unit_tests.rst:216
msgid "Remember that ``onchange`` only applies in the Form views, not by changing the attributes in python. This also applies in the tests. If you want to emulate a Form view, you can use ``odoo.tests.common.Form``."
msgstr ""
#: ../../content/developer/tutorials/unit_tests.rst:220
msgid "The tests should be in a ``tests`` folder at the root of your module. Each test file name should start with `test_` and be imported in the ``__init__.py`` of the test folder. You shouldn't import the test folder/module in the ``__init__.py`` of the module."
msgstr ""
#: ../../content/developer/tutorials/unit_tests.rst:236
msgid "All the tests should extend ``odoo.tests.common.TransactionCase``. You usually define a ``setUpClass`` and the tests. After writing the `setUpClass`, you have an `env` available in the class and can start interacting with the ORM."
msgstr ""
#: ../../content/developer/tutorials/unit_tests.rst:240
msgid "These test classes are built on top of the ``unittest`` python module."
msgstr ""
#: ../../content/developer/tutorials/unit_tests.rst:283
msgid "For better readability, split your tests into multiple files depending on the scope of the tests. You can also have a Common class that most of the tests should inherit from; this common class can define the whole setup for the module. For instance, in `account <https://github.com/odoo/odoo/blob/17.0/addons/account/tests/common.py>`__."
msgstr ""
#: ../../content/developer/tutorials/unit_tests.rst:288
msgid "Update the code so no one can:"
msgstr ""
#: ../../content/developer/tutorials/unit_tests.rst:290
msgid "Create an offer for a sold property"
msgstr ""
#: ../../content/developer/tutorials/unit_tests.rst:291
msgid "Sell a property with no accepted offers on it"
msgstr ""
#: ../../content/developer/tutorials/unit_tests.rst:293
msgid "and create tests for both of these cases. Additionally check that selling a property that can be sold is correctly marked as sold after selling it."
msgstr ""
#: ../../content/developer/tutorials/unit_tests.rst:297
msgid "Someone keeps breaking the reset of Garden Area and Orientation when you uncheck the Garden checkbox. Make sure it doesn't happen again."
msgstr ""
#: ../../content/developer/tutorials/unit_tests.rst:300
msgid "Tip: remember the note about `Form` a little bit above."
msgstr ""
#: ../../content/developer/tutorials/web.rst:5
msgid "Customizing the web client"
msgstr ""
#: ../../content/developer/tutorials/web.rst:8
msgid "This tutorial is outdated."
msgstr ""
#: ../../content/developer/tutorials/web.rst:14
msgid "This guide is about creating modules for Odoo's web client."
msgstr ""
#: ../../content/developer/tutorials/web.rst:16
msgid "To create websites with Odoo, see :doc:`website`; to add business capabilities or extend existing business systems of Odoo, see :doc:`backend`."
msgstr ""
#: ../../content/developer/tutorials/web.rst:21
msgid "This guide assumes knowledge of:"
msgstr ""
#: ../../content/developer/tutorials/web.rst:23
msgid "Javascript basics and good practices"
msgstr ""
#: ../../content/developer/tutorials/web.rst:24
msgid "jQuery_"
msgstr ""
#: ../../content/developer/tutorials/web.rst:25
msgid "`Underscore.js`_"
msgstr ""
#: ../../content/developer/tutorials/web.rst:27
msgid "It also requires :doc:`an installed Odoo <../../administration/install>`, and Git_."
msgstr ""
#: ../../content/developer/tutorials/web.rst:30
msgid "A Simple Module"
msgstr ""
#: ../../content/developer/tutorials/web.rst:32
msgid "Let's start with a simple Odoo module holding basic web component configuration and letting us test the web framework."
msgstr ""
#: ../../content/developer/tutorials/web.rst:35
msgid "The example module is available online and can be downloaded using the following command:"
msgstr ""
#: ../../content/developer/tutorials/web.rst:42
msgid "This will create a ``petstore`` folder wherever you executed the command. You then need to add that folder to Odoo's :option:`addons path <odoo-bin --addons-path>`, create a new database and install the ``oepetstore`` module."
msgstr ""
#: ../../content/developer/tutorials/web.rst:47
msgid "If you browse the ``petstore`` folder, you should see the following content:"
msgstr ""
#: ../../content/developer/tutorials/web.rst:73
msgid "The module already holds various server customizations. We'll come back to these later, for now let's focus on the web-related content, in the ``static`` folder."
msgstr ""
#: ../../content/developer/tutorials/web.rst:77
msgid "Files used in the \"web\" side of an Odoo module must be placed in a ``static`` folder so they are available to a web browser, files outside that folder can not be fetched by browsers. The ``src/css``, ``src/js`` and ``src/xml`` sub-folders are conventional and not strictly necessary."
msgstr ""
#: ../../content/developer/tutorials/web.rst:82
msgid "``oepetstore/static/css/petstore.css``"
msgstr ""
#: ../../content/developer/tutorials/web.rst:83
msgid "Currently empty, will hold the CSS_ for pet store content"
msgstr ""
#: ../../content/developer/tutorials/web.rst:84
msgid "``oepetstore/static/xml/petstore.xml``"
msgstr ""
#: ../../content/developer/tutorials/web.rst:85
msgid "Mostly empty, will hold :ref:`reference/qweb` templates"
msgstr ""
#: ../../content/developer/tutorials/web.rst:104
msgid "``oepetstore/static/js/petstore.js``"
msgstr ""
#: ../../content/developer/tutorials/web.rst:87
msgid "The most important (and interesting) part, contains the logic of the application (or at least its web-browser side) as javascript. It should currently look like::"
msgstr ""
#: ../../content/developer/tutorials/web.rst:106
msgid "Which only prints a small message in the browser's console."
msgstr ""
#: ../../content/developer/tutorials/web.rst:108
msgid "The files in the ``static`` folder, need to be defined within the module in order for them to be loaded correctly. Everything in ``src/xml`` is defined in ``__manifest__.py`` while the contents of ``src/css`` and ``src/js`` are defined in ``petstore.xml``, or a similar file."
msgstr ""
#: ../../content/developer/tutorials/web.rst:114
msgid "All JavaScript files are concatenated and :term:`minified` to improve application load time."
msgstr ""
#: ../../content/developer/tutorials/web.rst:117
msgid "One of the drawback is debugging becomes more difficult as individual files disappear and the code is made significantly less readable. It is possible to disable this process by enabling the \"developer mode\": log into your Odoo instance (user *admin* password *admin* by default) open the user menu (in the top-right corner of the Odoo screen) and select :guilabel:`About Odoo` then :guilabel:`Activate the developer mode`:"
msgstr ""
#: ../../content/developer/tutorials/web.rst:131
msgid "This will reload the web client with optimizations disabled, making development and debugging significantly more comfortable."
msgstr ""
#: ../../content/developer/tutorials/web.rst:134
msgid "qweb files hooked via __manifest__.py, but js and CSS use bundles"
msgstr ""
#: ../../content/developer/tutorials/web.rst:137
msgid "Odoo JavaScript Module"
msgstr ""
#: ../../content/developer/tutorials/web.rst:139
msgid "Javascript doesn't have built-in modules. As a result variables defined in different files are all mashed together and may conflict. This has given rise to various module patterns used to build clean namespaces and limit risks of naming conflicts."
msgstr ""
#: ../../content/developer/tutorials/web.rst:144
msgid "The Odoo framework uses one such pattern to define modules within web addons, in order to both namespace code and correctly order its loading."
msgstr ""
#: ../../content/developer/tutorials/web.rst:147
msgid "``oepetstore/static/js/petstore.js`` contains a module declaration::"
msgstr ""
#: ../../content/developer/tutorials/web.rst:153
msgid "In Odoo web, modules are declared as functions set on the global ``odoo`` variable. The function's name must be the same as the addon (in this case ``oepetstore``) so the framework can find it, and automatically initialize it."
msgstr ""
#: ../../content/developer/tutorials/web.rst:157
msgid "When the web client loads your module it will call the root function and provide two parameters:"
msgstr ""
#: ../../content/developer/tutorials/web.rst:160
msgid "the first parameter is the current instance of the Odoo web client, it gives access to various capabilities defined by the Odoo (translations, network services) as well as objects defined by the core or by other modules."
msgstr ""
#: ../../content/developer/tutorials/web.rst:164
msgid "the second parameter is your own local namespace automatically created by the web client. Objects and variables which should be accessible from outside your module (either because the Odoo web client needs to call them or because others may want to customize them) should be set inside that namespace."
msgstr ""
#: ../../content/developer/tutorials/web.rst:171
msgid "Classes"
msgstr ""
#: ../../content/developer/tutorials/web.rst:173
msgid "Much as modules, and contrary to most object-oriented languages, javascript does not build in *classes*\\ [#classes]_ although it provides roughly equivalent (if lower-level and more verbose) mechanisms."
msgstr ""
#: ../../content/developer/tutorials/web.rst:177
msgid "For simplicity and developer-friendliness Odoo web provides a class system based on John Resig's `Simple JavaScript Inheritance`_."
msgstr ""
#: ../../content/developer/tutorials/web.rst:180
msgid "New classes are defined by calling the :func:`~odoo.web.Class.extend` method of :class:`odoo.web.Class`::"
msgstr ""
#: ../../content/developer/tutorials/web.rst:189
msgid "The :func:`~odoo.web.Class.extend` method takes a dictionary describing the new class's content (methods and static attributes). In this case, it will only have a ``say_hello`` method which takes no parameters."
msgstr ""
#: ../../content/developer/tutorials/web.rst:193
msgid "Classes are instantiated using the ``new`` operator::"
msgstr ""
#: ../../content/developer/tutorials/web.rst:199
msgid "And attributes of the instance can be accessed via ``this``::"
msgstr ""
#: ../../content/developer/tutorials/web.rst:212
msgid "Classes can provide an initializer to perform the initial setup of the instance, by defining an ``init()`` method. The initializer receives the parameters passed when using the ``new`` operator::"
msgstr ""
#: ../../content/developer/tutorials/web.rst:229
msgid "It is also possible to create subclasses from existing (used-defined) classes by calling :func:`~odoo.web.Class.extend` on the parent class, as is done to subclass :class:`~odoo.web.Class`::"
msgstr ""
#: ../../content/developer/tutorials/web.rst:243
msgid "When overriding a method using inheritance, you can use ``this._super()`` to call the original method::"
msgstr ""
#: ../../content/developer/tutorials/web.rst:259
msgid "``_super`` is not a standard method, it is set on-the-fly to the next method in the current inheritance chain, if any. It is only defined during the *synchronous* part of a method call, for use in asynchronous handlers (after network calls or in ``setTimeout`` callbacks) a reference to its value should be retained, it should not be accessed via ``this``::"
msgstr ""
#: ../../content/developer/tutorials/web.rst:282
msgid "Widgets Basics"
msgstr ""
#: ../../content/developer/tutorials/web.rst:284
msgid "The Odoo web client bundles jQuery_ for easy DOM manipulation. It is useful and provides a better API than standard `W3C DOM`_\\ [#dombugs]_, but insufficient to structure complex applications leading to difficult maintenance."
msgstr ""
#: ../../content/developer/tutorials/web.rst:289
msgid "Much like object-oriented desktop UI toolkits (e.g. Qt_, Cocoa_ or GTK_), Odoo Web makes specific components responsible for sections of a page. In Odoo web, the base for such components is the :class:`~odoo.Widget` class, a component specialized in handling a page section and displaying information for the user."
msgstr ""
#: ../../content/developer/tutorials/web.rst:296
msgid "Your First Widget"
msgstr ""
#: ../../content/developer/tutorials/web.rst:298
msgid "The initial demonstration module already provides a basic widget::"
msgstr ""
#: ../../content/developer/tutorials/web.rst:306
msgid "It extends :class:`~odoo.Widget` and overrides the standard method :func:`~odoo.Widget.start`, which — much like the previous ``MyClass`` — does little for now."
msgstr ""
#: ../../content/developer/tutorials/web.rst:310
msgid "This line at the end of the file::"
msgstr ""
#: ../../content/developer/tutorials/web.rst:315
msgid "registers our basic widget as a client action. Client actions will be explained later, for now this is just what allows our widget to be called and displayed when we select the :menuselection:`Pet Store --> Pet Store --> Home Page` menu."
msgstr ""
#: ../../content/developer/tutorials/web.rst:322
msgid "because the widget will be called from outside our module, the web client needs its \"fully qualified\" name, not the local version."
msgstr ""
#: ../../content/developer/tutorials/web.rst:326
msgid "Display Content"
msgstr ""
#: ../../content/developer/tutorials/web.rst:328
msgid "Widgets have a number of methods and features, but the basics are simple:"
msgstr ""
#: ../../content/developer/tutorials/web.rst:330
msgid "set up a widget"
msgstr ""
#: ../../content/developer/tutorials/web.rst:331
msgid "format the widget's data"
msgstr ""
#: ../../content/developer/tutorials/web.rst:332
msgid "display the widget"
msgstr ""
#: ../../content/developer/tutorials/web.rst:334
msgid "The ``HomePage`` widget already has a :func:`~odoo.Widget.start` method. That method is part of the normal widget lifecycle and automatically called once the widget is inserted in the page. We can use it to display some content."
msgstr ""
#: ../../content/developer/tutorials/web.rst:339
msgid "All widgets have a :attr:`~odoo.Widget.$el` which represents the section of page they're in charge of (as a jQuery_ object). Widget content should be inserted there. By default, :attr:`~odoo.Widget.$el` is an empty ``<div>`` element."
msgstr ""
#: ../../content/developer/tutorials/web.rst:344
msgid "A ``<div>`` element is usually invisible to the user if it has no content (or without specific styles giving it a size) which is why nothing is displayed on the page when ``HomePage`` is launched."
msgstr ""
#: ../../content/developer/tutorials/web.rst:348
msgid "Let's add some content to the widget's root element, using jQuery::"
msgstr ""
#: ../../content/developer/tutorials/web.rst:356
msgid "That message will now appear when you open :menuselection:`Pet Store --> Pet Store --> Home Page`"
msgstr ""
#: ../../content/developer/tutorials/web.rst:361
msgid "to refresh the javascript code loaded in Odoo Web, you will need to reload the page. There is no need to restart the Odoo server."
msgstr ""
#: ../../content/developer/tutorials/web.rst:364
msgid "The ``HomePage`` widget is used by Odoo Web and managed automatically. To learn how to use a widget \"from scratch\" let's create a new one::"
msgstr ""
#: ../../content/developer/tutorials/web.rst:373
msgid "We can now add our ``GreetingsWidget`` to the ``HomePage`` by using the ``GreetingsWidget``'s :func:`~odoo.Widget.appendTo` method::"
msgstr ""
#: ../../content/developer/tutorials/web.rst:384
msgid "``HomePage`` first adds its own content to its DOM root"
msgstr ""
#: ../../content/developer/tutorials/web.rst:385
msgid "``HomePage`` then instantiates ``GreetingsWidget``"
msgstr ""
#: ../../content/developer/tutorials/web.rst:386
msgid "Finally it tells ``GreetingsWidget`` where to insert itself, delegating part of its :attr:`~odoo.Widget.$el` to the ``GreetingsWidget``."
msgstr ""
#: ../../content/developer/tutorials/web.rst:389
msgid "When the :func:`~odoo.Widget.appendTo` method is called, it asks the widget to insert itself at the specified position and to display its content. The :func:`~odoo.Widget.start` method will be called during the call to :func:`~odoo.Widget.appendTo`."
msgstr ""
#: ../../content/developer/tutorials/web.rst:394
msgid "To see what happens under the displayed interface, we will use the browser's DOM Explorer. But first let's alter our widgets slightly so we can more easily find where they are, by :attr:`adding a class to their root elements <odoo.Widget.className>`::"
msgstr ""
#: ../../content/developer/tutorials/web.rst:408
msgid "If you can find the relevant section of the DOM (right-click on the text then :guilabel:`Inspect Element`), it should look like this:"
msgstr ""
#: ../../content/developer/tutorials/web.rst:420
msgid "Which clearly shows the two ``<div>`` elements automatically created by :class:`~odoo.Widget`, because we added some classes on them."
msgstr ""
#: ../../content/developer/tutorials/web.rst:423
msgid "We can also see the two message-holding divs we added ourselves"
msgstr ""
#: ../../content/developer/tutorials/web.rst:425
msgid "Finally, note the ``<div class=\"oe_petstore_greetings\">`` element which represents the ``GreetingsWidget`` instance is *inside* the ``<div class=\"oe_petstore_homepage\">`` which represents the ``HomePage`` instance, since we appended"
msgstr ""
#: ../../content/developer/tutorials/web.rst:431
msgid "Widget Parents and Children"
msgstr ""
#: ../../content/developer/tutorials/web.rst:433
msgid "In the previous part, we instantiated a widget using this syntax::"
msgstr ""
#: ../../content/developer/tutorials/web.rst:437
msgid "The first argument is ``this``, which in that case was a ``HomePage`` instance. This tells the widget being created which other widget is its *parent*."
msgstr ""
#: ../../content/developer/tutorials/web.rst:441
msgid "As we've seen, widgets are usually inserted in the DOM by another widget and *inside* that other widget's root element. This means most widgets are \"part\" of another widget, and exist on behalf of it. We call the container the *parent*, and the contained widget the *child*."
msgstr ""
#: ../../content/developer/tutorials/web.rst:446
msgid "Due to multiple technical and conceptual reasons, it is necessary for a widget to know who is its parent and who are its children."
msgstr ""
#: ../../content/developer/tutorials/web.rst:457
msgid ":func:`~odoo.Widget.getParent`"
msgstr ""
#: ../../content/developer/tutorials/web.rst:450
msgid "can be used to get the parent of a widget::"
msgstr ""
#: ../../content/developer/tutorials/web.rst:469
msgid ":func:`~odoo.Widget.getChildren`"
msgstr ""
#: ../../content/developer/tutorials/web.rst:460
msgid "can be used to get a list of its children::"
msgstr ""
#: ../../content/developer/tutorials/web.rst:471
msgid "When overriding the :func:`~odoo.Widget.init` method of a widget it is *of the utmost importance* to pass the parent to the ``this._super()`` call, otherwise the relation will not be set up correctly::"
msgstr ""
#: ../../content/developer/tutorials/web.rst:482
msgid "Finally, if a widget does not have a parent (e.g. because it's the root widget of the application), ``null`` can be provided as parent::"
msgstr ""
#: ../../content/developer/tutorials/web.rst:488
msgid "Destroying Widgets"
msgstr ""
#: ../../content/developer/tutorials/web.rst:490
msgid "If you can display content to your users, you should also be able to erase it. This is done via the :func:`~odoo.Widget.destroy` method::"
msgstr ""
#: ../../content/developer/tutorials/web.rst:495
msgid "When a widget is destroyed it will first call :func:`~odoo.Widget.destroy` on all its children. Then it erases itself from the DOM. If you have set up permanent structures in :func:`~odoo.Widget.init` or :func:`~odoo.Widget.start` which must be explicitly cleaned up (because the garbage collector will not handle them), you can override :func:`~odoo.Widget.destroy`."
msgstr ""
#: ../../content/developer/tutorials/web.rst:503
msgid "when overriding :func:`~odoo.Widget.destroy`, ``_super()`` *must always* be called otherwise the widget and its children are not correctly cleaned up leaving possible memory leaks and \"phantom events\", even if no error is displayed"
msgstr ""
#: ../../content/developer/tutorials/web.rst:509
msgid "The QWeb Template Engine"
msgstr ""
#: ../../content/developer/tutorials/web.rst:511
msgid "In the previous section we added content to our widgets by directly manipulating (and adding to) their DOM::"
msgstr ""
#: ../../content/developer/tutorials/web.rst:516
msgid "This allows generating and displaying any type of content, but gets unwieldy when generating significant amounts of DOM (lots of duplication, quoting issues, ...)"
msgstr ""
#: ../../content/developer/tutorials/web.rst:520
msgid "As many other environments, Odoo's solution is to use a `template engine`_. Odoo's template engine is called :ref:`reference/qweb`."
msgstr ""
#: ../../content/developer/tutorials/web.rst:523
msgid "QWeb is an XML-based templating language, similar to `Genshi <http://en.wikipedia.org/wiki/Genshi_(templating_language)>`_, `Thymeleaf <http://en.wikipedia.org/wiki/Thymeleaf>`_ or `Facelets <http://en.wikipedia.org/wiki/Facelets>`_. It has the following characteristics:"
msgstr ""
#: ../../content/developer/tutorials/web.rst:529
msgid "It's implemented fully in JavaScript and rendered in the browser"
msgstr ""
#: ../../content/developer/tutorials/web.rst:530
msgid "Each template file (XML files) contains multiple templates"
msgstr ""
#: ../../content/developer/tutorials/web.rst:531
msgid "It has special support in Odoo Web's :class:`~odoo.Widget`, though it can be used outside of Odoo's web client (and it's possible to use :class:`~odoo.Widget` without relying on QWeb)"
msgstr ""
#: ../../content/developer/tutorials/web.rst:536
msgid "The rationale behind using QWeb instead of existing javascript template engines is the extensibility of pre-existing (third-party) templates, much like Odoo :doc:`views <../reference/user_interface/view_records>`."
msgstr ""
#: ../../content/developer/tutorials/web.rst:540
msgid "Most javascript template engines are text-based which precludes easy structural extensibility where an XML-based templating engine can be generically altered using e.g. XPath or CSS and a tree-alteration DSL (or even just XSLT). This flexibility and extensibility is a core characteristic of Odoo, and losing it was considered unacceptable."
msgstr ""
#: ../../content/developer/tutorials/web.rst:547
msgid "Using QWeb"
msgstr ""
#: ../../content/developer/tutorials/web.rst:549
msgid "First let's define a simple QWeb template in the almost-empty ``oepetstore/static/src/xml/petstore.xml`` file:"
msgstr ""
#: ../../content/developer/tutorials/web.rst:561
msgid "Now we can use this template inside of the ``HomePage`` widget. Using the ``QWeb`` loader variable defined at the top of the page, we can call to the template defined in the XML file::"
msgstr ""
#: ../../content/developer/tutorials/web.rst:571
msgid ":func:`QWeb.render` looks for the specified template, renders it to a string and returns the result."
msgstr ""
#: ../../content/developer/tutorials/web.rst:574
msgid "However, because :class:`~odoo.Widget` has special integration for QWeb the template can be set directly on the widget via its :attr:`~odoo.Widget.template` attribute::"
msgstr ""
#: ../../content/developer/tutorials/web.rst:585
msgid "Although the result looks similar, there are two differences between these usages:"
msgstr ""
#: ../../content/developer/tutorials/web.rst:588
msgid "with the second version, the template is rendered right before :func:`~odoo.Widget.start` is called"
msgstr ""
#: ../../content/developer/tutorials/web.rst:590
msgid "in the first version the template's content is added to the widget's root element, whereas in the second version the template's root element is directly *set as* the widget's root element. Which is why the \"greetings\" sub-widget also gets a red background"
msgstr ""
#: ../../content/developer/tutorials/web.rst:596
msgid "templates should have a single non-``t`` root element, especially if they're set as a widget's :attr:`~odoo.Widget.template`. If there are multiple \"root elements\", results are undefined (usually only the first root element will be used and the others will be ignored)"
msgstr ""
#: ../../content/developer/tutorials/web.rst:602
msgid "QWeb Context"
msgstr ""
#: ../../content/developer/tutorials/web.rst:604
msgid "QWeb templates can be given data and can contain basic display logic."
msgstr ""
#: ../../content/developer/tutorials/web.rst:606
msgid "For explicit calls to :func:`QWeb.render`, the template data is passed as second parameter::"
msgstr ""
#: ../../content/developer/tutorials/web.rst:611
msgid "with the template modified to:"
msgstr ""
#: ../../content/developer/tutorials/web.rst:619
msgid "will result in:"
msgstr ""
#: ../../content/developer/tutorials/web.rst:625
msgid "When using :class:`~odoo.Widget`'s integration it is not possible to provide additional data to the template. The template will be given a single ``widget`` context variable, referencing the widget being rendered right before :func:`~odoo.Widget.start` is called (the widget's state will essentially be that set up by :func:`~odoo.Widget.init`):"
msgstr ""
#: ../../content/developer/tutorials/web.rst:656
msgid "Template Declaration"
msgstr ""
#: ../../content/developer/tutorials/web.rst:658
msgid "We've seen how to *render* QWeb templates, let's now see the syntax of the templates themselves."
msgstr ""
#: ../../content/developer/tutorials/web.rst:661
msgid "A QWeb template is composed of regular XML mixed with QWeb *directives*. A QWeb directive is declared with XML attributes starting with ``t-``."
msgstr ""
#: ../../content/developer/tutorials/web.rst:664
msgid "The most basic directive is ``t-name``, used to declare new templates in a template file:"
msgstr ""
#: ../../content/developer/tutorials/web.rst:675
msgid "``t-name`` takes the name of the template being defined, and declares that it can be called using :func:`QWeb.render`. It can only be used at the top-level of a template file."
msgstr ""
#: ../../content/developer/tutorials/web.rst:680
msgid "Escaping"
msgstr ""
#: ../../content/developer/tutorials/web.rst:682
msgid "The ``t-esc`` directive can be used to output text:"
msgstr ""
#: ../../content/developer/tutorials/web.rst:688
msgid "It takes a Javascript expression which is evaluated, the result of the expression is then HTML-escaped and inserted in the document. Since it's an expression it's possible to provide just a variable name as above, or a more complex expression like a computation:"
msgstr ""
#: ../../content/developer/tutorials/web.rst:697
msgid "or method calls:"
msgstr ""
#: ../../content/developer/tutorials/web.rst:704
msgid "Outputting HTML"
msgstr ""
#: ../../content/developer/tutorials/web.rst:706
msgid "To inject HTML in the page being rendered, use ``t-raw``. Like ``t-esc`` it takes an arbitrary Javascript expression as parameter, but it does not perform an HTML-escape step."
msgstr ""
#: ../../content/developer/tutorials/web.rst:716
msgid "``t-raw`` *must not* be used on any data which may contain non-escaped user-provided content as this leads to `cross-site scripting`_ vulnerabilities"
msgstr ""
#: ../../content/developer/tutorials/web.rst:723
msgid "QWeb can have conditional blocks using ``t-if``. The directive takes an arbitrary expression, if the expression is falsy (``false``, ``null``, ``0`` or an empty string) the whole block is suppressed, otherwise it is displayed."
msgstr ""
#: ../../content/developer/tutorials/web.rst:740
msgid "QWeb doesn't have an \"else\" structure, use a second ``t-if`` with the original condition inverted. You may want to store the condition in a local variable if it's a complex or expensive expression."
msgstr ""
#: ../../content/developer/tutorials/web.rst:745
msgid "Iteration"
msgstr ""
#: ../../content/developer/tutorials/web.rst:747
msgid "To iterate on a list, use ``t-foreach`` and ``t-as``. ``t-foreach`` takes an expression returning a list to iterate on ``t-as`` takes a variable name to bind to each item during iteration."
msgstr ""
#: ../../content/developer/tutorials/web.rst:761
msgid "``t-foreach`` can also be used with numbers and objects (dictionaries)"
msgstr ""
#: ../../content/developer/tutorials/web.rst:765
msgid "Defining attributes"
msgstr ""
#: ../../content/developer/tutorials/web.rst:767
msgid "QWeb provides two related directives to define computed attributes: :samp:`t-att-{name}` and :samp:`t-attf-{name}`. In either case, *name* is the name of the attribute to create (e.g. ``t-att-id`` defines the attribute ``id`` after rendering)."
msgstr ""
#: ../../content/developer/tutorials/web.rst:772
msgid "``t-att-`` takes a javascript expression whose result is set as the attribute's value, it is most useful if all of the attribute's value is computed:"
msgstr ""
#: ../../content/developer/tutorials/web.rst:783
msgid "``t-attf-`` takes a *format string*. A format string is literal text with interpolation blocks inside, an interpolation block is a javascript expression between ``{{`` and ``}}``, which will be replaced by the result of the expression. It is most useful for attributes which are partially literal and partially computed such as a class:"
msgstr ""
#: ../../content/developer/tutorials/web.rst:796
msgid "Calling other templates"
msgstr ""
#: ../../content/developer/tutorials/web.rst:798
msgid "Templates can be split into sub-templates (for simplicity, maintainability, reusability or to avoid excessive markup nesting)."
msgstr ""
#: ../../content/developer/tutorials/web.rst:801
msgid "This is done using the ``t-call`` directive, which takes the name of the template to render:"
msgstr ""
#: ../../content/developer/tutorials/web.rst:815
msgid "rendering the ``A`` template will result in:"
msgstr ""
#: ../../content/developer/tutorials/web.rst:823
msgid "Sub-templates inherit the rendering context of their caller."
msgstr ""
#: ../../content/developer/tutorials/web.rst:826
msgid "To Learn More About QWeb"
msgstr ""
#: ../../content/developer/tutorials/web.rst:828
msgid "For a QWeb reference, see :ref:`reference/qweb`."
msgstr ""
#: ../../content/developer/tutorials/web.rst:831
#: ../../content/developer/tutorials/web.rst:1097
msgid "Exercise"
msgstr ""
#: ../../content/developer/tutorials/web.rst:833
msgid "Usage of QWeb in Widgets"
msgstr ""
#: ../../content/developer/tutorials/web.rst:835
msgid "Create a widget whose constructor takes two parameters aside from ``parent``: ``product_names`` and ``color``."
msgstr ""
#: ../../content/developer/tutorials/web.rst:838
msgid "``product_names`` should an array of strings, each one the name of a product"
msgstr ""
#: ../../content/developer/tutorials/web.rst:840
msgid "``color`` is a string containing a color in CSS color format (ie: ``#000000`` for black)."
msgstr ""
#: ../../content/developer/tutorials/web.rst:843
msgid "The widget should display the given product names one under the other, each one in a separate box with a background color with the value of ``color`` and a border. You should use QWeb to render the HTML. Any necessary CSS should be in ``oepetstore/static/src/css/petstore.css``."
msgstr ""
#: ../../content/developer/tutorials/web.rst:848
msgid "Use the widget in ``HomePage`` with half a dozen products."
msgstr ""
#: ../../content/developer/tutorials/web.rst:912
msgid "Widget Helpers"
msgstr ""
#: ../../content/developer/tutorials/web.rst:915
msgid "``Widget``'s jQuery Selector"
msgstr ""
#: ../../content/developer/tutorials/web.rst:917
msgid "Selecting DOM elements within a widget can be performed by calling the ``find()`` method on the widget's DOM root::"
msgstr ""
#: ../../content/developer/tutorials/web.rst:922
msgid "But because it's a common operation, :class:`~odoo.Widget` provides an equivalent shortcut through the :func:`~odoo.Widget.$` method::"
msgstr ""
#: ../../content/developer/tutorials/web.rst:933
msgid "The global jQuery function ``$()`` should *never* be used unless it is absolutely necessary: selection on a widget's root are scoped to the widget and local to it, but selections with ``$()`` are global to the page/application and may match parts of other widgets and views, leading to odd or dangerous side-effects. Since a widget should generally act only on the DOM section it owns, there is no cause for global selection."
msgstr ""
#: ../../content/developer/tutorials/web.rst:941
msgid "Easier DOM Events Binding"
msgstr ""
#: ../../content/developer/tutorials/web.rst:943
msgid "We have previously bound DOM events using normal jQuery event handlers (e.g. ``.click()`` or ``.change()``) on widget elements::"
msgstr ""
#: ../../content/developer/tutorials/web.rst:958
msgid "While this works it has a few issues:"
msgstr ""
#: ../../content/developer/tutorials/web.rst:960
msgid "it is rather verbose"
msgstr ""
#: ../../content/developer/tutorials/web.rst:961
msgid "it does not support replacing the widget's root element at runtime as the binding is only performed when ``start()`` is run (during widget initialization)"
msgstr ""
#: ../../content/developer/tutorials/web.rst:964
msgid "it requires dealing with ``this``-binding issues"
msgstr ""
#: ../../content/developer/tutorials/web.rst:966
msgid "Widgets thus provide a shortcut to DOM event binding via :attr:`~odoo.Widget.events`::"
msgstr ""
#: ../../content/developer/tutorials/web.rst:978
msgid ":attr:`~odoo.Widget.events` is an object (mapping) of an event to the function or method to call when the event is triggered:"
msgstr ""
#: ../../content/developer/tutorials/web.rst:981
msgid "the key is an event name, possibly refined with a CSS selector in which case only if the event happens on a selected sub-element will the function or method run: ``click`` will handle all clicks within the widget, but ``click .my_button`` will only handle clicks in elements bearing the ``my_button`` class"
msgstr ""
#: ../../content/developer/tutorials/web.rst:986
msgid "the value is the action to perform when the event is triggered"
msgstr ""
#: ../../content/developer/tutorials/web.rst:988
msgid "It can be either a function::"
msgstr ""
#: ../../content/developer/tutorials/web.rst:994
msgid "or the name of a method on the object (see example above)."
msgstr ""
#: ../../content/developer/tutorials/web.rst:996
msgid "In either case, the ``this`` is the widget instance and the handler is given a single parameter, the `jQuery event object`_ for the event."
msgstr ""
#: ../../content/developer/tutorials/web.rst:1000
msgid "Widget Events and Properties"
msgstr ""
#: ../../content/developer/tutorials/web.rst:1005
msgid "Widgets provide an event system (separate from the DOM/jQuery event system described above): a widget can fire events on itself, and other widgets (or itself) can bind themselves and listen for these events::"
msgstr ""
#: ../../content/developer/tutorials/web.rst:1025
msgid "This widget acts as a facade, transforming user input (through DOM events) into a documentable internal event to which parent widgets can bind themselves."
msgstr ""
#: ../../content/developer/tutorials/web.rst:1029
msgid ":func:`~odoo.Widget.trigger` takes the name of the event to trigger as its first (mandatory) argument, any further arguments are treated as event data and passed directly to listeners."
msgstr ""
#: ../../content/developer/tutorials/web.rst:1033
msgid "We can then set up a parent event instantiating our generic widget and listening to the ``user_chose`` event using :func:`~odoo.Widget.on`::"
msgstr ""
#: ../../content/developer/tutorials/web.rst:1051
msgid ":func:`~odoo.Widget.on` binds a function to be called when the event identified by ``event_name`` is. The ``func`` argument is the function to call and ``object`` is the object to which that function is related if it is a method. The bound function will be called with the additional arguments of :func:`~odoo.Widget.trigger` if it has any. Example::"
msgstr ""
#: ../../content/developer/tutorials/web.rst:1070
msgid "Triggering events on an other widget is generally a bad idea. The main exception to that rule is ``odoo.web.bus`` which exists specifically to broadcasts evens in which any widget could be interested throughout the Odoo web application."
msgstr ""
#: ../../content/developer/tutorials/web.rst:1076
msgid "Properties"
msgstr ""
#: ../../content/developer/tutorials/web.rst:1078
msgid "Properties are very similar to normal object attributes in that they allow storing data on a widget instance, however they have the additional feature that they trigger events when set::"
msgstr ""
#: ../../content/developer/tutorials/web.rst:1091
msgid ":func:`~odoo.Widget.set` sets the value of a property and triggers :samp:`change:{propname}` (where *propname* is the property name passed as first parameter to :func:`~odoo.Widget.set`) and ``change``"
msgstr ""
#: ../../content/developer/tutorials/web.rst:1094
msgid ":func:`~odoo.Widget.get` retrieves the value of a property."
msgstr ""
#: ../../content/developer/tutorials/web.rst:1099
msgid "Widget Properties and Events"
msgstr ""
#: ../../content/developer/tutorials/web.rst:1101
msgid "Create a widget ``ColorInputWidget`` that will display 3 ``<input type=\"text\">``. Each of these ``<input>`` is dedicated to type a hexadecimal number from 00 to FF. When any of these ``<input>`` is modified by the user the widget must query the content of the three ``<input>``, concatenate their values to have a complete CSS color code (ie: ``#00FF00``) and put the result in a property named ``color``. Please note the jQuery ``change()`` event that you can bind on any HTML ``<input>`` element and the ``val()`` method that can query the current value of that ``<input>`` could be useful to you for this exercise."
msgstr ""
#: ../../content/developer/tutorials/web.rst:1111
msgid "Then, modify the ``HomePage`` widget to instantiate ``ColorInputWidget`` and display it. The ``HomePage`` widget should also display an empty rectangle. That rectangle must always, at any moment, have the same background color as the color in the ``color`` property of the ``ColorInputWidget`` instance."
msgstr ""
#: ../../content/developer/tutorials/web.rst:1117
msgid "Use QWeb to generate all HTML."
msgstr ""
#: ../../content/developer/tutorials/web.rst:1190
msgid "Modify existing widgets and classes"
msgstr ""
#: ../../content/developer/tutorials/web.rst:1192
msgid "The class system of the Odoo web framework allows direct modification of existing classes using the :func:`~odoo.web.Class.include` method::"
msgstr ""
#: ../../content/developer/tutorials/web.rst:1210
msgid "This system is similar to the inheritance mechanism, except it will alter the target class in-place instead of creating a new class."
msgstr ""
#: ../../content/developer/tutorials/web.rst:1213
msgid "In that case, ``this._super()`` will call the original implementation of a method being replaced/redefined. If the class already had sub-classes, all calls to ``this._super()`` in sub-classes will call the new implementations defined in the call to :func:`~odoo.web.Class.include`. This will also work if some instances of the class (or of any of its sub-classes) were created prior to the call to :func:`~odoo.Widget.include`."
msgstr ""
#: ../../content/developer/tutorials/web.rst:1223
msgid "The process to translate text in Python and JavaScript code is very similar. You could have noticed these lines at the beginning of the ``petstore.js`` file::"
msgstr ""
#: ../../content/developer/tutorials/web.rst:1230
msgid "These lines are simply used to import the translation functions in the current JavaScript module. They are used thus::"
msgstr ""
#: ../../content/developer/tutorials/web.rst:1235
msgid "In Odoo, translations files are automatically generated by scanning the source code. All piece of code that calls a certain function are detected and their content is added to a translation file that will then be sent to the translators. In Python, the function is ``_()``. In JavaScript the function is :func:`~odoo.web._t` (and also :func:`~odoo.web._lt`)."
msgstr ""
#: ../../content/developer/tutorials/web.rst:1241
msgid "``_t()`` will return the translation defined for the text it is given. If no translation is defined for that text, it will return the original text as-is."
msgstr ""
#: ../../content/developer/tutorials/web.rst:1246
msgid "To inject user-provided values in translatable strings, it is recommended to use `_.str.sprintf <http://gabceb.github.io/underscore.string.site/#sprintf>`_ with named arguments *after* the translation::"
msgstr ""
#: ../../content/developer/tutorials/web.rst:1256
msgid "This makes translatable strings more readable to translators, and gives them more flexibility to reorder or ignore parameters."
msgstr ""
#: ../../content/developer/tutorials/web.rst:1259
msgid ":func:`~odoo.web._lt` (\"lazy translate\") is similar but somewhat more complex: instead of translating its parameter immediately, it returns an object which, when converted to a string, will perform the translation."
msgstr ""
#: ../../content/developer/tutorials/web.rst:1263
msgid "It is used to define translatable terms before the translations system is initialized, for class attributes for instance (as modules are loaded before the user's language is configured and translations are downloaded)."
msgstr ""
#: ../../content/developer/tutorials/web.rst:1268
msgid "Communication with the Odoo Server"
msgstr ""
#: ../../content/developer/tutorials/web.rst:1271
msgid "Contacting Models"
msgstr ""
#: ../../content/developer/tutorials/web.rst:1273
msgid "Most operations with Odoo involve communicating with *models* implementing business concern, these models will then (potentially) interact with some storage engine (usually PostgreSQL_)."
msgstr ""
#: ../../content/developer/tutorials/web.rst:1277
msgid "Although jQuery_ provides a `$.ajax`_ function for network interactions, communicating with Odoo requires additional metadata whose setup before every call would be verbose and error-prone. As a result, Odoo web provides higher-level communication primitives."
msgstr ""
#: ../../content/developer/tutorials/web.rst:1282
msgid "To demonstrate this, the file ``petstore.py`` already contains a small model with a sample method:"
msgstr ""
#: ../../content/developer/tutorials/web.rst:1297
msgid "This declares a model with two fields, and a method ``my_method()`` which returns a literal dictionary."
msgstr ""
#: ../../content/developer/tutorials/web.rst:1300
msgid "Here is a sample widget that calls ``my_method()`` and displays the result::"
msgstr ""
#: ../../content/developer/tutorials/web.rst:1313
msgid "The class used to call Odoo models is :class:`odoo.Model`. It is instantiated with the Odoo model's name as first parameter (``oepetstore.message_of_the_day`` here)."
msgstr ""
#: ../../content/developer/tutorials/web.rst:1317
msgid ":func:`~odoo.web.Model.call` can be used to call any (public) method of an Odoo model. It takes the following positional arguments:"
msgstr ""
#: ../../content/developer/tutorials/web.rst:1321
msgid "The name of the method to call, ``my_method`` here"
msgstr ""
#: ../../content/developer/tutorials/web.rst:1337
msgid "``args``"
msgstr ""
#: ../../content/developer/tutorials/web.rst:1323
msgid "an array of `positional arguments`_ to provide to the method. Because the example has no positional argument to provide, the ``args`` parameter is not provided."
msgstr ""
#: ../../content/developer/tutorials/web.rst:1327
msgid "Here is an other example with positional arguments:"
msgstr ""
#: ../../content/developer/tutorials/web.rst:1351
msgid "``kwargs``"
msgstr ""
#: ../../content/developer/tutorials/web.rst:1340
msgid "a mapping of `keyword arguments`_ to pass. The example provides a single named argument ``context``."
msgstr ""
#: ../../content/developer/tutorials/web.rst:1353
msgid ":func:`~odoo.Widget.call` returns a deferred resolved with the value returned by the model's method as first argument."
msgstr ""
#: ../../content/developer/tutorials/web.rst:1357
msgid "CompoundContext"
msgstr ""
#: ../../content/developer/tutorials/web.rst:1359
msgid "The previous section used a ``context`` argument which was not explained in the method call::"
msgstr ""
#: ../../content/developer/tutorials/web.rst:1364
msgid "The context is like a \"magic\" argument that the web client will always give to the server when calling a method. The context is a dictionary containing multiple keys. One of the most important key is the language of the user, used by the server to translate all the messages of the application. Another one is the time zone of the user, used to compute correctly dates and times if Odoo is used by people in different countries."
msgstr ""
#: ../../content/developer/tutorials/web.rst:1371
msgid "The ``argument`` is necessary in all methods, otherwise bad things could happen (such as the application not being translated correctly). That's why, when you call a model's method, you should always provide that argument. The solution to achieve that is to use :class:`odoo.web.CompoundContext`."
msgstr ""
#: ../../content/developer/tutorials/web.rst:1376
msgid ":class:`~odoo.web.CompoundContext` is a class used to pass the user's context (with language, time zone, etc...) to the server as well as adding new keys to the context (some models' methods use arbitrary keys added to the context). It is created by giving to its constructor any number of dictionaries or other :class:`~odoo.web.CompoundContext` instances. It will merge all those contexts before sending them to the server."
msgstr ""
#: ../../content/developer/tutorials/web.rst:1394
msgid "You can see the dictionary in the argument ``context`` contains some keys that are related to the configuration of the current user in Odoo plus the ``new_key`` key that was added when instantiating :class:`~odoo.web.CompoundContext`."
msgstr ""
#: ../../content/developer/tutorials/web.rst:1400
msgid "Queries"
msgstr ""
#: ../../content/developer/tutorials/web.rst:1402
msgid "While :func:`~odoo.Model.call` is sufficient for any interaction with Odoo models, Odoo Web provides a helper for simpler and clearer querying of models (fetching of records based on various conditions): :func:`~odoo.Model.query` which acts as a shortcut for the common combination of :py:meth:`~odoo.models.Model.search` and ::py:meth:`~odoo.models.Model.read`. It provides a clearer syntax to search and read models::"
msgstr ""
#: ../../content/developer/tutorials/web.rst:1417
msgid "versus::"
msgstr ""
#: ../../content/developer/tutorials/web.rst:1427
msgid ":func:`~odoo.web.Model.query` takes an optional list of fields as parameter (if no field is provided, all fields of the model are fetched). It returns a :class:`odoo.web.Query` which can be further customized before being executed"
msgstr ""
#: ../../content/developer/tutorials/web.rst:1431
msgid ":class:`~odoo.web.Query` represents the query being built. It is immutable, methods to customize the query actually return a modified copy, so it's possible to use the original and the new version side-by-side. See :class:`~odoo.web.Query` for its customization options."
msgstr ""
#: ../../content/developer/tutorials/web.rst:1436
msgid "When the query is set up as desired, simply call :func:`~odoo.web.Query.all` to execute it and return a deferred to its result. The result is the same as :py:meth:`~odoo.models.Model.read`'s, an array of dictionaries where each dictionary is a requested record, with each requested field a dictionary key."
msgstr ""
#: ../../content/developer/tutorials/web.rst:1443
msgid "Exercises"
msgstr ""
#: ../../content/developer/tutorials/web.rst:1445
msgid "Message of the Day"
msgstr ""
#: ../../content/developer/tutorials/web.rst:1447
msgid "Create a ``MessageOfTheDay`` widget displaying the last record of the ``oepetstore.message_of_the_day`` model. The widget should fetch its record as soon as it is displayed."
msgstr ""
#: ../../content/developer/tutorials/web.rst:1451
msgid "Display the widget in the Pet Store home page."
msgstr ""
#: ../../content/developer/tutorials/web.rst:1511
msgid "Pet Toys List"
msgstr ""
#: ../../content/developer/tutorials/web.rst:1513
msgid "Create a ``PetToysList`` widget displaying 5 toys (using their name and their images)."
msgstr ""
#: ../../content/developer/tutorials/web.rst:1516
msgid "The pet toys are not stored in a new model, instead they're stored in ``product.product`` using a special category *Pet Toys*. You can see the pre-generated toys and add new ones by going to :menuselection:`Pet Store --> Pet Store --> Pet Toys`. You will probably need to explore ``product.product`` to create the right domain to select just pet toys."
msgstr ""
#: ../../content/developer/tutorials/web.rst:1523
msgid "In Odoo, images are generally stored in regular fields encoded as base64_, HTML supports displaying images straight from base64 with :samp:`<img src=\"data:{mime_type};base64,{base64_image_data}\"/>`"
msgstr ""
#: ../../content/developer/tutorials/web.rst:1527
msgid "The ``PetToysList`` widget should be displayed on the home page on the right of the ``MessageOfTheDay`` widget. You will need to make some layout with CSS to achieve this."
msgstr ""
#: ../../content/developer/tutorials/web.rst:1647
msgid "Existing web components"
msgstr ""
#: ../../content/developer/tutorials/web.rst:1650
msgid "The Action Manager"
msgstr ""
#: ../../content/developer/tutorials/web.rst:1652
msgid "In Odoo, many operations start from an :doc:`action <../reference/backend/actions>`: opening a menu item (to a view), printing a report, ..."
msgstr ""
#: ../../content/developer/tutorials/web.rst:1655
msgid "Actions are pieces of data describing how a client should react to the activation of a piece of content. Actions can be stored (and read through a model) or they can be generated on-the fly (locally to the client by javascript code, or remotely by a method of a model)."
msgstr ""
#: ../../content/developer/tutorials/web.rst:1660
msgid "In Odoo Web, the component responsible for handling and reacting to these actions is the *Action Manager*."
msgstr ""
#: ../../content/developer/tutorials/web.rst:1664
msgid "Using the Action Manager"
msgstr ""
#: ../../content/developer/tutorials/web.rst:1666
msgid "The action manager can be invoked explicitly from javascript code by creating a dictionary describing :doc:`an action <../reference/backend/actions>` of the right type, and calling an action manager instance with it."
msgstr ""
#: ../../content/developer/tutorials/web.rst:1670
msgid ":func:`~odoo.Widget.do_action` is a shortcut of :class:`~odoo.Widget` looking up the \"current\" action manager and executing the action::"
msgstr ""
#: ../../content/developer/tutorials/web.rst:1686
msgid "The most common action ``type`` is ``ir.actions.act_window`` which provides views to a model (displays a model in various manners), its most common attributes are:"
msgstr ""
#: ../../content/developer/tutorials/web.rst:1691
msgid "The model to display in views"
msgstr ""
#: ../../content/developer/tutorials/web.rst:1693
msgid "For form views, a preselected record in ``res_model``"
msgstr ""
#: ../../content/developer/tutorials/web.rst:1695
msgid "Lists the views available through the action. A list of ``[view_id, view_type]``, ``view_id`` can either be the database identifier of a view of the right type, or ``false`` to use the view by default for the specified type. View types can not be present multiple times. The action will open the first view of the list by default."
msgstr ""
#: ../../content/developer/tutorials/web.rst:1701
msgid "``target``"
msgstr ""
#: ../../content/developer/tutorials/web.rst:1701
msgid "Either ``current`` (the default) which replaces the \"content\" section of the web client by the action, or ``new`` to open the action in a dialog box."
msgstr ""
#: ../../content/developer/tutorials/web.rst:1704
msgid "Additional context data to use within the action."
msgstr ""
#: ../../content/developer/tutorials/web.rst:1706
msgid "Jump to Product"
msgstr ""
#: ../../content/developer/tutorials/web.rst:1708
msgid "Modify the ``PetToysList`` component so clicking on a toy replaces the homepage by the toy's form view."
msgstr ""
#: ../../content/developer/tutorials/web.rst:1755
msgid "Client Actions"
msgstr ""
#: ../../content/developer/tutorials/web.rst:1757
msgid "Throughout this guide, we used a simple ``HomePage`` widget which the web client automatically starts when we select the right menu item. But how did the Odoo web know to start this widget? Because the widget is registered as a *client action*."
msgstr ""
#: ../../content/developer/tutorials/web.rst:1762
msgid "A client action is (as its name implies) an action type defined almost entirely in the client, in javascript for Odoo web. The server simply sends an action tag (an arbitrary name), and optionally adds a few parameters, but beyond that *everything* is handled by custom client code."
msgstr ""
#: ../../content/developer/tutorials/web.rst:1767
msgid "Our widget is registered as the handler for the client action through this::"
msgstr ""
#: ../../content/developer/tutorials/web.rst:1772
msgid "``instance.web.client_actions`` is a :class:`~odoo.web.Registry` in which the action manager looks up client action handlers when it needs to execute one. The first parameter of :class:`~odoo.web.Registry.add` is the name (tag) of the client action, and the second parameter is the path to the widget from the Odoo web client root."
msgstr ""
#: ../../content/developer/tutorials/web.rst:1778
msgid "When a client action must be executed, the action manager looks up its tag in the registry, walks the specified path and displays the widget it finds at the end."
msgstr ""
#: ../../content/developer/tutorials/web.rst:1782
msgid "a client action handler can also be a regular function, in which case it'll be called and its result (if any) will be interpreted as the next action to execute."
msgstr ""
#: ../../content/developer/tutorials/web.rst:1786
msgid "On the server side, we had simply defined an ``ir.actions.client`` action:"
msgstr ""
#: ../../content/developer/tutorials/web.rst:1794
msgid "and a menu opening the action:"
msgstr ""
#: ../../content/developer/tutorials/web.rst:1802
msgid "Architecture of the Views"
msgstr ""
#: ../../content/developer/tutorials/web.rst:1804
msgid "Much of Odoo web's usefulness (and complexity) resides in views. Each view type is a way of displaying a model in the client."
msgstr ""
#: ../../content/developer/tutorials/web.rst:1808
msgid "The View Manager"
msgstr ""
#: ../../content/developer/tutorials/web.rst:1810
msgid "When an ``ActionManager`` instance receive an action of type ``ir.actions.act_window``, it delegates the synchronization and handling of the views themselves to a *view manager*, which will then set up one or multiple views depending on the original action's requirements:"
msgstr ""
#: ../../content/developer/tutorials/web.rst:1820
msgid "The Views"
msgstr ""
#: ../../content/developer/tutorials/web.rst:1822
msgid "Most :doc:`Odoo views <../reference/user_interface/view_records>` are implemented through a subclass of :class:`odoo.web.View` which provides a bit of generic basic structure for handling events and displaying model information."
msgstr ""
#: ../../content/developer/tutorials/web.rst:1826
msgid "The *search view* is considered a view type by the main Odoo framework, but handled separately by the web client (as it's a more permanent fixture and can interact with other views, which regular views don't do)."
msgstr ""
#: ../../content/developer/tutorials/web.rst:1830
msgid "A view is responsible for loading its own description XML (using :py:class:`~odoo.models.Model.fields_view_get`) and any other data source it needs. To that purpose, views are provided with an optional view identifier set as the :attr:`~odoo.web.View.view_id` attribute."
msgstr ""
#: ../../content/developer/tutorials/web.rst:1835
msgid "Views are also provided with a :class:`~odoo.web.DataSet` instance which holds most necessary model information (the model name and possibly various record ids)."
msgstr ""
#: ../../content/developer/tutorials/web.rst:1839
msgid "Views may also want to handle search queries by overriding :func:`~odoo.web.View.do_search`, and updating their :class:`~odoo.web.DataSet` as necessary."
msgstr ""
#: ../../content/developer/tutorials/web.rst:1844
msgid "The Form View Fields"
msgstr ""
#: ../../content/developer/tutorials/web.rst:1846
msgid "A common need is the extension of the web form view to add new ways of displaying fields."
msgstr ""
#: ../../content/developer/tutorials/web.rst:1849
msgid "All built-in fields have a default display implementation, a new form widget may be necessary to correctly interact with a new field type (e.g. a :term:`GIS` field) or to provide new representations and ways to interact with existing field types (e.g. validate :py:class:`~odoo.fields.Char` fields which should contain email addresses and display them as email links)."
msgstr ""
#: ../../content/developer/tutorials/web.rst:1856
msgid "To explicitly specify which form widget should be used to display a field, simply use the ``widget`` attribute in the view's XML description:"
msgstr ""
#: ../../content/developer/tutorials/web.rst:1865
msgid "the same widget is used in both \"view\" (read-only) and \"edit\" modes of a form view, it's not possible to use a widget in one and an other widget in the other"
msgstr ""
#: ../../content/developer/tutorials/web.rst:1868
msgid "and a given field (name) can not be used multiple times in the same form"
msgstr ""
#: ../../content/developer/tutorials/web.rst:1869
msgid "a widget may ignore the current mode of the form view and remain the same in both view and edit modes"
msgstr ""
#: ../../content/developer/tutorials/web.rst:1872
msgid "most of this should probably move to an advanced form view guide"
msgstr ""
#: ../../content/developer/tutorials/web.rst:1874
msgid "Fields are instantiated by the form view after it has read its XML description and constructed the corresponding HTML representing that description. After that, the form view will communicate with the field objects using some methods. These methods are defined by the ``FieldInterface`` interface. Almost all fields inherit the ``AbstractField`` abstract class. That class defines some default mechanisms that need to be implemented by most fields."
msgstr ""
#: ../../content/developer/tutorials/web.rst:1882
msgid "Here are some of the responsibilities of a field class:"
msgstr ""
#: ../../content/developer/tutorials/web.rst:1884
msgid "The field class must display and allow the user to edit the value of the field."
msgstr ""
#: ../../content/developer/tutorials/web.rst:1885
msgid "It must correctly implement the 3 field attributes available in all fields of Odoo. The ``AbstractField`` class already implements an algorithm that dynamically calculates the value of these attributes (they can change at any moment because their value change according to the value of other fields). Their values are stored in *Widget Properties* (the widget properties were explained earlier in this guide). It is the responsibility of each field class to check these widget properties and dynamically adapt depending of their values. Here is a description of each of these attributes:"
msgstr ""
#: ../../content/developer/tutorials/web.rst:1895
msgid "``required``: The field must have a value before saving. If ``required`` is ``true`` and the field doesn't have a value, the method ``is_valid()`` of the field must return ``false``."
msgstr ""
#: ../../content/developer/tutorials/web.rst:1898
msgid "``invisible``: When this is ``true``, the field must be invisible. The ``AbstractField`` class already has a basic implementation of this behavior that fits most fields."
msgstr ""
#: ../../content/developer/tutorials/web.rst:1901
msgid "``readonly``: When ``true``, the field must not be editable by the user. Most fields in Odoo have a completely different behavior depending on the value of ``readonly``. As example, the ``FieldChar`` displays an HTML ``<input>`` when it is editable and simply displays the text when it is read-only. This also means it has much more code it would need to implement only one behavior, but this is necessary to ensure a good user experience."
msgstr ""
#: ../../content/developer/tutorials/web.rst:1909
msgid "Fields have two methods, ``set_value()`` and ``get_value()``, which are called by the form view to give it the value to display and get back the new value entered by the user. These methods must be able to handle the value as given by the Odoo server when a ``read()`` is performed on a model and give back a valid value for a ``write()``. Remember that the JavaScript/Python data types used to represent the values given by ``read()`` and given to ``write()`` is not necessarily the same in Odoo. As example, when you read a many2one, it is always a tuple whose first value is the id of the pointed record and the second one is the name get (ie: ``(15, \"Agrolait\")``). But when you write a many2one it must be a single integer, not a tuple anymore. ``AbstractField`` has a default implementation of these methods that works well for simple data type and set a widget property named ``value``."
msgstr ""
#: ../../content/developer/tutorials/web.rst:1923
msgid "Please note that, to better understand how to implement fields, you are strongly encouraged to look at the definition of the ``FieldInterface`` interface and the ``AbstractField`` class directly in the code of the Odoo web client."
msgstr ""
#: ../../content/developer/tutorials/web.rst:1929
msgid "Creating a New Type of Field"
msgstr ""
#: ../../content/developer/tutorials/web.rst:1931
msgid "In this part we will explain how to create a new type of field. The example here will be to re-implement the ``FieldChar`` class and progressively explain each part."
msgstr ""
#: ../../content/developer/tutorials/web.rst:1936
msgid "Simple Read-Only Field"
msgstr ""
#: ../../content/developer/tutorials/web.rst:1938
msgid "Here is a first implementation that will only display text. The user will not be able to modify the content of the field."
msgstr ""
#: ../../content/developer/tutorials/web.rst:1955
msgid "In this example, we declare a class named ``FieldChar2`` inheriting from ``AbstractField``. We also register this class in the registry ``instance.web.form.widgets`` under the key ``char2``. That will allow us to use this new field in any form view by specifying ``widget=\"char2\"`` in the ``<field/>`` tag in the XML declaration of the view."
msgstr ""
#: ../../content/developer/tutorials/web.rst:1961
msgid "In this example, we define a single method: ``render_value()``. All it does is display the widget property ``value``. Those are two tools defined by the ``AbstractField`` class. As explained before, the form view will call the method ``set_value()`` of the field to set the value to display. This method already has a default implementation in ``AbstractField`` which simply sets the widget property ``value``. ``AbstractField`` also watch the ``change:value`` event on itself and calls the ``render_value()`` when it occurs. So, ``render_value()`` is a convenience method to implement in child classes to perform some operation each time the value of the field changes."
msgstr ""
#: ../../content/developer/tutorials/web.rst:1971
msgid "In the ``init()`` method, we also define the default value of the field if none is specified by the form view (here we assume the default value of a ``char`` field should be an empty string)."
msgstr ""
#: ../../content/developer/tutorials/web.rst:1976
msgid "Read-Write Field"
msgstr ""
#: ../../content/developer/tutorials/web.rst:1978
msgid "Read-only fields, which only display content and don't allow the user to modify it can be useful, but most fields in Odoo also allow editing. This makes the field classes more complicated, mostly because fields are supposed to handle both editable and non-editable mode, those modes are often completely different (for design and usability purpose) and the fields must be able to switch between modes at any moment."
msgstr ""
#: ../../content/developer/tutorials/web.rst:1985
msgid "To know in which mode the current field should be, the ``AbstractField`` class sets a widget property named ``effective_readonly``. The field should watch for changes in that widget property and display the correct mode accordingly. Example::"
msgstr ""
#: ../../content/developer/tutorials/web.rst:2033
msgid "In the ``start()`` method (which is called immediately after a widget has been appended to the DOM), we bind on the event ``change:effective_readonly``. That allows us to redisplay the field each time the widget property ``effective_readonly`` changes. This event handler will call ``display_field()``, which is also called directly in ``start()``. This ``display_field()`` was created specifically for this field, it's not a method defined in ``AbstractField`` or any other class. We can use this method to display the content of the field depending on the current mode."
msgstr ""
#: ../../content/developer/tutorials/web.rst:2042
msgid "From now on the conception of this field is typical, except there is a lot of verifications to know the state of the ``effective_readonly`` property:"
msgstr ""
#: ../../content/developer/tutorials/web.rst:2045
msgid "In the QWeb template used to display the content of the widget, it displays an ``<input type=\"text\" />`` if we are in read-write mode and nothing in particular in read-only mode."
msgstr ""
#: ../../content/developer/tutorials/web.rst:2048
msgid "In the ``display_field()`` method, we have to bind on the ``change`` event of the ``<input type=\"text\" />`` to know when the user has changed the value. When it happens, we call the ``internal_set_value()`` method with the new value of the field. This is a convenience method provided by the ``AbstractField`` class. That method will set a new value in the ``value`` property but will not trigger a call to ``render_value()`` (which is not necessary since the ``<input type=\"text\" />`` already contains the correct value)."
msgstr ""
#: ../../content/developer/tutorials/web.rst:2056
msgid "In ``render_value()``, we use a completely different code to display the value of the field depending if we are in read-only or in read-write mode."
msgstr ""
#: ../../content/developer/tutorials/web.rst:2059
msgid "Create a Color Field"
msgstr ""
#: ../../content/developer/tutorials/web.rst:2061
msgid "Create a ``FieldColor`` class. The value of this field should be a string containing a color code like those used in CSS (example: ``#FF0000`` for red). In read-only mode, this color field should display a little block whose color corresponds to the value of the field. In read-write mode, you should display an ``<input type=\"color\" />``. That type of ``<input />`` is an HTML5 component that doesn't work in all browsers but works well in Google Chrome. So it's OK to use as an exercise."
msgstr ""
#: ../../content/developer/tutorials/web.rst:2069
msgid "You can use that widget in the form view of the ``message_of_the_day`` model for its field named ``color``. As a bonus, you can change the ``MessageOfTheDay`` widget created in the previous part of this guide to display the message of the day with the background color indicated in the ``color`` field."
msgstr ""
#: ../../content/developer/tutorials/web.rst:2134
msgid "The Form View Custom Widgets"
msgstr ""
#: ../../content/developer/tutorials/web.rst:2136
msgid "Form fields are used to edit a single field, and are intrinsically linked to a field. Because this may be limiting, it is also possible to create *form widgets* which are not so restricted and have less ties to a specific lifecycle."
msgstr ""
#: ../../content/developer/tutorials/web.rst:2141
msgid "Custom form widgets can be added to a form view through the ``widget`` tag:"
msgstr ""
#: ../../content/developer/tutorials/web.rst:2147
msgid "This type of widget will simply be created by the form view during the creation of the HTML according to the XML definition. They have properties in common with the fields (like the ``effective_readonly`` property) but they are not assigned a precise field. And so they don't have methods like ``get_value()`` and ``set_value()``. They must inherit from the ``FormWidget`` abstract class."
msgstr ""
#: ../../content/developer/tutorials/web.rst:2154
msgid "Form widgets can interact with form fields by listening for their changes and fetching or altering their values. They can access form fields through their :attr:`~odoo.web.form.FormWidget.field_manager` attribute::"
msgstr ""
#: ../../content/developer/tutorials/web.rst:2174
msgid ":attr:`~odoo.web.form.FormWidget` is generally the :class:`~odoo.web.form.FormView` itself, but features used from it should be limited to those defined by :class:`~odoo.web.form.FieldManagerMixin`, the most useful being:"
msgstr ""
#: ../../content/developer/tutorials/web.rst:2179
msgid ":func:`~odoo.web.form.FieldManagerMixin.get_field_value(field_name)` which returns the value of a field."
msgstr ""
#: ../../content/developer/tutorials/web.rst:2181
msgid ":func:`~odoo.web.form.FieldManagerMixin.set_values(values)` sets multiple field values, takes a mapping of ``{field_name: value_to_set}``"
msgstr ""
#: ../../content/developer/tutorials/web.rst:2183
msgid "An event :samp:`field_changed:{field_name}` is triggered any time the value of the field called ``field_name`` is changed"
msgstr ""
#: ../../content/developer/tutorials/web.rst:2186
msgid "Show Coordinates on Google Map"
msgstr ""
#: ../../content/developer/tutorials/web.rst:2188
msgid "Add two fields to ``product.product`` storing a latitude and a longitude, then create a new form widget to display the latitude and longitude of a product's origin on a map"
msgstr ""
#: ../../content/developer/tutorials/web.rst:2192
msgid "To display the map, use Google Map's embedding:"
msgstr ""
#: ../../content/developer/tutorials/web.rst:2199
msgid "where ``XXX`` should be replaced by the latitude and ``YYY`` by the longitude."
msgstr ""
#: ../../content/developer/tutorials/web.rst:2202
msgid "Display the two position fields and a map widget using them in a new notebook page of the product's form view."
msgstr ""
#: ../../content/developer/tutorials/web.rst:2234
msgid "Get the Current Coordinate"
msgstr ""
#: ../../content/developer/tutorials/web.rst:2236
msgid "Add a button resetting the product's coordinates to the location of the user, you can get these coordinates using the `javascript geolocation API`_."
msgstr ""
#: ../../content/developer/tutorials/web.rst:2240
msgid "Now we would like to display an additional button to automatically set the coordinates to the location of the current user."
msgstr ""
#: ../../content/developer/tutorials/web.rst:2243
msgid "To get the coordinates of the user, an easy way is to use the geolocation JavaScript API. `See the online documentation to know how to use it`_."
msgstr ""
#: ../../content/developer/tutorials/web.rst:2248
msgid "Please also note that the user should not be able to click on that button when the form view is in read-only mode. So, this custom widget should handle correctly the ``effective_readonly`` property just like any field. One way to do this would be to make the button disappear when ``effective_readonly`` is true."
msgstr ""
#: ../../content/developer/tutorials/web.rst:2299
msgid "as a separate concept from instances. In many languages classes are full-fledged objects and themselves instance (of metaclasses) but there remains two fairly separate hierarchies between classes and instances"
msgstr ""
#: ../../content/developer/tutorials/web.rst:2303
msgid "as well as papering over cross-browser differences, although this has become less necessary over time"
msgstr ""
#: ../../content/developer/tutorials/website.rst:5
msgid "Building a Website"
msgstr ""
#: ../../content/developer/tutorials/website.rst:12
msgid "This guide assumes `basic knowledge of Python <http://docs.python.org/2/tutorial/>`_"
msgstr ""
#: ../../content/developer/tutorials/website.rst:14
msgid "This guide assumes :doc:`an installed Odoo <../../administration/install>`"
msgstr ""
#: ../../content/developer/tutorials/website.rst:17
msgid "Creating a basic module"
msgstr ""
#: ../../content/developer/tutorials/website.rst:19
msgid "In Odoo, tasks are performed by creating modules."
msgstr ""
#: ../../content/developer/tutorials/website.rst:21
msgid "Modules customize the behavior of an Odoo installation, either by adding new behaviors or by altering existing ones (including behaviors added by other modules)."
msgstr ""
#: ../../content/developer/tutorials/website.rst:25
msgid ":ref:`Odoo's scaffolding <reference/cmdline/scaffold>` can setup a basic module. To quickly get started simply invoke:"
msgstr ""
#: ../../content/developer/tutorials/website.rst:32
msgid "This will automatically create a ``my-modules`` *module directory* with an ``academy`` module inside. The directory can be an existing module directory if you want, but the module name must be unique within the directory."
msgstr ""
#: ../../content/developer/tutorials/website.rst:37
msgid "A demonstration module"
msgstr ""
#: ../../content/developer/tutorials/website.rst:39
msgid "We have a \"complete\" module ready for installation."
msgstr ""
#: ../../content/developer/tutorials/website.rst:41
msgid "Although it does absolutely nothing we can install it:"
msgstr ""
#: ../../content/developer/tutorials/website.rst:43
msgid "start the Odoo server"
msgstr ""
#: ../../content/developer/tutorials/website.rst:49
msgid "go to http://localhost:8069"
msgstr ""
#: ../../content/developer/tutorials/website.rst:50
msgid "create a new database including demonstration data"
msgstr ""
#: ../../content/developer/tutorials/website.rst:51
msgid "to go :menuselection:`Settings --> Modules --> Modules`"
msgstr ""
#: ../../content/developer/tutorials/website.rst:52
msgid "in the top-right corner remove the *Installed* filter and search for *academy*"
msgstr ""
#: ../../content/developer/tutorials/website.rst:54
msgid "click the :guilabel:`Install` button for the *Academy* module"
msgstr ""
#: ../../content/developer/tutorials/website.rst:57
msgid "To the browser"
msgstr ""
#: ../../content/developer/tutorials/website.rst:59
msgid ":ref:`Controllers <reference/controllers>` interpret browser requests and send data back."
msgstr ""
#: ../../content/developer/tutorials/website.rst:62
msgid "Add a simple controller and ensure it is imported by ``__init__.py`` (so Odoo can find it):"
msgstr ""
#: ../../content/developer/tutorials/website.rst:65
#: ../../content/developer/tutorials/website.rst:101
#: ../../content/developer/tutorials/website.rst:248
#: ../../content/developer/tutorials/website.rst:306
#: ../../content/developer/tutorials/website.rst:374
#: ../../content/developer/tutorials/website.rst:389
#: ../../content/developer/tutorials/website.rst:406
msgid "``academy/controllers.py``"
msgstr ""
#: ../../content/developer/tutorials/website.rst:77
msgid "Shut down your server (:kbd:`^C`) then restart it:"
msgstr ""
#: ../../content/developer/tutorials/website.rst:83
msgid "and open a page to http://localhost:8069/academy/academy/, you should see your \"page\" appear:"
msgstr ""
#: ../../content/developer/tutorials/website.rst:89
msgid "Templates"
msgstr ""
#: ../../content/developer/tutorials/website.rst:91
msgid "Generating HTML in Python isn't very pleasant."
msgstr ""
#: ../../content/developer/tutorials/website.rst:93
msgid "The usual solution is templates_, pseudo-documents with placeholders and display logic. Odoo allows any Python templating system, but provides its own :ref:`QWeb <reference/qweb>` templating system which integrates with other features."
msgstr ""
#: ../../content/developer/tutorials/website.rst:98
msgid "Create a template and ensure the template file is registered in the ``__manifest__.py`` manifest, and alter the controller to use our template:"
msgstr ""
#: ../../content/developer/tutorials/website.rst:112
#: ../../content/developer/tutorials/website.rst:260
#: ../../content/developer/tutorials/website.rst:318
#: ../../content/developer/tutorials/website.rst:415
#: ../../content/developer/tutorials/website.rst:434
#: ../../content/developer/tutorials/website.rst:475
#: ../../content/developer/tutorials/website.rst:502
#: ../../content/developer/tutorials/website.rst:523
#: ../../content/developer/tutorials/website.rst:537
#: ../../content/developer/tutorials/website.rst:550
#: ../../content/developer/tutorials/website.rst:974
#: ../../content/developer/tutorials/website.rst:997
msgid "``academy/templates.xml``"
msgstr ""
#: ../../content/developer/tutorials/website.rst:126
msgid "The templates iterates (``t-foreach``) on all the teachers (passed through the *template context*), and prints each teacher in its own paragraph."
msgstr ""
#: ../../content/developer/tutorials/website.rst:129
msgid "Finally restart Odoo and update the module's data (to install the template) by going to :menuselection:`Settings --> Modules --> Modules --> Academy` and clicking :guilabel:`Upgrade`."
msgstr ""
#: ../../content/developer/tutorials/website.rst:135
msgid "Alternatively, Odoo can be restarted :option:`and update modules at the same time<odoo-bin -u>`:"
msgstr ""
#: ../../content/developer/tutorials/website.rst:142
msgid "Going to http://localhost:8069/academy/academy/ should now result in:"
msgstr ""
#: ../../content/developer/tutorials/website.rst:147
msgid "Storing data in Odoo"
msgstr ""
#: ../../content/developer/tutorials/website.rst:149
msgid ":ref:`Odoo models <reference/orm/model>` map to database tables."
msgstr ""
#: ../../content/developer/tutorials/website.rst:151
msgid "In the previous section we just displayed a list of string entered statically in the Python code. This doesn't allow modifications or persistent storage so we'll now move our data to the database."
msgstr ""
#: ../../content/developer/tutorials/website.rst:156
msgid "Defining the data model"
msgstr ""
#: ../../content/developer/tutorials/website.rst:158
msgid "Define a teacher model, and ensure it is imported from ``__init__.py`` so it is correctly loaded:"
msgstr ""
#: ../../content/developer/tutorials/website.rst:161
#: ../../content/developer/tutorials/website.rst:466
#: ../../content/developer/tutorials/website.rst:661
#: ../../content/developer/tutorials/website.rst:735
#: ../../content/developer/tutorials/website.rst:801
#: ../../content/developer/tutorials/website.rst:918
msgid "``academy/models.py``"
msgstr ""
#: ../../content/developer/tutorials/website.rst:171
msgid "Then setup :ref:`basic access control <reference/security/acl>` for the model and add them to the manifest:"
msgstr ""
#: ../../content/developer/tutorials/website.rst:174
#: ../../content/developer/tutorials/website.rst:295
#: ../../content/developer/tutorials/website.rst:591
#: ../../content/developer/tutorials/website.rst:790
#: ../../content/developer/tutorials/website.rst:851
#: ../../content/developer/tutorials/website.rst:868
msgid "``academy/__manifest__.py``"
msgstr ""
#: ../../content/developer/tutorials/website.rst:183
#: ../../content/developer/tutorials/website.rst:670
msgid "``academy/security/ir.model.access.csv``"
msgstr ""
#: ../../content/developer/tutorials/website.rst:189
msgid "this simply gives read access (``perm_read``) to all users (``group_id:id`` left empty)."
msgstr ""
#: ../../content/developer/tutorials/website.rst:194
msgid ":ref:`Data files <reference/data>` (XML or CSV) must be added to the module manifest, Python files (models or controllers) don't but have to be imported from ``__init__.py`` (directly or indirectly)"
msgstr ""
#: ../../content/developer/tutorials/website.rst:200
msgid "the administrator user bypasses access control, they have access to all models even if not given access"
msgstr ""
#: ../../content/developer/tutorials/website.rst:204
msgid "Demonstration data"
msgstr ""
#: ../../content/developer/tutorials/website.rst:206
msgid "The second step is to add some demonstration data to the system so it's possible to test it easily. This is done by adding a ``demo`` :ref:`data file <reference/data>`, which must be linked from the manifest:"
msgstr ""
#: ../../content/developer/tutorials/website.rst:210
#: ../../content/developer/tutorials/website.rst:889
msgid "``academy/demo.xml``"
msgstr ""
#: ../../content/developer/tutorials/website.rst:229
msgid ":ref:`Data files <reference/data>` can be used for demo and non-demo data. Demo data are only loaded in \"demonstration mode\" and can be used for flow testing and demonstration, non-demo data are always loaded and used as initial system setup."
msgstr ""
#: ../../content/developer/tutorials/website.rst:234
msgid "In this case we're using demonstration data because an actual user of the system would want to input or import their own teachers list, this list is only useful for testing."
msgstr ""
#: ../../content/developer/tutorials/website.rst:241
msgid "The last step is to alter model and template to use our demonstration data:"
msgstr ""
#: ../../content/developer/tutorials/website.rst:243
msgid "fetch the records from the database instead of having a static list"
msgstr ""
#: ../../content/developer/tutorials/website.rst:244
msgid "Because :meth:`~odoo.models.Model.search` returns a set of records matching the filter (\"all records\" here), alter the template to print each teacher's ``name``"
msgstr ""
#: ../../content/developer/tutorials/website.rst:274
msgid "Restart the server and update the module (in order to update the manifest and templates and load the demo file) then navigate to http://localhost:8069/academy/academy/. The page should look slightly different: names should simply be prefixed by a number (the database identifier for the teacher)."
msgstr ""
#: ../../content/developer/tutorials/website.rst:281
msgid "Website support"
msgstr ""
#: ../../content/developer/tutorials/website.rst:283
msgid "Odoo bundles a module dedicated to building websites."
msgstr ""
#: ../../content/developer/tutorials/website.rst:285
msgid "So far we've used controllers fairly directly, but Odoo 8 added deeper integration and a few other services (e.g. default styling, theming) via the ``website`` module."
msgstr ""
#: ../../content/developer/tutorials/website.rst:289
msgid "first, add ``website`` as a dependency to ``academy``"
msgstr ""
#: ../../content/developer/tutorials/website.rst:290
msgid "then add the ``website=True`` flag on the controller, this sets up a few new variables on :ref:`the request object <reference/http/request>` and allows using the website layout in our template"
msgstr ""
#: ../../content/developer/tutorials/website.rst:293
msgid "use the website layout in the template"
msgstr ""
#: ../../content/developer/tutorials/website.rst:338
msgid "After restarting the server while updating the module (in order to update the manifest and template) access http://localhost:8069/academy/academy/ should yield a nicer looking page with branding and a number of built-in page elements (top-level menu, footer, …)"
msgstr ""
#: ../../content/developer/tutorials/website.rst:345
msgid "The website layout also provides support for editing tools: click :guilabel:`Sign In` (in the top-right), fill the credentials in (``admin`` / ``admin`` by default) then click :guilabel:`Log In`."
msgstr ""
#: ../../content/developer/tutorials/website.rst:349
msgid "You're now in Odoo \"proper\": the administrative interface. For now click on the :guilabel:`Website` menu item (top-left corner."
msgstr ""
#: ../../content/developer/tutorials/website.rst:352
msgid "We're back in the website but as an administrator, with access to advanced editing features provided by the *website* support:"
msgstr ""
#: ../../content/developer/tutorials/website.rst:355
msgid "a template code editor (:menuselection:`Customize --> HTML Editor`) where you can see and edit all templates used for the current page"
msgstr ""
#: ../../content/developer/tutorials/website.rst:357
msgid "the :guilabel:`Edit` button in the top-left switches to \"editing mode\" where blocks (snippets) and rich text editing are available"
msgstr ""
#: ../../content/developer/tutorials/website.rst:359
msgid "a number of other features such as mobile preview or :abbr:`SEO (Search Engine Optimization)`"
msgstr ""
#: ../../content/developer/tutorials/website.rst:363
msgid "URLs and routing"
msgstr ""
#: ../../content/developer/tutorials/website.rst:365
msgid "Controller methods are associated with *routes* via the :func:`~odoo.http.route` decorator which takes a routing string and a number of attributes to customise its behavior or security."
msgstr ""
#: ../../content/developer/tutorials/website.rst:369
msgid "We've seen a \"literal\" routing string, which matches a URL section exactly, but routing strings can also use `converter patterns`_ which match bits of URLs and make those available as local variables. For instance we can create a new controller method which takes a bit of URL and prints it out:"
msgstr ""
#: ../../content/developer/tutorials/website.rst:382
msgid "restart Odoo, access http://localhost:8069/academy/Alice/ and http://localhost:8069/academy/Bob/ and see the difference."
msgstr ""
#: ../../content/developer/tutorials/website.rst:385
msgid "As the name indicates, `converter patterns`_ don't just do extraction, they also do *validation* and *conversion*, so we can change the new controller to only accept integers:"
msgstr ""
#: ../../content/developer/tutorials/website.rst:396
msgid "Restart Odoo, access http://localhost:8069/academy/2, note how the old value was a string, but the new one was converted to an integers. Try accessing http://localhost:8069/academy/Carol/ and note that the page was not found: since \"Carol\" is not an integer, the route was ignored and no route could be found."
msgstr ""
#: ../../content/developer/tutorials/website.rst:402
msgid "Odoo provides an additional converter called ``model`` which provides records directly when given their id. Let's use this to create a generic page for teacher biographies:"
msgstr ""
#: ../../content/developer/tutorials/website.rst:431
msgid "then change the list of model to link to our new controller:"
msgstr ""
#: ../../content/developer/tutorials/website.rst:453
msgid "Restart Odoo and upgrade the module, then you can visit each teacher's page. As an exercise, try adding blocks to a teacher's page to write a biography, then go to another teacher's page and so forth. You will discover, that your biography is shared between all teachers, because blocks are added to the *template*, and the *biography* template is shared between all teachers, when one page is edited they're all edited at the same time."
msgstr ""
#: ../../content/developer/tutorials/website.rst:461
msgid "Field editing"
msgstr ""
#: ../../content/developer/tutorials/website.rst:463
msgid "Data which is specific to a record should be saved on that record, so let us add a new biography field to our teachers:"
msgstr ""
#: ../../content/developer/tutorials/website.rst:492
msgid "Restart Odoo and update the views, reload the teacher's page and… the field is invisible since it contains nothing."
msgstr ""
#: ../../content/developer/tutorials/website.rst:495
msgid "the view has been set to noupdate because modified previously, force via ``-i`` or do something else?"
msgstr ""
#: ../../content/developer/tutorials/website.rst:498
msgid "For record fields, templates can use a special ``t-field`` directive which allows editing the field content from the website using field-specific interfaces. Change the *person* template to use ``t-field``:"
msgstr ""
#: ../../content/developer/tutorials/website.rst:512
msgid "Restart Odoo and upgrade the module, there is now a placeholder under the teacher's name and a new zone for blocks in :guilabel:`Edit` mode. Content dropped there is stored in the corresponding teacher's ``biography`` field, and thus specific to that teacher."
msgstr ""
#: ../../content/developer/tutorials/website.rst:517
msgid "The teacher's name is also editable, and when saved the change is visible on the index page."
msgstr ""
#: ../../content/developer/tutorials/website.rst:520
msgid "``t-field`` can also take formatting options which depend on the exact field. For instance if we display the modification date for a teacher's record:"
msgstr ""
#: ../../content/developer/tutorials/website.rst:534
msgid "it is displayed in a very \"computery\" manner and hard to read, but we could ask for a human-readable version:"
msgstr ""
#: ../../content/developer/tutorials/website.rst:548
msgid "or a relative display:"
msgstr ""
#: ../../content/developer/tutorials/website.rst:562
msgid "Administration and ERP integration"
msgstr ""
#: ../../content/developer/tutorials/website.rst:565
msgid "A brief and incomplete introduction to the Odoo administration"
msgstr ""
#: ../../content/developer/tutorials/website.rst:567
msgid "The Odoo administration was briefly seen during the `website support`_ section. We can go back to it using :menuselection:`Administrator --> Administrator` in the menu (or :guilabel:`Sign In` if you're signed out)."
msgstr ""
#: ../../content/developer/tutorials/website.rst:571
msgid "The conceptual structure of the Odoo backend is simple:"
msgstr ""
#: ../../content/developer/tutorials/website.rst:573
msgid "first are menus, a tree (menus can have sub-menus) of records. Menus without children map to…"
msgstr ""
#: ../../content/developer/tutorials/website.rst:575
msgid "actions. Actions have various types: links, reports, code which Odoo should execute or data display. Data display actions are called *window actions*, and tell Odoo to display a given *model* according to a set of views…"
msgstr ""
#: ../../content/developer/tutorials/website.rst:578
msgid "a view has a type, a broad category to which it corresponds (a list, a graph, a calendar) and an *architecture* which customises the way the model is displayed inside the view."
msgstr ""
#: ../../content/developer/tutorials/website.rst:583
msgid "Editing in the Odoo administration"
msgstr ""
#: ../../content/developer/tutorials/website.rst:585
msgid "By default, an Odoo model is essentially invisible to a user. To make it visible it must be available through an action, which itself needs to be reachable, generally through a menu."
msgstr ""
#: ../../content/developer/tutorials/website.rst:589
msgid "Let's create a menu for our model:"
msgstr ""
#: ../../content/developer/tutorials/website.rst:601
#: ../../content/developer/tutorials/website.rst:632
#: ../../content/developer/tutorials/website.rst:680
#: ../../content/developer/tutorials/website.rst:752
#: ../../content/developer/tutorials/website.rst:811
msgid "``academy/views.xml``"
msgstr ""
#: ../../content/developer/tutorials/website.rst:618
msgid "then accessing http://localhost:8069/web/ in the top left should be a menu :guilabel:`Academy`, which is selected by default, as it is the first menu, and having opened a listing of teachers. From the listing it is possible to :guilabel:`Create` new teacher records, and to switch to the \"form\" by-record view."
msgstr ""
#: ../../content/developer/tutorials/website.rst:624
msgid "If there is no definition of how to present records (a :doc:`view <../reference/user_interface/view_records>`) Odoo will automatically create a basic one on-the-fly. In our case it works for the \"list\" view for now (only displays the teacher's name) but in the \"form\" view the HTML ``biography`` field is displayed side-by-side with the ``name`` field and not given enough space. Let's define a custom form view to make viewing and editing teacher records a better experience:"
msgstr ""
#: ../../content/developer/tutorials/website.rst:651
msgid "We have seen a pair of \"basic\" fields stored directly in the record. There are :ref:`a number of basic fields <reference/fields/basic>`. The second broad categories of fields are :ref:`relational <reference/fields/relational>` and used to link records to one another (within a model or across models)."
msgstr ""
#: ../../content/developer/tutorials/website.rst:657
msgid "For demonstration, let's create a *courses* model. Each course should have a ``teacher`` field, linking to a single teacher record, but each teacher can teach many courses:"
msgstr ""
#: ../../content/developer/tutorials/website.rst:677
msgid "let's also add views so we can see and edit a course's teacher:"
msgstr ""
#: ../../content/developer/tutorials/website.rst:730
msgid "It should also be possible to create new courses directly from a teacher's page, or to see all the courses they teach, so add :class:`the inverse relationship <odoo.fields.One2many>` to the *teachers* model:"
msgstr ""
#: ../../content/developer/tutorials/website.rst:774
msgid "Discussions and notifications"
msgstr ""
#: ../../content/developer/tutorials/website.rst:776
msgid "Odoo provides technical models, which don't directly fulfill business needs but which add capabilities to business objects without having to build them by hand."
msgstr ""
#: ../../content/developer/tutorials/website.rst:780
msgid "One of these is the *Chatter* system, part of Odoo's email and messaging system, which can add notifications and discussion threads to any model. The model simply has to :attr:`~odoo.models.Model._inherit` ``mail.thread``, and add the ``message_ids`` field to its form view to display the discussion thread. Discussion threads are per-record."
msgstr ""
#: ../../content/developer/tutorials/website.rst:786
msgid "For our academy, it makes sense to allow discussing courses to handle e.g. scheduling changes or discussions between teachers and assistants:"
msgstr ""
#: ../../content/developer/tutorials/website.rst:831
msgid "At the bottom of each course form, there is now a discussion thread and the possibility for users of the system to leave messages and follow or unfollow discussions linked to specific courses."
msgstr ""
#: ../../content/developer/tutorials/website.rst:836
msgid "Selling courses"
msgstr ""
#: ../../content/developer/tutorials/website.rst:838
msgid "Odoo also provides business models which allow using or opting in business needs more directly. For instance the ``website_sale`` module sets up an e-commerce site based on the products in the Odoo system. We can easily make course subscriptions sellable by making our courses specific kinds of products."
msgstr ""
#: ../../content/developer/tutorials/website.rst:844
msgid "Rather than the previous classical inheritance, this means replacing our *course* model by the *product* model, and extending products in-place (to add anything we need to it)."
msgstr ""
#: ../../content/developer/tutorials/website.rst:848
msgid "First of all we need to add a dependency on ``website_sale`` so we get both products (via ``sale``) and the ecommerce interface:"
msgstr ""
#: ../../content/developer/tutorials/website.rst:862
msgid "restart Odoo, update your module, there is now a :guilabel:`Shop` section in the website, listing a number of pre-filled (via demonstration data) products."
msgstr ""
#: ../../content/developer/tutorials/website.rst:865
msgid "The second step is to replace the *courses* model by ``product.template``, and add a new category of product for courses:"
msgstr ""
#: ../../content/developer/tutorials/website.rst:879
msgid "``academy/data.xml``"
msgstr ""
#: ../../content/developer/tutorials/website.rst:928
msgid "With this installed, a few courses are now available in the :guilabel:`Shop`, though they may have to be looked for."
msgstr ""
#: ../../content/developer/tutorials/website.rst:933
msgid "to extend a model in-place, it's :attr:`inherited <odoo.models.Model._inherit>` without giving it a new :attr:`~odoo.models.Model._name`"
msgstr ""
#: ../../content/developer/tutorials/website.rst:936
msgid "``product.template`` already uses the discussions system, so we can remove it from our extension model"
msgstr ""
#: ../../content/developer/tutorials/website.rst:938
msgid "we're creating our courses as *published* by default so they can be seen without having to log in"
msgstr ""
#: ../../content/developer/tutorials/website.rst:942
msgid "Altering existing views"
msgstr ""
#: ../../content/developer/tutorials/website.rst:944
msgid "So far, we have briefly seen:"
msgstr ""
#: ../../content/developer/tutorials/website.rst:946
msgid "the creation of new models"
msgstr ""
#: ../../content/developer/tutorials/website.rst:947
msgid "the creation of new views"
msgstr ""
#: ../../content/developer/tutorials/website.rst:948
msgid "the creation of new records"
msgstr ""
#: ../../content/developer/tutorials/website.rst:949
msgid "the alteration of existing models"
msgstr ""
#: ../../content/developer/tutorials/website.rst:951
msgid "We're left with the alteration of existing records and the alteration of existing views. We'll do both on the :guilabel:`Shop` pages."
msgstr ""
#: ../../content/developer/tutorials/website.rst:954
msgid "View alteration is done by creating *extension* views, which are applied on top of the original view and alter it. These alteration views can be added or removed without modifying the original, making it easier to try things out and roll changes back."
msgstr ""
#: ../../content/developer/tutorials/website.rst:959
msgid "Since our courses are free, there is no reason to display their price on the shop page, so we're going to alter the view and hide the price if it's 0. The first task is finding out which view displays the price, this can be done via :menuselection:`Customize --> HTML Editor` which lets us read the various templates involved in rendering a page. Going through a few of them, \"Product item\" looks a likely culprit."
msgstr ""
#: ../../content/developer/tutorials/website.rst:966
msgid "Altering view architectures is done in 3 steps:"
msgstr ""
#: ../../content/developer/tutorials/website.rst:968
msgid "Create a new view"
msgstr ""
#: ../../content/developer/tutorials/website.rst:969
msgid "Extend the view to modify by setting the new view's ``inherit_id`` to the modified view's external id"
msgstr ""
#: ../../content/developer/tutorials/website.rst:971
msgid "In the architecture, use the ``xpath`` tag to select and alter elements from the modified view"
msgstr ""
#: ../../content/developer/tutorials/website.rst:983
msgid "The second thing we will change is making the product categories sidebar visible by default: :menuselection:`Customize --> Product Categories` lets you toggle a tree of product categories (used to filter the main display) on and off."
msgstr ""
#: ../../content/developer/tutorials/website.rst:988
msgid "This is done via the ``customize_show`` and ``active`` fields of extension templates: an extension template (such as the one we've just created) can be *customize_show=True*. This choice will display the view in the :guilabel:`Customize` menu with a check box, allowing administrators to activate or disable them (and easily customize their website pages)."
msgstr ""
#: ../../content/developer/tutorials/website.rst:994
msgid "We simply need to modify the *Product Categories* record and set its default to *active=\"True\"*:"
msgstr ""
#: ../../content/developer/tutorials/website.rst:1004
msgid "With this, the *Product Categories* sidebar will automatically be enabled when the *Academy* module is installed."
msgstr ""