Перейти к содержимому
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
3 Ответы
7777 Представления

When clicking on a row of a tree view, it opens a form view of the record.

Is it possible to disable this ? And is possible to choose the form view to be opened ?

Using "editable" is not an option beacuse when not in edit mode the click always works.

Аватар
Отменить
Лучший ответ

Hi,
We can disable the form view of the one2many field by assigning the following style to the field.

<field name="your_o2m" style="pointer-events:none;" />

But the issue is this style will disable the click in editable state too.

It will be better to define a form view to that field, then the click will open the form view which we assigned.

Eg:

We can define a form view like below


let invoice_line_ids is our one2many field and normally we will define a view with <tree></tree> for getting a tree view.For getting a required form view, we just need to define our required view inside <form></form> along with that like above.

Hope it helps.

Аватар
Отменить
Лучший ответ

if you want to disable form view from appear and want to add and edit and delete functions run in tree just

you can do this by try this code


<field name="att_sheet_action_ids">


                        <tree editable="bottom" create="1" edit="1" delete="1">

                            <field name="no_days"/>

                            <field name="sheet_action"/>

                        </tree>

                    </field>


Аватар
Отменить
Лучший ответ

Is there really no better way to do this? I would like to open the record on full page view when the line is clicked, not modal/pop-over.

This is driving me nuts. The sonly solution I've found is to add

so that just an empty form shows up and added a button to the row where I can define the action, but it's definately not very user friendly.



Аватар
Отменить