Make sure value is always set for computed fields
(without these a CacheMiss error is thrown by odoo)pull/347/head
parent
317b4c40bc
commit
c087613b92
|
@ -116,7 +116,8 @@ class IrActionsReport(models.Model):
|
||||||
def _compute_is_py3o_native_format(self):
|
def _compute_is_py3o_native_format(self):
|
||||||
fmt = Formats()
|
fmt = Formats()
|
||||||
for rec in self:
|
for rec in self:
|
||||||
if not rec.report_type == "py3o":
|
rec.is_py3o_native_format = False
|
||||||
|
if not rec.report_type == "py3o" or not rec.py3o_filetype:
|
||||||
continue
|
continue
|
||||||
filetype = rec.py3o_filetype
|
filetype = rec.py3o_filetype
|
||||||
rec.is_py3o_native_format = fmt.get_format(filetype).native
|
rec.is_py3o_native_format = fmt.get_format(filetype).native
|
||||||
|
@ -129,6 +130,8 @@ class IrActionsReport(models.Model):
|
||||||
@api.depends("lo_bin_path", "is_py3o_native_format", "report_type")
|
@api.depends("lo_bin_path", "is_py3o_native_format", "report_type")
|
||||||
def _compute_py3o_report_not_available(self):
|
def _compute_py3o_report_not_available(self):
|
||||||
for rec in self:
|
for rec in self:
|
||||||
|
rec.is_py3o_report_not_available = False
|
||||||
|
rec.msg_py3o_report_not_available = ""
|
||||||
if not rec.report_type == "py3o":
|
if not rec.report_type == "py3o":
|
||||||
continue
|
continue
|
||||||
if not rec.is_py3o_native_format and not rec.lo_bin_path:
|
if not rec.is_py3o_native_format and not rec.lo_bin_path:
|
||||||
|
|
|
@ -46,6 +46,8 @@ class IrActionsReport(models.Model):
|
||||||
)
|
)
|
||||||
def _compute_py3o_report_not_available(self):
|
def _compute_py3o_report_not_available(self):
|
||||||
for rec in self:
|
for rec in self:
|
||||||
|
rec.is_py3o_report_not_available = False
|
||||||
|
rec.msg_py3o_report_not_available = ""
|
||||||
if not rec.report_type == "py3o":
|
if not rec.report_type == "py3o":
|
||||||
continue
|
continue
|
||||||
if (
|
if (
|
||||||
|
|
Loading…
Reference in New Issue