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

On a form view with a Many2Many field, I'd like users to be able to Add existing records to M2M field, but not Create new records.

In other words, when we hit the 'Add' button to add objects to M2M field, there is a 'Create' button in addition to 'Select' button, on the form.

How do we remove this 'Create' button from the 'Add' (Select) view?

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

Hi,

Following link may help you:
https://www.odoo.com/forum/Help-1/question/can-we-hide-createedit-button-of-form-view-16340

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

Nehal,
unfortunately, it doesn't help much, as in my case a tree view is concerned, not the form view.

Luis Filipe,
users should still be able to add existing entries, but not the new ones. I was talking about prohibiting CREATION, not prohibiting ADDITION.

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

Hi, in the page definition of your view try this:

                            <page string="Tracing">
                                <field name="tracing_ids">
                                    <tree delete="false" create="false" >
                                        <field name="change_date" />
                                        <field name="executor" />
                                        <field name="state" />
                                        <field name="assigned_to" />
                                    </tree>
                                </field>                            
                            </page>

With the attributes create="false", users won't be able to add new entries. and the delete="false" they won't be able to delete them either.

I hope this is what you wanted.

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
0
thg 9 21
2004
1
thg 5 19
5740
2
thg 12 18
9230
5
thg 1 24
8553
1
thg 7 19
5951