Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
3 Trả lời
9040 Lượt xem

Is there any option like:

options='{"no_open": True}'

but for hide "Create and Edit..." line?

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

you can make the widget = selection

<field name = "name" widget = "selection"/>
Ảnh đại diện
Huỷ bỏ

good answer.

Tác giả

It's sutable if small amount of records, but I have many records and need Search More... functionality.

Hi, wowas... you can remove create and edit from (V.7) addons/web/static/src/js view_form.js , just comment the lines from 2939 to 2945, then create and edit will disappear. but it'll be for all of you modules..!

Maybe the 'base_optional_quick_create' module can be useful too: https://code.launchpad.net/~elbati/server-env-tools/adding_base_optional_quick_create_7 . This module allows to avoid to 'quick create' new records, through many2one fields, for a specific model. You can configure which models should allow 'quick create'. When specified, the 'quick create' option will always open the standard create form.

Câu trả lời hay nhất

simple use tags create and delete in your xml file

syntax:

<field name="field_name" create="false" delete="false"/>

Ảnh đại diện
Huỷ bỏ
Tác giả

It don't work for many2one.

Câu trả lời hay nhất

You could make it make it read-only, but that wouldn't allow you to edit lines:

<field name="myfield" readonly="1"/>

If you want it to be editable, but not able to add lines, the closest thing it to change the Access Rights on the related table so that the user has Write Access but no Create Access.

Ảnh đại diện
Huỷ bỏ
Tác giả

Need have Full Access for related table, because this field in the same object for choose parent instance. But need restrict create parent instance because it does not make sense (in my context).

Bài viết liên quan Trả lời Lượt xem Hoạt động
2
thg 2 25
5766
1
thg 12 24
1356
1
thg 11 22
15913
3
thg 8 22
12872
2
thg 8 22
4391