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

Hello All,

I am using Odoo10 and want to group_by/filter One2many field records according to batch number. I tried difference solution but didn't get expected result. So, Anyone can suggest me solution for this problem?

This is same problem like if we want to group by sale order line in sale order according to same product name.

I'm tried below code:

<field name="weight_cal_machine" mode="tree,form" colspan="4" nolabel="1" widget="one2many_list" context="{'group_by':'batch_number'}">
<tree editable="bottom" delete="false"
colors="blue:status_type == 'assign'; darkgreen:status_type == 'verify';"
create="false">
        <field name="batch_number" readonly="1" string="Batch"/>
        <field name="status_type"/>
    </tree>
    <form>
        <group colspan="4" col="4">
            <field name="batch_number" readonly="1"/>
        </group>
    </form>
</field>
الصورة الرمزية
إهمال
أفضل إجابة

Hi Pawan,

Hope this will help:

<field string = "Batch Number" name = "batch_number" filter_domain = "[('weight_cal_machine. batch_number, '=', self)] "> 


الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
3
يوليو 25
21964
0
سبتمبر 23
144
1
يناير 21
16935
2
يناير 24
16083
0
أكتوبر 17
5051