Zum Inhalt springen
Menü
Sie müssen registriert sein, um mit der Community zu interagieren.
Diese Frage wurde gekennzeichnet
1 Antworten
3437 Ansichten

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
Verwerfen
Beste Antwort

Hello @mazen


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

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

Avatar
Verwerfen
Autor

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.