콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
3 답글
73670 화면

Hello,

Is there anyway I can force odoo to delete all the cache? I am seeing that some of the changes I am making are not apprearing and I found out it is a cache issue, is there something I can do about it besides cleaning my browser cache?

Thanks!

아바타
취소
베스트 답변

Hello,

How invalidate_all()  is supposed to be used ? In V11 CE, I am trying to call :

self.env.invalidate_all()

in write overload. It causes this error :

AttributeError: 'Environment' object has no attribute 'invalidate_all'
Thanks for any information.

Edit :
found another way to solve my problem. Record rules based on many2many relationship were not applied when many2many fields values were modified.

This override solved my problem, don't know if I'm doing right :
@api.multi 
def write(self, vals): 
ret = super(MyModel, self).write(vals)
if 'my_many2many_field' in vals:
    self.env['ir.rule'].clear_caches()
return ret

아바타
취소
베스트 답변

I assume you are talking about the ORM cache.

Clearing caches can be performed using the invalidate_all() method of the Environment object.

https://www.odoo.com/documentation/10.0/reference/orm.html#low-level-sql


아바타
취소
베스트 답변

clearing caches could be done using the function clear_caches, you can inherit the function write and call it if the targeted field gets changed

아바타
취소
관련 게시물 답글 화면 활동
0
3월 15
3666
1
5월 25
628
0
1월 24
1393
0
7월 23
2085
2
5월 23
8235