This commit is contained in:
gsinghpal
2026-05-21 03:37:25 -04:00
parent b2f483d67c
commit 1314f4581d
47 changed files with 5730 additions and 177 deletions

View File

@@ -95,10 +95,20 @@ class FpFair(models.Model):
}
def action_view_signed_document(self):
"""Open the signed PDF attachment in a new browser tab."""
"""Open the signed PDF in the fusion_pdf_preview dialog.
Falls back to a new-tab URL when the helper isn't installed.
See CLAUDE.md "PDF Preview" for the contract.
"""
self.ensure_one()
if not self.x_fc_signed_pdf_id:
return False
if hasattr(self.x_fc_signed_pdf_id, 'action_fusion_preview'):
return self.x_fc_signed_pdf_id.action_fusion_preview(
title=self.x_fc_signed_pdf_id.name or 'Signed FAIR',
model_name=self._name,
record_ids=self.id,
)
return {
'type': 'ir.actions.act_url',
'url': '/web/content/%s?download=true' % self.x_fc_signed_pdf_id.id,