Odoo Help


How to group by One2many field records according to batch number Odoo10?

Pawan Sharma
on 9/14/18, 2:14 AM 85 views

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';"
        <field name="batch_number" readonly="1" string="Batch"/>
        <field name="status_type"/>
        <group colspan="4" col="4">
            <field name="batch_number" readonly="1"/>
On 9/14/18, 10:40 AM

Hi Pawan,

Hope this will help:

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

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 9/14/18, 2:14 AM
Seen: 85 times
Last updated: 9/14/18, 10:40 AM