Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
1991 มุมมอง

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

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
0
ก.ย. 21
2199
3
ส.ค. 24
1344
3
ก.ค. 24
1696
0
ส.ค. 21
1909
2
มี.ค. 15
8036