跳至內容
選單
此問題已被標幟
3 回覆
11182 瀏覽次數

I'm trying to change Create Button for Product Attribute.

Its button is to add column at the top and fill it out to submit form.

But I want it to be like create button for sales order which popup form view to make product.attribute model in workflow.

Please let me know

All I've done is

<record id="eric_product_attribute" model="ir.actions.act_window">
<field name="name">Product Attributes</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">product.attribute</field>
<field name="view_mode">tree,form</field>
<field name="view_type">form</field>
<field name="view_id" ref="product.attribute_tree_view"/>
<field name="help" type="html">
<p class="oe_view_nocontent_create">
Click to define a new product Attribute.
</p>
</field>
</record>
<!-- add menu-->
<menuitem action="eric_product_attribute"
id="menu_product_attribute" name="Product Attributes"
parent="base.menu_sale_config" sequence="16" />

But when I click create button in tree view, It makes me to fill out on the column at the top.

Thanks

頭像
捨棄
作者 最佳答案

I found the solution with help from IT Libertas

<xpath expr="//tree" position="attributes">
    <attribute name="editable"></attribute>
</xpath>
 the attribute's value should be empty

Thanks!!
頭像
捨棄
最佳答案

Hi, 

if understand your requirements correctly, you just need to change the attribute 'editable" in the view product.attribute_tree_view

Inherit the view in a way similar to:

        <record id="some_form" model="ir.ui.view">
            <field name="name">some_name</field>
            <field name="model">product.attribute</field>
            <field name="inherit_id" ref="product.attribute_tree_view"/>
            <field name="arch" type="xml">
                <xpath expr="//tree" position="attributes">
                    <attribute name="editable">0</attribute>
                </xpath>
            </field>
        </record>


頭像
捨棄
作者

I've tried editable attribute to 0 but when I clicked a create button, I could create one at the bottom of the list.

相關帖文 回覆 瀏覽次數 活動
1
3月 15
4667
4
10月 15
10001
4
7月 15
3784
0
3月 15
6275
1
12月 22
6658