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

Hi,

here, i have mentioned the code:

                    <notebook>
                            <page string="Test Lines">
                            <field name="labtest_type_line" options="{'no_create': True, 'no_create_edit':True}" >
                                <tree string="Test Name" editable="bottom" >
                                    <field name="labtest_type_id" required="1"/>
                                    <field name="state" invisible="1"/>
                                   
                                    <field name="sample_value"/>
                                    <field name="sample_value_per"/>
                                    <field name="ontruck_value" attrs="{'invisible': [('state', '=', 'draft')]}"/>
                                    <field name="ontruck_value_per" attrs="{'invisible': [('state', '=', 'draft')]}"/>
                                   
                                    <field name="final_value" attrs="{'invisible': [('state', 'in', ('draft','sample'))]}"/>
                                    <field name="final_value_per" attrs="{'invisible': [('state', 'in', ('draft','sample'))]}"/>
                                </tree>
                            </field>
                            </page>
                        </notebook>

Can anyone tell what i did mistake?

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

Hi V,
<tree string="Test Name" editable="bottom"  create="false">

You have mentioned Many2one in subject but it's one2many

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

Hello Mr. V,

Please Try from below,

options="{'no_quick_create':True,'no_create_edit':True,'no_open': True,}"

OR

<field name="Your_many2one_field" widget="selection">

For your ref:

  • no_quick_create - It will remove Create and edit... option.
  • no_create_edit - It will remove Create "entered text" option.
  • no_create - no_quick_create and no_create_edit combined.
  • no_open - in read mode: do not render as a link.

Thanks,

Dipak

Ảnh đại diện
Huỷ bỏ

Hello Dipak,

Thanks for your answer!

I applied your solution but when I clicked on 'Search More..' option inside M2O field, I see 'Create' button.

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

just remove editable="bottom" and add create="0" to your tree tag.

<tree create="0">
Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
2
thg 2 25
5395
1
thg 12 24
1153
1
thg 11 22
15699
2
thg 8 22
4170
0
thg 7 22
836