Skip to Content
Odoo Меню
  • Увійти
  • Спробуйте це безкоштовно
  • Додатки
    Фінанси
    • Бухоблік
    • Виставлення рахунку
    • Витрати
    • Електронні таблиці (BI)
    • Документи
    • Підпис
    Продажі
    • CRM
    • Продажі
    • POS Магазин
    • POS Ресторан
    • Підписки
    • Оренда
    Веб-сайти
    • Конструктор веб-сайту
    • Електронна комерція
    • Блог
    • Форум
    • Живий чат
    • Електронне навчання
    Ланцюг поставок
    • Склад
    • Виробництво
    • PLM
    • Купівлі
    • Технічне обслуговування
    • Якість
    Кадри
    • Співробітники
    • Рекрутинг
    • Відпустки
    • Оцінювання
    • Рекомендації
    • Автотранспорт
    Маркетинг
    • Маркетинг соцмереж
    • Email-маркетинг
    • SMS-маркетинг
    • Події
    • Автом. маркетингу
    • Опитування
    Послуги
    • Проект
    • Табелі
    • Виїзне обслуговування
    • Служба підтримки
    • Планування
    • Призначення
    Продуктивність
    • Обговорення
    • Схвалення
    • IoT
    • IP-телефонія
    • База знань
    • WhatsApp
    Сторонні модулі Odoo Studio Платформа Odoo Cloud
  • Сфери
    Роздрібна торгівля
    • Книжковий магазин
    • Магазин одягу
    • Магазин меблів
    • Продуктовий магазин
    • Магазин будівельних матеріалів
    • Магазин іграшок
    Food & Hospitality
    • Бар та паб
    • Ресторан
    • Фастфуд
    • Guest House
    • Дистриб'ютор напоїв
    • Hotel
    Real Estate
    • Real Estate Agency
    • Архітектурна фірма
    • Будівництво
    • Управління нерухомістю
    • Садівництво
    • Асоціація власників нерухомості
    Consulting
    • Accounting Firm
    • Партнер Odoo
    • Marketing Agency
    • Юридична фірма
    • Придбання Талантів
    • Аудит та сертифікація
    Виробництво
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Корпоративні подарунки
    Здоров'я & Фітнес
    • Спортивний клуб
    • Оптика
    • Фітнес-центр
    • Практики здоров'я
    • Аптека
    • Салон краси
    Trades
    • Ремонтник
    • IT-обладнання та Підтримка
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Others
    • Nonprofit Organization
    • Екологічна агенція
    • Оренда білбордів
    • Фотографія
    • Лізинг велосипедів
    • Реселлер програмного забезпечення
    Browse all Industries
  • Спільнота
    Навчання
    • Навчальний посібник
    • Документація
    • Сертифікації
    • Тренування
    • Блог
    • Подкаст
    Сприяйте Освіті
    • Програма навчання
    • Бізнес гра Scale Up!
    • Відвідайте Odoo
    Отримайте програмне забезпечення
    • Завантаження
    • Порівняйте версії
    • Релізи
    Співпрацюйте
    • Github
    • Форум
    • Події
    • Переклади
    • Стати партнером
    • Services for Partners
    • Зареєструйте вашу бухгалтерську фірму
    Отримайте послуги
    • Знайдіть партнера
    • Знайдіть бухгалтера
    • Зустріньтеся з консультантом
    • Послуги з впровадження
    • Референси клієнтів
    • Підтримка
    • Оновлення
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Отримати демо
  • Ціни
  • Допомога

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

  • CRM
  • e-Commerce
  • Бухоблік
  • Склад
  • PoS
  • Проект
  • MRP
All apps
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
All Posts Люди Значки
Мітки (View all)
odoo accounting v14 pos v15
Про цей форум
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
All Posts Люди Значки
Мітки (View all)
odoo accounting v14 pos v15
Про цей форум
Допомога

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

Підписатися

Отримуйте сповіщення про активність щодо цієї публікації

Це запитання позначене
addressstudiodesign
1 Відповісти
3799 Переглядів
Аватар
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
Аватар
Відмінити
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.

Аватар
Gracious Joseph
Найкраща відповідь
  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
Аватар
Відмінити
Ricardo Ayala

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

Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Реєстрація
Related Posts Відповіді Переглядів Дія
Display Delivery Address in Sales Orders
address salesorder studio customfield
Аватар
Аватар
1
лип. 23
3553
debit and credit in currency
studio
Аватар
Аватар
1
лист. 25
2011
Menu's with different default filter Вирішено
studio
Аватар
Аватар
1
лип. 25
2141
Digest mails - any good resources for Studio Вирішено
studio
Аватар
Аватар
2
бер. 25
2261
Payment terms format change
studio
Аватар
0
лют. 25
1864
Спільнота
  • Навчальний посібник
  • Документація
  • Форум
Open Source
  • Завантаження
  • Github
  • Runbot
  • Переклади
Послуги
  • Хостинг Odoo.sh
  • Підтримка
  • Оновлення
  • Кастомні доробки
  • Навчання
  • Знайдіть бухгалтера
  • Знайдіть партнера
  • Стати партнером
Про нас
  • Наша компанія
  • Торгові активи
  • Зв'яжіться з нами
  • Вакансії
  • Події
  • Подкаст
  • Блог
  • Клієнти
  • Юридичні документи • Конфіденційність
  • Безпека
الْعَرَبيّة 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 - це набір програм для роботи з відкритим кодом, які охоплюють всі ваші потреби компанії: CRM, електронна комерція, бухгалтерський облік, склад, точка продажу, управління проектами тощо.

Унікальна пропозиція Odoo - це одночасно дуже проста у використанні та повністю інтегрована.

Website made with

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