Pular para o conteúdo
Odoo Menu
  • Entrar
  • Experimente grátis
  • Aplicativos
    Finanças
    • Financeiro
    • Faturamento
    • Despesas
    • Planilhas (BI)
    • Documentos
    • Assinar Documentos
    Vendas
    • CRM
    • Vendas
    • PDV Loja
    • PDV Restaurantes
    • Assinaturas
    • Locação
    Websites
    • Criador de Sites
    • e-Commerce
    • Blog
    • Fórum
    • Chat ao Vivo
    • e-Learning
    Cadeia de mantimentos
    • Inventário
    • Fabricação
    • PLM - Ciclo de Vida do Produto
    • Compras
    • Manutenção
    • Qualidade
    Recursos Humanos
    • Funcionários
    • Recrutamento
    • Folgas
    • Avaliações
    • Indicações
    • Frota
    Marketing
    • Redes Sociais
    • Marketing por E-mail
    • Marketing por SMS
    • Eventos
    • Automação de Marketing
    • Pesquisas
    Serviços
    • Projeto
    • Planilhas de Horas
    • Serviço de Campo
    • Central de Ajuda
    • Planejamento
    • Compromissos
    Produtividade
    • Mensagens
    • Aprovações
    • Internet das Coisas
    • VoIP
    • Conhecimento
    • WhatsApp
    Aplicativos de terceiros Odoo Studio Plataforma Odoo Cloud
  • Setores
    Varejo
    • Loja de livros
    • Loja de roupas
    • Loja de móveis
    • Mercearia
    • Loja de ferramentas
    • Loja de brinquedos
    Comida e hospitalidade
    • Bar e Pub
    • Restaurante
    • Fast Food
    • Hospedagem
    • Distribuidor de bebidas
    • Hotel
    Imóveis
    • Imobiliária
    • Escritório de arquitetura
    • Construção
    • Administração de propriedades
    • Jardinagem
    • Associação de proprietários de imóveis
    Consultoria
    • Escritório de Contabilidade
    • Parceiro Odoo
    • Agência de marketing
    • Escritório de advocacia
    • Aquisição de talentos
    • Auditoria e Certificação
    Fabricação
    • Têxtil
    • Metal
    • Móveis
    • Alimentação
    • Cervejaria
    • Presentes corporativos
    Saúde e Boa forma
    • Clube esportivo
    • Loja de óculos
    • Academia
    • Profissionais de bem-estar
    • Farmácia
    • Salão de cabeleireiro
    Comércio
    • Handyman
    • Hardware e Suporte de TI
    • Sistemas de energia solar
    • Sapataria
    • Serviços de limpeza
    • Serviços de climatização
    Outros
    • Organização sem fins lucrativos
    • Agência Ambiental
    • Aluguel de outdoors
    • Fotografia
    • Aluguel de bicicletas
    • Revendedor de software
    Navegar por todos os setores
  • Comunidade
    Aprenda
    • Tutoriais
    • Documentação
    • Certificações
    • Treinamento
    • Blog
    • Podcast
    Empodere a Educação
    • Programa de educação
    • Scale Up! Jogo de Negócios
    • Visite a Odoo
    Obtenha o Software
    • Baixar
    • Comparar edições
    • Releases
    Colaborar
    • Github
    • Fórum
    • Eventos
    • Traduções
    • Torne-se um parceiro
    • Serviços para parceiros
    • Cadastre seu escritório contábil
    Obtenha os serviços
    • Encontre um parceiro
    • Encontre um Contador
    • Conheça um consultor
    • Serviços de Implementação
    • Referências de Clientes
    • Suporte
    • Upgrades
    Github YouTube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Faça uma demonstração
  • Preços
  • Ajuda

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Financeiro
  • Inventário
  • PoS
  • Projeto
  • MRP
All apps
É necessário estar registrado para interagir com a comunidade.
Todas as publicações Pessoas Emblemas
Marcadores (Ver tudo)
odoo accounting v14 pos v15
Sobre este fórum
É necessário estar registrado para interagir com a comunidade.
Todas as publicações Pessoas Emblemas
Marcadores (Ver tudo)
odoo accounting v14 pos v15
Sobre este fórum
Ajuda

How to get the design of address fields looking like the contact

Inscrever

Seja notificado quando houver atividade nesta publicação

Esta pergunta foi sinalizada
addressstudiodesign
1 Responder
3776 Visualizações
Avatar
Michael Spitzer

I am using odoo studio and there is a  very nice address section in the contacts module where the word 'contact' is displayed and then a few address fields underneath to make it into a group of fields, I would like to make the user put in an address on a custom module and I want to know how to make it look similar to the one on the contacts but this module has no relation to the contacts module.

For Example I want to have the fields 'address Line 1', 'address Line 2', 'city', 'zip' etc. but I don't want it to look like completely separate fields, rather I want it to look like a group, something like this:




 

0
Avatar
Cancelar
Gracious Joseph

To achieve the same grouped design for address fields in your custom module as seen in the Contacts module, follow these steps:

1. Leverage Odoo Studio (UI Approach)

If you're using Odoo Studio, you can group fields visually to mimic the Contacts module's address section.

  1. Go to Your Custom Module in Studio:
    • Open the module you want to modify in Odoo Studio.
  2. Add a New Group:
    • Drag and drop a Group container to the form view where you want the address section.
  3. Add Fields to the Group:
    • Add fields like Street, Street2, City, ZIP, State, and Country inside the group.
    • Ensure the fields are aligned horizontally (you can adjust this in the group properties).
  4. Customize the Label:
    • Add a Static Text above the group and set it to "Contact" or another label to match the Contacts module.
  5. Apply CSS (Optional):
    • If the design isn’t exactly what you want, you can add custom CSS using the "Custom JavaScript/CSS" section in Odoo Studio (only available in certain editions).

2. Manual XML Customization (Developer Mode)

If Odoo Studio doesn't provide enough flexibility or you're comfortable editing XML, you can directly modify the form view of your custom module.

Example:

Here’s how to create an address-like design:

xmlCopy code<record id="view_custom_module_form" model="ir.ui.view">
    <field name="name">custom.module.form</field>
    <field name="model">custom.module</field>
    <field name="arch" type="xml">
        <form string="Custom Module">
            <sheet>
                <!-- Address Section -->
                <group>
                    <div class="o_address_format">
                        <div>
                            <label>Contact</label>
                        </div>
                        <group>
                            <field name="street" placeholder="Street..." />
                            <field name="street2" placeholder="Street 2..." />
                            <group>
                                <field name="city" placeholder="City..." />
                                <field name="state_id" placeholder="State..." />
                                <field name="zip" placeholder="ZIP..." />
                            </group>
                            <field name="country_id" placeholder="Country..." />
                        </group>
                    </div>
                </group>
            </sheet>
        </form>
    </field>
</record>

3. Use the Address Formatting Style

Odoo's Contacts module uses predefined CSS styles to group address fields. You can apply the same styles to your custom module by adding o_address_format and related CSS classes.

CSS Styling (Optional):

If you want finer control over the appearance, you can add custom CSS.

Example:

xmlCopy code<template id="assets_backend" inherit_id="web.assets_backend" name="Custom Address Styles">
    <xpath expr="." position="inside">
        <style>
            .o_address_format {
                margin-bottom: 10px;
                padding: 10px;
                border: 1px solid #eaeaea;
                border-radius: 5px;
                background-color: #f9f9f9;
            }
            .o_address_format label {
                font-weight: bold;
                margin-bottom: 5px;
                display: block;
            }
        </style>
    </xpath>
</template>

4. Add Country and State Widgets

To enhance the functionality of the fields, use many2one fields for state_id and country_id, referencing the respective models (res.country.state and res.country). This provides dropdowns similar to the Contacts module.

Example:

xmlCopy code<field name="country_id" widget="many2one" options="{'no_create': True}" placeholder="Country..." />
<field name="state_id" widget="many2one" options="{'no_create': True}" placeholder="State..." />

5. Add Placeholders (Optional)

To make the fields look cleaner, you can add placeholders (like "Street...", "City...") as shown in the example XML above. These placeholders guide the user without needing labels for every field.

6. Test and Adjust

  • Once you've implemented the changes, save your modifications and refresh the module.
  • Test the form layout to ensure it looks and functions as expected.

Avatar
Gracious Joseph
Melhor resposta
  1. ChatGPT said:
    In Odoo Studio, the "Group" container is not found directly in the fields menu but rather in the form view editor toolbar. Here's how you can locate and use it:

    Steps to Find and Use the "Group" Container in Odoo Studio:

    1. Open Odoo Studio:
      • Navigate to your custom module.
      • Activate the Studio by clicking the "Studio" button in the top-right corner.
    2. Edit the Form View:
      • Select the form view of the model you want to modify.
      • Enter the Edit mode for the form.
    3. Locate the Group Container:
      • In the layout toolbox on the right-hand side, look for the "Group" element.
      • This is usually available under the "Form Elements" or "Structure" section.
    4. Drag and Drop the Group Container:
      • Drag the "Group" element into the form where you want to place the address fields.
    5. Add Fields to the Group:
      • After placing the group, drag the address fields (e.g., Street, City, ZIP) into the group container.
      • Adjust the arrangement of the fields horizontally or vertically as needed.
    6. Customize the Group:
      • Add a static label (e.g., "Contact") above the group for clarity.
      • Adjust the properties of the group (like columns and alignment) using the sidebar options.
    7. Save and Test:
      • Save your changes and test the form layout to ensure it meets your requirements.
    If the "Group" container is not visible, it may be due to limited access permissions or an issue with the Studio configuration. In that case, you can consider customizing the XML code of the form view, as shown in the previous example, for greater control.

0
Avatar
Cancelar
Ricardo Ayala

there is no "group" container, but maybe it refers to the column container

Está gostando da discussão? Não fique apenas lendo, participe!

Crie uma conta hoje mesmo para aproveitar os recursos exclusivos e interagir com nossa incrível comunidade!

Inscreva-se
Publicações relacionadas Respostas Visualizações Atividade
Display Delivery Address in Sales Orders
address salesorder studio customfield
Avatar
Avatar
1
jul. 23
3546
debit and credit in currency
studio
Avatar
Avatar
1
nov. 25
1995
Menu's with different default filter Resolvido
studio
Avatar
Avatar
1
jul. 25
2133
Digest mails - any good resources for Studio Resolvido
studio
Avatar
Avatar
2
mar. 25
2256
Payment terms format change
studio
Avatar
0
fev. 25
1857
Comunidade
  • Tutoriais
  • Documentação
  • Fórum
Open Source
  • Baixar
  • Github
  • Runbot
  • Traduções
Serviços
  • Odoo.sh Hosting
  • Suporte
  • Upgrade
  • Desenvolvimentos personalizados
  • Educação
  • Encontre um Contador
  • Encontre um parceiro
  • Torne-se um parceiro
Sobre nós
  • Nossa empresa
  • Ativos da marca
  • Contato
  • Empregos
  • Eventos
  • Podcast
  • Blog
  • Clientes
  • Legal • Privacidade
  • Segurança
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo é um conjunto de aplicativos de negócios em código aberto que cobre todas as necessidades de sua empresa: CRM, comércio eletrônico, contabilidade, estoque, ponto de venda, gerenciamento de projetos, etc.

A proposta de valor exclusiva Odoo é ser, ao mesmo tempo, muito fácil de usar e totalmente integrado.

Site feito com

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now