Hello
I am using odoo V13
I want to pass the data from read_group to my computed One2many Field
in order to use it in my costum report
here is my code
operations_products = fields.One2many("gmarche.operationproduct","command_id",string="products",compute='_operations_products', context={'group_by': 'product'})
def _operations_products(self):
self.operations_products = self.env['gmarche.operationproduct'].read_group([('command_id','=',self.id)], ['product','product_designation','qte','currency_id','soustotal','nprix','prix'], ['product'],lazy=False)
is this the right way
any suggestion to group the model gmarche.operationproduct by product
and then use it in a report
thank you