İçereği Atla
Menü
This question has been flagged
1 Cevapla
1398 Görünümler

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.

Avatar
Vazgeç
Best Answer

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

Avatar
Vazgeç
Related Posts Cevaplar Görünümler Aktivite
0
Eyl 21
1871
3
Ağu 24
952
3
Tem 24
1311
0
Ağu 21
1558
2
Mar 15
7586