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 do I access sub-components of a list field?

Підписатися

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

Це запитання позначене
viewsxmlinheritanceextend
2 Відповіді
7670 Переглядів
Аватар
Jeff Beidler

If you go to the details page for a product and click on the "Procurements" tab, you'll see a list labeled "Suppliers".  Looking at the XML for the page, the only field I can see in this location is "seller_ids".  However, the list also shows "Delivery Lead Time" and "Minimal Quantity".  Are these fields somehow contained within "seller_ids", like an array?  I can't find any other views that add the other fields.  I would like to add "Product Name" and "Product Code" to the list.  I believe all of the fields are in the "product.supplierinfo" model.  How do I go about this?

0
Аватар
Відмінити
Аватар
Alex Gallien
Найкраща відповідь

If you check out addons/product/product.py, you'll see that 'seller_ids' is a one2many field pointing to 'product.supplierinfo' from 'product_id'. If you search for product.supplierinfo in addons/product/product_view.xml there are two records that reference it, "product_supplierinfo_form_view" and "product_supplierinfo_tree_view". The first of these is the the one that pops up when you click "Add an item" under suppliers, the second is the table that you are trying to edit. It looks like this:

 

        <record id="product_supplierinfo_tree_view" model="ir.ui.view">

            <field name="name">product.supplierinfo.tree.view</field>

            <field name="model">product.supplierinfo</field>

            <field name="arch" type="xml">

                <tree string="Supplier Information">

                    <field name="sequence" widget="handle"/>

                    <field name="name"/>

                    <field name="delay"/>

                    <field name="min_qty"/>

                    <field name="company_id" groups="base.group_multi_company" widget="selection"/>

                </tree>

            </field>

        </record>

So what you'd have to do here is create a new module, inherit the "product_supplierinfo_tree_view" by using <field name="inherit_id" ref="product.product_supplierinfo_tree_view">, then add your fields using something like:

<record id="product_supplierinfo_tree_view_inherit" model="ir.ui.view">

    <field name="name">product.supplierinfo.tree.view</field>

    <field name="model">product.supplierinfo<field>

    <field name="inherit_id" ref="product.product_supplierinfo_tree_view">

        <field name="name" position="after">

            <field name="product_name"/>

            <field name="product_code"/>

        </field>

Since those columns are already in the 'product.supplierinfo' you don't even need to add any custom python code to your module.

 

Hope that helps! Cheers.

 

----

Alex Gallien

Information Officer LLC

E-mail: agallien@informationofficer.com

Web: www.informationofficer.com

1
Аватар
Відмінити
Jeff Beidler
Автор

Thanks for the detailed answer, Alex! I will try it out as soon as I get a chance. I think I saw that view when I was looking around, but don't remember seeing the other fields. Maybe it was a different one.

Jeff Beidler
Автор

Awesome, it works! I had searched for 'seller_ids' in product_view.xml, but it shows up somewhere else, not in the view to inherit. I didn't understand the connection made from the definition of 'seller_ids' in product.py to the view with the fields. I have a little better understanding of it now, but probably still not a total grasp. Thanks again!

Alex Gallien

No problem. There is a lack of solid information out there on the inner workings of OpenERP - glad to be of use.

Jeff Beidler
Автор

I also tried to override the field label by adding

Jeff Beidler
Автор

Doh! Guess you can't put XML code in comments. :\

Alex Gallien

Try editing your original post and putting the code there.

Jeff Beidler
Автор

I made a new question: https://www.odoo.com/forum/help-1/question/how-do-you-override-a-field-label-in-an-xml-view-62791 It would be nice if there were a code markdown feature for the forum. :)

Аватар
Marek Mosiewicz
Найкраща відповідь

There is special extension mechanism in Odoo. You can add fields to existing form in new module.

So your fields are added by addon modules.

 

http://consultantodoo.com

0
Аватар
Відмінити
Jeff Beidler
Автор

I knew that much. Can you provide further details as to how to access other fields from product.supplierinfo inside the _seller_ids_ field?

OdooBot
What exactly you want navigate and form which class ? I you can navigate normally by fields even if it ends with _id

2014-09-10 19:18 GMT+02:00 Jeff Beidler <jeffb@videx.com>:

I knew that much. Can you provide further details as to how to access other fields from product.supplierinfo inside the _seller_ids_ field?

--
Jeff Beidler
Sent by OpenERP S.A. using Odoo about Forum Post False

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 Відповіді Переглядів Дія
Replace xpath expr with xpath
views xml inheritance xpath
Аватар
0
серп. 21
4149
Using a Module to Customize Product Tree View
views modules xml inheritance
Аватар
Аватар
Аватар
Аватар
5
лист. 15
14096
View inheritance hiding a field
views inheritance
Аватар
Аватар
1
лист. 24
2554
Change the Position of field in Xpath Вирішено
views inheritance
Аватар
Аватар
Аватар
Аватар
Аватар
5
лип. 24
95701
How to extend a base template for a specific page only, without affecting other pages that use the same base template?
views inheritance
Аватар
Аватар
1
груд. 23
3962
Спільнота
  • Навчальний посібник
  • Документація
  • Форум
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