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 manage tree view inside a form view

Підписатися

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

Це запитання позначене
treeviewone2manyformview
2 Відповіді
29961 Переглядів
Аватар
arthur

Hello, I am creating a custom form view for odoo stock.picking module

My xml file contains the following record:

<record id="raizs_stock_picking_form_view" model="ir.ui.view">
    <field name="name">raizs.stock.picking.form.view</field>
    <field name="model">stock.picking</field>
    <field name="priority" eval="20"/>
    <field name="arch" type="xml">
        <form string="Movimentos">
            <sheet>
                <group>
                    <field name="name"></field>
                    <field name="partner_id"></field>
                    <field name="state"></field>
                </group>
                <notebook>
                    <page string="Produtos" >
                            <field name="id" invisible="1"/>
                        <field name="move_lines" style="pointer-events:none;">
                            <tree create="false" edit="false" editable="bottom" options="{'no_open': True}">
                                    <field name="state" invisible="True"/>
                                    <field name="additional" invisible="
                                    <field name="is_initial_demand_editable" invisible="True"/>
                                    <field name="is_quantity_done_editable" invisible="True"/>
                                    <field name="has_move_lines" invisible="True"/>
                                    <field name="product_id" required="1" attrs="{'readonly': ['|', '&amp;', ('state', '!=', 'draft'),                                                 ('additional', '=', False), ('has_move_lines', '=', True)]}"/>
                                    <field name="product_uom_qty" string="Initial Demand" attrs="{'readonly':                                                 [('is_initial_demand_editable', '=', False)]}"/>
                                    <field name="quantity_done" string="Done" attrs="{'readonly': [('is_quantity_done_editable',                                                 '=', False)]}"/>
                                    <field name="product_uom" attrs="{'readonly': [('state', '!=', 'draft'), ('additional', '=', False)]}"                                             options="{'no_open': True, 'no_create': True}" string="Unit of Measure"                                             groups="product.group_uom"/>
                            </tree>
                    </field>
            </page>
        </notebook>
    </sheet>
</form>
</field>
  </record>


I am having two problems:

1. I am trying to prevent the clicking on the move_line tree lines from opening the form view, but it keeps opening.

2. I want to display this tree view on odoo app for android, but it keeps showing the move_line records as a kanban view, even if I didn't specify it.

How do I get these 2 points right?

Thank you!

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

Thanks to your answer @subbarao, Unfortunately, the changes  you mentioned didn't work for me =/

I will post my whole view to clarify things, but basically I created to two menuitems and two actions for them, that open the same list and form views, but with different domains.

<?xml version="1.0" encoding="UTF-8"?>
<odoo>
    <menuitem
        id="raizs_receipt_root_menu"
        name="Recebimentos"
    />

<record id="raizs_stock_picking_form_view" model="ir.ui.view">
    <field name="name">raizs.stock.picking.form.view</field>
    <field name="model">stock.picking</field>
    <field name="priority" eval="20"/>
    <field name="arch" type="xml">
    <form string="Movimentos">
        <sheet>
            <group>
                <field name="name"></field>
                <field name="partner_id"></field>
                <field name="state"></field>
           </group>
           <notebook>
                <page string="Produtos" >
                    <field name="id" invisible="1"/>
                    <field name="move_lines">
                        <tree create="false" editable="bottom" options="{'no_open': True}">
                            <field name="state" invisible="True"/>
                            <field name="additional" invisible="True"/>
                            <field name="is_initial_demand_editable" invisible="True"/>
                            <field name="is_quantity_done_editable" invisible="True"/>
                            <field name="has_move_lines" invisible="True"/>
                            <field name="product_id" required="1" attrs="{'readonly': ['|', '&amp;', ('state', '!=', 'draft'),                             ('additional', '=', False), ('has_move_lines', '=', True)]}"/>
                            <field name="product_uom_qty" string="Initial Demand" attrs="{'readonly':                             [('is_initial_demand_editable', '=', False)]}"/>
                            <field name="quantity_done" string="Done" attrs="{'readonly': [('is_quantity_done_editable', '=',                             False)]}"/>
                            <field name="product_uom" attrs="{'readonly': [('state', '!=', 'draft'), ('additional', '=', False)]}"                             options="{'no_open': True, 'no_create': True}" string="Unit of Measure"                             groups="product.group_uom"/>
                            <button name="add_quantity_done" string="+" type="object"/>
                            <button name="remove_quantity_done" string="-" type="object"/>
                        </tree>
                    </field>
                </page>
                </notebook>
            </sheet>
         </form>
    </field>
</record>

<record id="raizs_stock_picking_tree_view" model="ir.ui.view">
    <field name="name">raizs.stock.picking.tree.view</field>
    <field name="model">stock.picking</field>
    <field name="arch" type="xml">
        <tree string="Movimentos">
            <field name="partner_id"></field>
            <field name="scheduled_date"></field>
            <field name="state"></field>
        </tree>
    </field>
</record>

<record model="ir.actions.act_window" id="action_raizs_today_receipts">
    <field name="name">Recebimentos de hoje</field>
    <field name="res_pmodel">stock.picking</field>
    <field name="view_model">tree,form</field>
    <field name="view_ids" eval="[(5, 0, 0),
            (0, 0, {'view_mode': 'tree', 'view_id': ref('raizs_stock_picking_tree_view')}),
            (0, 0, {'view_mode': 'form', 'view_id': ref('raizs_stock_picking_form_view')})]"
    />
    <field name="domain">
        [
            ('scheduled_date','&gt;=',(context_today().strftime('%Y-%m-%d'))),
            ('location_dest_id','=',38)
        ]
    </field>
</record>
<menuitem
    id="raizs_today_receipts_menu"
    parent="raizs_receipt_root_menu"
    action="action_raizs_today_receipts"
/>

<record model="ir.actions.act_window" id="action_raizs_late_receipts">
    <field name="name">Recebimentos atrasados</field>
    <field name="res_model">stock.picking</field>
    <field name="view_model">tree,form</field>
    <field name="view_ids" eval="[(5, 0, 0),
        (0, 0, {'view_mode': 'tree', 'view_id': ref('raizs_stock_picking_tree_view')}),
        (0, 0, {'view_mode': 'form', 'view_id': ref('raizs_stock_picking_form_view')})]"
    />
    <field name="domain">
    [
        ('scheduled_date','&lt;=',(context_today().strftime('%Y-%m-%d'))),
        ('location_dest_id','=',38)
    ]
    </field>
</record>
<menuitem
    id="raizs_late_receipts_menu"
    parent="raizs_receipt_root_menu"
    action="action_raizs_late_receipts"
/>

</odoo> 


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

solution for Point 1

edit="false"  you have to remove
create="false" if you use ting you can't able to add new lines only possible to edit the existing lines

<field name="move_lines" style="pointer-events:none;">
                            <tree create="false" editable="bottom" options="{'no_open': True}">
                                    <field name="state" invisible="True"/>
                                    <field name="is_initial_demand_editable" invisible="True"/>
                                    <field name="is_quantity_done_editable" invisible="True"/>
                                    <field name="has_move_lines" invisible="True"/>
                                    <field name="product_id" required="1" attrs="{'readonly': ['|', '&amp;', ('state', '!=', 'draft'),                                                 ('additional', '=', False), ('has_move_lines', '=', True)]}"/>
                                    <field name="product_uom_qty" string="Initial Demand" attrs="{'readonly':                                                 [('is_initial_demand_editable', '=', False)]}"/>
                                    <field name="quantity_done" string="Done" attrs="{'readonly': [('is_quantity_done_editable',                                                 '=', False)]}"/>
                                    <field name="product_uom" attrs="{'readonly': [('state', '!=', 'draft'), ('additional', '=', False)]}"                                             options="{'no_open': True, 'no_create': True}" string="Unit of Measure"                                            groups="product.group_uom"/>
                            </tree>
                    </field>


to reflect these changes you have inherit and add menu action of picking
form view_id = raizs_stock_picking_form_view
0
Аватар
Відмінити
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 Відповіді Переглядів Дія
How to repeat basic mechanism for deleting lines inside form view.
treeview one2many delete formview
Аватар
Аватар
1
січ. 23
2763
In one to many relation each many record having one more one to many relation... how can i show those data(one more one to many Вирішено
treeview one2many repeatin formview
Аватар
Аватар
Аватар
Аватар
3
груд. 23
24071
From tree view to dynamic form view
treeview formview
Аватар
Аватар
1
вер. 23
5298
how to add a button in a one2many tree view Вирішено
treeview one2many
Аватар
Аватар
Аватар
Аватар
Аватар
4
груд. 23
18575
Display One2many field value in tree view (Odoo 9)
treeview one2many
Аватар
Аватар
1
вер. 16
8052
Спільнота
  • Навчальний посібник
  • Документація
  • Форум
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