convert rst to markdown
This commit is contained in:
@@ -0,0 +1,106 @@
|
||||
# Approval rules
|
||||
|
||||
Approval rules are used to automate approval processes for actions. They allow you to define
|
||||
the criteria for when an approval is required before an action can be performed using a button.
|
||||
|
||||
## Configuration
|
||||
|
||||
To add approval rules with Studio, proceed as follows:
|
||||
|
||||
1. {ref}`Open Studio <studio/access>` and switch to the required {doc}`view <views>`.
|
||||
|
||||
2. Select the button to which the rule should be applied.
|
||||
|
||||
3. Click {icon}`fa-plus` {guilabel}`Add an approval step` in the {icon}`fa-server`
|
||||
{guilabel}`Properties` tab.
|
||||
|
||||
4. Specify which users are responsible for approving the action by using one of the following fields
|
||||
or both:
|
||||
|
||||
> - {guilabel}`Approvers` to specify one or several users;
|
||||
>
|
||||
> - {guilabel}`Approver Group` to specify one user group.
|
||||
>
|
||||
> :::{note}
|
||||
> An activity is created for all users set as {guilabel}`Approvers` when their approval is
|
||||
> requested.
|
||||
> :::
|
||||
|
||||
5. (*optional*) Select the {guilabel}`Users to Notify` via an internal note when the action is
|
||||
approved or rejected.
|
||||
|
||||
6. (*optional*) Add a {guilabel}`Description` to be displayed on the button.
|
||||
|
||||
:::{tip}
|
||||
You can specify under which condition(s) an approval step should be applied by clicking the
|
||||
{icon}`fa-filter` ({guilabel}`filter`) icon next to the {guilabel}`Approvers` field.
|
||||
:::
|
||||
|
||||
To add another approval step, click {icon}`fa-plus` {guilabel}`Add an approval step`. When there are
|
||||
multiple steps, you can:
|
||||
|
||||
- Enable {guilabel}`Exclusive Approval` on any step so that a user who approves a step cannot
|
||||
approve another step for the same record.
|
||||
- Change the {guilabel}`Approval Order` of the steps by selecting a number, `1` being the first
|
||||
step, `2` the second step, and so on. A user responsible for a higher step can approve/reject
|
||||
previous step(s) unless {guilabel}`Exclusive Approval` is selected.
|
||||
|
||||
Click the {icon}`fa-trash` ({guilabel}`trash`) icon next to the {guilabel}`Approvers` field to
|
||||
remove an approval step.
|
||||
|
||||
:::{tip}
|
||||
You can create {ref}`user groups <access-rights/groups>` specifically for approvals.
|
||||
:::
|
||||
|
||||
(approval-rules-use)=
|
||||
|
||||
## Use
|
||||
|
||||
Once an approval rule has been defined for a button, a **user avatar** icon is displayed next to the
|
||||
button's label for each approval step. Clicking an icon reveals the step(s).
|
||||
|
||||
```{image} approval_rules/approval-button.png
|
||||
:alt: Confirm button with two approval steps
|
||||
```
|
||||
|
||||
:::{note}
|
||||
If an unauthorized user clicks the button, an error message is displayed and an activity is
|
||||
created for the users specified in the {guilabel}`Approvers` field, if any.
|
||||
:::
|
||||
|
||||
Authorized users can:
|
||||
|
||||
- Perform the action directly by clicking the button if it is the last/only approval step.
|
||||
|
||||
- Approve the action and let another user perform it - or move it to the next approval step - by
|
||||
clicking the **user avatar** icon next to the button's label, then clicking the {icon}`fa-check`
|
||||
({guilabel}`approve`).
|
||||
|
||||
- Reject the action by clicking the **user avatar** icon next to the button's label and then the
|
||||
{icon}`fa-times` ({guilabel}`reject`) button.
|
||||
|
||||
- (only for users selected under the {guilabel}`Approvers` field) Delegate their approval rights to
|
||||
one or several users for **all records** by:
|
||||
|
||||
- Clicking the {icon}`oi-view-kanban` ({guilabel}`kanban view`) icon and then
|
||||
{guilabel}`Delegate`.
|
||||
|
||||
- Selecting one or several {guilabel}`Approvers`, {guilabel}`Until` when they will have approval
|
||||
rights (forever if left empty), and, optionally, the user(s) who should be notified via an
|
||||
internal note using the {guilabel}`Notify to` field.
|
||||
|
||||
```{image} approval_rules/delegate-dialog.png
|
||||
:alt: Delegate to dialog
|
||||
```
|
||||
|
||||
:::{tip}
|
||||
- A user who approves/rejects an action can revoke their decision by clicking the **user avatar**
|
||||
icon next to the button's label and then the {icon}`fa-undo` ({guilabel}`revoke`) button. They
|
||||
can also revoke the decision of other users for steps with a lower {guilabel}`Approval Order`
|
||||
unless {guilabel}`Exclusive Approval` is enabled.
|
||||
- Approvals are tracked in the record's chatter. An approval entry is also created every time
|
||||
a Studio approval-related action is performed. To access approval entries, {doc}`activate the
|
||||
developer mode </applications/general/developer_mode>` and go to {menuselection}`Settings -->
|
||||
Technical --> Studio Approval Entries`.
|
||||
:::
|
||||
|
||||
@@ -1,93 +0,0 @@
|
||||
==============
|
||||
Approval rules
|
||||
==============
|
||||
|
||||
Approval rules are used to automate approval processes for actions. They allow you to define
|
||||
the criteria for when an approval is required before an action can be performed using a button.
|
||||
|
||||
Configuration
|
||||
=============
|
||||
|
||||
To add approval rules with Studio, proceed as follows:
|
||||
|
||||
#. :ref:`Open Studio <studio/access>` and switch to the required :doc:`view <views>`.
|
||||
#. Select the button to which the rule should be applied.
|
||||
#. Click :icon:`fa-plus` :guilabel:`Add an approval step` in the :icon:`fa-server`
|
||||
:guilabel:`Properties` tab.
|
||||
#. Specify which users are responsible for approving the action by using one of the following fields
|
||||
or both:
|
||||
|
||||
- :guilabel:`Approvers` to specify one or several users;
|
||||
- :guilabel:`Approver Group` to specify one user group.
|
||||
|
||||
.. note::
|
||||
An activity is created for all users set as :guilabel:`Approvers` when their approval is
|
||||
requested.
|
||||
|
||||
#. (*optional*) Select the :guilabel:`Users to Notify` via an internal note when the action is
|
||||
approved or rejected.
|
||||
#. (*optional*) Add a :guilabel:`Description` to be displayed on the button.
|
||||
|
||||
.. tip::
|
||||
You can specify under which condition(s) an approval step should be applied by clicking the
|
||||
:icon:`fa-filter` (:guilabel:`filter`) icon next to the :guilabel:`Approvers` field.
|
||||
|
||||
To add another approval step, click :icon:`fa-plus` :guilabel:`Add an approval step`. When there are
|
||||
multiple steps, you can:
|
||||
|
||||
- Enable :guilabel:`Exclusive Approval` on any step so that a user who approves a step cannot
|
||||
approve another step for the same record.
|
||||
- Change the :guilabel:`Approval Order` of the steps by selecting a number, `1` being the first
|
||||
step, `2` the second step, and so on. A user responsible for a higher step can approve/reject
|
||||
previous step(s) unless :guilabel:`Exclusive Approval` is selected.
|
||||
|
||||
Click the :icon:`fa-trash` (:guilabel:`trash`) icon next to the :guilabel:`Approvers` field to
|
||||
remove an approval step.
|
||||
|
||||
.. tip::
|
||||
You can create :ref:`user groups <access-rights/groups>` specifically for approvals.
|
||||
|
||||
.. _approval-rules/use:
|
||||
|
||||
Use
|
||||
===
|
||||
|
||||
Once an approval rule has been defined for a button, a **user avatar** icon is displayed next to the
|
||||
button's label for each approval step. Clicking an icon reveals the step(s).
|
||||
|
||||
.. image:: approval_rules/approval-button.png
|
||||
:alt: Confirm button with two approval steps
|
||||
|
||||
.. note::
|
||||
If an unauthorized user clicks the button, an error message is displayed and an activity is
|
||||
created for the users specified in the :guilabel:`Approvers` field, if any.
|
||||
|
||||
Authorized users can:
|
||||
|
||||
- Perform the action directly by clicking the button if it is the last/only approval step.
|
||||
- Approve the action and let another user perform it - or move it to the next approval step - by
|
||||
clicking the **user avatar** icon next to the button's label, then clicking the :icon:`fa-check`
|
||||
(:guilabel:`approve`).
|
||||
- Reject the action by clicking the **user avatar** icon next to the button's label and then the
|
||||
:icon:`fa-times` (:guilabel:`reject`) button.
|
||||
- (only for users selected under the :guilabel:`Approvers` field) Delegate their approval rights to
|
||||
one or several users for **all records** by:
|
||||
|
||||
- Clicking the :icon:`oi-view-kanban` (:guilabel:`kanban view`) icon and then
|
||||
:guilabel:`Delegate`.
|
||||
- Selecting one or several :guilabel:`Approvers`, :guilabel:`Until` when they will have approval
|
||||
rights (forever if left empty), and, optionally, the user(s) who should be notified via an
|
||||
internal note using the :guilabel:`Notify to` field.
|
||||
|
||||
.. image:: approval_rules/delegate-dialog.png
|
||||
:alt: Delegate to dialog
|
||||
|
||||
.. tip::
|
||||
- A user who approves/rejects an action can revoke their decision by clicking the **user avatar**
|
||||
icon next to the button's label and then the :icon:`fa-undo` (:guilabel:`revoke`) button. They
|
||||
can also revoke the decision of other users for steps with a lower :guilabel:`Approval Order`
|
||||
unless :guilabel:`Exclusive Approval` is enabled.
|
||||
- Approvals are tracked in the record's chatter. An approval entry is also created every time
|
||||
a Studio approval-related action is performed. To access approval entries, :doc:`activate the
|
||||
developer mode </applications/general/developer_mode>` and go to :menuselection:`Settings -->
|
||||
Technical --> Studio Approval Entries`.
|
||||
@@ -0,0 +1,364 @@
|
||||
# Automation rules
|
||||
|
||||
Automation rules are used to trigger automatic changes based on user actions (e.g., apply a
|
||||
modification when a field is set to a specific value), email events, time conditions (e.g., archive
|
||||
a record 7 days after its last update), or external events.
|
||||
|
||||
To create an automation rule with Studio, proceed as follows:
|
||||
|
||||
1. {ref}`Open Studio <studio/access>` and click {guilabel}`Automations`, then {guilabel}`New`.
|
||||
2. Select the {ref}`studio/automated-actions/trigger` and, if necessary, fill in the fields that
|
||||
appear on the screen based on the chosen trigger.
|
||||
3. Click {guilabel}`Add an action`, then select the {guilabel}`Type` of
|
||||
{ref}`action <studio/automated-actions/action>` and fill in the fields that appear on the screen
|
||||
based on your selected action.
|
||||
4. Click {guilabel}`Save & Close` or {guilabel}`Save & New`.
|
||||
|
||||
```{eval-rst}
|
||||
.. example::
|
||||
|
||||
.. image:: automated_actions/automation-rule-ex.png
|
||||
:alt: Example of an automated action on the Subscription model
|
||||
```
|
||||
|
||||
:::{tip}
|
||||
- To modify the {doc}`model <models_modules_apps>` of the automation rule, switch models before
|
||||
clicking {guilabel}`Automations` in Studio, or {ref}`activate the developer mode
|
||||
<developer-mode>`, create or edit an automation rule, and select the {guilabel}`Model` in the
|
||||
{guilabel}`Automation Rules` form.
|
||||
|
||||
- You can also create automation rules from any kanban stage by clicking the gear icon
|
||||
({guilabel}`⚙` ) next to the kanban stage name, then selecting {guilabel}`Automations`. In this
|
||||
case, the {guilabel}`Trigger` is set to {guilabel}`Stage is set to` by default, but you can
|
||||
change it if necessary.
|
||||
|
||||
```{image} automated_actions/automations-kanban.png
|
||||
:alt: Create automations from a kanban stage
|
||||
```
|
||||
:::
|
||||
|
||||
(studio-automated-actions-trigger)=
|
||||
|
||||
## Trigger
|
||||
|
||||
The {guilabel}`Trigger` is used to define when the automation rule should be applied. The available
|
||||
triggers depend on the {doc}`model <models_modules_apps>`. Five trigger categories are available
|
||||
overall:
|
||||
|
||||
- {ref}`studio/automated-actions/trigger/values-updated`
|
||||
- {ref}`studio/automated-actions/trigger/email-events`
|
||||
- {ref}`studio/automated-actions/trigger/values-timing-conditions`
|
||||
- {ref}`studio/automated-actions/trigger/custom`
|
||||
- {ref}`studio/automated-actions/trigger/external`
|
||||
|
||||
:::{tip}
|
||||
You can also define a {guilabel}`Before Update Domain` to specify the conditions that must be met
|
||||
*before* the automation rule is triggered. In contrast, the conditions defined using the
|
||||
{ref}`Extra Conditions <studio/automated-actions/trigger/values-timing-conditions>` and
|
||||
{ref}`Apply on <studio/automated-actions/trigger/custom>` filters are checked *during* the
|
||||
execution of the automation rule.
|
||||
|
||||
To define a {guilabel}`Before Update Domain`, {ref}`activate the developer mode
|
||||
<developer-mode>`, create or edit an automation rule, click {guilabel}`Edit Domain`, then click
|
||||
{guilabel}`New Rule`.
|
||||
|
||||
For example, if you want the automated action to happen when an email address is set on a
|
||||
contact that did not have an address before (in contrast to modifying their existing address),
|
||||
define the {guilabel}`Before Update Domain` to {guilabel}`Email is not set`, and the
|
||||
{guilabel}`Apply on` domain to {guilabel}`Email is set`.
|
||||
|
||||
```{image} automated_actions/before-update-domain.png
|
||||
:alt: Example of a trigger with a Before Update Domain
|
||||
```
|
||||
:::
|
||||
|
||||
(studio-automated-actions-trigger-values-updated)=
|
||||
|
||||
### Values Updated
|
||||
|
||||
The triggers available in this category depend on the model and are based on common field changes,
|
||||
such as adding a specific tag (e.g., to a task) or setting the {guilabel}`User` field. Select the
|
||||
trigger, then select a value if required.
|
||||
|
||||
```{image} automated_actions/values-updated-trigger.png
|
||||
:alt: Example of a Values Updated trigger
|
||||
```
|
||||
|
||||
(studio-automated-actions-trigger-email-events)=
|
||||
|
||||
### Email Events
|
||||
|
||||
Trigger automated actions upon receiving or sending emails.
|
||||
|
||||
(studio-automated-actions-trigger-values-timing-conditions)=
|
||||
|
||||
### Timing Conditions
|
||||
|
||||
Trigger automated actions based on a date field. The following triggers are available:
|
||||
|
||||
- {guilabel}`Based on date field`: Select the field to be used next to the {guilabel}`Delay` field.
|
||||
- {guilabel}`After creation`: The action is triggered when a record is created and saved.
|
||||
- {guilabel}`After last update`: The action is triggered when an existing record is edited and
|
||||
saved.
|
||||
|
||||
You can then define:
|
||||
|
||||
- a {guilabel}`Delay`: Specify the number of minutes, hours, days, or months. To trigger the action
|
||||
before the trigger date, specify a negative number. If you selected the {guilabel}`Based on date
|
||||
field` trigger, you must also select the date field to be used to determine the delay.
|
||||
- {guilabel}`Extra Conditions`: Click {guilabel}`Add condition`, then specify the conditions to be
|
||||
met to trigger the automation rule. Click {guilabel}`New Rule` to add another condition.
|
||||
|
||||
The action is triggered when the delay is reached and the conditions are met.
|
||||
|
||||
```{eval-rst}
|
||||
.. example::
|
||||
If you want to send a reminder email 30 minutes before the start of a calendar event, select the
|
||||
:guilabel:`Start (Calendar Event)` under :guilabel:`Trigger Date` and set the :guilabel:`Delay`
|
||||
to **-30** :guilabel:`Minutes`.
|
||||
|
||||
.. image:: automated_actions/timing-conditions-trigger.png
|
||||
:alt: Example of a Based on date field trigger
|
||||
```
|
||||
|
||||
:::{note}
|
||||
By default, the scheduler checks for trigger dates every 4 hours, meaning lower granularity in
|
||||
time-based automations may not always be honored.
|
||||
:::
|
||||
|
||||
(studio-automated-actions-trigger-custom)=
|
||||
|
||||
### Custom
|
||||
|
||||
Trigger automated actions:
|
||||
|
||||
- {guilabel}`On save`: When the record is saved;
|
||||
- {guilabel}`On deletion`: When a record is deleted;
|
||||
- {guilabel}`On UI change`: When a field's value is changed on the {ref}`Form view
|
||||
<studio/views/general/form>`, even before saving the record.
|
||||
|
||||
For the {guilabel}`On save` and {guilabel}`On UI change` triggers, you **must** then select the
|
||||
field(s) to be used to trigger the automation rule in the {guilabel}`When updating` field.
|
||||
|
||||
:::{warning}
|
||||
If no field is selected in the {guilabel}`When updating` field, the automated action may be
|
||||
executed multiple times per record.
|
||||
:::
|
||||
|
||||
Optionally, you can also define additional conditions to be met to trigger the automation rule in
|
||||
the {guilabel}`Apply on` field.
|
||||
|
||||
:::{note}
|
||||
The {guilabel}`On UI change` trigger can only be used with the
|
||||
{ref}`studio/automated-actions/action/python-code` action and only works when a modification is
|
||||
made manually. The action is not executed if the field is changed through another automation
|
||||
rule.
|
||||
:::
|
||||
|
||||
(studio-automated-actions-trigger-external)=
|
||||
|
||||
### External
|
||||
|
||||
Trigger automated actions based on an external event using a webhook. A webhook is a method of
|
||||
communication between two systems where the source system sends an HTTP(S) request to a destination
|
||||
system based on a specific event. It usually includes a data payload containing information about
|
||||
the event that occurred.
|
||||
|
||||
To configure the {guilabel}`On webhook` trigger, copy the {guilabel}`URL` generated by Odoo into the
|
||||
destination system (i.e., the system receiving the request). Then, in the {guilabel}`Target Record`
|
||||
field, enter the code to run to define the record(s) to be updated using the automation rule.
|
||||
|
||||
:::{warning}
|
||||
The URL must be treated as **confidential**; sharing it online or without caution could
|
||||
potentially expose your system to malicious parties. Click the {guilabel}`Rotate Secret` button
|
||||
to change the URL's secret if necessary.
|
||||
:::
|
||||
|
||||
:::{note}
|
||||
- The code defined by default in the {guilabel}`Target Record` field works for webhooks coming
|
||||
from another Odoo database. It is used to determine the record(s) to be updated using the
|
||||
information in the payload.
|
||||
- If you wish to use the webhook's content for a purpose other than to find the record(s) (e.g.,
|
||||
*create* a record), your only option is to use an {ref}`studio/automated-actions/action/python-code`
|
||||
action. In this case, the {guilabel}`Target record` field must contain any valid code, but its
|
||||
result doesn't have any effect on the automated action itself.
|
||||
- The webhook content is available in the server action context as a `payload` variable (i.e., a
|
||||
dictionary that contains the GET parameters or POST JSON body of the incoming request).
|
||||
:::
|
||||
|
||||
You can also choose to {guilabel}`Log Calls` to record the payloads received, e.g., to make sure the
|
||||
data sent by the source system matches the expected format and content. This also helps identify
|
||||
and diagnose any issues that may arise. To access the logs, click the {guilabel}`Logs` smart
|
||||
button at the top of the {guilabel}`Automation rules` form.
|
||||
|
||||
(studio-automated-actions-action)=
|
||||
|
||||
## Actions
|
||||
|
||||
Once you have defined the automation rule's {ref}`trigger <studio/automated-actions/trigger>`, click
|
||||
{guilabel}`Add an action` to define the action to be executed.
|
||||
|
||||
:::{tip}
|
||||
You can define multiple actions for the same trigger/automation rule. The actions are executed
|
||||
in the order they are defined. This means, for example, that if you define an
|
||||
{guilabel}`Update record` action and then a {guilabel}`Send email` action, the email uses the
|
||||
updated values. However, if the {guilabel}`Send email` action is defined before the
|
||||
{guilabel}`Update record` action, the email uses the values set *before* the update action is
|
||||
run.
|
||||
:::
|
||||
|
||||
(studio-automated-actions-action-update-record)=
|
||||
|
||||
### Update Record
|
||||
|
||||
This action allows to update one of the record's (related) fields. Click the {guilabel}`Update`
|
||||
field and, in the list that opens, select or search for the field to be updated; click the right
|
||||
arrow next to the field name to access the list of related fields if needed.
|
||||
|
||||
If you selected a {ref}`many2many field <studio/fields/relational-fields/many2many>`, choose whether
|
||||
the field must be updated by {guilabel}`Adding`, {guilabel}`Removing`, or {guilabel}`Setting it to`
|
||||
the selected value or by {guilabel}`Clearing it`.
|
||||
|
||||
```{eval-rst}
|
||||
.. example::
|
||||
If you want the automated action to remove a tag from the customer record, set the
|
||||
:guilabel:`Update` field to :guilabel:`Customer > Tags`, select :guilabel:`By Removing`, then
|
||||
select the tag.
|
||||
|
||||
.. image:: automated_actions/update-record-action.png
|
||||
:alt: Example of an Update Record action
|
||||
```
|
||||
|
||||
:::{tip}
|
||||
Alternatively, you can also set a record's field dynamically using Python code. To do so, select
|
||||
{guilabel}`Compute` instead of {guilabel}`Update`, then enter the code to be used for computing
|
||||
the field's value. For example, if you want the automation rule to compute a custom
|
||||
{ref}`datetime field <studio/fields/simple-fields/date-time>` when a task's priority is set to
|
||||
`High` (by starring the task), you can define the trigger {guilabel}`Priority is set to` to
|
||||
`High` and define the {guilabel}`Update Record` action as follows:
|
||||
|
||||
```{image} automated_actions/update-record-compute.png
|
||||
:alt: Compute a custom datetime field using a Python expression
|
||||
```
|
||||
:::
|
||||
|
||||
### Create Activity
|
||||
|
||||
This action is used to schedule a new activity linked to the record. Select an {guilabel}`Activity
|
||||
Type`, enter a {guilabel}`Title` and description, then specify when you want the activity to be
|
||||
scheduled in the {guilabel}`Due Date In` field, and select a {guilabel}`User type`:
|
||||
|
||||
- To always assign the activity to the same user, select {guilabel}`Specific User` and add the user
|
||||
in the {guilabel}`Responsible` field;
|
||||
- To target a user linked to the record dynamically, select {guilabel}`Dynamic User (based on
|
||||
record)` and change the {guilabel}`User Field` if necessary.
|
||||
|
||||
```{eval-rst}
|
||||
.. example::
|
||||
After a lead is turned into an opportunity, you want the automated action to set up a call for
|
||||
the user responsible for the lead. To do so, set the :guilabel:`Activity Type` to
|
||||
:guilabel:`Call` and the :guilabel:`User Type` to :guilabel:`Dynamic User (based on record)`.
|
||||
|
||||
.. image:: automated_actions/create-activity-action.png
|
||||
:alt: Example of a Create Activity action
|
||||
```
|
||||
|
||||
### Send Email and Send SMS
|
||||
|
||||
These actions are used to send an email or a text message to a contact linked to a specific record.
|
||||
To do so, select or create an {guilabel}`Email Template` or an {guilabel}`SMS Template`, then, in
|
||||
the {guilabel}`Send Email As` or {guilabel}`Send SMS As` field, choose how you want to send the
|
||||
email or text message:
|
||||
|
||||
- {guilabel}`Email`: to send the message as an email to the recipients of the {guilabel}`Email
|
||||
Template`.
|
||||
- {guilabel}`Message`: to post the message on the record and notify the record's followers.
|
||||
- {guilabel}`Note`: to send the message as an internal note visible to internal users in the
|
||||
chatter.
|
||||
- {guilabel}`SMS (without note)`: to send the message as a text message to the recipients of the
|
||||
{guilabel}`SMS template`.
|
||||
- {guilabel}`SMS (with note)`: to send the message as a text message to the recipients of the
|
||||
{guilabel}`SMS template` and post it as an internal note in the chatter.
|
||||
- {guilabel}`Note only`: to only post the message as an internal note in the chatter.
|
||||
|
||||
(studio-automated-actions-action-send-whatsapp)=
|
||||
|
||||
### Send WhatsApp
|
||||
|
||||
:::{important}
|
||||
To automate the sending of WhatsApp messages, one or more
|
||||
{ref}`WhatsApp templates <productivity/whatsapp/templates>` must be created.
|
||||
:::
|
||||
|
||||
This action is used to send a WhatsApp message to a contact linked to a specific record.
|
||||
To do so, select the appropriate {guilabel}`WhatsApp Template` from the drop-down menu.
|
||||
|
||||
(studio-automated-actions-action-add-followers)=
|
||||
|
||||
### Add Followers and Remove Followers
|
||||
|
||||
Use these actions to (un)subscribe existing contacts to/from the record.
|
||||
|
||||
### Create Record
|
||||
|
||||
This action is used to create a new record on any model.
|
||||
|
||||
Select the required model in the {guilabel}`Record to Create` field; it contains the current model
|
||||
by default. Specify a {guilabel}`Name` for the record, and then, if you want to create the record on
|
||||
another model, select a field in the {guilabel}`Link Field` field to link the record that
|
||||
triggered the creation of the new record.
|
||||
|
||||
:::{note}
|
||||
The dropdown list related to the {guilabel}`Link Field` field only contains {ref}`one2many fields
|
||||
<studio/fields/relational-fields/one2many>` existing on the current model that are linked to a
|
||||
{ref}`many2one field <studio/fields/relational-fields/many2one>` on the target model.
|
||||
:::
|
||||
|
||||
:::{tip}
|
||||
You can create another automation rule with {ref}`studio/automated-actions/action/update-record`
|
||||
actions to update the fields of the new record if necessary. For example, you can use a
|
||||
{guilabel}`Create Record` action to create a new project task and then assign it to a specific
|
||||
user using an {guilabel}`Update Record` action.
|
||||
:::
|
||||
|
||||
(studio-automated-actions-action-python-code)=
|
||||
|
||||
### Execute Code
|
||||
|
||||
This action is used to execute Python code. You can write your code into the {guilabel}`Code` tab
|
||||
using the following variables:
|
||||
|
||||
- `env`: environment on which the action is triggered
|
||||
- `model`: model of the record on which the action is triggered; is a void recordset
|
||||
- `record`: record on which the action is triggered; may be void
|
||||
- `records`: recordset of all records on which the action is triggered in multi-mode; this may be
|
||||
left empty
|
||||
- `time`, `datetime`, `dateutil`, `timezone`: useful Python libraries
|
||||
- `float_compare`: utility function to compare floats based on specific precision
|
||||
- `log(message, level='info')`: logging function to record debug information in ir.logging
|
||||
table
|
||||
- `_logger.info(message)`: logger to emit messages in server logs
|
||||
- `UserError`: exception class for raising user-facing warning messages
|
||||
- `Command`: x2many commands namespace
|
||||
- `action = {...}`: to return an action
|
||||
|
||||
:::{tip}
|
||||
The available variables are described both in the {guilabel}`Code` and {guilabel}`Help` tabs.
|
||||
:::
|
||||
|
||||
### Send Webhook Notification
|
||||
|
||||
This action allows to send a POST request with the values of the {guilabel}`Fields` to the URL
|
||||
specified in the {guilabel}`URL` field.
|
||||
|
||||
The {guilabel}`Sample Payload` provides a preview of the data included in the request using a random
|
||||
record's data or dummy data if no record is available.
|
||||
|
||||
(studio-automated-actions-action-several-actions)=
|
||||
|
||||
### Execute Existing Actions
|
||||
|
||||
The action is used to trigger multiple actions (linked to the current model) at the same time. To do
|
||||
so, click on {guilabel}`Add a line`, then, in the {guilabel}`Add: Child Actions` pop-up, select an
|
||||
existing action or click {guilabel}`New` to create a new one.
|
||||
|
||||
@@ -1,355 +0,0 @@
|
||||
================
|
||||
Automation rules
|
||||
================
|
||||
|
||||
Automation rules are used to trigger automatic changes based on user actions (e.g., apply a
|
||||
modification when a field is set to a specific value), email events, time conditions (e.g., archive
|
||||
a record 7 days after its last update), or external events.
|
||||
|
||||
To create an automation rule with Studio, proceed as follows:
|
||||
|
||||
#. :ref:`Open Studio <studio/access>` and click :guilabel:`Automations`, then :guilabel:`New`.
|
||||
#. Select the :ref:`studio/automated-actions/trigger` and, if necessary, fill in the fields that
|
||||
appear on the screen based on the chosen trigger.
|
||||
#. Click :guilabel:`Add an action`, then select the :guilabel:`Type` of
|
||||
:ref:`action <studio/automated-actions/action>` and fill in the fields that appear on the screen
|
||||
based on your selected action.
|
||||
#. Click :guilabel:`Save & Close` or :guilabel:`Save & New`.
|
||||
|
||||
.. example::
|
||||
|
||||
.. image:: automated_actions/automation-rule-ex.png
|
||||
:alt: Example of an automated action on the Subscription model
|
||||
|
||||
.. tip::
|
||||
- To modify the :doc:`model <models_modules_apps>` of the automation rule, switch models before
|
||||
clicking :guilabel:`Automations` in Studio, or :ref:`activate the developer mode
|
||||
<developer-mode>`, create or edit an automation rule, and select the :guilabel:`Model` in the
|
||||
:guilabel:`Automation Rules` form.
|
||||
- You can also create automation rules from any kanban stage by clicking the gear icon
|
||||
(:guilabel:`⚙` ) next to the kanban stage name, then selecting :guilabel:`Automations`. In this
|
||||
case, the :guilabel:`Trigger` is set to :guilabel:`Stage is set to` by default, but you can
|
||||
change it if necessary.
|
||||
|
||||
.. image:: automated_actions/automations-kanban.png
|
||||
:alt: Create automations from a kanban stage
|
||||
|
||||
.. _studio/automated-actions/trigger:
|
||||
|
||||
Trigger
|
||||
=======
|
||||
|
||||
The :guilabel:`Trigger` is used to define when the automation rule should be applied. The available
|
||||
triggers depend on the :doc:`model <models_modules_apps>`. Five trigger categories are available
|
||||
overall:
|
||||
|
||||
- :ref:`studio/automated-actions/trigger/values-updated`
|
||||
- :ref:`studio/automated-actions/trigger/email-events`
|
||||
- :ref:`studio/automated-actions/trigger/values-timing-conditions`
|
||||
- :ref:`studio/automated-actions/trigger/custom`
|
||||
- :ref:`studio/automated-actions/trigger/external`
|
||||
|
||||
.. tip::
|
||||
You can also define a :guilabel:`Before Update Domain` to specify the conditions that must be met
|
||||
*before* the automation rule is triggered. In contrast, the conditions defined using the
|
||||
:ref:`Extra Conditions <studio/automated-actions/trigger/values-timing-conditions>` and
|
||||
:ref:`Apply on <studio/automated-actions/trigger/custom>` filters are checked *during* the
|
||||
execution of the automation rule.
|
||||
|
||||
To define a :guilabel:`Before Update Domain`, :ref:`activate the developer mode
|
||||
<developer-mode>`, create or edit an automation rule, click :guilabel:`Edit Domain`, then click
|
||||
:guilabel:`New Rule`.
|
||||
|
||||
For example, if you want the automated action to happen when an email address is set on a
|
||||
contact that did not have an address before (in contrast to modifying their existing address),
|
||||
define the :guilabel:`Before Update Domain` to :guilabel:`Email is not set`, and the
|
||||
:guilabel:`Apply on` domain to :guilabel:`Email is set`.
|
||||
|
||||
.. image:: automated_actions/before-update-domain.png
|
||||
:alt: Example of a trigger with a Before Update Domain
|
||||
|
||||
.. _studio/automated-actions/trigger/values-updated:
|
||||
|
||||
Values Updated
|
||||
--------------
|
||||
|
||||
The triggers available in this category depend on the model and are based on common field changes,
|
||||
such as adding a specific tag (e.g., to a task) or setting the :guilabel:`User` field. Select the
|
||||
trigger, then select a value if required.
|
||||
|
||||
.. image:: automated_actions/values-updated-trigger.png
|
||||
:alt: Example of a Values Updated trigger
|
||||
|
||||
.. _studio/automated-actions/trigger/email-events:
|
||||
|
||||
Email Events
|
||||
------------
|
||||
|
||||
Trigger automated actions upon receiving or sending emails.
|
||||
|
||||
.. _studio/automated-actions/trigger/values-timing-conditions:
|
||||
|
||||
Timing Conditions
|
||||
-----------------
|
||||
|
||||
Trigger automated actions based on a date field. The following triggers are available:
|
||||
|
||||
- :guilabel:`Based on date field`: Select the field to be used next to the :guilabel:`Delay` field.
|
||||
- :guilabel:`After creation`: The action is triggered when a record is created and saved.
|
||||
- :guilabel:`After last update`: The action is triggered when an existing record is edited and
|
||||
saved.
|
||||
|
||||
You can then define:
|
||||
|
||||
- a :guilabel:`Delay`: Specify the number of minutes, hours, days, or months. To trigger the action
|
||||
before the trigger date, specify a negative number. If you selected the :guilabel:`Based on date
|
||||
field` trigger, you must also select the date field to be used to determine the delay.
|
||||
- :guilabel:`Extra Conditions`: Click :guilabel:`Add condition`, then specify the conditions to be
|
||||
met to trigger the automation rule. Click :guilabel:`New Rule` to add another condition.
|
||||
|
||||
The action is triggered when the delay is reached and the conditions are met.
|
||||
|
||||
.. example::
|
||||
If you want to send a reminder email 30 minutes before the start of a calendar event, select the
|
||||
:guilabel:`Start (Calendar Event)` under :guilabel:`Trigger Date` and set the :guilabel:`Delay`
|
||||
to **-30** :guilabel:`Minutes`.
|
||||
|
||||
.. image:: automated_actions/timing-conditions-trigger.png
|
||||
:alt: Example of a Based on date field trigger
|
||||
|
||||
.. note::
|
||||
By default, the scheduler checks for trigger dates every 4 hours, meaning lower granularity in
|
||||
time-based automations may not always be honored.
|
||||
|
||||
.. _studio/automated-actions/trigger/custom:
|
||||
|
||||
Custom
|
||||
------
|
||||
|
||||
Trigger automated actions:
|
||||
|
||||
- :guilabel:`On save`: When the record is saved;
|
||||
- :guilabel:`On deletion`: When a record is deleted;
|
||||
- :guilabel:`On UI change`: When a field's value is changed on the :ref:`Form view
|
||||
<studio/views/general/form>`, even before saving the record.
|
||||
|
||||
For the :guilabel:`On save` and :guilabel:`On UI change` triggers, you **must** then select the
|
||||
field(s) to be used to trigger the automation rule in the :guilabel:`When updating` field.
|
||||
|
||||
.. warning::
|
||||
If no field is selected in the :guilabel:`When updating` field, the automated action may be
|
||||
executed multiple times per record.
|
||||
|
||||
Optionally, you can also define additional conditions to be met to trigger the automation rule in
|
||||
the :guilabel:`Apply on` field.
|
||||
|
||||
.. note::
|
||||
The :guilabel:`On UI change` trigger can only be used with the
|
||||
:ref:`studio/automated-actions/action/python-code` action and only works when a modification is
|
||||
made manually. The action is not executed if the field is changed through another automation
|
||||
rule.
|
||||
|
||||
.. _studio/automated-actions/trigger/external:
|
||||
|
||||
External
|
||||
--------
|
||||
|
||||
Trigger automated actions based on an external event using a webhook. A webhook is a method of
|
||||
communication between two systems where the source system sends an HTTP(S) request to a destination
|
||||
system based on a specific event. It usually includes a data payload containing information about
|
||||
the event that occurred.
|
||||
|
||||
To configure the :guilabel:`On webhook` trigger, copy the :guilabel:`URL` generated by Odoo into the
|
||||
destination system (i.e., the system receiving the request). Then, in the :guilabel:`Target Record`
|
||||
field, enter the code to run to define the record(s) to be updated using the automation rule.
|
||||
|
||||
.. warning::
|
||||
The URL must be treated as **confidential**; sharing it online or without caution could
|
||||
potentially expose your system to malicious parties. Click the :guilabel:`Rotate Secret` button
|
||||
to change the URL's secret if necessary.
|
||||
|
||||
.. note::
|
||||
- The code defined by default in the :guilabel:`Target Record` field works for webhooks coming
|
||||
from another Odoo database. It is used to determine the record(s) to be updated using the
|
||||
information in the payload.
|
||||
- If you wish to use the webhook's content for a purpose other than to find the record(s) (e.g.,
|
||||
*create* a record), your only option is to use an :ref:`studio/automated-actions/action/python-code`
|
||||
action. In this case, the :guilabel:`Target record` field must contain any valid code, but its
|
||||
result doesn't have any effect on the automated action itself.
|
||||
- The webhook content is available in the server action context as a `payload` variable (i.e., a
|
||||
dictionary that contains the GET parameters or POST JSON body of the incoming request).
|
||||
|
||||
You can also choose to :guilabel:`Log Calls` to record the payloads received, e.g., to make sure the
|
||||
data sent by the source system matches the expected format and content. This also helps identify
|
||||
and diagnose any issues that may arise. To access the logs, click the :guilabel:`Logs` smart
|
||||
button at the top of the :guilabel:`Automation rules` form.
|
||||
|
||||
.. _studio/automated-actions/action:
|
||||
|
||||
Actions
|
||||
=======
|
||||
|
||||
Once you have defined the automation rule's :ref:`trigger <studio/automated-actions/trigger>`, click
|
||||
:guilabel:`Add an action` to define the action to be executed.
|
||||
|
||||
.. tip::
|
||||
You can define multiple actions for the same trigger/automation rule. The actions are executed
|
||||
in the order they are defined. This means, for example, that if you define an
|
||||
:guilabel:`Update record` action and then a :guilabel:`Send email` action, the email uses the
|
||||
updated values. However, if the :guilabel:`Send email` action is defined before the
|
||||
:guilabel:`Update record` action, the email uses the values set *before* the update action is
|
||||
run.
|
||||
|
||||
.. _studio/automated-actions/action/update-record:
|
||||
|
||||
Update Record
|
||||
-------------
|
||||
|
||||
This action allows to update one of the record's (related) fields. Click the :guilabel:`Update`
|
||||
field and, in the list that opens, select or search for the field to be updated; click the right
|
||||
arrow next to the field name to access the list of related fields if needed.
|
||||
|
||||
If you selected a :ref:`many2many field <studio/fields/relational-fields/many2many>`, choose whether
|
||||
the field must be updated by :guilabel:`Adding`, :guilabel:`Removing`, or :guilabel:`Setting it to`
|
||||
the selected value or by :guilabel:`Clearing it`.
|
||||
|
||||
.. example::
|
||||
If you want the automated action to remove a tag from the customer record, set the
|
||||
:guilabel:`Update` field to :guilabel:`Customer > Tags`, select :guilabel:`By Removing`, then
|
||||
select the tag.
|
||||
|
||||
.. image:: automated_actions/update-record-action.png
|
||||
:alt: Example of an Update Record action
|
||||
|
||||
.. tip::
|
||||
Alternatively, you can also set a record's field dynamically using Python code. To do so, select
|
||||
:guilabel:`Compute` instead of :guilabel:`Update`, then enter the code to be used for computing
|
||||
the field's value. For example, if you want the automation rule to compute a custom
|
||||
:ref:`datetime field <studio/fields/simple-fields/date-time>` when a task's priority is set to
|
||||
`High` (by starring the task), you can define the trigger :guilabel:`Priority is set to` to
|
||||
`High` and define the :guilabel:`Update Record` action as follows:
|
||||
|
||||
.. image:: automated_actions/update-record-compute.png
|
||||
:alt: Compute a custom datetime field using a Python expression
|
||||
|
||||
Create Activity
|
||||
---------------
|
||||
|
||||
This action is used to schedule a new activity linked to the record. Select an :guilabel:`Activity
|
||||
Type`, enter a :guilabel:`Title` and description, then specify when you want the activity to be
|
||||
scheduled in the :guilabel:`Due Date In` field, and select a :guilabel:`User type`:
|
||||
|
||||
- To always assign the activity to the same user, select :guilabel:`Specific User` and add the user
|
||||
in the :guilabel:`Responsible` field;
|
||||
- To target a user linked to the record dynamically, select :guilabel:`Dynamic User (based on
|
||||
record)` and change the :guilabel:`User Field` if necessary.
|
||||
|
||||
.. example::
|
||||
After a lead is turned into an opportunity, you want the automated action to set up a call for
|
||||
the user responsible for the lead. To do so, set the :guilabel:`Activity Type` to
|
||||
:guilabel:`Call` and the :guilabel:`User Type` to :guilabel:`Dynamic User (based on record)`.
|
||||
|
||||
.. image:: automated_actions/create-activity-action.png
|
||||
:alt: Example of a Create Activity action
|
||||
|
||||
Send Email and Send SMS
|
||||
-----------------------
|
||||
|
||||
These actions are used to send an email or a text message to a contact linked to a specific record.
|
||||
To do so, select or create an :guilabel:`Email Template` or an :guilabel:`SMS Template`, then, in
|
||||
the :guilabel:`Send Email As` or :guilabel:`Send SMS As` field, choose how you want to send the
|
||||
email or text message:
|
||||
|
||||
- :guilabel:`Email`: to send the message as an email to the recipients of the :guilabel:`Email
|
||||
Template`.
|
||||
- :guilabel:`Message`: to post the message on the record and notify the record's followers.
|
||||
- :guilabel:`Note`: to send the message as an internal note visible to internal users in the
|
||||
chatter.
|
||||
- :guilabel:`SMS (without note)`: to send the message as a text message to the recipients of the
|
||||
:guilabel:`SMS template`.
|
||||
- :guilabel:`SMS (with note)`: to send the message as a text message to the recipients of the
|
||||
:guilabel:`SMS template` and post it as an internal note in the chatter.
|
||||
- :guilabel:`Note only`: to only post the message as an internal note in the chatter.
|
||||
|
||||
.. _studio/automated-actions/action/send-whatsapp:
|
||||
|
||||
Send WhatsApp
|
||||
-------------
|
||||
|
||||
.. important::
|
||||
To automate the sending of WhatsApp messages, one or more
|
||||
:ref:`WhatsApp templates <productivity/whatsapp/templates>` must be created.
|
||||
|
||||
This action is used to send a WhatsApp message to a contact linked to a specific record.
|
||||
To do so, select the appropriate :guilabel:`WhatsApp Template` from the drop-down menu.
|
||||
|
||||
.. _studio/automated-actions/action/add-followers:
|
||||
|
||||
Add Followers and Remove Followers
|
||||
----------------------------------
|
||||
|
||||
Use these actions to (un)subscribe existing contacts to/from the record.
|
||||
|
||||
Create Record
|
||||
-------------
|
||||
|
||||
This action is used to create a new record on any model.
|
||||
|
||||
Select the required model in the :guilabel:`Record to Create` field; it contains the current model
|
||||
by default. Specify a :guilabel:`Name` for the record, and then, if you want to create the record on
|
||||
another model, select a field in the :guilabel:`Link Field` field to link the record that
|
||||
triggered the creation of the new record.
|
||||
|
||||
.. note::
|
||||
The dropdown list related to the :guilabel:`Link Field` field only contains :ref:`one2many fields
|
||||
<studio/fields/relational-fields/one2many>` existing on the current model that are linked to a
|
||||
:ref:`many2one field <studio/fields/relational-fields/many2one>` on the target model.
|
||||
|
||||
.. tip::
|
||||
You can create another automation rule with :ref:`studio/automated-actions/action/update-record`
|
||||
actions to update the fields of the new record if necessary. For example, you can use a
|
||||
:guilabel:`Create Record` action to create a new project task and then assign it to a specific
|
||||
user using an :guilabel:`Update Record` action.
|
||||
|
||||
.. _studio/automated-actions/action/python-code:
|
||||
|
||||
Execute Code
|
||||
------------
|
||||
|
||||
This action is used to execute Python code. You can write your code into the :guilabel:`Code` tab
|
||||
using the following variables:
|
||||
|
||||
- `env`: environment on which the action is triggered
|
||||
- `model`: model of the record on which the action is triggered; is a void recordset
|
||||
- `record`: record on which the action is triggered; may be void
|
||||
- `records`: recordset of all records on which the action is triggered in multi-mode; this may be
|
||||
left empty
|
||||
- `time`, `datetime`, `dateutil`, `timezone`: useful Python libraries
|
||||
- `float_compare`: utility function to compare floats based on specific precision
|
||||
- `log(message, level='info')`: logging function to record debug information in ir.logging
|
||||
table
|
||||
- `_logger.info(message)`: logger to emit messages in server logs
|
||||
- `UserError`: exception class for raising user-facing warning messages
|
||||
- `Command`: x2many commands namespace
|
||||
- `action = {...}`: to return an action
|
||||
|
||||
.. tip::
|
||||
The available variables are described both in the :guilabel:`Code` and :guilabel:`Help` tabs.
|
||||
|
||||
Send Webhook Notification
|
||||
-------------------------
|
||||
|
||||
This action allows to send a POST request with the values of the :guilabel:`Fields` to the URL
|
||||
specified in the :guilabel:`URL` field.
|
||||
|
||||
The :guilabel:`Sample Payload` provides a preview of the data included in the request using a random
|
||||
record's data or dummy data if no record is available.
|
||||
|
||||
.. _studio/automated-actions/action/several-actions:
|
||||
|
||||
Execute Existing Actions
|
||||
------------------------
|
||||
|
||||
The action is used to trigger multiple actions (linked to the current model) at the same time. To do
|
||||
so, click on :guilabel:`Add a line`, then, in the :guilabel:`Add: Child Actions` pop-up, select an
|
||||
existing action or click :guilabel:`New` to create a new one.
|
||||
@@ -0,0 +1,536 @@
|
||||
# Fields and widgets
|
||||
|
||||
Fields structure the models of a database. If you picture a model as a table or spreadsheet, fields
|
||||
are the columns where data is stored in the records (i.e., the rows). Fields also define the type of
|
||||
data that is stored within them. How the data is presented and formatted on the {abbr}`UI (User
|
||||
Interface)` is defined by their widget.
|
||||
|
||||
From a technical point of view, there are 15 field types in Odoo. However, you can choose from 20
|
||||
fields in Studio, as some field types are available more than once with a different default widget.
|
||||
|
||||
:::{tip}
|
||||
{guilabel}`New Fields` can only be added to the {ref}`studio/views/general/form` and
|
||||
{ref}`studio/views/multiple-records/list` views. On other views, you can only add
|
||||
{guilabel}`Existing Fields` {dfn}`(fields already on the model)`.
|
||||
:::
|
||||
|
||||
(studio-fields-simple-fields)=
|
||||
|
||||
## Simple fields
|
||||
|
||||
Simple fields contain basic values, such as text, numbers, files, etc.
|
||||
|
||||
:::{note}
|
||||
Non-default widgets, when available, are presented as bullet points below.
|
||||
:::
|
||||
|
||||
(studio-fields-simple-fields-text)=
|
||||
|
||||
### Text (`char`)
|
||||
|
||||
The {guilabel}`Text` field is used for short text containing any character. One text line is
|
||||
displayed when filling out the field.
|
||||
|
||||
- {guilabel}`Badge`: displays the value inside a rounded shape, similar to a tag. The value cannot
|
||||
be edited on the UI, but a default value can be set.
|
||||
|
||||
- {guilabel}`Copy to Clipboard`: users can copy the value by clicking a button.
|
||||
|
||||
- {guilabel}`E-mail`: the value becomes a clickable *mailto* link.
|
||||
|
||||
- {guilabel}`Image`: displays an image using a URL. The value cannot be edited manually, but a
|
||||
default value can be set.
|
||||
|
||||
:::{note}
|
||||
This works differently than selecting the {ref}`Image field
|
||||
<studio/fields/simple-fields/image>` directly, as the image is not stored in Odoo when using a
|
||||
{guilabel}`Text` field with the {guilabel}`Image` widget. For example, it can be useful if you
|
||||
want to save disk space.
|
||||
:::
|
||||
|
||||
- {guilabel}`Phone`: the value becomes a clickable *tel* link.
|
||||
|
||||
:::{tip}
|
||||
Tick {guilabel}`Enable SMS` to add an option to send an SMS directly from Odoo next to the
|
||||
field.
|
||||
:::
|
||||
|
||||
- {guilabel}`URL`: the value becomes a clickable URL.
|
||||
|
||||
```{eval-rst}
|
||||
.. example::
|
||||
|
||||
.. image:: fields/text-examples.png
|
||||
:align: center
|
||||
:alt: Examples of Text fields with different widgets
|
||||
```
|
||||
|
||||
(studio-fields-simple-fields-multiline-text)=
|
||||
|
||||
### Multiline Text (`text`)
|
||||
|
||||
The {guilabel}`Multiline Text` field is used for longer text containing any type of character. Two
|
||||
text lines are displayed on the UI when filling out the field.
|
||||
|
||||
- {guilabel}`Copy to Clipboard`: users can copy the value by clicking a button.
|
||||
|
||||
```{eval-rst}
|
||||
.. example::
|
||||
|
||||
.. image:: fields/multiline-text-examples.png
|
||||
:align: center
|
||||
:alt: Examples of Multiline Text fields with different widgets
|
||||
```
|
||||
|
||||
(studio-fields-simple-fields-integer)=
|
||||
|
||||
### Integer (`integer`)
|
||||
|
||||
The {guilabel}`Integer` field is used for all integer numbers ({dfn}`positive, negative, or zero,
|
||||
without a decimal`).
|
||||
|
||||
- {guilabel}`Percentage Pie`: displays the value inside a percentage circle, usually for a computed
|
||||
value. The value cannot be edited on the UI, but a default value can be set.
|
||||
- {guilabel}`Progress Bar`: displays the value next to a percentage bar, usually for a computed
|
||||
value. The field cannot be edited manually, but a default value can be set.
|
||||
- {guilabel}`Handle`: displays a drag handle icon to order records manually in {ref}`List view
|
||||
<studio/views/multiple-records/list>`.
|
||||
|
||||
```{eval-rst}
|
||||
.. example::
|
||||
|
||||
.. image:: fields/integer-examples.png
|
||||
:align: center
|
||||
:alt: Examples of Integer fields with different widgets
|
||||
```
|
||||
|
||||
(studio-fields-simple-fields-decimal)=
|
||||
|
||||
### Decimal (`float`)
|
||||
|
||||
The {guilabel}`Decimal` field is used for all decimal numbers ({dfn}`positive, negative, or zero,
|
||||
with a decimal`).
|
||||
|
||||
:::{note}
|
||||
Decimal numbers are displayed with two decimals after the decimal point on the UI, but they are
|
||||
stored in the database with more precision.
|
||||
:::
|
||||
|
||||
- {guilabel}`Monetary`: it is similar to using the {ref}`Monetary field
|
||||
<studio/fields/simple-fields/monetary>`. It is recommended to use the later as it offers more
|
||||
functionalities.
|
||||
- {guilabel}`Percentage`: displays a percent character `%` after the value.
|
||||
- {guilabel}`Percentage Pie`: displays the value inside a percentage circle, usually for a computed
|
||||
value. The field cannot be edited manually, but a default value can be set.
|
||||
- {guilabel}`Progress Bar`: displays the value next to a percentage bar, usually for a computed
|
||||
value. The field cannot be edited manually, but a default value can be set.
|
||||
- {guilabel}`Time`: the value must follow the *hh:mm* format, with a maximum of 59 minutes.
|
||||
|
||||
```{eval-rst}
|
||||
.. example::
|
||||
|
||||
.. image:: fields/decimal-examples.png
|
||||
:align: center
|
||||
:alt: Examples of Decimal fields with different widgets
|
||||
```
|
||||
|
||||
(studio-fields-simple-fields-monetary)=
|
||||
|
||||
### Monetary (`monetary`)
|
||||
|
||||
The {guilabel}`Monetary` field is used for all monetary values.
|
||||
|
||||
:::{note}
|
||||
When you first add a {guilabel}`Monetary` field, you are prompted to add a {guilabel}`Currency`
|
||||
field if none exists already on the model. Odoo offers to add the {guilabel}`Currency` field for
|
||||
you. Once it is added, add the {guilabel}`Monetary` field again.
|
||||
:::
|
||||
|
||||
```{eval-rst}
|
||||
.. example::
|
||||
|
||||
.. image:: fields/monetary-example.png
|
||||
:align: center
|
||||
:alt: Example of a Monetary field along with its Currency field
|
||||
```
|
||||
|
||||
(studio-fields-simple-fields-html)=
|
||||
|
||||
### Html (`html`)
|
||||
|
||||
The {guilabel}`Html` field is used to add text that can be edited using the Odoo HTML editor.
|
||||
|
||||
- {guilabel}`Multiline Text`: disables the Odoo HTML editor to allow editing raw HTML.
|
||||
|
||||
```{eval-rst}
|
||||
.. example::
|
||||
|
||||
.. image:: fields/html-example.png
|
||||
:align: center
|
||||
:alt: Examples of Html fields with different widgets
|
||||
```
|
||||
|
||||
(studio-fields-simple-fields-date)=
|
||||
|
||||
### Date (`date`)
|
||||
|
||||
The {guilabel}`Date` field is used to select a date on a calendar.
|
||||
|
||||
- {guilabel}`Remaining Days`: the remaining number of days before the selected date is displayed
|
||||
(e.g., *In 5 days*), based on the current date.
|
||||
|
||||
```{eval-rst}
|
||||
.. example::
|
||||
|
||||
.. image:: fields/date-examples.png
|
||||
:align: center
|
||||
:alt: Examples of Date fields with different widgets
|
||||
```
|
||||
|
||||
(studio-fields-simple-fields-date-time)=
|
||||
|
||||
### Date & Time (`datetime`)
|
||||
|
||||
The {guilabel}`Date & Time` field is used to select a date on a calendar and a time on a clock. The
|
||||
user's current time is automatically used if no time is set.
|
||||
|
||||
- {guilabel}`Date`: used to record the time without displaying it on the UI.
|
||||
- {guilabel}`Remaining days`: displays the remaining number of days before the selected date (e.g.,
|
||||
*In 5 days*), based on the current date and time.
|
||||
|
||||
```{eval-rst}
|
||||
.. example::
|
||||
|
||||
.. image:: fields/date-time-examples.png
|
||||
:align: center
|
||||
:alt: Examples of Date & Time fields with different widgets
|
||||
```
|
||||
|
||||
(studio-fields-simple-fields-checkbox)=
|
||||
|
||||
### Checkbox (`boolean`)
|
||||
|
||||
The {guilabel}`Checkbox` field is used when a value should only be true or false, indicated by
|
||||
checking or unchecking a checkbox.
|
||||
|
||||
- {guilabel}`Button`: displays a radio button. The widget works without switching to the edit mode.
|
||||
- {guilabel}`Toggle`: displays a toggle button. The widget works without switching to the edit mode.
|
||||
|
||||
```{eval-rst}
|
||||
.. example::
|
||||
|
||||
.. image:: fields/checkbox-examples.png
|
||||
:align: center
|
||||
:alt: Examples of Checkbox fields with different widgets
|
||||
```
|
||||
|
||||
(studio-fields-simple-fields-selection)=
|
||||
|
||||
### Selection (`selection`)
|
||||
|
||||
The {guilabel}`Selection` field is used when users should select a single value from a group of
|
||||
predefined values.
|
||||
|
||||
- {guilabel}`Badge`: displays the value inside a rounded shape, similar to a tag. The value cannot
|
||||
be edited on the UI, but a default value can be set.
|
||||
|
||||
- {guilabel}`Badges`: displays all selectable values simultaneously inside rectangular shapes,
|
||||
organized horizontally.
|
||||
|
||||
- {guilabel}`Priority`: displays star symbols instead of values, which can be used to indicate an
|
||||
importance or satisfaction level, for example. This has the same effect as selecting the
|
||||
{ref}`Priority field <studio/fields/simple-fields/priority>`, although, for the latter, four
|
||||
priority values are already predefined.
|
||||
|
||||
- {guilabel}`Radio`: displays all selectable values at the same time as radio buttons.
|
||||
|
||||
:::{tip}
|
||||
By default, radio buttons are organized vertically. Tick {guilabel}`display horizontally` to
|
||||
switch the way they are displayed.
|
||||
:::
|
||||
|
||||
```{eval-rst}
|
||||
.. example::
|
||||
|
||||
.. image:: fields/selection-examples.png
|
||||
:align: center
|
||||
:alt: Examples of Selection fields with different widgets
|
||||
```
|
||||
|
||||
(studio-fields-simple-fields-priority)=
|
||||
|
||||
### Priority (`selection`)
|
||||
|
||||
The {guilabel}`Priority` field is used to display a three-star rating system, which can be used to
|
||||
indicate importance or satisfaction level. This field type is a {ref}`Selection field
|
||||
<studio/fields/simple-fields/selection>` with the {guilabel}`Priority` widget selected by default
|
||||
and four priority values predefined. Consequently, the {guilabel}`Badge`, {guilabel}`Badges`,
|
||||
{guilabel}`Radio`, and {guilabel}`Selection` widgets have the same effects as described under
|
||||
{ref}`Selection <studio/fields/simple-fields/selection>`.
|
||||
|
||||
:::{tip}
|
||||
To change the number of available stars by adding or removing values, click {guilabel}`Edit
|
||||
Values`. Note that the first value is equal to 0 stars (i.e., when no selection is made), so
|
||||
having four values results in a three-star rating system, for example.
|
||||
:::
|
||||
|
||||
```{eval-rst}
|
||||
.. example::
|
||||
|
||||
.. image:: fields/priority-example.png
|
||||
:align: center
|
||||
:alt: Example of a Priority field
|
||||
```
|
||||
|
||||
(studio-fields-simple-fields-file)=
|
||||
|
||||
### File (`binary`)
|
||||
|
||||
The {guilabel}`File` field is used to upload any type of file, or sign a form ({guilabel}`Sign`
|
||||
widget).
|
||||
|
||||
- {guilabel}`Image`: users can upload an image file, which is then displayed in {ref}`Form view
|
||||
<studio/views/general/form>`. This has the same effect as using the {ref}`Image field
|
||||
<studio/fields/simple-fields/image>`.
|
||||
- {guilabel}`PDF Viewer`: users can upload a PDF file, which can be then browsed from the
|
||||
{ref}`Form view <studio/views/general/form>`.
|
||||
- {guilabel}`Sign`: users can electronically sign the form. This has the same effect as selecting
|
||||
the {ref}`Sign field <studio/fields/simple-fields/sign>`.
|
||||
|
||||
```{eval-rst}
|
||||
.. example::
|
||||
|
||||
.. image:: fields/file-examples.png
|
||||
:align: center
|
||||
:alt: Examples of File fields with different widgets
|
||||
```
|
||||
|
||||
(studio-fields-simple-fields-image)=
|
||||
|
||||
### Image (`binary`)
|
||||
|
||||
The {guilabel}`Image` field is used to upload an image and display it in {ref}`Form view
|
||||
<studio/views/general/form>`. This field type is a {ref}`File field
|
||||
<studio/fields/simple-fields/file>` with the {guilabel}`Image` widget selected by default.
|
||||
Consequently, the {guilabel}`File`, {guilabel}`PDF Viewer`, and {guilabel}`Sign` widgets have the
|
||||
same effects as described under {ref}`File <studio/fields/simple-fields/file>`.
|
||||
|
||||
:::{tip}
|
||||
To change the display size of uploaded images, select {guilabel}`Small`, {guilabel}`Medium`, or
|
||||
{guilabel}`Large` under the {guilabel}`Size` option.
|
||||
:::
|
||||
|
||||
(studio-fields-simple-fields-sign)=
|
||||
|
||||
### Sign (`binary`)
|
||||
|
||||
The {guilabel}`Sign` field is used to sign the form electronically. This field type is a {ref}`File
|
||||
field <studio/fields/simple-fields/file>` with the {guilabel}`Sign` widget selected by default.
|
||||
Consequently, the {guilabel}`File`, {guilabel}`Image`, and {guilabel}`PDF Viewer` widgets have the
|
||||
same effects as described under {ref}`File <studio/fields/simple-fields/file>`.
|
||||
|
||||
:::{tip}
|
||||
To give users the {guilabel}`Auto` option when having to draw their signature, select one of the
|
||||
available {guilabel}`Auto-complete with` fields ({ref}`Text <studio/fields/simple-fields/text>`,
|
||||
{ref}`Many2One <studio/fields/relational-fields/many2one>`, and {ref}`Related Field
|
||||
<studio/fields/relational-fields/related-field>` on the model only). The signature is
|
||||
automatically generated using the data from the selected field.
|
||||
:::
|
||||
|
||||
(studio-fields-relational-fields)=
|
||||
|
||||
## Relational fields
|
||||
|
||||
Relational fields are used to link and display the data from records on another model.
|
||||
|
||||
:::{note}
|
||||
Non-default widgets, when available, are presented as bullet points below.
|
||||
:::
|
||||
|
||||
(studio-fields-relational-fields-many2one)=
|
||||
|
||||
### Many2One (`many2one`)
|
||||
|
||||
The {guilabel}`Many2One` field is used to link another record (from another model) to the record
|
||||
being edited. The record's name from the other model is then displayed on the record being edited.
|
||||
|
||||
```{eval-rst}
|
||||
.. example::
|
||||
On the *Sales Order* model, the :guilabel:`Customer` field is a :guilabel:`Many2One` field
|
||||
pointing at the *Contact* model. This allows **many** sales orders to be linked to **one**
|
||||
contact (customer).
|
||||
|
||||
.. image:: fields/many2one-diagram.png
|
||||
:align: center
|
||||
:alt: Diagram showing a many2one relationship
|
||||
```
|
||||
|
||||
:::{tip}
|
||||
- To prevent users from creating a new record in the linked model, tick {guilabel}`Disable
|
||||
creation`.
|
||||
- To prevent users from opening records in a pop-up window, tick {guilabel}`Disable opening`.
|
||||
- To help users only select the right record, click on {guilabel}`Domain` to create a filter.
|
||||
:::
|
||||
|
||||
- {guilabel}`Badge`: displays the value inside a rounded shape, similar to a tag. The value cannot
|
||||
be edited on the UI.
|
||||
- {guilabel}`Radio`: displays all selectable values at the same time as radio buttons.
|
||||
|
||||
(studio-fields-relational-fields-one2many)=
|
||||
|
||||
### One2Many (`one2many`)
|
||||
|
||||
The {guilabel}`One2Many` field is used to display the existing relations between a record on the
|
||||
current model and multiple records from another model.
|
||||
|
||||
```{eval-rst}
|
||||
.. example::
|
||||
You could add a :guilabel:`One2Many` field on the *Contact* model to look at **one** customer's
|
||||
**many** sales orders.
|
||||
|
||||
.. image:: fields/one2many-diagram.png
|
||||
:align: center
|
||||
:alt: Diagram showing a one2many relationship
|
||||
```
|
||||
|
||||
:::{note}
|
||||
To use a {guilabel}`One2Many` field, the two models must have been linked already using a
|
||||
{ref}`Many2One field <studio/fields/relational-fields/many2one>`. One2Many relations do not exist
|
||||
independently: a reverse-search of existing Many2One relations is performed.
|
||||
:::
|
||||
|
||||
(studio-fields-relational-fields-lines)=
|
||||
|
||||
### Lines (`one2many`)
|
||||
|
||||
The {guilabel}`Lines` field is used to create a table with rows and columns (e.g., the lines of
|
||||
products on a sales order).
|
||||
|
||||
:::{tip}
|
||||
To modify the columns, click on the {guilabel}`Lines` field and then {guilabel}`Edit List View`.
|
||||
To edit the form that pops up when a user clicks on {guilabel}`Add a line`, click on
|
||||
{guilabel}`Edit Form View` instead.
|
||||
:::
|
||||
|
||||
```{eval-rst}
|
||||
.. example::
|
||||
|
||||
.. image:: fields/lines-example.png
|
||||
:align: center
|
||||
:alt: Example of a Lines field
|
||||
```
|
||||
|
||||
(studio-fields-relational-fields-many2many)=
|
||||
|
||||
### Many2Many (`many2many`)
|
||||
|
||||
The {guilabel}`Many2Many` field is used to link multiple records from another model to multiple
|
||||
records on the current model. Many2Many fields can use {guilabel}`Disable creation`,
|
||||
{guilabel}`Disable opening`, {guilabel}`Domain`, just like {ref}`Many2One fields
|
||||
<studio/fields/relational-fields/many2one>`.
|
||||
|
||||
```{eval-rst}
|
||||
.. example::
|
||||
On the *Task* model, the :guilabel:`Assignees` field is a :guilabel:`Many2Many` field pointing at
|
||||
the *Contact* model. This allows a single user to be assigned to **many** tasks and **many**
|
||||
users to be assigned to a single task.
|
||||
|
||||
.. image:: fields/many2many-diagram.png
|
||||
:align: center
|
||||
:alt: Diagram showing many2many relationships
|
||||
```
|
||||
|
||||
- {guilabel}`Checkboxes`: users can select several values using checkboxes.
|
||||
- {guilabel}`Tags`: users can select several values appearing in rounded shapes, also known as
|
||||
*tags*. This has the same effect as selecting the {ref}`Tags field
|
||||
<studio/fields/relational-fields/tags>`.
|
||||
|
||||
(studio-fields-relational-fields-tags)=
|
||||
|
||||
### Tags (`many2many`)
|
||||
|
||||
The {guilabel}`Tags` field is used to display several values from another model appearing in rounded
|
||||
shapes, also known as *tags*. This field type is a {ref}`Many2Many field
|
||||
<studio/fields/relational-fields/many2many>` with the {guilabel}`Tags` widget selected by default.
|
||||
Consequently, the {guilabel}`Checkboxes` and {guilabel}`Many2Many` widgets have the same effects as
|
||||
described under {ref}`Many2Many <studio/fields/relational-fields/many2many>`.
|
||||
|
||||
:::{tip}
|
||||
To display tags with different background colors, tick {guilabel}`Use colors`.
|
||||
:::
|
||||
|
||||
```{eval-rst}
|
||||
.. example::
|
||||
|
||||
.. image:: fields/tags-example.png
|
||||
:align: center
|
||||
:alt: Example of a Tags field
|
||||
```
|
||||
|
||||
(studio-fields-relational-fields-related-field)=
|
||||
|
||||
### Related Field (`related`)
|
||||
|
||||
A {guilabel}`Related Field` is not a relational field per se; no relationship is created between
|
||||
models. It uses an existing relationship to fetch and display information from another record.
|
||||
|
||||
```{eval-rst}
|
||||
.. example::
|
||||
To display the email address of a customer on the *Sales Order* model, use the :guilabel:`Related
|
||||
Field` `partner_id.email` by selecting :guilabel:`Customer` and then :guilabel:`Email`.
|
||||
```
|
||||
|
||||
(studio-fields-properties)=
|
||||
|
||||
## Properties
|
||||
|
||||
- {guilabel}`Invisible`: When it is not necessary for users to view a field on the UI, tick
|
||||
{guilabel}`Invisible`. It helps clear the UI by only showing the essential fields depending on a
|
||||
specific situation.
|
||||
|
||||
```{eval-rst}
|
||||
.. example::
|
||||
On the *Form* view of the *Contact* model, the :guilabel:`Title` field only appears when
|
||||
:guilabel:`Individual` is selected, as that field would not be helpful for a
|
||||
:guilabel:`Company` contact.
|
||||
```
|
||||
|
||||
:::{note}
|
||||
The {guilabel}`Invisible` attribute also applies to Studio. To view hidden fields inside
|
||||
Studio, click on a view's {guilabel}`View` tab and tick {guilabel}`Show Invisible
|
||||
Elements`.
|
||||
:::
|
||||
|
||||
- {guilabel}`Required`: If a field should always be completed by the user before being able to
|
||||
proceed, tick {guilabel}`Required`.
|
||||
|
||||
- {guilabel}`Read only`: If users should not be able to modify a field, tick {guilabel}`Read only`.
|
||||
|
||||
:::{note}
|
||||
You can choose to apply these three properties only for specific records by clicking on
|
||||
{guilabel}`Conditional` and creating a filter.
|
||||
:::
|
||||
|
||||
- {guilabel}`Label`: The {guilabel}`Label` is the field's name on the UI.
|
||||
|
||||
:::{note}
|
||||
This is not the same name as used in the PostgreSQL database. To view and change the latter,
|
||||
activate the {ref}`Developer mode <developer-mode>`, and edit the {guilabel}`Technical Name`.
|
||||
:::
|
||||
|
||||
- {guilabel}`Help Tooltip`: To explain the purpose of a field, write a description under
|
||||
{guilabel}`Help Tooltip`. It is displayed inside a tooltip box when hovering with your mouse over
|
||||
the field's label.
|
||||
|
||||
- {guilabel}`Placeholder`: To provide an example of how a field should be completed, write it under
|
||||
{guilabel}`Placeholder`. It is displayed in light gray in lieu of the field's value.
|
||||
|
||||
- {guilabel}`Widget`: To change the default appearance or functionality of a field, select one of
|
||||
the available widgets.
|
||||
|
||||
- {guilabel}`Default value`: To add a default value to a field when a record is created, use
|
||||
{guilabel}`Default value`.
|
||||
|
||||
- {guilabel}`Limit visibility to groups`: To limit which users can see the field, select a user
|
||||
access group.
|
||||
|
||||
@@ -1,493 +0,0 @@
|
||||
==================
|
||||
Fields and widgets
|
||||
==================
|
||||
|
||||
Fields structure the models of a database. If you picture a model as a table or spreadsheet, fields
|
||||
are the columns where data is stored in the records (i.e., the rows). Fields also define the type of
|
||||
data that is stored within them. How the data is presented and formatted on the :abbr:`UI (User
|
||||
Interface)` is defined by their widget.
|
||||
|
||||
From a technical point of view, there are 15 field types in Odoo. However, you can choose from 20
|
||||
fields in Studio, as some field types are available more than once with a different default widget.
|
||||
|
||||
.. tip::
|
||||
:guilabel:`New Fields` can only be added to the :ref:`studio/views/general/form` and
|
||||
:ref:`studio/views/multiple-records/list` views. On other views, you can only add
|
||||
:guilabel:`Existing Fields` :dfn:`(fields already on the model)`.
|
||||
|
||||
.. _studio/fields/simple-fields:
|
||||
|
||||
Simple fields
|
||||
=============
|
||||
|
||||
Simple fields contain basic values, such as text, numbers, files, etc.
|
||||
|
||||
.. note::
|
||||
Non-default widgets, when available, are presented as bullet points below.
|
||||
|
||||
.. _studio/fields/simple-fields/text:
|
||||
|
||||
Text (`char`)
|
||||
-------------
|
||||
|
||||
The :guilabel:`Text` field is used for short text containing any character. One text line is
|
||||
displayed when filling out the field.
|
||||
|
||||
- :guilabel:`Badge`: displays the value inside a rounded shape, similar to a tag. The value cannot
|
||||
be edited on the UI, but a default value can be set.
|
||||
- :guilabel:`Copy to Clipboard`: users can copy the value by clicking a button.
|
||||
- :guilabel:`E-mail`: the value becomes a clickable *mailto* link.
|
||||
- :guilabel:`Image`: displays an image using a URL. The value cannot be edited manually, but a
|
||||
default value can be set.
|
||||
|
||||
.. note::
|
||||
This works differently than selecting the :ref:`Image field
|
||||
<studio/fields/simple-fields/image>` directly, as the image is not stored in Odoo when using a
|
||||
:guilabel:`Text` field with the :guilabel:`Image` widget. For example, it can be useful if you
|
||||
want to save disk space.
|
||||
|
||||
- :guilabel:`Phone`: the value becomes a clickable *tel* link.
|
||||
|
||||
.. tip::
|
||||
Tick :guilabel:`Enable SMS` to add an option to send an SMS directly from Odoo next to the
|
||||
field.
|
||||
|
||||
- :guilabel:`URL`: the value becomes a clickable URL.
|
||||
|
||||
.. example::
|
||||
|
||||
.. image:: fields/text-examples.png
|
||||
:align: center
|
||||
:alt: Examples of Text fields with different widgets
|
||||
|
||||
.. _studio/fields/simple-fields/multiline-text:
|
||||
|
||||
Multiline Text (`text`)
|
||||
-----------------------
|
||||
|
||||
The :guilabel:`Multiline Text` field is used for longer text containing any type of character. Two
|
||||
text lines are displayed on the UI when filling out the field.
|
||||
|
||||
- :guilabel:`Copy to Clipboard`: users can copy the value by clicking a button.
|
||||
|
||||
.. example::
|
||||
|
||||
.. image:: fields/multiline-text-examples.png
|
||||
:align: center
|
||||
:alt: Examples of Multiline Text fields with different widgets
|
||||
|
||||
.. _studio/fields/simple-fields/integer:
|
||||
|
||||
Integer (`integer`)
|
||||
-------------------
|
||||
|
||||
The :guilabel:`Integer` field is used for all integer numbers (:dfn:`positive, negative, or zero,
|
||||
without a decimal`).
|
||||
|
||||
- :guilabel:`Percentage Pie`: displays the value inside a percentage circle, usually for a computed
|
||||
value. The value cannot be edited on the UI, but a default value can be set.
|
||||
- :guilabel:`Progress Bar`: displays the value next to a percentage bar, usually for a computed
|
||||
value. The field cannot be edited manually, but a default value can be set.
|
||||
- :guilabel:`Handle`: displays a drag handle icon to order records manually in :ref:`List view
|
||||
<studio/views/multiple-records/list>`.
|
||||
|
||||
.. example::
|
||||
|
||||
.. image:: fields/integer-examples.png
|
||||
:align: center
|
||||
:alt: Examples of Integer fields with different widgets
|
||||
|
||||
.. _studio/fields/simple-fields/decimal:
|
||||
|
||||
Decimal (`float`)
|
||||
-----------------
|
||||
|
||||
The :guilabel:`Decimal` field is used for all decimal numbers (:dfn:`positive, negative, or zero,
|
||||
with a decimal`).
|
||||
|
||||
.. note::
|
||||
Decimal numbers are displayed with two decimals after the decimal point on the UI, but they are
|
||||
stored in the database with more precision.
|
||||
|
||||
- :guilabel:`Monetary`: it is similar to using the :ref:`Monetary field
|
||||
<studio/fields/simple-fields/monetary>`. It is recommended to use the later as it offers more
|
||||
functionalities.
|
||||
- :guilabel:`Percentage`: displays a percent character `%` after the value.
|
||||
- :guilabel:`Percentage Pie`: displays the value inside a percentage circle, usually for a computed
|
||||
value. The field cannot be edited manually, but a default value can be set.
|
||||
- :guilabel:`Progress Bar`: displays the value next to a percentage bar, usually for a computed
|
||||
value. The field cannot be edited manually, but a default value can be set.
|
||||
- :guilabel:`Time`: the value must follow the *hh:mm* format, with a maximum of 59 minutes.
|
||||
|
||||
.. example::
|
||||
|
||||
.. image:: fields/decimal-examples.png
|
||||
:align: center
|
||||
:alt: Examples of Decimal fields with different widgets
|
||||
|
||||
.. _studio/fields/simple-fields/monetary:
|
||||
|
||||
Monetary (`monetary`)
|
||||
---------------------
|
||||
|
||||
The :guilabel:`Monetary` field is used for all monetary values.
|
||||
|
||||
.. note::
|
||||
When you first add a :guilabel:`Monetary` field, you are prompted to add a :guilabel:`Currency`
|
||||
field if none exists already on the model. Odoo offers to add the :guilabel:`Currency` field for
|
||||
you. Once it is added, add the :guilabel:`Monetary` field again.
|
||||
|
||||
.. example::
|
||||
|
||||
.. image:: fields/monetary-example.png
|
||||
:align: center
|
||||
:alt: Example of a Monetary field along with its Currency field
|
||||
|
||||
.. _studio/fields/simple-fields/html:
|
||||
|
||||
Html (`html`)
|
||||
-------------
|
||||
|
||||
The :guilabel:`Html` field is used to add text that can be edited using the Odoo HTML editor.
|
||||
|
||||
- :guilabel:`Multiline Text`: disables the Odoo HTML editor to allow editing raw HTML.
|
||||
|
||||
.. example::
|
||||
|
||||
.. image:: fields/html-example.png
|
||||
:align: center
|
||||
:alt: Examples of Html fields with different widgets
|
||||
|
||||
.. _studio/fields/simple-fields/date:
|
||||
|
||||
Date (`date`)
|
||||
-------------
|
||||
|
||||
The :guilabel:`Date` field is used to select a date on a calendar.
|
||||
|
||||
- :guilabel:`Remaining Days`: the remaining number of days before the selected date is displayed
|
||||
(e.g., *In 5 days*), based on the current date.
|
||||
|
||||
.. example::
|
||||
|
||||
.. image:: fields/date-examples.png
|
||||
:align: center
|
||||
:alt: Examples of Date fields with different widgets
|
||||
|
||||
.. _studio/fields/simple-fields/date-time:
|
||||
|
||||
Date & Time (`datetime`)
|
||||
------------------------
|
||||
|
||||
The :guilabel:`Date & Time` field is used to select a date on a calendar and a time on a clock. The
|
||||
user's current time is automatically used if no time is set.
|
||||
|
||||
- :guilabel:`Date`: used to record the time without displaying it on the UI.
|
||||
- :guilabel:`Remaining days`: displays the remaining number of days before the selected date (e.g.,
|
||||
*In 5 days*), based on the current date and time.
|
||||
|
||||
.. example::
|
||||
|
||||
.. image:: fields/date-time-examples.png
|
||||
:align: center
|
||||
:alt: Examples of Date & Time fields with different widgets
|
||||
|
||||
.. _studio/fields/simple-fields/checkbox:
|
||||
|
||||
Checkbox (`boolean`)
|
||||
--------------------
|
||||
|
||||
The :guilabel:`Checkbox` field is used when a value should only be true or false, indicated by
|
||||
checking or unchecking a checkbox.
|
||||
|
||||
- :guilabel:`Button`: displays a radio button. The widget works without switching to the edit mode.
|
||||
- :guilabel:`Toggle`: displays a toggle button. The widget works without switching to the edit mode.
|
||||
|
||||
.. example::
|
||||
|
||||
.. image:: fields/checkbox-examples.png
|
||||
:align: center
|
||||
:alt: Examples of Checkbox fields with different widgets
|
||||
|
||||
.. _studio/fields/simple-fields/selection:
|
||||
|
||||
Selection (`selection`)
|
||||
-----------------------
|
||||
|
||||
The :guilabel:`Selection` field is used when users should select a single value from a group of
|
||||
predefined values.
|
||||
|
||||
- :guilabel:`Badge`: displays the value inside a rounded shape, similar to a tag. The value cannot
|
||||
be edited on the UI, but a default value can be set.
|
||||
- :guilabel:`Badges`: displays all selectable values simultaneously inside rectangular shapes,
|
||||
organized horizontally.
|
||||
- :guilabel:`Priority`: displays star symbols instead of values, which can be used to indicate an
|
||||
importance or satisfaction level, for example. This has the same effect as selecting the
|
||||
:ref:`Priority field <studio/fields/simple-fields/priority>`, although, for the latter, four
|
||||
priority values are already predefined.
|
||||
- :guilabel:`Radio`: displays all selectable values at the same time as radio buttons.
|
||||
|
||||
.. tip::
|
||||
By default, radio buttons are organized vertically. Tick :guilabel:`display horizontally` to
|
||||
switch the way they are displayed.
|
||||
|
||||
.. example::
|
||||
|
||||
.. image:: fields/selection-examples.png
|
||||
:align: center
|
||||
:alt: Examples of Selection fields with different widgets
|
||||
|
||||
.. _studio/fields/simple-fields/priority:
|
||||
|
||||
Priority (`selection`)
|
||||
----------------------
|
||||
|
||||
The :guilabel:`Priority` field is used to display a three-star rating system, which can be used to
|
||||
indicate importance or satisfaction level. This field type is a :ref:`Selection field
|
||||
<studio/fields/simple-fields/selection>` with the :guilabel:`Priority` widget selected by default
|
||||
and four priority values predefined. Consequently, the :guilabel:`Badge`, :guilabel:`Badges`,
|
||||
:guilabel:`Radio`, and :guilabel:`Selection` widgets have the same effects as described under
|
||||
:ref:`Selection <studio/fields/simple-fields/selection>`.
|
||||
|
||||
.. tip::
|
||||
To change the number of available stars by adding or removing values, click :guilabel:`Edit
|
||||
Values`. Note that the first value is equal to 0 stars (i.e., when no selection is made), so
|
||||
having four values results in a three-star rating system, for example.
|
||||
|
||||
.. example::
|
||||
|
||||
.. image:: fields/priority-example.png
|
||||
:align: center
|
||||
:alt: Example of a Priority field
|
||||
|
||||
.. _studio/fields/simple-fields/file:
|
||||
|
||||
File (`binary`)
|
||||
---------------
|
||||
|
||||
The :guilabel:`File` field is used to upload any type of file, or sign a form (:guilabel:`Sign`
|
||||
widget).
|
||||
|
||||
- :guilabel:`Image`: users can upload an image file, which is then displayed in :ref:`Form view
|
||||
<studio/views/general/form>`. This has the same effect as using the :ref:`Image field
|
||||
<studio/fields/simple-fields/image>`.
|
||||
- :guilabel:`PDF Viewer`: users can upload a PDF file, which can be then browsed from the
|
||||
:ref:`Form view <studio/views/general/form>`.
|
||||
- :guilabel:`Sign`: users can electronically sign the form. This has the same effect as selecting
|
||||
the :ref:`Sign field <studio/fields/simple-fields/sign>`.
|
||||
|
||||
.. example::
|
||||
|
||||
.. image:: fields/file-examples.png
|
||||
:align: center
|
||||
:alt: Examples of File fields with different widgets
|
||||
|
||||
.. _studio/fields/simple-fields/image:
|
||||
|
||||
Image (`binary`)
|
||||
----------------
|
||||
|
||||
The :guilabel:`Image` field is used to upload an image and display it in :ref:`Form view
|
||||
<studio/views/general/form>`. This field type is a :ref:`File field
|
||||
<studio/fields/simple-fields/file>` with the :guilabel:`Image` widget selected by default.
|
||||
Consequently, the :guilabel:`File`, :guilabel:`PDF Viewer`, and :guilabel:`Sign` widgets have the
|
||||
same effects as described under :ref:`File <studio/fields/simple-fields/file>`.
|
||||
|
||||
.. tip::
|
||||
To change the display size of uploaded images, select :guilabel:`Small`, :guilabel:`Medium`, or
|
||||
:guilabel:`Large` under the :guilabel:`Size` option.
|
||||
|
||||
.. _studio/fields/simple-fields/sign:
|
||||
|
||||
Sign (`binary`)
|
||||
---------------
|
||||
|
||||
The :guilabel:`Sign` field is used to sign the form electronically. This field type is a :ref:`File
|
||||
field <studio/fields/simple-fields/file>` with the :guilabel:`Sign` widget selected by default.
|
||||
Consequently, the :guilabel:`File`, :guilabel:`Image`, and :guilabel:`PDF Viewer` widgets have the
|
||||
same effects as described under :ref:`File <studio/fields/simple-fields/file>`.
|
||||
|
||||
.. tip::
|
||||
To give users the :guilabel:`Auto` option when having to draw their signature, select one of the
|
||||
available :guilabel:`Auto-complete with` fields (:ref:`Text <studio/fields/simple-fields/text>`,
|
||||
:ref:`Many2One <studio/fields/relational-fields/many2one>`, and :ref:`Related Field
|
||||
<studio/fields/relational-fields/related-field>` on the model only). The signature is
|
||||
automatically generated using the data from the selected field.
|
||||
|
||||
.. _studio/fields/relational-fields:
|
||||
|
||||
Relational fields
|
||||
=================
|
||||
|
||||
Relational fields are used to link and display the data from records on another model.
|
||||
|
||||
.. note::
|
||||
Non-default widgets, when available, are presented as bullet points below.
|
||||
|
||||
.. _studio/fields/relational-fields/many2one:
|
||||
|
||||
Many2One (`many2one`)
|
||||
---------------------
|
||||
|
||||
The :guilabel:`Many2One` field is used to link another record (from another model) to the record
|
||||
being edited. The record's name from the other model is then displayed on the record being edited.
|
||||
|
||||
.. example::
|
||||
On the *Sales Order* model, the :guilabel:`Customer` field is a :guilabel:`Many2One` field
|
||||
pointing at the *Contact* model. This allows **many** sales orders to be linked to **one**
|
||||
contact (customer).
|
||||
|
||||
.. image:: fields/many2one-diagram.png
|
||||
:align: center
|
||||
:alt: Diagram showing a many2one relationship
|
||||
|
||||
.. tip::
|
||||
- To prevent users from creating a new record in the linked model, tick :guilabel:`Disable
|
||||
creation`.
|
||||
- To prevent users from opening records in a pop-up window, tick :guilabel:`Disable opening`.
|
||||
- To help users only select the right record, click on :guilabel:`Domain` to create a filter.
|
||||
|
||||
- :guilabel:`Badge`: displays the value inside a rounded shape, similar to a tag. The value cannot
|
||||
be edited on the UI.
|
||||
- :guilabel:`Radio`: displays all selectable values at the same time as radio buttons.
|
||||
|
||||
.. _studio/fields/relational-fields/one2many:
|
||||
|
||||
One2Many (`one2many`)
|
||||
---------------------
|
||||
|
||||
The :guilabel:`One2Many` field is used to display the existing relations between a record on the
|
||||
current model and multiple records from another model.
|
||||
|
||||
.. example::
|
||||
You could add a :guilabel:`One2Many` field on the *Contact* model to look at **one** customer's
|
||||
**many** sales orders.
|
||||
|
||||
.. image:: fields/one2many-diagram.png
|
||||
:align: center
|
||||
:alt: Diagram showing a one2many relationship
|
||||
|
||||
.. note::
|
||||
To use a :guilabel:`One2Many` field, the two models must have been linked already using a
|
||||
:ref:`Many2One field <studio/fields/relational-fields/many2one>`. One2Many relations do not exist
|
||||
independently: a reverse-search of existing Many2One relations is performed.
|
||||
|
||||
.. _studio/fields/relational-fields/lines:
|
||||
|
||||
Lines (`one2many`)
|
||||
------------------
|
||||
|
||||
The :guilabel:`Lines` field is used to create a table with rows and columns (e.g., the lines of
|
||||
products on a sales order).
|
||||
|
||||
.. tip::
|
||||
To modify the columns, click on the :guilabel:`Lines` field and then :guilabel:`Edit List View`.
|
||||
To edit the form that pops up when a user clicks on :guilabel:`Add a line`, click on
|
||||
:guilabel:`Edit Form View` instead.
|
||||
|
||||
.. example::
|
||||
|
||||
.. image:: fields/lines-example.png
|
||||
:align: center
|
||||
:alt: Example of a Lines field
|
||||
|
||||
.. _studio/fields/relational-fields/many2many:
|
||||
|
||||
Many2Many (`many2many`)
|
||||
-----------------------
|
||||
|
||||
The :guilabel:`Many2Many` field is used to link multiple records from another model to multiple
|
||||
records on the current model. Many2Many fields can use :guilabel:`Disable creation`,
|
||||
:guilabel:`Disable opening`, :guilabel:`Domain`, just like :ref:`Many2One fields
|
||||
<studio/fields/relational-fields/many2one>`.
|
||||
|
||||
.. example::
|
||||
On the *Task* model, the :guilabel:`Assignees` field is a :guilabel:`Many2Many` field pointing at
|
||||
the *Contact* model. This allows a single user to be assigned to **many** tasks and **many**
|
||||
users to be assigned to a single task.
|
||||
|
||||
.. image:: fields/many2many-diagram.png
|
||||
:align: center
|
||||
:alt: Diagram showing many2many relationships
|
||||
|
||||
- :guilabel:`Checkboxes`: users can select several values using checkboxes.
|
||||
- :guilabel:`Tags`: users can select several values appearing in rounded shapes, also known as
|
||||
*tags*. This has the same effect as selecting the :ref:`Tags field
|
||||
<studio/fields/relational-fields/tags>`.
|
||||
|
||||
.. _studio/fields/relational-fields/tags:
|
||||
|
||||
Tags (`many2many`)
|
||||
------------------
|
||||
|
||||
The :guilabel:`Tags` field is used to display several values from another model appearing in rounded
|
||||
shapes, also known as *tags*. This field type is a :ref:`Many2Many field
|
||||
<studio/fields/relational-fields/many2many>` with the :guilabel:`Tags` widget selected by default.
|
||||
Consequently, the :guilabel:`Checkboxes` and :guilabel:`Many2Many` widgets have the same effects as
|
||||
described under :ref:`Many2Many <studio/fields/relational-fields/many2many>`.
|
||||
|
||||
.. tip::
|
||||
To display tags with different background colors, tick :guilabel:`Use colors`.
|
||||
|
||||
.. example::
|
||||
|
||||
.. image:: fields/tags-example.png
|
||||
:align: center
|
||||
:alt: Example of a Tags field
|
||||
|
||||
.. _studio/fields/relational-fields/related-field:
|
||||
|
||||
Related Field (`related`)
|
||||
-------------------------
|
||||
|
||||
A :guilabel:`Related Field` is not a relational field per se; no relationship is created between
|
||||
models. It uses an existing relationship to fetch and display information from another record.
|
||||
|
||||
.. example::
|
||||
To display the email address of a customer on the *Sales Order* model, use the :guilabel:`Related
|
||||
Field` `partner_id.email` by selecting :guilabel:`Customer` and then :guilabel:`Email`.
|
||||
|
||||
.. _studio/fields/properties:
|
||||
|
||||
Properties
|
||||
==========
|
||||
|
||||
- :guilabel:`Invisible`: When it is not necessary for users to view a field on the UI, tick
|
||||
:guilabel:`Invisible`. It helps clear the UI by only showing the essential fields depending on a
|
||||
specific situation.
|
||||
|
||||
.. example::
|
||||
On the *Form* view of the *Contact* model, the :guilabel:`Title` field only appears when
|
||||
:guilabel:`Individual` is selected, as that field would not be helpful for a
|
||||
:guilabel:`Company` contact.
|
||||
|
||||
.. note::
|
||||
The :guilabel:`Invisible` attribute also applies to Studio. To view hidden fields inside
|
||||
Studio, click on a view's :guilabel:`View` tab and tick :guilabel:`Show Invisible
|
||||
Elements`.
|
||||
|
||||
- :guilabel:`Required`: If a field should always be completed by the user before being able to
|
||||
proceed, tick :guilabel:`Required`.
|
||||
- :guilabel:`Read only`: If users should not be able to modify a field, tick :guilabel:`Read only`.
|
||||
|
||||
.. note::
|
||||
You can choose to apply these three properties only for specific records by clicking on
|
||||
:guilabel:`Conditional` and creating a filter.
|
||||
|
||||
- :guilabel:`Label`: The :guilabel:`Label` is the field's name on the UI.
|
||||
|
||||
.. note::
|
||||
This is not the same name as used in the PostgreSQL database. To view and change the latter,
|
||||
activate the :ref:`Developer mode <developer-mode>`, and edit the :guilabel:`Technical Name`.
|
||||
|
||||
- :guilabel:`Help Tooltip`: To explain the purpose of a field, write a description under
|
||||
:guilabel:`Help Tooltip`. It is displayed inside a tooltip box when hovering with your mouse over
|
||||
the field's label.
|
||||
- :guilabel:`Placeholder`: To provide an example of how a field should be completed, write it under
|
||||
:guilabel:`Placeholder`. It is displayed in light gray in lieu of the field's value.
|
||||
- :guilabel:`Widget`: To change the default appearance or functionality of a field, select one of
|
||||
the available widgets.
|
||||
- :guilabel:`Default value`: To add a default value to a field when a record is created, use
|
||||
:guilabel:`Default value`.
|
||||
- :guilabel:`Limit visibility to groups`: To limit which users can see the field, select a user
|
||||
access group.
|
||||
@@ -0,0 +1,227 @@
|
||||
# Models, modules, and apps
|
||||
|
||||
Models determine the logical structure of a database and how data is stored, organized, and
|
||||
manipulated. In other words, a model is a table of information that can be linked with other tables.
|
||||
A model usually represents a business concept, such as a *sales order*, *contact*, or *product*.
|
||||
|
||||
Modules and apps contain various elements, such as models, views, data files, web controllers, and
|
||||
static web data.
|
||||
|
||||
:::{note}
|
||||
All apps are modules. Larger, standalone modules are typically referred to as apps, whereas other
|
||||
modules usually serve as add-ons to said apps.
|
||||
:::
|
||||
|
||||
(studio-models-modules-apps-suggested-features)=
|
||||
|
||||
## Suggested features
|
||||
|
||||
When you create a new model or app with Studio, you can choose to add up to 14 features to speed
|
||||
up the creation process. These features bundle fields, default settings, and views that are usually
|
||||
used together to provide some standard functionality. Most of these features can be added later on,
|
||||
but adding them from the start makes the model creation process much easier. Furthermore, these
|
||||
features interact together in some cases to increase their usefulness.
|
||||
|
||||
```{eval-rst}
|
||||
.. example::
|
||||
Creating a model with the :ref:`studio/models-modules-apps/suggested-features/picture` and
|
||||
:ref:`studio/models-modules-apps/suggested-features/pipeline-stages` features enabled adds the
|
||||
image in the card layout of the :ref:`Kanban view <studio/views/multiple-records/kanban>`.
|
||||
|
||||
.. image:: models_modules_apps/picture-pipeline-kanban.png
|
||||
:align: center
|
||||
:alt: Combination of the Picture and Pipeline stages features on the Kanban view
|
||||
```
|
||||
|
||||
(studio-models-modules-apps-suggested-features-contact-details)=
|
||||
|
||||
### Contact details
|
||||
|
||||
Selecting {guilabel}`Contact details` adds to the {ref}`Form view <studio/views/general/form>` a
|
||||
{ref}`Many2One field <studio/fields/relational-fields/many2one>` linked to the *Contact* model and
|
||||
two of its {ref}`Related Fields <studio/fields/relational-fields/related-field>`: {guilabel}`Phone`
|
||||
and {guilabel}`Email`. The {guilabel}`Contact` field is also added to the {ref}`List view
|
||||
<studio/views/multiple-records/list>`, and the {ref}`Map view <studio/views/multiple-records/map>`
|
||||
is activated.
|
||||
|
||||
```{eval-rst}
|
||||
.. example::
|
||||
|
||||
.. image:: models_modules_apps/contact.png
|
||||
:align: center
|
||||
:alt: Contact details feature on the Form view
|
||||
```
|
||||
|
||||
(studio-models-modules-apps-suggested-features-user-assignment)=
|
||||
|
||||
### User assignment
|
||||
|
||||
Selecting {guilabel}`User assignment` adds to the {ref}`Form view <studio/views/general/form>` a
|
||||
{ref}`Many2One field <studio/fields/relational-fields/many2one>` linked to the *Contact* model, with
|
||||
the following {guilabel}`Domain`: `Share User is not set` to only allow the selection of *Internal
|
||||
Users*. In addition, the {guilabel}`many2one_avatar_user` widget is used to display the user's
|
||||
avatar. The {guilabel}`Responsible` field is also added to the {ref}`List view
|
||||
<studio/views/multiple-records/list>`.
|
||||
|
||||
```{eval-rst}
|
||||
.. example::
|
||||
|
||||
.. image:: models_modules_apps/user-assignment.png
|
||||
:align: center
|
||||
:alt: User assignment feature on the Form view
|
||||
```
|
||||
|
||||
(studio-models-modules-apps-suggested-features-date-calendar)=
|
||||
|
||||
### Date & Calendar
|
||||
|
||||
Selecting {guilabel}`Date & Calendar` adds to the {ref}`Form view <studio/views/general/form>` a
|
||||
{ref}`Date field <studio/fields/simple-fields/date>` and activates the {ref}`Calendar view
|
||||
<studio/views/timeline/calendar>`.
|
||||
|
||||
(studio-models-modules-apps-suggested-features-date-range-gantt)=
|
||||
|
||||
### Date range & Gantt
|
||||
|
||||
Selecting {guilabel}`Date range & Gantt` adds to the {ref}`Form view <studio/views/general/form>`
|
||||
two {ref}`Date fields <studio/fields/simple-fields/date>` next to each other: one to set a start
|
||||
date, the other to set an end date, using the {guilabel}`daterange` widget, and activates the
|
||||
{ref}`Gantt view <studio/views/timeline/gantt>`.
|
||||
|
||||
(studio-models-modules-apps-suggested-features-pipeline-stages)=
|
||||
|
||||
### Pipeline stages
|
||||
|
||||
Selecting {guilabel}`Pipeline stages` activates the {ref}`Kanban view
|
||||
<studio/views/multiple-records/kanban>`, adds several fields such as {ref}`Priority
|
||||
<studio/fields/simple-fields/priority>` and {guilabel}`Kanban State`, and three stages:
|
||||
{guilabel}`New`, {guilabel}`In Progress`, and {guilabel}`Done`. The {guilabel}`Pipeline status bar`
|
||||
and the {guilabel}`Kanban State` field are added to the {ref}`Form view
|
||||
<studio/views/general/form>`. The {guilabel}`Color` field is added to the {ref}`List view
|
||||
<studio/views/multiple-records/list>`.
|
||||
|
||||
:::{note}
|
||||
The {guilabel}`Pipeline stages` feature can be added at a later stage.
|
||||
:::
|
||||
|
||||
(studio-models-modules-apps-suggested-features-tags)=
|
||||
|
||||
### Tags
|
||||
|
||||
Selecting {guilabel}`Tags` adds to the {ref}`studio/views/general/form` and
|
||||
{ref}`studio/views/multiple-records/list` views a {ref}`Tags field
|
||||
<studio/fields/relational-fields/tags>`, creating a *Tag* model with preconfigured access rights in
|
||||
the process.
|
||||
|
||||
(studio-models-modules-apps-suggested-features-picture)=
|
||||
|
||||
### Picture
|
||||
|
||||
Selecting {guilabel}`Picture` adds to the top-right of the {ref}`Form view
|
||||
<studio/views/general/form>` an {ref}`Image field <studio/fields/simple-fields/image>`.
|
||||
|
||||
:::{note}
|
||||
The {guilabel}`Picture` feature can be added at a later stage.
|
||||
:::
|
||||
|
||||
(studio-models-modules-apps-suggested-features-lines)=
|
||||
|
||||
### Lines
|
||||
|
||||
Selecting {guilabel}`Lines`: adds to the {ref}`Form view <studio/views/general/form>` a {ref}`Lines
|
||||
field <studio/fields/relational-fields/lines>` inside a {guilabel}`Tab` component.
|
||||
|
||||
(studio-models-modules-apps-suggested-features-notes)=
|
||||
|
||||
### Notes
|
||||
|
||||
Selecting {guilabel}`Notes` adds to the {ref}`Form view <studio/views/general/form>` an {ref}`Html
|
||||
field <studio/fields/simple-fields/html>` using the full width of the form.
|
||||
|
||||
(studio-models-modules-apps-suggested-features-monetary-value)=
|
||||
|
||||
### Monetary value
|
||||
|
||||
Selecting {guilabel}`Monetary value` adds to the {ref}`studio/views/general/form` and
|
||||
{ref}`studio/views/multiple-records/list` views a {ref}`Monetary field
|
||||
<studio/fields/simple-fields/monetary>`. The {ref}`studio/views/reporting/graph` and
|
||||
{ref}`studio/views/reporting/pivot` views are also activated.
|
||||
|
||||
:::{note}
|
||||
A *Currency* field is added and hidden from the view.
|
||||
:::
|
||||
|
||||
(studio-models-modules-apps-suggested-features-company)=
|
||||
|
||||
### Company
|
||||
|
||||
Selecting {guilabel}`Company` adds to the {ref}`studio/views/general/form` and
|
||||
{ref}`studio/views/multiple-records/list` views a {ref}`Many2One field
|
||||
<studio/fields/relational-fields/many2one>` linked to the *Company* model.
|
||||
|
||||
:::{note}
|
||||
This is only useful if you work in a multi-company environment.
|
||||
:::
|
||||
|
||||
(studio-models-modules-apps-suggested-features-custom-sorting)=
|
||||
|
||||
### Custom Sorting
|
||||
|
||||
Selecting {guilabel}`Custom Sorting` adds to the {ref}`List view
|
||||
<studio/views/multiple-records/list>` a drag handle icon to manually reorder records.
|
||||
|
||||
```{eval-rst}
|
||||
.. example::
|
||||
|
||||
.. image:: views/list-drag-handle.png
|
||||
:align: center
|
||||
:alt: Custom Sorting feature on the List view
|
||||
```
|
||||
|
||||
(studio-models-modules-apps-suggested-features-chatter)=
|
||||
|
||||
### Chatter
|
||||
|
||||
Selecting {guilabel}`Chatter` adds to the {ref}`Form view <studio/views/general/form>` Chatter
|
||||
functionalities (sending messages, logging notes, and scheduling activities).
|
||||
|
||||
:::{note}
|
||||
The {guilabel}`Chatter` feature can be added at a later stage.
|
||||
:::
|
||||
|
||||
```{eval-rst}
|
||||
.. example::
|
||||
|
||||
.. image:: models_modules_apps/chatter.png
|
||||
:align: center
|
||||
:alt: Chatter feature on the Form view
|
||||
```
|
||||
|
||||
(studio-models-modules-apps-suggested-features-archiving)=
|
||||
|
||||
### Archiving
|
||||
|
||||
Selecting {guilabel}`Archiving` adds to the {ref}`studio/views/general/form` and
|
||||
{ref}`studio/views/multiple-records/list` views the {guilabel}`Archive` action and hides archived
|
||||
records from searches and views by default.
|
||||
|
||||
(studio-export-import)=
|
||||
|
||||
## Export and import customizations
|
||||
|
||||
When you do any customization with Studio, a new module named {guilabel}`Studio customizations` is
|
||||
added to your database.
|
||||
|
||||
To export these customizations, go to {menuselection}`Main dashboard --> Studio --> Customizations
|
||||
--> Export` to download a ZIP file containing all customizations.
|
||||
|
||||
To import and install these customizations in another database, connect to the destination database
|
||||
and go to {menuselection}`Main dashboard --> Studio --> Customizations --> Import`, then upload
|
||||
the exported ZIP file before clicking on the {guilabel}`Import` button.
|
||||
|
||||
:::{warning}
|
||||
Before importing, make sure the destination database contains the same apps and modules as the
|
||||
source database. Studio does not add the underlying modules as dependencies of the exported
|
||||
module.
|
||||
:::
|
||||
|
||||
@@ -1,227 +0,0 @@
|
||||
=========================
|
||||
Models, modules, and apps
|
||||
=========================
|
||||
|
||||
Models determine the logical structure of a database and how data is stored, organized, and
|
||||
manipulated. In other words, a model is a table of information that can be linked with other tables.
|
||||
A model usually represents a business concept, such as a *sales order*, *contact*, or *product*.
|
||||
|
||||
Modules and apps contain various elements, such as models, views, data files, web controllers, and
|
||||
static web data.
|
||||
|
||||
.. note::
|
||||
All apps are modules. Larger, standalone modules are typically referred to as apps, whereas other
|
||||
modules usually serve as add-ons to said apps.
|
||||
|
||||
.. _studio/models-modules-apps/suggested-features:
|
||||
|
||||
Suggested features
|
||||
==================
|
||||
|
||||
When you create a new model or app with Studio, you can choose to add up to 14 features to speed
|
||||
up the creation process. These features bundle fields, default settings, and views that are usually
|
||||
used together to provide some standard functionality. Most of these features can be added later on,
|
||||
but adding them from the start makes the model creation process much easier. Furthermore, these
|
||||
features interact together in some cases to increase their usefulness.
|
||||
|
||||
.. example::
|
||||
Creating a model with the :ref:`studio/models-modules-apps/suggested-features/picture` and
|
||||
:ref:`studio/models-modules-apps/suggested-features/pipeline-stages` features enabled adds the
|
||||
image in the card layout of the :ref:`Kanban view <studio/views/multiple-records/kanban>`.
|
||||
|
||||
.. image:: models_modules_apps/picture-pipeline-kanban.png
|
||||
:align: center
|
||||
:alt: Combination of the Picture and Pipeline stages features on the Kanban view
|
||||
|
||||
.. _studio/models-modules-apps/suggested-features/contact-details:
|
||||
|
||||
Contact details
|
||||
---------------
|
||||
|
||||
Selecting :guilabel:`Contact details` adds to the :ref:`Form view <studio/views/general/form>` a
|
||||
:ref:`Many2One field <studio/fields/relational-fields/many2one>` linked to the *Contact* model and
|
||||
two of its :ref:`Related Fields <studio/fields/relational-fields/related-field>`: :guilabel:`Phone`
|
||||
and :guilabel:`Email`. The :guilabel:`Contact` field is also added to the :ref:`List view
|
||||
<studio/views/multiple-records/list>`, and the :ref:`Map view <studio/views/multiple-records/map>`
|
||||
is activated.
|
||||
|
||||
.. example::
|
||||
|
||||
.. image:: models_modules_apps/contact.png
|
||||
:align: center
|
||||
:alt: Contact details feature on the Form view
|
||||
|
||||
.. _studio/models-modules-apps/suggested-features/user-assignment:
|
||||
|
||||
User assignment
|
||||
---------------
|
||||
|
||||
Selecting :guilabel:`User assignment` adds to the :ref:`Form view <studio/views/general/form>` a
|
||||
:ref:`Many2One field <studio/fields/relational-fields/many2one>` linked to the *Contact* model, with
|
||||
the following :guilabel:`Domain`: `Share User is not set` to only allow the selection of *Internal
|
||||
Users*. In addition, the :guilabel:`many2one_avatar_user` widget is used to display the user's
|
||||
avatar. The :guilabel:`Responsible` field is also added to the :ref:`List view
|
||||
<studio/views/multiple-records/list>`.
|
||||
|
||||
.. example::
|
||||
|
||||
.. image:: models_modules_apps/user-assignment.png
|
||||
:align: center
|
||||
:alt: User assignment feature on the Form view
|
||||
|
||||
.. _studio/models-modules-apps/suggested-features/date-calendar:
|
||||
|
||||
Date & Calendar
|
||||
---------------
|
||||
|
||||
Selecting :guilabel:`Date & Calendar` adds to the :ref:`Form view <studio/views/general/form>` a
|
||||
:ref:`Date field <studio/fields/simple-fields/date>` and activates the :ref:`Calendar view
|
||||
<studio/views/timeline/calendar>`.
|
||||
|
||||
.. _studio/models-modules-apps/suggested-features/date-range-gantt:
|
||||
|
||||
Date range & Gantt
|
||||
------------------
|
||||
|
||||
Selecting :guilabel:`Date range & Gantt` adds to the :ref:`Form view <studio/views/general/form>`
|
||||
two :ref:`Date fields <studio/fields/simple-fields/date>` next to each other: one to set a start
|
||||
date, the other to set an end date, using the :guilabel:`daterange` widget, and activates the
|
||||
:ref:`Gantt view <studio/views/timeline/gantt>`.
|
||||
|
||||
.. _studio/models-modules-apps/suggested-features/pipeline-stages:
|
||||
|
||||
Pipeline stages
|
||||
---------------
|
||||
|
||||
Selecting :guilabel:`Pipeline stages` activates the :ref:`Kanban view
|
||||
<studio/views/multiple-records/kanban>`, adds several fields such as :ref:`Priority
|
||||
<studio/fields/simple-fields/priority>` and :guilabel:`Kanban State`, and three stages:
|
||||
:guilabel:`New`, :guilabel:`In Progress`, and :guilabel:`Done`. The :guilabel:`Pipeline status bar`
|
||||
and the :guilabel:`Kanban State` field are added to the :ref:`Form view
|
||||
<studio/views/general/form>`. The :guilabel:`Color` field is added to the :ref:`List view
|
||||
<studio/views/multiple-records/list>`.
|
||||
|
||||
.. note::
|
||||
The :guilabel:`Pipeline stages` feature can be added at a later stage.
|
||||
|
||||
.. _studio/models-modules-apps/suggested-features/tags:
|
||||
|
||||
Tags
|
||||
----
|
||||
|
||||
Selecting :guilabel:`Tags` adds to the :ref:`studio/views/general/form` and
|
||||
:ref:`studio/views/multiple-records/list` views a :ref:`Tags field
|
||||
<studio/fields/relational-fields/tags>`, creating a *Tag* model with preconfigured access rights in
|
||||
the process.
|
||||
|
||||
.. _studio/models-modules-apps/suggested-features/picture:
|
||||
|
||||
Picture
|
||||
-------
|
||||
|
||||
Selecting :guilabel:`Picture` adds to the top-right of the :ref:`Form view
|
||||
<studio/views/general/form>` an :ref:`Image field <studio/fields/simple-fields/image>`.
|
||||
|
||||
.. note::
|
||||
The :guilabel:`Picture` feature can be added at a later stage.
|
||||
|
||||
.. _studio/models-modules-apps/suggested-features/lines:
|
||||
|
||||
Lines
|
||||
-----
|
||||
|
||||
Selecting :guilabel:`Lines`: adds to the :ref:`Form view <studio/views/general/form>` a :ref:`Lines
|
||||
field <studio/fields/relational-fields/lines>` inside a :guilabel:`Tab` component.
|
||||
|
||||
.. _studio/models-modules-apps/suggested-features/notes:
|
||||
|
||||
Notes
|
||||
-----
|
||||
|
||||
Selecting :guilabel:`Notes` adds to the :ref:`Form view <studio/views/general/form>` an :ref:`Html
|
||||
field <studio/fields/simple-fields/html>` using the full width of the form.
|
||||
|
||||
.. _studio/models-modules-apps/suggested-features/monetary-value:
|
||||
|
||||
Monetary value
|
||||
--------------
|
||||
|
||||
Selecting :guilabel:`Monetary value` adds to the :ref:`studio/views/general/form` and
|
||||
:ref:`studio/views/multiple-records/list` views a :ref:`Monetary field
|
||||
<studio/fields/simple-fields/monetary>`. The :ref:`studio/views/reporting/graph` and
|
||||
:ref:`studio/views/reporting/pivot` views are also activated.
|
||||
|
||||
.. note::
|
||||
A *Currency* field is added and hidden from the view.
|
||||
|
||||
.. _studio/models-modules-apps/suggested-features/company:
|
||||
|
||||
Company
|
||||
-------
|
||||
|
||||
Selecting :guilabel:`Company` adds to the :ref:`studio/views/general/form` and
|
||||
:ref:`studio/views/multiple-records/list` views a :ref:`Many2One field
|
||||
<studio/fields/relational-fields/many2one>` linked to the *Company* model.
|
||||
|
||||
.. note::
|
||||
This is only useful if you work in a multi-company environment.
|
||||
|
||||
.. _studio/models-modules-apps/suggested-features/custom-sorting:
|
||||
|
||||
Custom Sorting
|
||||
--------------
|
||||
|
||||
Selecting :guilabel:`Custom Sorting` adds to the :ref:`List view
|
||||
<studio/views/multiple-records/list>` a drag handle icon to manually reorder records.
|
||||
|
||||
.. example::
|
||||
|
||||
.. image:: views/list-drag-handle.png
|
||||
:align: center
|
||||
:alt: Custom Sorting feature on the List view
|
||||
|
||||
.. _studio/models-modules-apps/suggested-features/chatter:
|
||||
|
||||
Chatter
|
||||
-------
|
||||
|
||||
Selecting :guilabel:`Chatter` adds to the :ref:`Form view <studio/views/general/form>` Chatter
|
||||
functionalities (sending messages, logging notes, and scheduling activities).
|
||||
|
||||
.. note::
|
||||
The :guilabel:`Chatter` feature can be added at a later stage.
|
||||
|
||||
.. example::
|
||||
|
||||
.. image:: models_modules_apps/chatter.png
|
||||
:align: center
|
||||
:alt: Chatter feature on the Form view
|
||||
|
||||
.. _studio/models-modules-apps/suggested-features/archiving:
|
||||
|
||||
Archiving
|
||||
---------
|
||||
|
||||
Selecting :guilabel:`Archiving` adds to the :ref:`studio/views/general/form` and
|
||||
:ref:`studio/views/multiple-records/list` views the :guilabel:`Archive` action and hides archived
|
||||
records from searches and views by default.
|
||||
|
||||
.. _studio/export-import:
|
||||
|
||||
Export and import customizations
|
||||
================================
|
||||
|
||||
When you do any customization with Studio, a new module named :guilabel:`Studio customizations` is
|
||||
added to your database.
|
||||
|
||||
To export these customizations, go to :menuselection:`Main dashboard --> Studio --> Customizations
|
||||
--> Export` to download a ZIP file containing all customizations.
|
||||
|
||||
To import and install these customizations in another database, connect to the destination database
|
||||
and go to :menuselection:`Main dashboard --> Studio --> Customizations --> Import`, then upload
|
||||
the exported ZIP file before clicking on the :guilabel:`Import` button.
|
||||
|
||||
.. warning::
|
||||
Before importing, make sure the destination database contains the same apps and modules as the
|
||||
source database. Studio does not add the underlying modules as dependencies of the exported
|
||||
module.
|
||||
+155
-144
@@ -1,29 +1,28 @@
|
||||
===========
|
||||
PDF reports
|
||||
===========
|
||||
# PDF reports
|
||||
|
||||
With Studio, you can :ref:`edit existing PDF reports <studio/pdf-reports/edit>` (e.g., invoices,
|
||||
quotations, etc.) or :ref:`create new ones <studio/pdf-reports/edit>`.
|
||||
With Studio, you can {ref}`edit existing PDF reports <studio/pdf-reports/edit>` (e.g., invoices,
|
||||
quotations, etc.) or {ref}`create new ones <studio/pdf-reports/edit>`.
|
||||
|
||||
.. _studio/pdf-reports/default-layout:
|
||||
(studio-pdf-reports-default-layout)=
|
||||
|
||||
Default layout
|
||||
==============
|
||||
## Default layout
|
||||
|
||||
The default layout of reports is managed outside Studio. Go to :menuselection:`Settings`, then, in
|
||||
the :guilabel:`Companies` section, click :guilabel:`Configure Document Layout`. Layout settings are
|
||||
The default layout of reports is managed outside Studio. Go to {menuselection}`Settings`, then, in
|
||||
the {guilabel}`Companies` section, click {guilabel}`Configure Document Layout`. Layout settings are
|
||||
company-specific but apply to all reports.
|
||||
|
||||
.. tip::
|
||||
You can see how the different settings affect the report layout in the report preview on the
|
||||
right, or download a sample invoice PDF by clicking :guilabel:`Download PDF Preview`.
|
||||
:::{tip}
|
||||
You can see how the different settings affect the report layout in the report preview on the
|
||||
right, or download a sample invoice PDF by clicking {guilabel}`Download PDF Preview`.
|
||||
:::
|
||||
|
||||
Use the following settings:
|
||||
|
||||
.. _studio/pdf-reports/default-layout/layout:
|
||||
(studio-pdf-reports-default-layout-layout)=
|
||||
|
||||
- :guilabel:`Layout`: Four layouts are available:
|
||||
- {guilabel}`Layout`: Four layouts are available:
|
||||
|
||||
```{eval-rst}
|
||||
.. tabs::
|
||||
|
||||
.. tab:: Light
|
||||
@@ -45,164 +44,165 @@ Use the following settings:
|
||||
|
||||
.. image:: pdf_reports/layout-striped.png
|
||||
:alt: Striped report layout sample
|
||||
```
|
||||
|
||||
.. _studio/pdf-reports/default-layout/font:
|
||||
(studio-pdf-reports-default-layout-font)=
|
||||
|
||||
- :guilabel:`Font`: Seven fonts are available: Lato, Roboto, Open Sans, Montserrat, Oswald, Raleway,
|
||||
- {guilabel}`Font`: Seven fonts are available: Lato, Roboto, Open Sans, Montserrat, Oswald, Raleway,
|
||||
and Tajawal (which supports Arabic and Latin scripts). Go to the
|
||||
`Google Fonts website <https://fonts.google.com/>`_ to preview them.
|
||||
[Google Fonts website](https://fonts.google.com/) to preview them.
|
||||
|
||||
.. _studio/pdf-reports/default-layout/logo:
|
||||
(studio-pdf-reports-default-layout-logo)=
|
||||
|
||||
- :guilabel:`Company logo`: Click the :guilabel:`Edit` button to upload or change the logo. This
|
||||
- {guilabel}`Company logo`: Click the {guilabel}`Edit` button to upload or change the logo. This
|
||||
adds the logo to the company’s record on the *Company* model, which you can access by going to
|
||||
:menuselection:`Settings` and then clicking :guilabel:`Update Info` in the :guilabel:`Companies`
|
||||
{menuselection}`Settings` and then clicking {guilabel}`Update Info` in the {guilabel}`Companies`
|
||||
section.
|
||||
|
||||
.. _studio/pdf-reports/default-layout/colors:
|
||||
(studio-pdf-reports-default-layout-colors)=
|
||||
|
||||
- :guilabel:`Colors`: Change the primary and secondary colors used to structure reports. The default
|
||||
- {guilabel}`Colors`: Change the primary and secondary colors used to structure reports. The default
|
||||
colors are automatically generated based on the colors of the logo.
|
||||
|
||||
.. _studio/pdf-reports/default-layout/background:
|
||||
(studio-pdf-reports-default-layout-background)=
|
||||
|
||||
- :guilabel:`Layout background`: The following backgrounds are available:
|
||||
- {guilabel}`Layout background`: The following backgrounds are available:
|
||||
|
||||
- :guilabel:`Blank`: nothing is displayed.
|
||||
- :guilabel:`Geometric`: an image featuring geometric shapes is displayed in the background.
|
||||
- :guilabel:`Custom`: upload a custom background image.
|
||||
- {guilabel}`Blank`: nothing is displayed.
|
||||
- {guilabel}`Geometric`: an image featuring geometric shapes is displayed in the background.
|
||||
- {guilabel}`Custom`: upload a custom background image.
|
||||
|
||||
.. _studio/pdf-reports/default-layout/tagline:
|
||||
(studio-pdf-reports-default-layout-tagline)=
|
||||
|
||||
- :guilabel:`Company tagline`: This is displayed in the header of :ref:`external reports
|
||||
- {guilabel}`Company tagline`: This is displayed in the header of {ref}`external reports
|
||||
<studio/pdf-reports/header-footer/external>`. You can add multiple lines of text.
|
||||
|
||||
.. _studio/pdf-reports/default-layout/details:
|
||||
(studio-pdf-reports-default-layout-details)=
|
||||
|
||||
- :guilabel:`Company details`: These are displayed in the header of :ref:`external reports
|
||||
- {guilabel}`Company details`: These are displayed in the header of {ref}`external reports
|
||||
<studio/pdf-reports/header-footer/external>`. You can add multiple lines of text.
|
||||
|
||||
.. _studio/pdf-reports/default-layout/footer:
|
||||
(studio-pdf-reports-default-layout-footer)=
|
||||
|
||||
- :guilabel:`Footer`: This text is used in the footer of :ref:`external reports
|
||||
- {guilabel}`Footer`: This text is used in the footer of {ref}`external reports
|
||||
<studio/pdf-reports/header-footer/external>`. You can add multiple lines of text. You can also
|
||||
edit the footer using the :ref:`report editor <studio/pdf-reports/edit>`.
|
||||
edit the footer using the {ref}`report editor <studio/pdf-reports/edit>`.
|
||||
|
||||
.. _studio/pdf-reports/default-layout/paper:
|
||||
(studio-pdf-reports-default-layout-paper)=
|
||||
|
||||
- :guilabel:`Paper format`: to define the default paper size of reports. You can select
|
||||
:guilabel:`A4` (21 cm x 29.7 cm), :guilabel:`US Letter` (21.59 cm x 27.54 cm), or
|
||||
:guilabel:`QR codes page`. This can also be defined for individual reports in the
|
||||
:guilabel:`Paper format` field in :ref:`Studio <studio/pdf-reports/create>`.
|
||||
- {guilabel}`Paper format`: to define the default paper size of reports. You can select
|
||||
{guilabel}`A4` (21 cm x 29.7 cm), {guilabel}`US Letter` (21.59 cm x 27.54 cm), or
|
||||
{guilabel}`QR codes page`. This can also be defined for individual reports in the
|
||||
{guilabel}`Paper format` field in {ref}`Studio <studio/pdf-reports/create>`.
|
||||
|
||||
.. _studio/pdf-reports/create:
|
||||
(studio-pdf-reports-create)=
|
||||
|
||||
Creating new PDF reports
|
||||
========================
|
||||
## Creating new PDF reports
|
||||
|
||||
To create a new report for a model, access the model, click the **Toggle Studio** button, then click
|
||||
:guilabel:`Reports`. Click :guilabel:`New` and, in the popup window that opens, select the type of
|
||||
{guilabel}`Reports`. Click {guilabel}`New` and, in the popup window that opens, select the type of
|
||||
report. This is solely used to determine what is displayed in the header and footer:
|
||||
|
||||
.. _studio/pdf-reports/header-footer/external:
|
||||
(studio-pdf-reports-header-footer-external)=
|
||||
|
||||
- :guilabel:`External`:
|
||||
- {guilabel}`External`:
|
||||
|
||||
- The header displays the company's :ref:`logo <studio/pdf-reports/default-layout/logo>`,
|
||||
:ref:`tagline <studio/pdf-reports/default-layout/tagline>`, and
|
||||
:ref:`details <studio/pdf-reports/default-layout/details>`.
|
||||
- The header displays the company's {ref}`logo <studio/pdf-reports/default-layout/logo>`,
|
||||
{ref}`tagline <studio/pdf-reports/default-layout/tagline>`, and
|
||||
{ref}`details <studio/pdf-reports/default-layout/details>`.
|
||||
- The footer displays the values set in the
|
||||
:ref:`Footer <studio/pdf-reports/default-layout/footer>` field and the page number.
|
||||
{ref}`Footer <studio/pdf-reports/default-layout/footer>` field and the page number.
|
||||
|
||||
- :guilabel:`Internal`: The header displays the user's current date and time,
|
||||
:guilabel:`Company Name`, and page number. There is no footer.
|
||||
- {guilabel}`Internal`: The header displays the user's current date and time,
|
||||
{guilabel}`Company Name`, and page number. There is no footer.
|
||||
|
||||
- :guilabel:`Blank`: There is neither a header nor a footer. Click in the upper left corner of the
|
||||
- {guilabel}`Blank`: There is neither a header nor a footer. Click in the upper left corner of the
|
||||
page to edit the report.
|
||||
|
||||
Once you have created the report, you can start :ref:`editing it <studio/pdf-reports/edit>`.
|
||||
Once you have created the report, you can start {ref}`editing it <studio/pdf-reports/edit>`.
|
||||
|
||||
.. _studio/pdf-reports/edit:
|
||||
(studio-pdf-reports-edit)=
|
||||
|
||||
Editing PDF reports
|
||||
===================
|
||||
## Editing PDF reports
|
||||
|
||||
To access the reports available for a model, access the model (e.g., sales orders), click the
|
||||
**Toggle Studio** button, then click :guilabel:`Reports`. Select an existing report to open it or
|
||||
:ref:`create a new one <studio/pdf-reports/create>`.
|
||||
**Toggle Studio** button, then click {guilabel}`Reports`. Select an existing report to open it or
|
||||
{ref}`create a new one <studio/pdf-reports/create>`.
|
||||
|
||||
.. tip::
|
||||
Alternatively, you can also open Studio, click :guilabel:`Reports`, and search for a specific
|
||||
report or model.
|
||||
:::{tip}
|
||||
Alternatively, you can also open Studio, click {guilabel}`Reports`, and search for a specific
|
||||
report or model.
|
||||
:::
|
||||
|
||||
.. important::
|
||||
It is strongly recommended to **duplicate** the standard report and perform changes in the
|
||||
duplicated version. To duplicate a report, hover the mouse pointer on the top right corner
|
||||
of the report, click the vertical ellipsis icon (:guilabel:`⋮`), and then select
|
||||
:guilabel:`Duplicate`.
|
||||
:::{important}
|
||||
It is strongly recommended to **duplicate** the standard report and perform changes in the
|
||||
duplicated version. To duplicate a report, hover the mouse pointer on the top right corner
|
||||
of the report, click the vertical ellipsis icon ({guilabel}`⋮`), and then select
|
||||
{guilabel}`Duplicate`.
|
||||
|
||||
.. image:: pdf_reports/duplicate-report.png
|
||||
:alt: Duplicating a PDF report
|
||||
```{image} pdf_reports/duplicate-report.png
|
||||
:alt: Duplicating a PDF report
|
||||
```
|
||||
:::
|
||||
|
||||
Options
|
||||
-------
|
||||
### Options
|
||||
|
||||
Once you've selected or created a report, you can use the options in the left part of the screen to:
|
||||
|
||||
- Change the :guilabel:`Report name`. The new name is applied everywhere (in Studio, under
|
||||
the :guilabel:`Print` button, and in the PDF file name).
|
||||
- Modify the :guilabel:`Paper format`. If no value is selected, the format defined in the
|
||||
:ref:`default layout <studio/pdf-reports/default-layout/paper>` is used.
|
||||
- :guilabel:`Show in print menu`: to add the report in the :guilabel:`Print` menu available from the
|
||||
- Change the {guilabel}`Report name`. The new name is applied everywhere (in Studio, under
|
||||
the {guilabel}`Print` button, and in the PDF file name).
|
||||
- Modify the {guilabel}`Paper format`. If no value is selected, the format defined in the
|
||||
{ref}`default layout <studio/pdf-reports/default-layout/paper>` is used.
|
||||
- {guilabel}`Show in print menu`: to add the report in the {guilabel}`Print` menu available from the
|
||||
record.
|
||||
- :guilabel:`Reload from attachment`: to save the report as an attachment on the record the first
|
||||
- {guilabel}`Reload from attachment`: to save the report as an attachment on the record the first
|
||||
time it is generated and reload the original version of the report any subsequent time. This is
|
||||
legally required for invoices and is mainly used in this case.
|
||||
- :guilabel:`Limit visibility to groups`: to limit the availability of the PDF report to specific
|
||||
:doc:`user groups <../general/users/access_rights>`.
|
||||
- :guilabel:`Edit sources`: to modify the report directly in the :ref:`XML file
|
||||
- {guilabel}`Limit visibility to groups`: to limit the availability of the PDF report to specific
|
||||
{doc}`user groups <../general/users/access_rights>`.
|
||||
- {guilabel}`Edit sources`: to modify the report directly in the {ref}`XML file
|
||||
<studio/pdf-reports/XML-editing>`.
|
||||
- :guilabel:`Reset report`: to discard all changes made to the report and reset it to its standard
|
||||
- {guilabel}`Reset report`: to discard all changes made to the report and reset it to its standard
|
||||
version.
|
||||
- :guilabel:`Print preview`: to generate and download a report preview.
|
||||
- {guilabel}`Print preview`: to generate and download a report preview.
|
||||
|
||||
Report editor
|
||||
-------------
|
||||
### Report editor
|
||||
|
||||
The report editor allows you to modify the formatting and contents of the report.
|
||||
|
||||
.. tip::
|
||||
- You can :guilabel:`Undo` or :guilabel:`Redo` changes using the related buttons or the shortcuts
|
||||
`CTRL Z` and `CTRL Y`.
|
||||
:::{tip}
|
||||
- You can {guilabel}`Undo` or {guilabel}`Redo` changes using the related buttons or the shortcuts
|
||||
`CTRL Z` and `CTRL Y`.
|
||||
- Changes are saved automatically when you leave the report or manually using the
|
||||
{guilabel}`Save` button.
|
||||
- You can reset the report to its standard version by clicking the {guilabel}`Reset report` button
|
||||
in the left part of the screen.
|
||||
:::
|
||||
|
||||
- Changes are saved automatically when you leave the report or manually using the
|
||||
:guilabel:`Save` button.
|
||||
:::{important}
|
||||
Editing the header and footer of a report impacts all standard and custom reports.
|
||||
:::
|
||||
|
||||
- You can reset the report to its standard version by clicking the :guilabel:`Reset report` button
|
||||
in the left part of the screen.
|
||||
|
||||
.. important::
|
||||
Editing the header and footer of a report impacts all standard and custom reports.
|
||||
|
||||
Conditional blocks
|
||||
~~~~~~~~~~~~~~~~~~
|
||||
#### Conditional blocks
|
||||
|
||||
The dashed rectangles represent **conditional blocks** (*if/else* statements). These are used to
|
||||
show/hide content based on specific conditions. Click on the block to view the conditions.
|
||||
|
||||
.. image:: pdf_reports/conditional-block-if.png
|
||||
:alt: View conditions applied to a block.
|
||||
```{image} pdf_reports/conditional-block-if.png
|
||||
:alt: View conditions applied to a block.
|
||||
```
|
||||
|
||||
Select a value to preview its corresponding output and edit it if necessary.
|
||||
|
||||
.. image:: pdf_reports/conditional-block-else.png
|
||||
:alt: Preview the output of another condition.
|
||||
```{image} pdf_reports/conditional-block-else.png
|
||||
:alt: Preview the output of another condition.
|
||||
```
|
||||
|
||||
.. note::
|
||||
Conditions can only be edited in :ref:`XML <studio/pdf-reports/XML-editing>`.
|
||||
:::{note}
|
||||
Conditions can only be edited in {ref}`XML <studio/pdf-reports/XML-editing>`.
|
||||
:::
|
||||
|
||||
Other content
|
||||
~~~~~~~~~~~~~
|
||||
#### Other content
|
||||
|
||||
There are two types of text content in reports:
|
||||
|
||||
@@ -212,79 +212,82 @@ There are two types of text content in reports:
|
||||
the report is generated, e.g., the SO number or the quotation date.
|
||||
|
||||
You can add content (e.g., fields, lists, tables, images, banners, etc.) to the report using
|
||||
commands. Type `/` to open the :ref:`powerbox <knowledge/powerbox>`, then type the command's
|
||||
commands. Type `/` to open the {ref}`powerbox <knowledge/powerbox>`, then type the command's
|
||||
name or select it from the list.
|
||||
|
||||
To add static text to the report, type the text where you want it.
|
||||
|
||||
For more advanced changes, you can :ref:`edit the report in the XML directly
|
||||
For more advanced changes, you can {ref}`edit the report in the XML directly
|
||||
<studio/pdf-reports/XML-editing>`.
|
||||
|
||||
.. _studio/pdf-reports/add-field:
|
||||
(studio-pdf-reports-add-field)=
|
||||
|
||||
Add a field
|
||||
***********
|
||||
##### Add a field
|
||||
|
||||
To add a field, type `/` and select the :guilabel:`Field` command. In the list that opens, select
|
||||
To add a field, type `/` and select the {guilabel}`Field` command. In the list that opens, select
|
||||
or search for the field; click the right arrow next to the field name to access the list of related
|
||||
fields if needed. Then, specify the default value and press `Enter`.
|
||||
|
||||
.. image:: pdf_reports/powerbox-field.png
|
||||
:alt: Select a related field.
|
||||
```{image} pdf_reports/powerbox-field.png
|
||||
:alt: Select a related field.
|
||||
```
|
||||
|
||||
Add a data table
|
||||
****************
|
||||
##### Add a data table
|
||||
|
||||
Data tables are used to display :ref:`relational fields <studio/fields/relational-fields>`. To add
|
||||
a data table, type `/`, select the :guilabel:`Dynamic Table` command, and select the relation to be
|
||||
Data tables are used to display {ref}`relational fields <studio/fields/relational-fields>`. To add
|
||||
a data table, type `/`, select the {guilabel}`Dynamic Table` command, and select the relation to be
|
||||
displayed in the table.
|
||||
|
||||
.. note::
|
||||
Only relations of type `one2many` or `many2many` can be displayed as data tables.
|
||||
:::{note}
|
||||
Only relations of type `one2many` or `many2many` can be displayed as data tables.
|
||||
:::
|
||||
|
||||
Once the table has been added, you can add columns using the table tools. Position the cursor on top
|
||||
of the column, then click the purple rectangle and select an option.
|
||||
|
||||
.. image:: pdf_reports/table-add-column.png
|
||||
:alt: Add a column in a dynamic table.
|
||||
```{image} pdf_reports/table-add-column.png
|
||||
:alt: Add a column in a dynamic table.
|
||||
```
|
||||
|
||||
You can then insert the :ref:`field of your choice
|
||||
You can then insert the {ref}`field of your choice
|
||||
<studio/pdf-reports/add-field>` in the columns. The dialog box that opens shows the source object
|
||||
for the field (e.g., the *Tag* model) and the list of available fields.
|
||||
|
||||
.. image:: pdf_reports/dynamic-table.png
|
||||
:alt: List of available fields for the Tag model.
|
||||
```{image} pdf_reports/dynamic-table.png
|
||||
:alt: List of available fields for the Tag model.
|
||||
```
|
||||
|
||||
.. note::
|
||||
- The default row automatically iterates over the field's content, generating a row on the report
|
||||
for each field value (e.g., one row per tag). You can add static content rows above or below
|
||||
the generated rows using the table tools.
|
||||
- You can also add data tables by :ref:`modifying the report's XML <studio/pdf-reports/XML-editing>`.
|
||||
:::{note}
|
||||
- The default row automatically iterates over the field's content, generating a row on the report
|
||||
for each field value (e.g., one row per tag). You can add static content rows above or below
|
||||
the generated rows using the table tools.
|
||||
- You can also add data tables by {ref}`modifying the report's XML <studio/pdf-reports/XML-editing>`.
|
||||
:::
|
||||
|
||||
Formatting
|
||||
**********
|
||||
##### Formatting
|
||||
|
||||
To format text in the report, select it, then format it using the options in the
|
||||
:ref:`knowledge/text-editor`.
|
||||
{ref}`knowledge/text-editor`.
|
||||
|
||||
.. image:: pdf_reports/text-editor.png
|
||||
:alt: Format text using the text editor.
|
||||
> ```{image} pdf_reports/text-editor.png
|
||||
> :alt: Format text using the text editor.
|
||||
> ```
|
||||
|
||||
.. _studio/pdf-reports/XML-editing:
|
||||
(studio-pdf-reports-xml-editing)=
|
||||
|
||||
Editing the report's XML
|
||||
------------------------
|
||||
### Editing the report's XML
|
||||
|
||||
.. warning::
|
||||
Modifying the XML directly may result in report issues during :doc:`upgrades
|
||||
<../../../administration/upgrade>`. If this happens, simply copy your changes from the old
|
||||
database into your upgraded database.
|
||||
:::{warning}
|
||||
Modifying the XML directly may result in report issues during {doc}`upgrades
|
||||
<../../../administration/upgrade>`. If this happens, simply copy your changes from the old
|
||||
database into your upgraded database.
|
||||
:::
|
||||
|
||||
To edit the report's XML, click :guilabel:`Edit sources` in the left pane.
|
||||
To edit the report's XML, click {guilabel}`Edit sources` in the left pane.
|
||||
|
||||
Examples
|
||||
~~~~~~~~
|
||||
#### Examples
|
||||
|
||||
```{eval-rst}
|
||||
.. spoiler:: Modify a non-compliant table
|
||||
|
||||
Sometimes, tables are not properly recognized as such due to complex structures. In those cases,
|
||||
@@ -370,7 +373,9 @@ Examples
|
||||
|
||||
.. image:: pdf_reports/XML-SO-product-category.png
|
||||
:alt: Add a Product Category column in a SO.
|
||||
```
|
||||
|
||||
```{eval-rst}
|
||||
.. spoiler:: Add a data table
|
||||
|
||||
To add a table in XML, you need to know the names of the fields and objects you wish to access
|
||||
@@ -407,7 +412,9 @@ Examples
|
||||
When adding tables manually, style them using `Bootstrap classes
|
||||
<https://getbootstrap.com/docs/5.1/content/tables>`_, like the `table` class included in the
|
||||
example above.
|
||||
```
|
||||
|
||||
```{eval-rst}
|
||||
.. spoiler:: Conditional blocks
|
||||
|
||||
If you want to show/hide content based on specific conditions, you can manually add `if/else`
|
||||
@@ -501,7 +508,9 @@ Examples
|
||||
The title *Pro-Forma Invoice* is used depending on some contextual conditions. If these
|
||||
conditions are not met and the state of the document is either `draft` or `sent`, then
|
||||
*Quotation* is used. If none of those conditions are met, the report's title is *Order*.
|
||||
```
|
||||
|
||||
```{eval-rst}
|
||||
.. spoiler:: Images
|
||||
|
||||
Working with images in a report can be challenging, as precise control over image size and
|
||||
@@ -569,3 +578,5 @@ Examples
|
||||
|
||||
.. image:: pdf_reports/XML-images.png
|
||||
:alt: Add a column with the product image in the quotation table.
|
||||
```
|
||||
|
||||
@@ -0,0 +1,410 @@
|
||||
# Views
|
||||
|
||||
Views are the interface that allows displaying the data contained in a {doc}`model
|
||||
<models_modules_apps>`. One model can have several views, which are simply different ways to show
|
||||
the same data. In Studio, views are organized into four categories: {ref}`general
|
||||
<studio/views/general>`, {ref}`multiple records <studio/views/multiple-records>`, {ref}`timeline
|
||||
<studio/views/timeline>`, and {ref}`reporting <studio/views/reporting>`.
|
||||
|
||||
::::{tip}
|
||||
- To change the default view of a model, {ref}`access Studio <studio/access>`, go to
|
||||
{guilabel}`Views`, click the {icon}`fa-ellipsis-v` ({guilabel}`ellipsis`) icon next to the
|
||||
desired view, and click {guilabel}`Set as Default`.
|
||||
|
||||
- You can modify views using the built-in XML editor: Activate the {ref}`Developer mode
|
||||
<developer-mode>`, go to the view you want to edit, select the {guilabel}`View` tab, and
|
||||
click {guilabel}`</> XML`.
|
||||
|
||||
:::{important}
|
||||
If you are editing a view using the XML editor, avoid making changes directly to standard
|
||||
and inherited views, as these would be reset and lost during updates or module upgrades.
|
||||
Always make sure you select the right Studio inherited views: When you modify a
|
||||
view in Studio by dragging and dropping a new field, for example, a specific Studio
|
||||
inherited view and its corresponding XPath, which defines the modified part of the view, are
|
||||
automatically generated.
|
||||
:::
|
||||
::::
|
||||
|
||||
(studio-views-general)=
|
||||
|
||||
## General views
|
||||
|
||||
:::{note}
|
||||
The settings described below are found under the view's {guilabel}`View` tab unless specified
|
||||
otherwise.
|
||||
:::
|
||||
|
||||
(studio-views-general-form)=
|
||||
|
||||
### Form
|
||||
|
||||
The {guilabel}`Form` {icon}`fa-address-card` view is used when creating and editing records, such as
|
||||
contacts, sales orders, products, etc.
|
||||
|
||||
- To structure a form, drag and drop the {guilabel}`Tabs and Columns` element found under the
|
||||
{guilabel}`+ Add` tab.
|
||||
|
||||
- To prevent users from creating, editing, or deleting records, untick {guilabel}`Can Create`,
|
||||
{guilabel}`Can Edit`, or {guilabel}`Can Delete`.
|
||||
|
||||
- To add a button, click {guilabel}`Add a button` at the top of the form, enter a {guilabel}`Label`,
|
||||
and select the button's action:
|
||||
|
||||
- {guilabel}`Run a Server Action`: select the {ref}`server action <reference/actions/server>` to
|
||||
be executed from the dropdown list;
|
||||
- {guilabel}`Call a method`: specify an existing Python method already defined in Odoo.
|
||||
|
||||
- To change a button's label or style, click the button and edit its {guilabel}`Label` or
|
||||
{guilabel}`Class` (either `btn-primary` or `btn-secondary`) in the {guilabel}`Properties` tab.
|
||||
|
||||
- To add a smart button, click the {icon}`fa-plus-square` ({guilabel}`plus`) icon in the top-right
|
||||
corner of the form. Enter a {guilabel}`Label`, choose an {guilabel}`Icon`, and select a
|
||||
{ref}`related field <studio/fields/relational-fields/related-field>`.
|
||||
|
||||
```{eval-rst}
|
||||
.. example::
|
||||
|
||||
.. image:: views/form-sales-order.png
|
||||
:alt: Sales order model's Form view
|
||||
```
|
||||
|
||||
(studio-views-general-activity)=
|
||||
|
||||
### Activity
|
||||
|
||||
The {guilabel}`Activity` {icon}`fa-clock-o` view is used to schedule and have an overview of
|
||||
activities (emails, calls, etc.) linked to records.
|
||||
|
||||
:::{note}
|
||||
This view can only be modified within Studio by editing the XML code.
|
||||
:::
|
||||
|
||||
```{eval-rst}
|
||||
.. example::
|
||||
|
||||
.. image:: views/activity-lead-opportunity.png
|
||||
:alt: Lead/Opportunity model's Activity view
|
||||
```
|
||||
|
||||
(studio-views-general-search)=
|
||||
|
||||
### Search
|
||||
|
||||
The {guilabel}`Search` {icon}`oi-search` view is added on top of other views to filter, group, and
|
||||
search records.
|
||||
|
||||
- To add custom {guilabel}`Filters` and structure them using {guilabel}`Separators`, go to the
|
||||
{guilabel}`+ Add` tab and drag and drop them under {guilabel}`Filters`.
|
||||
- To add an existing field under the search dropdown menu, go to the {guilabel}`+ Add` tab and
|
||||
drag and drop it under {guilabel}`Autocompletion Fields`.
|
||||
|
||||
```{eval-rst}
|
||||
.. example::
|
||||
|
||||
.. image:: views/search-project-kanban.png
|
||||
:alt: Project model's Search view on the Kanban view
|
||||
```
|
||||
|
||||
(studio-views-multiple-records)=
|
||||
|
||||
## Multiple records views
|
||||
|
||||
:::{note}
|
||||
The settings described below are found under the view's {guilabel}`View` tab unless specified
|
||||
otherwise.
|
||||
:::
|
||||
|
||||
(studio-views-multiple-records-kanban)=
|
||||
|
||||
### Kanban
|
||||
|
||||
The {guilabel}`Kanban` {icon}`oi-view-kanban` view is often used to support business flows by moving
|
||||
records across stages or as an alternative way to display records inside *cards*.
|
||||
|
||||
:::{note}
|
||||
If the {guilabel}`Kanban` view exists, it is used by default to display data on mobile devices
|
||||
instead of the {ref}`List view <studio/views/multiple-records/list>`.
|
||||
:::
|
||||
|
||||
- To prevent users from creating new records, untick {guilabel}`Can Create`.
|
||||
- To create records directly within the view, in a minimalistic form, enable {guilabel}`Quick
|
||||
Create`.
|
||||
- To set a default grouping for records, select a field under {guilabel}`Default Group By`.
|
||||
|
||||
```{eval-rst}
|
||||
.. example::
|
||||
|
||||
.. image:: views/kanban-project.png
|
||||
:alt: Project model's Kanban view
|
||||
```
|
||||
|
||||
(studio-views-multiple-records-list)=
|
||||
|
||||
### List
|
||||
|
||||
The {guilabel}`List` {icon}`oi-view-list` view is used to overview many records at once, look for
|
||||
records, and edit simple records.
|
||||
|
||||
- To prevent users from creating, editing, or deleting records, untick {guilabel}`Can Create`,
|
||||
{guilabel}`Can Edit`, or {guilabel}`Can Delete`.
|
||||
|
||||
- To create and edit records directly within the view, select either {guilabel}`Add record at the
|
||||
bottom`, {guilabel}`Add record on top` or {guilabel}`Open form view` under
|
||||
{guilabel}`When Creating Record`.
|
||||
|
||||
:::{note}
|
||||
This prevents users from opening records in {ref}`Form view <studio/views/general/form>` from the
|
||||
{guilabel}`List` view.
|
||||
:::
|
||||
|
||||
- To edit several records at once, tick {guilabel}`Enable Mass Editing`.
|
||||
|
||||
- To change the way records are sorted by default, select a field under {guilabel}`Sort By`.
|
||||
|
||||
- To set a default grouping for records, select a field under {guilabel}`Default Group By`.
|
||||
|
||||
- To add a button, click {guilabel}`Add a button` at the top of the list, enter a {guilabel}`Label`,
|
||||
and select the button's action:
|
||||
|
||||
- {guilabel}`Run a Server Action`: select the {ref}`server action <reference/actions/server>` to
|
||||
be executed from the dropdown list;
|
||||
- {guilabel}`Call a method`: specify an existing Python method already defined in Odoo.
|
||||
|
||||
:::{tip}
|
||||
To add a {icon}`oi-draggable` ({guilabel}`drag handle`) icon to reorder records manually, add an
|
||||
{ref}`Integer field <studio/fields/simple-fields/integer>` with the {guilabel}`Handle` widget.
|
||||
|
||||
```{image} views/list-drag-handle.png
|
||||
:alt: Drag handle icon enabling to sort records manually in List view
|
||||
```
|
||||
:::
|
||||
|
||||
```{eval-rst}
|
||||
.. example::
|
||||
|
||||
.. image:: views/list-sales-order.png
|
||||
:alt: Sales order model's List view
|
||||
```
|
||||
|
||||
(studio-views-multiple-records-map)=
|
||||
|
||||
### Map
|
||||
|
||||
The {guilabel}`Map` {icon}`fa-map-marker` view is used to display records on a map. For example, it
|
||||
is used in the Field Service app to plan an itinerary between different tasks.
|
||||
|
||||
:::{note}
|
||||
A {ref}`Many2One field <studio/fields/relational-fields/many2one>` linked to the *Contact* model
|
||||
is required to activate the view, as the contact address is used to position records on the map.
|
||||
:::
|
||||
|
||||
- To select which kind of contact should be used on the map, select it under {guilabel}`Contact
|
||||
Field`.
|
||||
- To hide the name or the address of the record, tick {guilabel}`Hide Name` or {guilabel}`Hide
|
||||
Address`.
|
||||
- To add information from other fields, select them under {guilabel}`Additional Fields`.
|
||||
- To have a route suggested between the different records, tick {guilabel}`Enable Routing` and
|
||||
select which field should be used to sort records for the routing.
|
||||
|
||||
```{eval-rst}
|
||||
.. example::
|
||||
|
||||
.. image:: views/map-task.png
|
||||
:alt: Task model's Map view
|
||||
```
|
||||
|
||||
(studio-views-timeline)=
|
||||
|
||||
## Timeline views
|
||||
|
||||
:::{note}
|
||||
- When you first activate one of the timeline views, you need to select which {ref}`Date
|
||||
<studio/fields/simple-fields/date>` or {ref}`Date & Time
|
||||
<studio/fields/simple-fields/date-time>` fields on your model should be used to define when the
|
||||
records start and stop in order to display them on the view. You can modify the
|
||||
{guilabel}`Start Date Field` and {guilabel}`Stop Date Field` after activating the view.
|
||||
- The settings described below are found under the view's {guilabel}`View` tab unless specified
|
||||
otherwise.
|
||||
:::
|
||||
|
||||
(studio-views-timeline-calendar)=
|
||||
|
||||
### Calendar
|
||||
|
||||
The {guilabel}`Calendar` {icon}`fa-calendar` view is used to overview and manage records inside a
|
||||
calendar.
|
||||
|
||||
- To create records directly within the view instead of opening the {ref}`Form view
|
||||
<studio/views/general/form>`, enable {guilabel}`Quick Create`.
|
||||
|
||||
:::{note}
|
||||
This only works on specific models that can be *quick-created* using only a *name*. However,
|
||||
most models do not support quick creation and open the {guilabel}`Form` view to fill in the
|
||||
required fields.
|
||||
:::
|
||||
|
||||
- To color records on the calendar, select a field under {guilabel}`Color`. All the records sharing
|
||||
the same value for that field are displayed using the same color.
|
||||
|
||||
:::{note}
|
||||
As the number of colors is limited, the same color can end up being assigned to different
|
||||
values.
|
||||
:::
|
||||
|
||||
- To display events lasting the whole day at the top of the calendar, select a {ref}`Checkbox field
|
||||
<studio/fields/simple-fields/checkbox>` that specifies if the event lasts the whole day.
|
||||
|
||||
- To choose the default time scale used to display events, select {guilabel}`Day`, {guilabel}`Week`,
|
||||
{guilabel}`Month`, or {guilabel}`Year` under {guilabel}`Default Display Mode`.
|
||||
|
||||
:::{note}
|
||||
You can also use a {guilabel}`Delay Field` to display the duration of the event in hours by
|
||||
selecting a {ref}`Decimal <studio/fields/simple-fields/decimal>` or {ref}`Integer
|
||||
<studio/fields/simple-fields/integer>` field on the model which specifies the duration of the
|
||||
event. However, if you set an {guilabel}`End Date Field`, the {guilabel}`Delay Field` will not be
|
||||
taken into account.
|
||||
:::
|
||||
|
||||
```{eval-rst}
|
||||
.. example::
|
||||
|
||||
.. image:: views/calendar-event.png
|
||||
:alt: Calendar Event model's Calendar view
|
||||
```
|
||||
|
||||
(studio-views-timeline-cohort)=
|
||||
|
||||
### Cohort
|
||||
|
||||
The {guilabel}`Cohort` {icon}`oi-view-cohort` view is used to examine the life cycle of records over
|
||||
a time period. For example, it is used in the Subscriptions app to view the subscriptions' retention
|
||||
rate.
|
||||
|
||||
- To display a measure (i.e., the aggregated value of a given field) by default on the view, select
|
||||
a {guilabel}`Measure Field`.
|
||||
- To choose which time interval is used by default to group results, select {guilabel}`Day`,
|
||||
{guilabel}`Week`, {guilabel}`Month`, or {guilabel}`Year` under {guilabel}`Interval`.
|
||||
- To change the cohort {guilabel}`Mode`, select either {guilabel}`Retention` {dfn}`the percentage
|
||||
of records staying over a period of time, it starts at 100% and decreases with time` or
|
||||
{guilabel}`Churn` {dfn}`the percentage of records moving out over a period of time - it starts at
|
||||
0% and increases with time`.
|
||||
- To change the way the {guilabel}`Timeline` (i.e., the columns) progresses, select either
|
||||
{guilabel}`Forward` (from 0 to +15) or {guilabel}`Backward` (from -15 to 0). For most purposes,
|
||||
the {guilabel}`Forward` timeline is used.
|
||||
|
||||
```{eval-rst}
|
||||
.. example::
|
||||
|
||||
.. image:: views/cohort-subscription.png
|
||||
:alt: Subscription model's Cohort view
|
||||
```
|
||||
|
||||
(studio-views-timeline-gantt)=
|
||||
|
||||
### Gantt
|
||||
|
||||
The {guilabel}`Gantt` {icon}`fa-tasks` view is used to forecast and examine the overall progress of
|
||||
records. Records are represented by a bar under a time scale.
|
||||
|
||||
- To prevent users from creating or editing records, untick {guilabel}`Can Create` or {guilabel}`Can
|
||||
Edit`.
|
||||
|
||||
- To fill cells in gray whenever a record should not be created there (e.g., on weekends for
|
||||
employees), tick {guilabel}`Display Unavailability`.
|
||||
|
||||
:::{note}
|
||||
The underlying model must support this feature, and support for it cannot be added using
|
||||
Studio. It is supported for the Project, Time Off, Planning, and Manufacturing apps.
|
||||
:::
|
||||
|
||||
- To show a total row at the bottom, tick {guilabel}`Display Total row`.
|
||||
|
||||
- To collapse multiple records in a single row, tick {guilabel}`Collapse First Level`.
|
||||
|
||||
- To choose which way records are grouped by default on rows (e.g., per employee or project), select
|
||||
a field under {guilabel}`Default Group by`.
|
||||
|
||||
- To define a default time scale to view records, select {guilabel}`Day`, {guilabel}`Week`,
|
||||
{guilabel}`Month`, or {guilabel}`Year` under {guilabel}`Default Scale`.
|
||||
|
||||
- To color records on the view, select a field under {guilabel}`Color`. All the records sharing the
|
||||
same value for that field are displayed using the same color.
|
||||
|
||||
:::{note}
|
||||
As the number of colors is limited, the same color can be assigned to different values.
|
||||
:::
|
||||
|
||||
- To specify with which degree of precision each time scale should be divided by, select
|
||||
{guilabel}`Quarter Hour`, {guilabel}`Half Hour`, or {guilabel}`Hour` under {guilabel}`Day
|
||||
Precision`, {guilabel}`Half Day` or {guilabel}`Day` under {guilabel}`Week Precision`, and
|
||||
{guilabel}`Month Precision`.
|
||||
|
||||
```{eval-rst}
|
||||
.. example::
|
||||
|
||||
.. image:: views/gantt-planning.png
|
||||
:alt: Planning Shift model's Gantt view
|
||||
```
|
||||
|
||||
(studio-views-reporting)=
|
||||
|
||||
## Reporting views
|
||||
|
||||
:::{note}
|
||||
The settings described below are found under the view's {guilabel}`View` tab unless specified
|
||||
otherwise.
|
||||
:::
|
||||
|
||||
(studio-views-reporting-pivot)=
|
||||
|
||||
### Pivot
|
||||
|
||||
The {guilabel}`Pivot` {icon}`oi-view-pivot` view is used to explore and analyze the data contained
|
||||
in records in an interactive manner. It is especially useful to aggregate numeric data, create
|
||||
categories, and drill down the data by expanding and collapsing different levels of data.
|
||||
|
||||
- To access all records whose data is aggregated under a cell, tick {guilabel}`Access records from
|
||||
cell`.
|
||||
- To divide the data into different categories, select field(s) under {guilabel}`Column grouping`,
|
||||
{guilabel}`Row grouping - First level`, or {guilabel}`Row grouping - Second level`.
|
||||
- To add different types of data to be measured using the view, select a field under
|
||||
{guilabel}`Measures`.
|
||||
- To display a count of records that made up the aggregated data in a cell, tick {guilabel}`Display
|
||||
count`.
|
||||
|
||||
```{eval-rst}
|
||||
.. example::
|
||||
|
||||
.. image:: views/pivot-purchase-report.png
|
||||
:alt: Purchase Report model's Pivot view
|
||||
```
|
||||
|
||||
(studio-views-reporting-graph)=
|
||||
|
||||
### Graph
|
||||
|
||||
The {guilabel}`Graph` {icon}`fa-area-chart` view is used to showcase data from records in a bar,
|
||||
line, or pie chart.
|
||||
|
||||
- To change the default chart, select {guilabel}`Bar`, {guilabel}`Line`, or {guilabel}`Pie` under
|
||||
{guilabel}`Type`.
|
||||
- To choose a default data dimension (category), select a field under {guilabel}`First dimension`
|
||||
and, if needed, another under {guilabel}`Second dimension`.
|
||||
- To select a default type of data to be measured using the view, select a field under
|
||||
{guilabel}`Measure`.
|
||||
- *For Bar and Line charts only*: To sort the different data categories by their value, select
|
||||
{guilabel}`Ascending` (from lowest to highest value) or {guilabel}`Descending` (from highest to
|
||||
lowest) under {guilabel}`Sorting`.
|
||||
- *For Bar and Pie charts only*: To access all records whose data is aggregated under a data
|
||||
category on the chart, tick {guilabel}`Access records from graph`.
|
||||
- *For Bar charts only*: When using two data dimensions (categories), display the two columns on top
|
||||
of each other by default by ticking {guilabel}`Stacked graph`.
|
||||
|
||||
```{eval-rst}
|
||||
.. example::
|
||||
|
||||
.. image:: views/graph-sales-report.png
|
||||
:alt: Sales Analysis Report model's Bar chart on Graph view
|
||||
:scale: 75%
|
||||
```
|
||||
|
||||
@@ -1,374 +0,0 @@
|
||||
=====
|
||||
Views
|
||||
=====
|
||||
|
||||
Views are the interface that allows displaying the data contained in a :doc:`model
|
||||
<models_modules_apps>`. One model can have several views, which are simply different ways to show
|
||||
the same data. In Studio, views are organized into four categories: :ref:`general
|
||||
<studio/views/general>`, :ref:`multiple records <studio/views/multiple-records>`, :ref:`timeline
|
||||
<studio/views/timeline>`, and :ref:`reporting <studio/views/reporting>`.
|
||||
|
||||
.. tip::
|
||||
- To change the default view of a model, :ref:`access Studio <studio/access>`, go to
|
||||
:guilabel:`Views`, click the :icon:`fa-ellipsis-v` (:guilabel:`ellipsis`) icon next to the
|
||||
desired view, and click :guilabel:`Set as Default`.
|
||||
- You can modify views using the built-in XML editor: Activate the :ref:`Developer mode
|
||||
<developer-mode>`, go to the view you want to edit, select the :guilabel:`View` tab, and
|
||||
click :guilabel:`</> XML`.
|
||||
|
||||
.. important::
|
||||
If you are editing a view using the XML editor, avoid making changes directly to standard
|
||||
and inherited views, as these would be reset and lost during updates or module upgrades.
|
||||
Always make sure you select the right Studio inherited views: When you modify a
|
||||
view in Studio by dragging and dropping a new field, for example, a specific Studio
|
||||
inherited view and its corresponding XPath, which defines the modified part of the view, are
|
||||
automatically generated.
|
||||
|
||||
.. _studio/views/general:
|
||||
|
||||
General views
|
||||
=============
|
||||
|
||||
.. note::
|
||||
The settings described below are found under the view's :guilabel:`View` tab unless specified
|
||||
otherwise.
|
||||
|
||||
.. _studio/views/general/form:
|
||||
|
||||
Form
|
||||
----
|
||||
|
||||
The :guilabel:`Form` :icon:`fa-address-card` view is used when creating and editing records, such as
|
||||
contacts, sales orders, products, etc.
|
||||
|
||||
- To structure a form, drag and drop the :guilabel:`Tabs and Columns` element found under the
|
||||
:guilabel:`+ Add` tab.
|
||||
- To prevent users from creating, editing, or deleting records, untick :guilabel:`Can Create`,
|
||||
:guilabel:`Can Edit`, or :guilabel:`Can Delete`.
|
||||
- To add a button, click :guilabel:`Add a button` at the top of the form, enter a :guilabel:`Label`,
|
||||
and select the button's action:
|
||||
|
||||
- :guilabel:`Run a Server Action`: select the :ref:`server action <reference/actions/server>` to
|
||||
be executed from the dropdown list;
|
||||
- :guilabel:`Call a method`: specify an existing Python method already defined in Odoo.
|
||||
|
||||
- To change a button's label or style, click the button and edit its :guilabel:`Label` or
|
||||
:guilabel:`Class` (either `btn-primary` or `btn-secondary`) in the :guilabel:`Properties` tab.
|
||||
- To add a smart button, click the :icon:`fa-plus-square` (:guilabel:`plus`) icon in the top-right
|
||||
corner of the form. Enter a :guilabel:`Label`, choose an :guilabel:`Icon`, and select a
|
||||
:ref:`related field <studio/fields/relational-fields/related-field>`.
|
||||
|
||||
.. example::
|
||||
|
||||
.. image:: views/form-sales-order.png
|
||||
:alt: Sales order model's Form view
|
||||
|
||||
.. _studio/views/general/activity:
|
||||
|
||||
Activity
|
||||
--------
|
||||
|
||||
The :guilabel:`Activity` :icon:`fa-clock-o` view is used to schedule and have an overview of
|
||||
activities (emails, calls, etc.) linked to records.
|
||||
|
||||
.. note::
|
||||
This view can only be modified within Studio by editing the XML code.
|
||||
|
||||
.. example::
|
||||
|
||||
.. image:: views/activity-lead-opportunity.png
|
||||
:alt: Lead/Opportunity model's Activity view
|
||||
|
||||
.. _studio/views/general/search:
|
||||
|
||||
Search
|
||||
------
|
||||
|
||||
The :guilabel:`Search` :icon:`oi-search` view is added on top of other views to filter, group, and
|
||||
search records.
|
||||
|
||||
- To add custom :guilabel:`Filters` and structure them using :guilabel:`Separators`, go to the
|
||||
:guilabel:`+ Add` tab and drag and drop them under :guilabel:`Filters`.
|
||||
- To add an existing field under the search dropdown menu, go to the :guilabel:`+ Add` tab and
|
||||
drag and drop it under :guilabel:`Autocompletion Fields`.
|
||||
|
||||
.. example::
|
||||
|
||||
.. image:: views/search-project-kanban.png
|
||||
:alt: Project model's Search view on the Kanban view
|
||||
|
||||
.. _studio/views/multiple-records:
|
||||
|
||||
Multiple records views
|
||||
======================
|
||||
|
||||
.. note::
|
||||
The settings described below are found under the view's :guilabel:`View` tab unless specified
|
||||
otherwise.
|
||||
|
||||
.. _studio/views/multiple-records/kanban:
|
||||
|
||||
Kanban
|
||||
------
|
||||
|
||||
The :guilabel:`Kanban` :icon:`oi-view-kanban` view is often used to support business flows by moving
|
||||
records across stages or as an alternative way to display records inside *cards*.
|
||||
|
||||
.. note::
|
||||
If the :guilabel:`Kanban` view exists, it is used by default to display data on mobile devices
|
||||
instead of the :ref:`List view <studio/views/multiple-records/list>`.
|
||||
|
||||
- To prevent users from creating new records, untick :guilabel:`Can Create`.
|
||||
- To create records directly within the view, in a minimalistic form, enable :guilabel:`Quick
|
||||
Create`.
|
||||
- To set a default grouping for records, select a field under :guilabel:`Default Group By`.
|
||||
|
||||
.. example::
|
||||
|
||||
.. image:: views/kanban-project.png
|
||||
:alt: Project model's Kanban view
|
||||
|
||||
.. _studio/views/multiple-records/list:
|
||||
|
||||
List
|
||||
----
|
||||
|
||||
The :guilabel:`List` :icon:`oi-view-list` view is used to overview many records at once, look for
|
||||
records, and edit simple records.
|
||||
|
||||
- To prevent users from creating, editing, or deleting records, untick :guilabel:`Can Create`,
|
||||
:guilabel:`Can Edit`, or :guilabel:`Can Delete`.
|
||||
- To create and edit records directly within the view, select either :guilabel:`Add record at the
|
||||
bottom`, :guilabel:`Add record on top` or :guilabel:`Open form view` under
|
||||
:guilabel:`When Creating Record`.
|
||||
|
||||
.. note::
|
||||
This prevents users from opening records in :ref:`Form view <studio/views/general/form>` from the
|
||||
:guilabel:`List` view.
|
||||
|
||||
- To edit several records at once, tick :guilabel:`Enable Mass Editing`.
|
||||
- To change the way records are sorted by default, select a field under :guilabel:`Sort By`.
|
||||
- To set a default grouping for records, select a field under :guilabel:`Default Group By`.
|
||||
- To add a button, click :guilabel:`Add a button` at the top of the list, enter a :guilabel:`Label`,
|
||||
and select the button's action:
|
||||
|
||||
- :guilabel:`Run a Server Action`: select the :ref:`server action <reference/actions/server>` to
|
||||
be executed from the dropdown list;
|
||||
- :guilabel:`Call a method`: specify an existing Python method already defined in Odoo.
|
||||
|
||||
.. tip::
|
||||
To add a :icon:`oi-draggable` (:guilabel:`drag handle`) icon to reorder records manually, add an
|
||||
:ref:`Integer field <studio/fields/simple-fields/integer>` with the :guilabel:`Handle` widget.
|
||||
|
||||
.. image:: views/list-drag-handle.png
|
||||
:alt: Drag handle icon enabling to sort records manually in List view
|
||||
|
||||
.. example::
|
||||
|
||||
.. image:: views/list-sales-order.png
|
||||
:alt: Sales order model's List view
|
||||
|
||||
.. _studio/views/multiple-records/map:
|
||||
|
||||
Map
|
||||
---
|
||||
|
||||
The :guilabel:`Map` :icon:`fa-map-marker` view is used to display records on a map. For example, it
|
||||
is used in the Field Service app to plan an itinerary between different tasks.
|
||||
|
||||
.. note::
|
||||
A :ref:`Many2One field <studio/fields/relational-fields/many2one>` linked to the *Contact* model
|
||||
is required to activate the view, as the contact address is used to position records on the map.
|
||||
|
||||
- To select which kind of contact should be used on the map, select it under :guilabel:`Contact
|
||||
Field`.
|
||||
- To hide the name or the address of the record, tick :guilabel:`Hide Name` or :guilabel:`Hide
|
||||
Address`.
|
||||
- To add information from other fields, select them under :guilabel:`Additional Fields`.
|
||||
- To have a route suggested between the different records, tick :guilabel:`Enable Routing` and
|
||||
select which field should be used to sort records for the routing.
|
||||
|
||||
.. example::
|
||||
|
||||
.. image:: views/map-task.png
|
||||
:alt: Task model's Map view
|
||||
|
||||
.. _studio/views/timeline:
|
||||
|
||||
Timeline views
|
||||
==============
|
||||
|
||||
.. note::
|
||||
- When you first activate one of the timeline views, you need to select which :ref:`Date
|
||||
<studio/fields/simple-fields/date>` or :ref:`Date & Time
|
||||
<studio/fields/simple-fields/date-time>` fields on your model should be used to define when the
|
||||
records start and stop in order to display them on the view. You can modify the
|
||||
:guilabel:`Start Date Field` and :guilabel:`Stop Date Field` after activating the view.
|
||||
- The settings described below are found under the view's :guilabel:`View` tab unless specified
|
||||
otherwise.
|
||||
|
||||
.. _studio/views/timeline/calendar:
|
||||
|
||||
Calendar
|
||||
--------
|
||||
|
||||
The :guilabel:`Calendar` :icon:`fa-calendar` view is used to overview and manage records inside a
|
||||
calendar.
|
||||
|
||||
- To create records directly within the view instead of opening the :ref:`Form view
|
||||
<studio/views/general/form>`, enable :guilabel:`Quick Create`.
|
||||
|
||||
.. note::
|
||||
This only works on specific models that can be *quick-created* using only a *name*. However,
|
||||
most models do not support quick creation and open the :guilabel:`Form` view to fill in the
|
||||
required fields.
|
||||
|
||||
- To color records on the calendar, select a field under :guilabel:`Color`. All the records sharing
|
||||
the same value for that field are displayed using the same color.
|
||||
|
||||
.. note::
|
||||
As the number of colors is limited, the same color can end up being assigned to different
|
||||
values.
|
||||
|
||||
- To display events lasting the whole day at the top of the calendar, select a :ref:`Checkbox field
|
||||
<studio/fields/simple-fields/checkbox>` that specifies if the event lasts the whole day.
|
||||
|
||||
- To choose the default time scale used to display events, select :guilabel:`Day`, :guilabel:`Week`,
|
||||
:guilabel:`Month`, or :guilabel:`Year` under :guilabel:`Default Display Mode`.
|
||||
|
||||
.. note::
|
||||
You can also use a :guilabel:`Delay Field` to display the duration of the event in hours by
|
||||
selecting a :ref:`Decimal <studio/fields/simple-fields/decimal>` or :ref:`Integer
|
||||
<studio/fields/simple-fields/integer>` field on the model which specifies the duration of the
|
||||
event. However, if you set an :guilabel:`End Date Field`, the :guilabel:`Delay Field` will not be
|
||||
taken into account.
|
||||
|
||||
.. example::
|
||||
|
||||
.. image:: views/calendar-event.png
|
||||
:alt: Calendar Event model's Calendar view
|
||||
|
||||
.. _studio/views/timeline/cohort:
|
||||
|
||||
Cohort
|
||||
------
|
||||
|
||||
The :guilabel:`Cohort` :icon:`oi-view-cohort` view is used to examine the life cycle of records over
|
||||
a time period. For example, it is used in the Subscriptions app to view the subscriptions' retention
|
||||
rate.
|
||||
|
||||
- To display a measure (i.e., the aggregated value of a given field) by default on the view, select
|
||||
a :guilabel:`Measure Field`.
|
||||
- To choose which time interval is used by default to group results, select :guilabel:`Day`,
|
||||
:guilabel:`Week`, :guilabel:`Month`, or :guilabel:`Year` under :guilabel:`Interval`.
|
||||
- To change the cohort :guilabel:`Mode`, select either :guilabel:`Retention` :dfn:`the percentage
|
||||
of records staying over a period of time, it starts at 100% and decreases with time` or
|
||||
:guilabel:`Churn` :dfn:`the percentage of records moving out over a period of time - it starts at
|
||||
0% and increases with time`.
|
||||
- To change the way the :guilabel:`Timeline` (i.e., the columns) progresses, select either
|
||||
:guilabel:`Forward` (from 0 to +15) or :guilabel:`Backward` (from -15 to 0). For most purposes,
|
||||
the :guilabel:`Forward` timeline is used.
|
||||
|
||||
.. example::
|
||||
|
||||
.. image:: views/cohort-subscription.png
|
||||
:alt: Subscription model's Cohort view
|
||||
|
||||
.. _studio/views/timeline/gantt:
|
||||
|
||||
Gantt
|
||||
-----
|
||||
|
||||
The :guilabel:`Gantt` :icon:`fa-tasks` view is used to forecast and examine the overall progress of
|
||||
records. Records are represented by a bar under a time scale.
|
||||
|
||||
- To prevent users from creating or editing records, untick :guilabel:`Can Create` or :guilabel:`Can
|
||||
Edit`.
|
||||
- To fill cells in gray whenever a record should not be created there (e.g., on weekends for
|
||||
employees), tick :guilabel:`Display Unavailability`.
|
||||
|
||||
.. note::
|
||||
The underlying model must support this feature, and support for it cannot be added using
|
||||
Studio. It is supported for the Project, Time Off, Planning, and Manufacturing apps.
|
||||
|
||||
- To show a total row at the bottom, tick :guilabel:`Display Total row`.
|
||||
- To collapse multiple records in a single row, tick :guilabel:`Collapse First Level`.
|
||||
- To choose which way records are grouped by default on rows (e.g., per employee or project), select
|
||||
a field under :guilabel:`Default Group by`.
|
||||
- To define a default time scale to view records, select :guilabel:`Day`, :guilabel:`Week`,
|
||||
:guilabel:`Month`, or :guilabel:`Year` under :guilabel:`Default Scale`.
|
||||
- To color records on the view, select a field under :guilabel:`Color`. All the records sharing the
|
||||
same value for that field are displayed using the same color.
|
||||
|
||||
.. note::
|
||||
As the number of colors is limited, the same color can be assigned to different values.
|
||||
|
||||
- To specify with which degree of precision each time scale should be divided by, select
|
||||
:guilabel:`Quarter Hour`, :guilabel:`Half Hour`, or :guilabel:`Hour` under :guilabel:`Day
|
||||
Precision`, :guilabel:`Half Day` or :guilabel:`Day` under :guilabel:`Week Precision`, and
|
||||
:guilabel:`Month Precision`.
|
||||
|
||||
.. example::
|
||||
|
||||
.. image:: views/gantt-planning.png
|
||||
:alt: Planning Shift model's Gantt view
|
||||
|
||||
.. _studio/views/reporting:
|
||||
|
||||
Reporting views
|
||||
===============
|
||||
|
||||
.. note::
|
||||
The settings described below are found under the view's :guilabel:`View` tab unless specified
|
||||
otherwise.
|
||||
|
||||
.. _studio/views/reporting/pivot:
|
||||
|
||||
Pivot
|
||||
-----
|
||||
|
||||
The :guilabel:`Pivot` :icon:`oi-view-pivot` view is used to explore and analyze the data contained
|
||||
in records in an interactive manner. It is especially useful to aggregate numeric data, create
|
||||
categories, and drill down the data by expanding and collapsing different levels of data.
|
||||
|
||||
- To access all records whose data is aggregated under a cell, tick :guilabel:`Access records from
|
||||
cell`.
|
||||
- To divide the data into different categories, select field(s) under :guilabel:`Column grouping`,
|
||||
:guilabel:`Row grouping - First level`, or :guilabel:`Row grouping - Second level`.
|
||||
- To add different types of data to be measured using the view, select a field under
|
||||
:guilabel:`Measures`.
|
||||
- To display a count of records that made up the aggregated data in a cell, tick :guilabel:`Display
|
||||
count`.
|
||||
|
||||
.. example::
|
||||
|
||||
.. image:: views/pivot-purchase-report.png
|
||||
:alt: Purchase Report model's Pivot view
|
||||
|
||||
.. _studio/views/reporting/graph:
|
||||
|
||||
Graph
|
||||
-----
|
||||
|
||||
The :guilabel:`Graph` :icon:`fa-area-chart` view is used to showcase data from records in a bar,
|
||||
line, or pie chart.
|
||||
|
||||
- To change the default chart, select :guilabel:`Bar`, :guilabel:`Line`, or :guilabel:`Pie` under
|
||||
:guilabel:`Type`.
|
||||
- To choose a default data dimension (category), select a field under :guilabel:`First dimension`
|
||||
and, if needed, another under :guilabel:`Second dimension`.
|
||||
- To select a default type of data to be measured using the view, select a field under
|
||||
:guilabel:`Measure`.
|
||||
- *For Bar and Line charts only*: To sort the different data categories by their value, select
|
||||
:guilabel:`Ascending` (from lowest to highest value) or :guilabel:`Descending` (from highest to
|
||||
lowest) under :guilabel:`Sorting`.
|
||||
- *For Bar and Pie charts only*: To access all records whose data is aggregated under a data
|
||||
category on the chart, tick :guilabel:`Access records from graph`.
|
||||
- *For Bar charts only*: When using two data dimensions (categories), display the two columns on top
|
||||
of each other by default by ticking :guilabel:`Stacked graph`.
|
||||
|
||||
.. example::
|
||||
|
||||
.. image:: views/graph-sales-report.png
|
||||
:alt: Sales Analysis Report model's Bar chart on Graph view
|
||||
:scale: 75%
|
||||
Reference in New Issue
Block a user