8


I'm working on generating a .docx document on Odoo 13, I checked the "report_py3o" module but there is no version for Odoo 13 so I decided to some kind of migrate (I just deleted the "@api.multi") the Odoo 12 version to Odoo 13. I got an error like odoo.exceptions.CacheMiss: ('ir.actions.report(85,).is_py3o_report_not_available', None) and my database was corrupted. Here is the full log : error log.

odoo.exceptions.CacheMiss: ('ir.actions.report(85,).is_py3o_report_not_available', None)

I also checked the aero module but it is avaible for 8.0 and 9.0 only.
Can you help me? Do you have alternative for me?

CZoellner
  • 13,553
  • 3
  • 25
  • 38
m0r7y
  • 670
  • 1
  • 8
  • 27
  • 1
    Please don't mix so many questions. I've edited the title to point on the real problem here. If you want to ask for alternatives, you could create another question, which is probably being closed anyway, because that wouldn't be a question about programming itself. – CZoellner Apr 08 '20 at 09:29

1 Answers1

14

I haven't watched into it, but a CacheMiss is usually thrown, when a computed field method isn't computing a value for every record it gets.

Wrong:

computed_char_field = fields.Char(compute="_compute_computed_char_field")
some_boolean = fields.Boolean()

def _compute_computed_char_field(self):
    for record in self:
        if record.some_boolean:
            record.computed_char_field = 'something'

If there are some records with some_boolean == False you will get a CacheMiss when calling them (in a list view for example)

Correct way is to always set a value, in this example just add an else branch:

def _compute_computed_char_field(self):
    for record in self:
        if record.some_boolean:
            record.computed_char_field = 'something'
        else:
            record.computed_char_field = ''
CZoellner
  • 13,553
  • 3
  • 25
  • 38
  • Thank you very much for your reply. I noticed that computed field in the module. I will test it and will give you feedback. – m0r7y Apr 08 '20 at 09:43
  • 2
    I set all computed fields in the correct way as you teach me. The module now, works for v13. Thank you very much. – m0r7y Apr 08 '20 at 10:09