Contributors mailing list archives

contributors@odoo-community.org

Browse archives

Avatar

Re: Technical help on odoo cache framework

by
DEC, Yann Papouin
- 24/04/2020 17:10:16
Indeed, self.invalidate_cache() is fixing the issue when added after super().

I tried self.invalidate_cache(['move_raw_ids']) to avoid the "RPG vs Bug" solution but the issue stay the same.
About @api.depends, I read that it was used to trigger computed fields update.

After some testing, I'm pretty sure that it is a framework issue because to reproduce it, you need this particular case:

- ProductA MTO - Manufacture (BoM A)
- ProductB MTO - Manufacture (BoM B)
- ProductC MTO - Buy
- ProductD MTO - Buy

BoM A Content:
- ProductB
- ProductC

BoM B Content:
- ProductD

When creating a new ProductA production, my inherited _generate_move() is correctly called for ProductB production but it fails for ProductA. If BoM content is switched, then it works fine...
The second clue that make me think that it is framework issue is the fact that the CacheMiss exception should not be raised in the UI and that the server does not report any issue on INFO/DEBUG handlers like if the exception had leaked to the UI unintentionally.



Reference