تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
1 الرد
7980 أدوات العرض

How to add a group by to search view of product master? I am unable to add my group_id ( customized one ) to search view of product form ? please refer a following code,

<record id="product_search_by_group_form_view" model="ir.ui.view">

        <field name="name">group.search.form</field>
        <field name="model">product.product</field>
        <field name="inherit_id" ref="product.product_search_form_view"/>
        <field name="arch" type="xml">

               <filter name="consumable" position="before">
               <filter icon="terp-accessories-archiver-minus" string="Group" domain="[('group_id', '!=', False)]" />
               <filter icon="terp-accessories-archiver-minus" string="Sub Group" domain="[('sub_group_id', '!=', False)]" />
               <filter icon="terp-accessories-archiver-minus" string="Product Type" domain="[('type_id', '!=', False)]" />
               <filter icon="terp-accessories-archiver-minus" string="Product Sub Type" domain="[('sub_type_id', '!=', False)]" />

               <filter string="Type" position="after">
       <filter string='product-group' icon="terp-stock_symbol-selection" domain="[]" context="{'group_by' :'group_id'}"/>
               </filter>

               </filter>
        </field>

 </record>
الصورة الرمزية
إهمال
أفضل إجابة

Should be:

<record id="product_search_by_group_form_view" model="ir.ui.view">

        <field name="name">group.search.form</field>
        <field name="model">product.product</field>
        <field name="inherit_id" ref="product.product_search_form_view"/>
        <field name="arch" type="xml">

               <filter name="consumable" position="before">
               <filter icon="terp-accessories-archiver-minus" string="Group" domain="[('group_id', '!=', False)]" />
               <filter icon="terp-accessories-archiver-minus" string="Sub Group" domain="[('sub_group_id', '!=', False)]" />
               <filter icon="terp-accessories-archiver-minus" string="Product Type" domain="[('type_id', '!=', False)]" />
               <filter icon="terp-accessories-archiver-minus" string="Product Sub Type" domain="[('sub_type_id', '!=', False)]" />
               </filter>            
     <filter string="Type" position="after">
<filter string='product-group' icon="terp-stock_symbol-selection" domain="[]" context="{'group_by' :'group_id'}"/>
</filter>
</filter> </field> </record>

So, you forgot the fist filter position before.


Hope this helps,

الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
2
نوفمبر 15
10478
1
يوليو 25
389
Search a message تم الحل
1
فبراير 25
1208
0
مايو 24
1627
0
سبتمبر 23
2150