跳至内容
菜单
此问题已终结
1 回复
1395 查看

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
1868
3
8月 24
947
3
7月 24
1307
0
8月 21
1556
2
3月 15
7583