Skip to Content
Menu
This question has been flagged
1 Reply
3105 Views

Hello, i have a selection field in py as bellow 

product = fields.selection([('box','Box'), ('carton','Carton')] 'Product')

in the view (xml file) it is inside table

<field name='product_ids'>

                        <tree string="Product_type" editable='bottom'>

                            <field name='product'/>

                        </tree>
</field>

how can i count how many 'box' selected in the table in qweb odoo report 

thanks 

Avatar
Discard
Best Answer

Hello @mazen


With the below query you can get the Box's count.

self.env['table_name'].search_count([('product', '=', 'box')])

Avatar
Discard
Author

sorry for late reply and thank you very much, i will try to check this.

Hello @mazen,

Can you please mark this as a resolved if you are satisfied with my answer.