[FIX] report_qweb_signer: Handle multi-company correctly
parent
44c3aa7023
commit
1119f4635b
|
@ -39,16 +39,13 @@ 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
|
||||||
company_id = self.env.user.company_id.id
|
company_id = self.env.company.id
|
||||||
if res_ids:
|
if res_ids:
|
||||||
obj = self.env[self.model].browse(res_ids[0])
|
obj = self.env[self.model].browse(res_ids[0])
|
||||||
if "company_id" in obj:
|
if "company_id" in obj:
|
||||||
company_id = obj.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), ("model_id", "=", self.model)]
|
||||||
("company_id", "=", company_id),
|
|
||||||
("model_id", "=", self.model),
|
|
||||||
]
|
|
||||||
)
|
)
|
||||||
if not certificates:
|
if not certificates:
|
||||||
return False
|
return False
|
||||||
|
|
Loading…
Reference in New Issue