[FIX] report_qweb_signer: Fix when report is printed without related objects (print from wizard in some cases)
parent
4d2b04c281
commit
44c3aa7023
|
@ -39,11 +39,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