changes
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user