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

Specifically, I try to understand how 'Configure Variant' in product template view works. In the header it got:


< button string="Configure Variants" type="action"
name="%(product_attribute_value_action)d"
attrs="{'invisible': ['|', ('attribute_line_ids', 'groups="product.group_product_variant" />


How does Odoo recognize product_attribute_value_action to deliver correct ir.act_window action? I try to find product_attribute_value_action declaration anywhere but cant find it.


Edit: I just found out how to insert tag into the post. The button tag gets deleted everytime I post.

頭像
捨棄
最佳答案

Hi,

In Odoo %(product_attribute_value_action)d is a special syntax used by Odoo to reference the XML ID of the action.


The action definition is :

<record id="product_attribute_value_action" model="ir.actions.act_window">

        <field name="name">Product Variant Values</field>

        <field name="res_model">product.template.attribute.value</field>

        <field name="view_mode">tree,form</field>

        <field name="domain">[('product_tmpl_id', '=', active_id)]</field>

        <field name="view_ids"

                eval="[(5, 0, 0),

                (0, 0, {'view_mode': 'tree', 'view_id': ref('product.product_template_attribute_value_view_tree')}),

                (0, 0, {'view_mode': 'form', 'view_id': ref('product.product_template_attribute_value_view_form')})]" />

        <field name="context">{

            'default_product_tmpl_id': active_id,

            'search_default_active': 1,

        }</field>

    </record>


Hope it helps

頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
0
9月 21
2483
3
8月 24
2097
3
7月 24
2127
0
8月 21
2210
2
3月 15
8481