Siirry sisältöön
Menu
Sinun on rekisteröidyttävä, jotta voit olla vuorovaikutuksessa yhteisön kanssa.
Tämä kysymys on merkitty
2468 Näkymät

I have a multi-company database with a model that has about 40k records.

The customer's model has the following field:

    company_ids = fields.Many2many('res.company', string='Companies')

And I have the following record rule in place:

    
    Own Company
   
    ['|', ('company_id', '=', user.company_id.id), ('company_ids', 'child_of', user.company_id.id)]




When a user opens the tree view for that model, it takes a long time to load, and it is affecting the performance of the business.


Edit: It is worth noting that sometimes the view loads really fast (only 2 seconds), but othertimes it takes a long time!


What should I do to make loading the tree view faster?
Should I index the table that holds the many2many relation?
Any help is appreciated. Thanks.

Avatar
Hylkää

Hi, chances for a single record rule causing slow loading is very low. Please check and confirm by deactivating record rule.
Chances are, you have some compute fields in the model, which causes loading time.

In case the loading time is caused from record rule, you might want to consider increasing your server size.

Tekijä

Thanks for the reply, I checked the tree view, it does not include any computed fields.
Also it is worth noting that sometimes the view loads really fast (only 2 seconds), but othertimes it takes a long time!

Aiheeseen liittyviä artikkeleita Vastaukset Näkymät Toimenpide
0
heinäk. 25
985
1
heinäk. 25
820
0
helmik. 25
1877
1
helmik. 24
2066
2
syysk. 23
11212