'Inherit read_group to calculate the sum of the non-stored fields, as it is not automatically done anymore through the XML.'

@api.model
def read_group(self, domain, fields, groupby, offset=0, limit=None, orderby=False, lazy=True):

    res = super(ProductProduct, self).read_group(domain, fields, groupby, offset=offset, limit=limit, orderby=orderby, lazy=lazy)
    fields_list = ['turnover', 'sale_avg_price', 'sale_purchase_price', 'sale_num_invoiced', 'purchase_num_invoiced', 'sales_gap', 'purchase_gap', 'total_cost', 'sale_expected', 'normal_cost', 'total_margin', 'expected_margin', 'total_margin_rate', 'expected_margin_rate']
    if any(((x in fields) for x in fields_list)):
        re_ind = 0
        prod_re = {}
        tot_products = self.browse([])
        for re in res:
            if re.get('__domain'):
                products = self.search(re['__domain'])
                tot_products |= products
                for prod in products:
                    prod_re[prod.id] = re_ind
            re_ind += 1
        res_val = tot_products._compute_product_margin_fields_values(field_names=[x for x in fields if (fields in fields_list)])
        for key in res_val.keys():
            for l in res_val[key].keys():
                re = res[prod_re[key]]
                if re.get(l):
                    re[l] += res_val[key][l]
                else:
                    re[l] = res_val[key][l]
    return res
