[FIX] report_qweb_signer: Fix when report is printed without related objects (print from wizard in some cases)
parent
f697543148
commit
f93480f107
|
@ -38,11 +38,11 @@ class IrActionsReport(models.Model):
|
||||||
"""Obtain the proper certificate for the report and the conditions."""
|
"""Obtain the proper certificate for the report and the conditions."""
|
||||||
if self.report_type != "qweb-pdf":
|
if self.report_type != "qweb-pdf":
|
||||||
return False
|
return False
|
||||||
obj = self.env[self.model].browse(res_ids[0])
|
company_id = self.env.user.company_id.id
|
||||||
if "company_id" in obj:
|
if res_ids:
|
||||||
company_id = obj.company_id.id
|
obj = self.env[self.model].browse(res_ids[0])
|
||||||
else:
|
if "company_id" in obj:
|
||||||
company_id = self.env.user.company_id.id
|
company_id = obj.company_id.id
|
||||||
certificates = self.env["report.certificate"].search(
|
certificates = self.env["report.certificate"].search(
|
||||||
[
|
[
|
||||||
("company_id", "=", company_id),
|
("company_id", "=", company_id),
|
||||||
|
|
Loading…
Reference in New Issue