Campos e widgets
Campos estruturam os modelos de um banco de dados. Se você pensar em um modelo como uma tabela ou planilha, os campos são as colunas e os registros são as linhas individuais. Os campos também definem o tipo de dados armazenados neles. A forma como os dados de um campo são apresentados e formatados na UI (Interface do Usuário) é controlada pelo seu widget.
Com o Studio, é possível:
add new fields <studio/fields/add-new> to your database. From a technical point of view, there are 15 field types <studio/fields/field-types> in Odoo. However, you can choose from 21 field types in Studio, as some field types are available more than once with a different default widget;
add existing fields, <studio/fields/add-existing> i.e., fields that already exists on a model, to any view of that model;
modify a field's properties <studio/fields/modify>; or
remove a field from a view <studio/fields/remove>.
Campos criados usando Studio são salvos como colunas no seu banco de dados Odoo. Campos de propriedade, por outro lado, funcionam como pseudo-campos; eles são compartilhados por todos os registros vinculados ao mesmo registro pai (por exemplo, para tarefas, o projeto, ou para um produto, a categoria do produto), mas não são salvos como colunas no seu banco de dados.
Adicionar um campo Deadline à visualização de formulário de uma tarefa usando Studio torna esse campo visível em todas as tarefas no seu banco de dados. Adicionar um campo de propriedade Special instructions a uma tarefa torna o campo visível em todas as tarefas dentro do mesmo projeto (ou seja, seu pai) enquanto as tarefas de outros projetos permanecem inalteradas.
Tipos de campos
Os campos podem ser amplamente divididos em duas categorias:
Simple fields <studio/fields/simple-fields>, which contain basic values, such as text, numbers, files, etc.
Relational fields <studio/fields/relational-fields>, which are used to link and display the data from records on another model.
Campos de IA são essencialmente campos Odoo padrão com capacidades de IA adicionadas que permitem que seus valores sejam gerados automaticamente através de prompts.
Campos simples
Texto (char)
O campo Texto é usado para texto curto contendo qualquer caractere. Uma linha de texto é exibida ao preencher o campo.
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.
Copy to Clipboard: users can copy the value by clicking a button.
E-mail: the value becomes a clickable mailto link.
Image: displays an image using a URL. The value cannot be edited manually, but a default value can be set.
Phone: the value becomes a clickable tel link.
URL: the value becomes a clickable URL.
Texto multilinha (text)
O campo Texto multilinha é usado para textos mais longos que contenham qualquer tipo de caractere. Duas linhas de texto são exibidas na interface do usuário quando o campo é preenchido.
Copy to Clipboard: users can copy the value by clicking a button.
Número inteiro (integer)
O campo Número inteiro é usado para todos os números inteiros (positivos, negativos ou zero, sem decimal).
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.
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.
Handle: displays a drag handle icon to order records manually in List view <studio/views/multiple-records/list>.
Decimal (float)
O campo Decimal é usado para todos os números decimais (positivo, negativo ou zero, com decimal).
Monetary: it is similar to using the Monetary field <studio/fields/simple-fields-monetary>. It is recommended to use the latter as it offers more functionalities.
Percentage: displays a percent character % after the value.
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.
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.
Time: the value must follow the hh:mm format, with a maximum of 59 minutes.
Monetário (monetário)
O campo Monetário é usado para todos os valores monetários.
Html (html)
O campo Html é usado para adicionar texto que pode ser editado usando o editor HTML do Odoo.
Multiline Text: disables the Odoo HTML editor to allow editing raw HTML.
Data (date)'
O campo Data é usado para selecionar uma data em um calendário.
Remaining Days: the remaining number of days before the selected date is displayed (e.g., In 5 days), based on the current date. This field should be set to Read only.
Data e Hora (datetime)
O campo Data e Hora é usado para selecionar uma data em um calendário e uma hora em um relógio. A hora atual do usuário é usada automaticamente se nenhuma hora for definida.
Assim como as propriedades gerais <studio/fields/properties>, algumas propriedades específicas <studio/fields/properties-date-datetime> estão disponíveis para os campos Data e Hora que têm o widget Data e Hora ou Intervalo de data definido.
Intervalo de datas (daterange)
O widget Intervalo de datar é usado para exibir um período de tempo definido por uma data de início e uma data de término em uma única linha. Um intervalo de datas pode ter uma data de início e de término obrigatória, por exemplo, para um evento de vários dias, ou permitir uma data de início ou de término opcional, por exemplo, para uma intervenção de serviço de campo ou uma tarefa de projeto.
A adição de um intervalo de datas requer dois campos: um campo Data e Hora com o widget Intervalo de datas definido e outro campo selecionado como a data inicial ou a data final. Esse campo subjacente pode ser um campo Data <studio/fields/simple-fields-date> ou Data e Hora existente, ou um campo criado especificamente para essa finalidade.
Para adicionar um intervalo de datas:
Identify an existing Date or Date & Time field that can be used as the underlying start/end date field, or add a new one. If the date range:
has a mandatory start date and end date, this field can be either the start date or end date; the outcome is the same.
allows an optional start or end date, this field is the start date or end date, respectively.
Para evitar a visualização da mesma informação duas vezes, o campo de data de início/término subjacente pode ser tornado invisível ativando Invisível ou removido da visualização clicando em Remover da visão.
Add a Date & Time field and set the Widget field to Date Range.
Enter an appropriate Label.
Select the underlying start/end date field from the Start date field or End date field dropdown, as relevant.
If the date range should have a mandatory start and end date, enable Always range.
Update any other general properties <studio/fields/properties> or specific properties for Date & Time fields <studio/fields/properties-date-datetime> as needed, then click Close in the upper right corner of the screen.
Dias restantes (remaining_days)
O widget Dias remanescentes exibe o número restante de dias antes da data selecionada (por exemplo, Em 5 dias), com base na data e na hora atuais. Esse campo deve ser definido como Somente leitura.
Caixa de seleção (boolean)
O campo Caixa de seleção é usado quando um valor deve ser apenas verdadeiro ou falso, indicado pela marcação ou desmarcação de uma caixa de seleção.
Button: displays a radio button. The widget works without switching to the edit mode.
Toggle: displays a toggle button. The widget works without switching to the edit mode.
Seleção (selection)
O campo Seleção é usado quando os usuários devem selecionar um único valor em um grupo de valores predefinidos.
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.
Badges: displays all selectable values simultaneously inside rectangular shapes, organized horizontally.
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 Priority field <studio/fields/simple-fields-priority>, although, for the latter, four priority values are already predefined.
Radio: displays all selectable values at the same time as radio buttons.
Status Bar: displays all selectable values at the same time as an arrow progress bar.
Prioridade (selection)
O campo Prioridade é usado para exibir um sistema de classificação de três estrelas, que pode ser usado para indicar a importância ou o nível de satisfação. Esse tipo de campo é um Campo de seleção <studio/fields/simple-fields/selection> com o widget Prioridade selecionado por padrão e quatro valores de prioridade predefinidos. Consequentemente, os widgets Medalha, Medalhas, Rádio e Seleção têm os mesmos efeitos descritos em Seleção<studio/fields/simple-fields-selection>.
Arquivo (binary)
O campo Arquivo é usado para carregar qualquer tipo de arquivo ou assinar um formulário (widget:guilabel:Assinar).
Image: users can upload an image file, which is then displayed in Form view <studio/views/general/form>. This has the same effect as using the Image field <studio/fields/simple-fields-image>.
PDF Viewer: users can upload a PDF file, which can be then browsed from the Form view <studio/views/general/form>.
Sign: users can electronically sign the form. This has the same effect as selecting the Sign field <studio/fields/simple-fields-sign>.
Imagem (binary)
O campo Imagem é utilizado para carregar uma imagem e exibi-la na Visualização de formulário <studio/views/general/form>. Esse tipo de campo é um File field <studio/fields/simple-fields-file> com o widget Imagem selecionado por padrão. Consequentemente, os widgets Arquivo, Visualizador de PDF e Assinar têm os mesmos efeitos descritos em Arquivo <studio/fields/simple-fields-file>.
Assinar (binary)
O campo Assinar é usado para assinar o formulário eletronicamente. Esse tipo de campo é um Campo de arquivo <studio/fields/simple-fields-file> com o widget Assinar selecionado por padrão. Consequentemente, os widgets Arquivo, Imagem e Visualizador de PDF têm os mesmos efeitos descritos em Arquivo <studio/fields/simple-fields/file>.
Campos relacionais
Many2One (many2one)
Campos Many2One é usado para vincular outro registro (de outro modelo) ao registro que está sendo editado. O nome do registro do outro modelo é então exibido no registro que está sendo editado.
Badge: displays the value inside a rounded shape, similar to a tag. The value cannot be edited on the UI.
Radio: displays all selectable values at the same time as radio buttons.
One2Many (one2many)
O campo One2Many é usado para exibir as relações existentes entre um registro no modelo atual e vários registros de outro modelo.
Linhas (one2many)
O campo Linhas é usado para criar uma tabela com linhas e colunas (por exemplo, as linhas de produtos em um pedido de vendas).
Many2Many (many2many)
O campo Many2Many é usado para vincular vários registros de outro modelo a vários registros no modelo atual. Os campos Many2Many podem usar Desabilitar criação, Desabilitar abertura, Domínio, assim como os campos Many2One <studio/fields/relational-fields-many2one>.
Checkboxes: users can select several values using checkboxes.
Tags: users can select several values appearing in rounded shapes, also known as tags. This has the same effect as selecting the Tags field <studio/fields/relational-fields-tags>.
Marcadores (many2many)
O campo Marcadores é usado para exibir vários valores de outro modelo que aparecem em formas arredondadas, também conhecidos como marcadores. Esse tipo de campo é um campo Many2Many <studio/fields/relational-fields/many2many> com o widget Tags selecionado por padrão. Consequentemente, os widgets Checkboxes e Many2Many têm os mesmos efeitos descritos em Many2Many <studio/fields/relational-fields-many2many>.
Adicionar um campo a uma visualização
Com Studio, é possível adicionar:
a new field <studio/fields/add-new> to a form <studio/views/general/form> or list view <studio/views/multiple-records/list> of a model
an existing field <studio/fields/add-existing>, i.e., a field that already exists on the model in question, to any view of that model
Adicionar um novo campo
Para adicionar um novo campo, siga estas etapas:
Navigate to the relevant form or list view, then click the oi-studio (Toggle Studio) icon in the upper-right corner. Alternatively, with any app open, click the oi-studio (Toggle Studio) icon, then navigate to the relevant form or list view.
In the fa-plus Add tab, drag the relevant field type <studio/fields/field-types> from the New Fields section and drop it in the desired position. If the new field is a relational field <studio/fields/relational-fields>, select the relevant reciprocal field, model, or related field in the pop-up.
In the fa-server Properties tab, configure the field's properties <studio/fields/properties>:
Enter the Label to be displayed as the field name on the UI; this is also used to generate the default technical name of the field.
Click anywhere outside the Label field to see the Technical Name updated with the default technical name.
Optionally, select a different Widget via the dropdown; the default widget for the field type <studio/fields/field-types> is selected by default.
Optionally, configure any other field properties <studio/fields/properties>.
Click Close in the top-right corner to close Studio.
Adding a new AI field <ai/add-a-new-field>
Adicionar um campo existente
Para adicionar um campo que existe no modelo mas que não está presente na visualização atual, siga estas etapas:
Navigate to the relevant view, then click the oi-studio (Toggle Studio) icon in the upper-right corner. Alternatively, with any app open, click the oi-studio (Toggle Studio) icon, then navigate to the relevant view.
In the fa-plus Add tab, in the left panel, click Existing Fields fa-caret-right to reveal a list of all the model's fields that are not currently present in the view.
Drag the relevant field and drop it in the desired position.
In the fa-server Properties tab, configure the relevant properties <studio/fields/properties> for the field in the current view.
Várias propriedades podem ser configuradas independentemente para diferentes visualizações, se necessário, como o Rótulo, o Widget, a visibilidade do campo para determinados grupos de usuários, bem como se o campo é Invisível, Obrigatório ou Somente Leitura.
Click Close in the top-right corner to close Studio.
Propriedades do campo
Uma série de propriedades gerais <studio/fields/properties-general> pode ser configurada para a maioria das combinações de tipo de campo e widget <studio/fields/field-types>. Propriedades adicionais estão disponíveis dependendo do tipo de campo e widget específicos selecionados. Por exemplo, campos Data e Hora usando o widget Data e Hora ou Intervalo de Datas têm várias propriedades específicas <studio/fields/properties-date-datetime> que podem ser configuradas.
Propriedades gerais
Class: Use Bootstrap or other custom classes defined in Odoo to customize how the field is styled and displayed on the UI.
Invisible: Enable this property when it is not necessary for users to view a field on the UI. This helps declutter the UI by only showing the essential fields depending on a specific situation.
Required: Enable this property if a field should always be completed by the user before being able to proceed.
Readonly: Enable this property if users should not be able to modify a field.
Label: This is the field name on the UI; the label is used to generate the technical name of the field.
Help Tooltip: To explain the purpose of a field, add a description. The text is displayed inside a tooltip box when hovering with your mouse over the question mark beside the field's label.
Technical Name: To view a field's technical name in Studio (and, during the configuration of a new field, edit it if desired), activate developer mode <developer-mode>.
Widget: To change the default appearance or functionality of a field, select one of the available widgets.
Placeholder: To provide an example of how a field should be completed, add a fixed placeholder text. The text appears in light gray until a value is entered.
Dynamic Placeholder: To provide the value of the selected field as an example of how a field should be completed. The text appears in light gray until a value is entered.
Default value: To display a default value in a field when a record is created, add a value.
Allow visibility to groups: To limit which users can view the field, select one or more user access groups <access-rights/groups>.
Forbid visibility to groups: To prevent certain users from seeing the field, select one or more user access groups <access-rights/groups>.
Propriedades dos campos de data e hora
Para campos Data e Hora usando o widget Data e Hora ou Intervalo de Datas, algumas propriedades específicas estão disponíveis:
Minimal precision: Determine the smallest date unit that must be selected in the date selector. The possible values are Day, Month, Year or Decade. If no value is selected, the user must select a day in the date selector.
Maximal precision: Determine the largest date unit that can be used to navigate the date selector. The possible values are Day, Month, Year or Decade. If no value is selected, the user can navigate the date selector by decade.
Warning for future dates: Enable this property to display a warning icon if a future date is selected.
Date format: By default the date will be shown as Apr 2, 2025, 08:05 AM. Enable this property to show the date in the format 4/2/2025 08:05:00. The numeric mode is the format set on the current language. In this mode the seconds are always shown.
Show date: This property is enabled by default for Date & Time fields. Disable this property to show only the time.
Show time: This property is enabled by default for Date & Time fields. On a read-only field, disable the property to show only the date. This can keep a list view less cluttered, for example.
Show seconds: This property is disabled by default for Date & Time fields. Enable the property to show the seconds.
Time interval: Enter a value to determine the minute intervals shown in the time selector. For example, enter 15 to allow quarter-hour intervals. The default value is set to 5 minutes.
Earliest accepted date: Enter the earliest date that can be selected in the date selector in ISO-format, i.e., YYYY-MM-DD. If the current date is always the earliest accepted date, enter today. On the date selector, dates prior to the earliest accepted date are grayed out.
Latest accepted date: Enter the latest date that can be selected in the date selector in ISO-format, i.e., YYYY-MM-DD. If the current date is always the latest accepted date, enter today. On the date selector, dates later than the latest accepted date are grayed out.
Modificar as propriedades de um campo
Para modificar as propriedades de um campo, siga estas etapas:
Navigate to the relevant view, then click the oi-studio (Toggle Studio) icon in the upper-right corner. Alternatively, with any app open, click the oi-studio (Toggle Studio) icon, then navigate to the relevant view.
Click on the relevant field.
In the fa-server Properties tab, make any desired changes to the field properties <studio/fields/properties>.
Várias propriedades podem ser configuradas independentemente para diferentes visualizações, como o Rótulo, o Widget, a visibilidade do campo para certos grupos de usuários, bem como se o campo é Invisível, Obrigatório ou Somente leitura.
Click Close in the top-right corner to close Studio.
Modificar o nome técnico de um campo
Para modificar o nome técnico de um campo, ative modo desenvolvedor <developer-mode>, depois siga estas etapas:
With the field open in Studio, copy the technical name of the field.
Remove the field <studio/fields/remove> from all views in Studio, then click Close to close Studio.
Navigate to .
Paste the copied technical name into the search bar, then open the relevant field.
Modify the Field Name as needed.
Após o nome técnico do campo ter sido atualizado, o campo pode então ser adicionado (novamente) à(s) visualização(ões) relevante(s) <studio/fields/add-existing> da lista de campos existentes.
Remover um campo de uma visualização
Para remover um campo de uma visualização, siga estas etapas:
Navigate to the relevant view, then click the oi-studio (Toggle Studio) icon in the upper-right corner. Alternatively, with any app open, click the oi-studio (Toggle Studio) icon, then navigate to the relevant view.
Click on the relevant field.
Scroll to the bottom of the Properties tab, then click Remove from view.
Click Ok to confirm the action.