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

Hi,

I'm new in odoo and i need to know how to hide a save button from inherited form view??

Could you please help me

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

I've tried it as you said to me but i'm still getting the save button

this is my code :


<record id="view_product_inherit_form" model="ir.ui.view">

<field name="name">product.inherit</field>

<field name="model">product.template</field>

<field name="inherit_id" ref="product.product_template_form_view"/>

<field name="arch" type="xml">

<xpath expr='//form[@string="Product"]' position='attributes'>

<attribute name="create">false</attribute>

</xpath>

</field>

</record>


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

Jihen,

On the form view's form tag, you can specify create='false' which will disallow the end user to create a record.

<form string="somehing" create="false" edit="false" version="7.0">
If you inherit from an existing view:

<record>

.. 

<xpath expr='//form[@string="something"]' position='attributes'>

<attribute name="create">false</attribute>

</xpath> 

</record>

Thanks.

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